Skip to content

Commit

Permalink
feat: configure release-it with conventional commits
Browse files Browse the repository at this point in the history
  • Loading branch information
weronikaolejniczak committed May 11, 2024
1 parent bb16231 commit f90c5f9
Show file tree
Hide file tree
Showing 11 changed files with 15,531 additions and 13,376 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": ["@commitlint/config-conventional"] }
1 change: 1 addition & 0 deletions apps/back-end/.release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@travellan/release-it');
17 changes: 9 additions & 8 deletions apps/back-end/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "back-end",
"name": "@travellan/back-end",
"version": "1.0.0",
"description": "Backend application for Travellan Project",
"main": "index.js",
"author": "Travellan",
"license": "ISC",
"description": "Back-end application for the Travellan project",
"private": true,
"main": "src/index.ts",
"scripts": {
"dev": "nodemon src/index.js",
"start": "node src/index.js",
"lint": "biome check --apply-unsafe src"
"dev": "nodemon src/index.ts",
"lint": "biome check --apply-unsafe src",
"release": "release-it --ci",
"start": "node src/index.ts"
},
"dependencies": {
"amadeus": "^10.0.0",
Expand All @@ -23,6 +23,7 @@
"url": "^0.11.3"
},
"devDependencies": {
"@travellan/release-it": "*",
"nodemon": "^3.1.0"
}
}
1 change: 1 addition & 0 deletions apps/mobile/.release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@travellan/release-it');
11 changes: 7 additions & 4 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "mobile",
"name": "@travellan/mobile",
"version": "1.0.0",
"description": "React Native application for the Travellan project",
"private": true,
"scripts": {
"android": "react-native run-android",
"devtools": "react-devtools",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "biome check --apply-unsafe src",
"devtools": "react-devtools"
"release": "release-it --ci",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.23.1",
Expand Down Expand Up @@ -70,6 +72,7 @@
"@react-native/babel-preset": "0.74.83",
"@react-native/metro-config": "0.74.83",
"@react-native/typescript-config": "0.74.83",
"@travellan/release-it": "*",
"@types/react": "^18.3.1",
"@types/react-test-renderer": "^18.3.0",
"babel-jest": "^29.7.0",
Expand Down
36 changes: 36 additions & 0 deletions configs/release-it/.release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const version = '${version}';
const packageName = process.env.npm_package_name;
const scope = packageName.split('/')[1];

module.exports = {
plugins: {
'@release-it/conventional-changelog': {
path: '.',
infile: 'CHANGELOG.md',
preset: 'conventionalcommits',
gitRawCommitsOpts: {
path: '.',
},
},
},
git: {
push: true,
tagName: `${packageName}-v${version}`,
pushRepo: '[email protected]:weronikaolejniczak/travellan.git',
commitsPath: '.',
commitMessage: `feat(${scope}): released version v${version} [no ci]`,
requireCommits: true,
requireCommitsFail: false,
},
npm: {
publish: false,
versionArgs: ['--workspaces false'],
},
github: {
release: true,
releaseName: `${packageName}-v${version}`,
},
hooks: {
'before:git:release': ['yarn', 'git add --all'],
},
};
6 changes: 6 additions & 0 deletions configs/release-it/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@travellan/release-it",
"version": "1.0.0",
"main": ".release-it.js",
"private": true
}
5 changes: 4 additions & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
pre-commit:
parallel: true
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index --again
run: npx biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index --again
lint-commit-msg:
run: npx commitlint --edit
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
"private": true,
"scripts": {
"lint": "turbo run lint",
"start": "turbo run start",
"postinstall": "lefthook install"
"postinstall": "lefthook install",
"release": "turbo release --concurrency=1",
"start": "turbo run start"
},
"workspaces": ["apps/back-end", "apps/mobile"],
"workspaces": ["apps/back-end", "apps/mobile", "configs/release-it"],
"devDependencies": {
"@biomejs/biome": "1.7.2",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@release-it/conventional-changelog": "^8.0.1",
"lefthook": "^1.6.10",
"release-it": "^17.2.1",
"typescript": "^5.4.5"
},
"engines": {
Expand Down
10 changes: 8 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@
],
"globalDotEnv": [".env"],
"pipeline": {
"lint": {},
"dev": {
"cache": false,
"persistent": true
},
"start": {}
"lint": {},
"release": {
"dependsOn": ["^release"],
"outputMode": "new-only"
},
"start": {
"cache": false
}
}
}
Loading

0 comments on commit f90c5f9

Please sign in to comment.