diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..2a6295c --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +bun 1.0.26 diff --git a/README.md b/README.md index 26decb6..22dcf04 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..ffd3064 Binary files /dev/null and b/bun.lockb differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..f98326f --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "@tatsutakein/project-boilerplate", + "type": "module", + "scripts": { + "plop": "plop" + }, + "devDependencies": { + "plop": "4.0.1" + } +} diff --git a/plopfile.mjs b/plopfile.mjs new file mode 100644 index 0000000..9e433b2 --- /dev/null +++ b/plopfile.mjs @@ -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, + }, + ] + }); +}; diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 2fc4b55..6256999 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -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 diff --git a/tools/plop/sample/README.md.hbs b/tools/plop/sample/README.md.hbs new file mode 100644 index 0000000..43b592f --- /dev/null +++ b/tools/plop/sample/README.md.hbs @@ -0,0 +1 @@ +# {{name}}