Skip to content

Commit f92b90b

Browse files
authored
Merge pull request #740 from lumapps/fix/fix-export-types
fix(release): fix TS types generation, version and changelog update
2 parents 31340bf + 788aac4 commit f92b90b

File tree

7 files changed

+36
-144
lines changed

7 files changed

+36
-144
lines changed

.github/workflows/chromatic.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
push:
77
tags:
88
- v*
9+
- '!v*-alpha.*' # ignore alpha versions
910

1011
env:
1112
node_version: '13.7.0'

CHANGELOG.md

Lines changed: 11 additions & 127 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,18 @@ This will produce the target build for `@lumx/core`, `@lumx/angularjs`, `@lumx/r
8080

8181
## How to publish packages
8282

83-
1. Create a release branch (ex: `release/vX.Y.Z`)
83+
1. Create a release branch (ex: `release/vX.Y.Z`) based on `master`
8484
2. Push it to remote (`git push origin release/vX.Y.Z`)
8585
3. Login to NPM with an authorized account: `npm login`
8686
4. Make sure your packages are up to date: `yarn`
87-
5. (Optionnal) Make sure the build doesn't crash: `yarn build`
88-
6. Publish the packages to NPM: `yarn release`
89-
(you will be asked what version bump to apply)
90-
7. Update the tag `git tag -f vX.Y.Z && git push --tags`
91-
8. Create a PR for the release branch to merge into master
87+
5. (Optional) Make sure the build doesn't crash: `yarn build`
88+
6. Publish the packages to NPM
89+
* to release an alpha version:
90+
`yarn release --dist-tag <npm-tag> vX.Y.Z-alpha.N`
91+
* the `--dist-tag <npm-tag>` option is used to avoid replacing the `latest` tag on NPM
92+
* to release a version: `yarn release`
93+
(you will be asked what version bump to apply)
94+
7. Create a PR for the release branch to merge into master
9295

9396
## Copyright and license
9497

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"@typescript-eslint/eslint-plugin": "^4.9.0",
99
"@typescript-eslint/parser": "^4.9.0",
1010
"babel-eslint": "^10.1.0",
11-
"changelog-verify": "^1.1.2",
1211
"es-abstract": "1.17.6",
1312
"eslint": "^7.14.0",
1413
"eslint-config-airbnb": "^18.2.1",
@@ -33,7 +32,6 @@
3332
"stylelint-prettier": "^1.1.2",
3433
"stylelint-scss": "^3.18.0",
3534
"typescript": "^4.1.2",
36-
"version-changelog": "^3.1.1",
3735
"webpack": "^4.44.1",
3836
"webpack-cli": "^4.2.0",
3937
"yeoman-generator": "^4.1.0",
@@ -71,6 +69,9 @@
7169
"build": "lerna run --stream build",
7270
"build:site": "yarn workspace lumx-site-demo clean && yarn workspace lumx-site-demo build",
7371
"build:storybook": "yarn workspace @lumx/react build:storybook",
72+
"build:react": "yarn workspace @lumx/react build",
73+
"build:core": "yarn workspace @lumx/core build",
74+
"build:angularjs": "yarn workspace @lumx/angularjs build",
7475
"chromatic": "npx chromatic -b build:storybook",
7576
"clean": "rm -rf packages/*/dist && lerna clean --yes && lerna run --stream clean",
7677
"clean:git-hooks": "yarn husky uninstall",
@@ -81,14 +82,14 @@
8182
"lint:style": "stylelint packages/**/*.{css,scss}",
8283
"lint:code": "eslint packages/**/*.{ts,tsx,js}",
8384
"prepare": "lerna run --stream prepare",
84-
"preversion": "git symbolic-ref --short -q HEAD | egrep -q '^master$' && echo 'ERROR: You can not release from the master branch.' && exit 1 || true",
85-
"version": "yarn --immutable && yarn version-changelog CHANGELOG.md && git add CHANGELOG.md",
8685
"release": "yarn lerna publish --force-publish",
8786
"scaffold": "yo ./packages/yo-generators --with-tests --with-demo",
8887
"setup:git-hooks": "yarn husky uninstall && yarn husky install || exit 0",
8988
"start": "yarn workspace lumx-site-demo start",
9089
"test": "lerna run --stream test",
9190
"storybook:react": "yarn workspace @lumx/react storybook",
91+
"check:not-master": "git symbolic-ref --short -q HEAD | egrep -q '^master$' && echo 'ERROR: You can not release from the master branch.' && exit 1 || true",
92+
"version": "yarn check:not-master && yarn && git add yarn.lock",
9293
"generate:design-tokens": "yarn workspace @lumx/core generate:design-tokens"
9394
},
9495
"workspaces": [

packages/lumx-core/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
},
3636
"scripts": {
3737
"generate:design-tokens": "yarn node style-dictionary",
38-
"build": "webpack",
39-
"postbuild": "rm -rf ./dist/*.js ./dist/*.js.map",
38+
"build": "webpack && yarn clean:unwanted-dist",
39+
"clean:unwanted-dist": "rm -rf ./dist/*.js ./dist/*.js.map",
4040
"prepare": "install-peers || exit 0",
41-
"prepublishOnly": "yarn build"
41+
"prepublishOnly": "yarn build",
42+
"version": "yarn version-changelog ../../CHANGELOG.md && yarn changelog-verify ../../CHANGELOG.md && git add ../../CHANGELOG.md"
4243
},
4344
"sideEffects": false,
4445
"version": "2.1.5",
@@ -52,6 +53,7 @@
5253
"@babel/preset-env": "^7.8.3",
5354
"@babel/preset-typescript": "^7.12.7",
5455
"autoprefixer": "^9.7.4",
56+
"changelog-verify": "^1.1.2",
5557
"clean-webpack-plugin": "^3.0.0",
5658
"copy-webpack-plugin": "^5.1.1",
5759
"core-js": "^3.6.4",
@@ -70,6 +72,7 @@
7072
"style-dictionary": "^2.10.0",
7173
"tinycolor2": "^1.4.1",
7274
"unminified-webpack-plugin": "^2.0.0",
75+
"version-changelog": "^3.1.1",
7376
"webpack": "^4.44.1",
7477
"webpack-notifier": "^1.8.0",
7578
"webpackbar": "^4.0.0"

packages/lumx-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
"url": "git+https://github.com/lumapps/design-system.git"
116116
},
117117
"scripts": {
118-
"build": "rollup -c",
119-
"postbuild": "dts-bundle-generator --no-check --external-types=react --external-imports=moment -o dist/types.d.ts src/index.ts",
118+
"build": "rollup -c && yarn generate:types",
119+
"generate:types": "dts-bundle-generator --no-check --external-types=react --external-imports=moment -o dist/types.d.ts src/index.ts",
120120
"prepare": "install-peers || exit 0",
121121
"prepublishOnly": "yarn build",
122122
"test": "jest --config jest/index.js --coverage --notify --passWithNoTests --detectOpenHandles --runInBand",

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5875,6 +5875,7 @@ __metadata:
58755875
"@babel/preset-env": ^7.8.3
58765876
"@babel/preset-typescript": ^7.12.7
58775877
autoprefixer: ^9.7.4
5878+
changelog-verify: ^1.1.2
58785879
classnames: ^2.2.6
58795880
clean-webpack-plugin: ^3.0.0
58805881
copy-webpack-plugin: ^5.1.1
@@ -5897,6 +5898,7 @@ __metadata:
58975898
style-dictionary: ^2.10.0
58985899
tinycolor2: ^1.4.1
58995900
unminified-webpack-plugin: ^2.0.0
5901+
version-changelog: ^3.1.1
59005902
webpack: ^4.44.1
59015903
webpack-notifier: ^1.8.0
59025904
webpackbar: ^4.0.0
@@ -5922,7 +5924,6 @@ __metadata:
59225924
"@typescript-eslint/eslint-plugin": ^4.9.0
59235925
"@typescript-eslint/parser": ^4.9.0
59245926
babel-eslint: ^10.1.0
5925-
changelog-verify: ^1.1.2
59265927
es-abstract: 1.17.6
59275928
eslint: ^7.14.0
59285929
eslint-config-airbnb: ^18.2.1
@@ -5947,7 +5948,6 @@ __metadata:
59475948
stylelint-prettier: ^1.1.2
59485949
stylelint-scss: ^3.18.0
59495950
typescript: ^4.1.2
5950-
version-changelog: ^3.1.1
59515951
webpack: ^4.44.1
59525952
webpack-cli: ^4.2.0
59535953
yeoman-generator: ^4.1.0

0 commit comments

Comments
 (0)