Skip to content

Commit

Permalink
Merge pull request #10 from tatsutakein/rt/add-plop
Browse files Browse the repository at this point in the history
chore: plop を利用したコード生成を追加
  • Loading branch information
tatsutakein authored Feb 16, 2024
2 parents e9a0dcb + dfb2f80 commit 0f123fd
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 0 deletions.
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}}

0 comments on commit 0f123fd

Please sign in to comment.