From 27c98b5823c212c8b9726710b5188144249d7841 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 17 May 2020 15:44:08 +0300 Subject: [PATCH] typescript(monorepo-template): feat: readme generation Signed-off-by: prescientmoon --- typescript/monorepo-template/.github/workflows/release.yml | 1 + .../monorepo-template/_templates/package/new/README.md.ejs | 6 ++++++ .../monorepo-template/_templates/package/new/index.js | 3 ++- .../_templates/package/new/package.json.ejs | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 typescript/monorepo-template/_templates/package/new/README.md.ejs diff --git a/typescript/monorepo-template/.github/workflows/release.yml b/typescript/monorepo-template/.github/workflows/release.yml index 0514161..a0c2d45 100644 --- a/typescript/monorepo-template/.github/workflows/release.yml +++ b/typescript/monorepo-template/.github/workflows/release.yml @@ -32,4 +32,5 @@ jobs: - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: pnpx semantic-release diff --git a/typescript/monorepo-template/_templates/package/new/README.md.ejs b/typescript/monorepo-template/_templates/package/new/README.md.ejs new file mode 100644 index 0000000..9a6ada1 --- /dev/null +++ b/typescript/monorepo-template/_templates/package/new/README.md.ejs @@ -0,0 +1,6 @@ +--- +to: packages/<%= name %>/README.md +--- +# <%- Name %> + +<%- description %> \ No newline at end of file diff --git a/typescript/monorepo-template/_templates/package/new/index.js b/typescript/monorepo-template/_templates/package/new/index.js index d4fa97f..e749a3d 100644 --- a/typescript/monorepo-template/_templates/package/new/index.js +++ b/typescript/monorepo-template/_templates/package/new/index.js @@ -5,5 +5,6 @@ exports.prompt = async ({ args }) => ({ ...args, org: packageJson.name, repository: JSON.stringify(packageJson.repository), - bugs: JSON.stringify(packageJson.bugs) + bugs: JSON.stringify(packageJson.bugs), + description: args.description || '' }) diff --git a/typescript/monorepo-template/_templates/package/new/package.json.ejs b/typescript/monorepo-template/_templates/package/new/package.json.ejs index 9e81a5d..e0834a4 100644 --- a/typescript/monorepo-template/_templates/package/new/package.json.ejs +++ b/typescript/monorepo-template/_templates/package/new/package.json.ejs @@ -4,7 +4,7 @@ to: packages/<%= name %>/package.json { "name": "@<%= org %>/<%= name %>", "version": "0.0.0", - "description": "", + "description": "<%- description %>", "keywords": [], "main": "dist/bundle.cjs.js", "module": "dist/bundle.esm.js",