Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to Nx workspace v18.1.3 #221

Merged
merged 5 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
steps:
- uses: pnpm/action-setup@v3
with:
version: 8.2
version: 8

- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
- name: Setup PNPM
uses: pnpm/action-setup@v3
with:
version: 8.2
version: 8

- name: Setup Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
Expand Down
6 changes: 5 additions & 1 deletion .verdaccio/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ uplinks:
maxage: 60m

packages:
'@nxrocks/*':
access: $all
publish: $all
# proxy: npmjs <-- disable this, because version `0.0.0-e2e` of `@nxrocks/*` packages was accidentally published to NPM 🤦🏿‍♂️ (it makes no sense to proxy them anyway)

'**':
# give all users (including non-authenticated users) full access
# because it is a local registry
access: $all
publish: $all
unpublish: $all

# if package is not available locally, proxy requests to npm registry
proxy: npmjs

Expand Down
6 changes: 2 additions & 4 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"affected": {
"defaultBase": "origin/develop"
},
"release": {
"projects": ["packages/*"],
"projectsRelationship": "independent",
Expand Down Expand Up @@ -83,5 +80,6 @@
},
"nxCloudAccessToken": "ZDRmZDczZWUtMDU2My00YzQ0LTlkMWEtZjM2YjZlZWNmNGIxfHJlYWQ=",
"parallel": 1,
"plugins": []
"plugins": [],
"defaultBase": "origin/develop"
}
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
"dependencies": {
"@clack/prompts": "^0.7.0",
"@swc/helpers": "0.5.2",
"create-nx-workspace": "~18.0.5",
"create-nx-workspace": "~18.1.3",
"enquirer": "^2.4.1",
"hpagent": "^1.2.0",
"js-yaml": "^4.1.0",
"minimatch": "^9.0.3",
"node-fetch": "^2.6.12",
"semver": "^7.6.0",
"terminal-link": "^2.1.1",
"tslib": "^2.6.1",
"unzipper": "^0.10.14",
Expand All @@ -48,20 +49,21 @@
"@commitlint/cli": "^17.6.1",
"@commitlint/config-angular": "^17.6.1",
"@jest/globals": "^29.5.0",
"@nx/devkit": "18.0.8",
"@nx/eslint-plugin": "18.0.8",
"@nx/jest": "18.0.8",
"@nx/js": "18.0.8",
"@nx/node": "18.0.8",
"@nx/plugin": "18.0.8",
"@nx/workspace": "18.0.8",
"@nx/devkit": "18.2.0",
"@nx/eslint-plugin": "18.2.0",
"@nx/jest": "18.2.0",
"@nx/js": "18.2.0",
"@nx/node": "18.2.0",
"@nx/plugin": "18.2.0",
"@nx/workspace": "18.2.0",
"@swc-node/register": "1.8.0",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.87",
"@types/fs-extra": "^9.0.13",
"@types/jest": "29.4.0",
"@types/node": "18.16.9",
"@types/node-fetch": "^2.6.9",
"@types/semver": "^7.5.8",
"@types/tmp": "^0.2.3",
"@types/unzipper": "^0.10.5",
"@types/xmldoc": "^1.1.6",
Expand All @@ -78,12 +80,12 @@
"jest-environment-node": "^29.4.1",
"jest-mock": "28.1.3",
"jsonc-eslint-parser": "^2.2.0",
"nx": "18.0.8",
"nx": "18.2.0",
"prettier": "2.6.2",
"ts-jest": "29.1.0",
"ts-node": "10.9.1",
"tslint": "6.1.3",
"typescript": "5.3.3",
"typescript": "5.4.3",
"verdaccio": "^5.0.4"
},
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"fs-extra": "^10.1.0",
"@nx/devkit": ">=18.0.0",
"tslib": "^2.6.1",
"minimatch": "^9.0.3"
"minimatch": "^9.0.3",
"semver": "^7.6.0"
},
"typings": "./src/index.d.ts",
"peerDependencies": {},
Expand Down
13 changes: 9 additions & 4 deletions packages/common/src/lib/workspace/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { basename, dirname, isAbsolute, join, relative, resolve } from 'path';

import {
NX_VERSION,
NxJsonConfiguration,
normalizePath,
readJsonFile,
workspaceRoot,
} from '@nx/devkit';
import { existsSync, readFileSync } from 'fs';
import { lt } from 'semver';

export function getProjectRoot(project: { root: string }) {
return resolve(workspaceRoot, project.root);
Expand Down Expand Up @@ -54,9 +56,12 @@ export function getProjectRootFromFile(filePath: string) {

export function isNxCrystalEnabled() {
const nxJson = readJsonFile<NxJsonConfiguration>(`${workspaceRoot}/nx.json`);
return !(
/**nxJson.useInferencePlugins === false ||**/ (
process.env['NX_ADD_PLUGINS'] === 'false'
)

if (lt(NX_VERSION, '18.1.0')) {
return process.env['NX_ADD_PLUGINS'] !== 'false';
}
return (
process.env['NX_ADD_PLUGINS'] !== 'false' &&
nxJson.useInferencePlugins !== false
);
}
Loading