Skip to content

Commit

Permalink
package versioning + auto changelog (module-federation#242)
Browse files Browse the repository at this point in the history
* versionning support

* chore: wip - versioning implementation

* chore(utils): release version 0.0.1

* chore(utils): release version 0.0.1

* chore: apply commitizen

* chore: contribution

* chore: cleanup

* chore(node): release version 0.2.0

* chore(node): release version 0.3.0

* chore(utils): release version 0.0.2

* chore: cleanup

* chore: move commitizen to dev deps

* chore: md url

Co-authored-by: Ran Shamay <ranshamay@microsoft.com>
  • Loading branch information
ranshamay and Ran Shamay authored Sep 30, 2022
1 parent 8eff65b commit d45bb92
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Thanks you for your contribution!
## commits
* must be followed by conventional commits
* could be achieved by using git commitizen (embedded in this repo).

## version release
* to release a version, please follow this command:
* `nx run PROJECT-NAME:version --releaseAs=MAJOR/MINOR/PATCH`
* find more options [here](https://github.com/jscutlery/semver#specify-the-level-of-change)
* this command will perform couple of operations.
* tag your commit with the relevant version.
* create changelog using semantic commits.
* bump the version of the project.
* if other projects depends on the current released project, they will be bumped as well.
* if case of bumping nextjs-mf project, NPM publish operation will be performed as well.
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
8 changes: 8 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,13 @@
"linter": "eslint"
}
}
},
"targetDependencies": {
"version": [
{
"target": "version",
"projects": "dependencies"
}
]
}
}
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
"scripts": {
"build": "nx build",
"start": "nx build && nx run-many --target=serve --verbose",
"prod": "nx build && nx run-many --target=build --verbose"
"prod": "nx build && nx run-many --target=build --verbose",
"commit": "cz"
},
"private": true,
"dependencies": {
"@module-federation/nextjs-mf": "link:./dist/packages/nextjs-mf",
"@module-federation/node": "link:./dist/packages/node",
"@module-federation/utilities": "link:./dist/packages/utilities",
"@swc/core": "^1.3.3",
"@swc/helpers": "~0.3.3",
"core-js": "^3.6.5",
"fast-glob": "^3.2.12",
Expand All @@ -29,10 +31,12 @@
"react-dom": "18.2.0",
"regenerator-runtime": "0.13.7",
"tslib": "^2.3.0",
"webpack": "^5.74.0",
"@swc/core": "^1.3.3"
"webpack": "^5.74.0"
},
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@jscutlery/semver": "^2.27.1",
"@nrwl/cli": "14.7.3",
"@nrwl/eslint-plugin-nx": "14.7.3",
"@nrwl/jest": "14.7.3",
Expand All @@ -52,13 +56,16 @@
"@types/webpack-sources": "^3.2.0",
"@typescript-eslint/eslint-plugin": "~5.33.1",
"@typescript-eslint/parser": "~5.33.1",
"commitizen": "^4.2.5",
"cz-conventional-changelog": "^3.3.0",
"eslint": "~8.15.0",
"eslint-config-next": "12.2.5",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-react": "7.31.1",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "^8.0.1",
"jest": "28.1.1",
"jest-environment-jsdom": "28.1.1",
"nx": "14.7.3",
Expand All @@ -74,6 +81,11 @@
"@module-federation/utilities": "link:./dist/packages/utilities",
"@module-federation/node": "link:./dist/packages/node"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"workspaces": {
"packages": [
"apps/**"
Expand Down
Empty file added packages/nextjs-mf/CHANGELOG.md
Empty file.
20 changes: 20 additions & 0 deletions packages/nextjs-mf/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,26 @@
"jestConfig": "packages/nextjs-mf/jest.config.js",
"passWithNoTests": true
}
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["nextjs-mf:npm", "nextjs-mf:github"],
"trackDeps": true
}
},
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "${tag}",
"notes": "${notes}"
}
},
"npm": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public"
}
}
},
"tags": [],
Expand Down
23 changes: 23 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Changelog

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

# [0.3.0](https://github.com/module-federation/nextjs-mf/compare/node-0.2.0...node-0.3.0) (2022-09-29)



# [0.2.0](https://github.com/module-federation/nextjs-mf/compare/node-0.1.0...node-0.2.0) (2022-09-29)



# 0.1.0 (2022-09-29)


### Bug Fixes

* **node:** fix path to webpack hmr runtime ([#231](https://github.com/module-federation/nextjs-mf/issues/231)) ([78e5f3c](https://github.com/module-federation/nextjs-mf/commit/78e5f3cefc1d67a6ec5d66b72b8b35408e19cfc2))


### Features

* Move Repo to NX ([#154](https://github.com/module-federation/nextjs-mf/issues/154)) ([d2a4dfa](https://github.com/module-federation/nextjs-mf/commit/d2a4dfac7fcdaa2b6a21e3d2973808d01649da61)), closes [#199](https://github.com/module-federation/nextjs-mf/issues/199) [#205](https://github.com/module-federation/nextjs-mf/issues/205) [#144](https://github.com/module-federation/nextjs-mf/issues/144) [#212](https://github.com/module-federation/nextjs-mf/issues/212)
20 changes: 20 additions & 0 deletions packages/node/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@
"options": {
"lintFilePatterns": ["packages/node/**/*.js"]
}
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["node:npm", "node:github"],
"trackDeps": true
}
},
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "${tag}",
"notes": "${notes}"
}
},
"npm": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public"
}
}
},
"tags": []
Expand Down
13 changes: 13 additions & 0 deletions packages/utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.0.2](https://github.com/module-federation/nextjs-mf/compare/utils-0.0.1...utils-0.0.2) (2022-09-29)



## 0.0.1 (2022-09-29)



## 0.0.1 (2022-09-29)
14 changes: 14 additions & 0 deletions packages/utilities/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@
"jestConfig": "packages/utilities/jest.config.ts",
"passWithNoTests": true
}
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["utils:github"],
"trackDeps": true
}
},
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "${tag}",
"notes": "${notes}"
}
}
},
"tags": []
Expand Down

0 comments on commit d45bb92

Please sign in to comment.