Skip to content

Commit fe6fc83

Browse files
committed
feat(template): publish dist/ instead of root dir to npm
1 parent 05a716d commit fe6fc83

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

generators/app/templates/.github/workflows/publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Build source
2222
run: yarn build
2323
- name: Publish package
24-
run: yarn publish --access public
24+
run: yarn publish dist --access public
2525
env:
2626
# Create your own token at https://github.com/organization/repository/settings/secrets
2727
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

generators/app/templates/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
"license": "MIT",
88
"author": "<%- elementAuthor %>",
99
"repository": "<%= elementRepository %>",
10-
"main": "dist/index.js",
11-
"typings": "dist/index.d.ts",
12-
"files": [
13-
"dist"
14-
],
10+
"main": "index.js",
11+
"typings": "index.d.ts",
1512
"scripts": {
1613
"purge": "rm -rf node_modules",
1714
"clean": "rm -rf dist",
@@ -21,13 +18,15 @@
2118
"lint": "tslint --project tsconfig.json --config tslint.json",
2219
"prebuild": "yarn clean",
2320
"build": "rollup -c",
21+
"postbuild": "copyfiles CHANGELOG.md LICENSE package.json README.md dist",
2422
"release": "standard-version --no-verify",
2523
"release:major": "yarn release --release-as major",
2624
"release:minor": "yarn release --release-as minor",
2725
"release:patch": "yarn release --release-as patch"
2826
},
2927
"devDependencies": {
3028
"@boringcodes/prettier-config": "*",
29+
"copyfiles": "^2.2.0",
3130
"husky": "^2.3.0",
3231
"prettier": "^2.0.2",
3332
"pretty-quick": "^2.0.1",

0 commit comments

Comments
 (0)