Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: plop を利用したコード生成を追加 #10

Merged
merged 6 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bun 1.0.26
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ After git clone, run the following command
$ make bs
```

### Add template

You can generate code from a template using plop by executing the following command.

```shell
$ bun plop
```

## Development Environment

TBD
Expand Down
Binary file added bun.lockb
Binary file not shown.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@tatsutakein/project-boilerplate",
"type": "module",
"scripts": {
"plop": "plop"
},
"devDependencies": {
"plop": "4.0.1"
}
}
22 changes: 22 additions & 0 deletions plopfile.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @param {import("plop").NodePlopAPI} plop
*/
export default function (plop) {
plop.setGenerator('sample', {
description: 'sample',
prompts: [{
type: 'input',
name: 'name',
message: 'sample name please'
}],
actions: [
{
type: 'addMany',
templateFiles: 'tools/plop/sample/**',
destination: './sample/{{name}}',
base: 'tools/plop/sample',
abortOnFail: true,
},
]
});
};
18 changes: 18 additions & 0 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ else
fi
echo "🚀 Git commit message: Finished"

##############################################################################
##
## mise
##
##############################################################################
echo ""
echo "🚀 mise install: Start"
if type mise >/dev/null 2>&1; then
if mise install; then
echo "✅ mise install: Success"
else
echo "🚫 mise install: Failed"
fi
else
echo "⚠️ mise install: Skip mise because it could not be found."
echo "⚠️ mise install: See https://mise.jdx.dev/getting-started.html for installation."
fi

##############################################################################
##
## Finish
Expand Down
1 change: 1 addition & 0 deletions tools/plop/sample/README.md.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# {{name}}
Loading