Skip to content

Commit f17aeba

Browse files
authored
Merge pull request #156 from scalprum/nx-update
chore: adopt nx release executors
2 parents 0f7afcc + 3558b9f commit f17aeba

File tree

20 files changed

+17858
-14656
lines changed

20 files changed

+17858
-14656
lines changed

.github/actions/release/action.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
- uses: './.github/actions/node-cache'
2424
- name: Install deps
2525
shell: bash
26-
run: npm i
26+
run: npm ci
2727
- name: git config
2828
shell: bash
2929
run: |
@@ -32,17 +32,18 @@ runs:
3232
- name: Build
3333
shell: bash
3434
run: npx nx run-many -t build
35-
- name: Set publish config
35+
- name: Set npm auth
3636
env:
3737
NPM_TOKEN: ${{ inputs.npm_token }}
3838
shell: bash
3939
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
40-
- name: Version
40+
- name: Release (Version, Changelog, Publish to npm and GitHub)
4141
shell: bash
4242
env:
4343
GH_TOKEN: ${{ inputs.gh_token }}
4444
GITHUB_TOKEN: ${{ inputs.gh_token }}
45-
run: npx nx affected --base=last-release --parallel=1 --target=version --postTargets=syncDependencies,build,npm,github --trackDeps
45+
NODE_AUTH_TOKEN: ${{ inputs.npm_token }}
46+
run: npx nx release --base=last-release
4647
- name: Tag last-release
4748
shell: bash
4849
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ Thumbs.db
3838
.webpack-cache
3939
.vscode
4040
.cdn-cache
41+
.cursor/rules/nx-rules.mdc
42+
.github/instructions/nx.instructions.md

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Disable legacy peer deps to prevent issues with dev dependency removal from lockfile
2+
# This ensures proper lockfile management during releases
3+
legacy-peer-deps=false

examples/test-app-e2e/cypress.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@ export default defineConfig({
1717
},
1818
});
1919
},
20+
// Please ensure you use `cy.origin()` when navigating between domains and remove this option.
21+
// See https://docs.cypress.io/app/references/migration-guide#Changes-to-cyorigin
22+
injectDocumentDomain: true,
2023
},
2124
});

examples/test-app/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "examples/test-app/src",
55
"projectType": "application",
6+
"tags": [],
67
"targets": {
78
"build": {
89
"executor": "@nx/webpack:webpack",
@@ -93,6 +94,5 @@
9394
"jestConfig": "examples/test-app/jest.config.ts"
9495
}
9596
}
96-
},
97-
"tags": []
97+
}
9898
}

jest.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getJestProjects } from '@nx/jest';
1+
import { getJestProjectsAsync } from '@nx/jest';
22

3-
export default {
4-
projects: getJestProjects(),
5-
};
3+
export default async () => ({
4+
projects: await getJestProjectsAsync(),
5+
});

nx.json

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
}
2828
}
2929
},
30-
"version": {
31-
"dependsOn": ["^version"]
32-
},
3330
"component-test": {
3431
"cache": true,
3532
"inputs": ["default", "^production"]
@@ -69,5 +66,86 @@
6966
"linter": "eslint"
7067
}
7168
}
69+
},
70+
"release": {
71+
"projects": ["@scalprum/core", "@scalprum/react-core", "@scalprum/react-test-utils"],
72+
"projectsRelationship": "independent",
73+
"version": {
74+
"generatorOptions": {
75+
"packageRoot": "dist/{projectRoot}",
76+
"currentVersionResolver": "git-tag",
77+
"updateDependents": "auto"
78+
},
79+
"conventionalCommits": {
80+
"types": {
81+
"feat": {
82+
"semverBump": "minor",
83+
"changelog": {
84+
"title": "Features"
85+
}
86+
},
87+
"fix": {
88+
"semverBump": "patch",
89+
"changelog": {
90+
"title": "Bug Fixes"
91+
}
92+
},
93+
"chore": {
94+
"semverBump": "patch",
95+
"changelog": {
96+
"title": "Chores"
97+
}
98+
},
99+
"refactor": {
100+
"semverBump": "patch",
101+
"changelog": {
102+
"title": "Refactoring"
103+
}
104+
},
105+
"docs": {
106+
"semverBump": "patch",
107+
"changelog": {
108+
"hidden": true
109+
}
110+
},
111+
"style": {
112+
"semverBump": "patch",
113+
"changelog": {
114+
"hidden": true
115+
}
116+
},
117+
"perf": {
118+
"semverBump": "patch",
119+
"changelog": {
120+
"hidden": true
121+
}
122+
},
123+
"test": {
124+
"semverBump": "patch",
125+
"changelog": {
126+
"hidden": true
127+
}
128+
}
129+
}
130+
}
131+
},
132+
"changelog": {
133+
"projectChangelogs": {
134+
"createRelease": "github",
135+
"renderOptions": {
136+
"authors": true,
137+
"commitReferences": true,
138+
"versionTitleDate": true
139+
}
140+
}
141+
},
142+
"releaseTagPattern": "{projectName}-{version}",
143+
"git": {
144+
"commitMessage": "chore: bump {projectName} to {version} [skip ci]",
145+
"push": true,
146+
"commit": true,
147+
"tag": true,
148+
"stageChanges": true
149+
}
72150
}
73151
}

0 commit comments

Comments
 (0)