Skip to content

Commit

Permalink
feat(qwik-nx): nx 17 support (#213)
Browse files Browse the repository at this point in the history
* feat(qwik-nx): migrate to nx@17 - automated changes

* chore(repo): bump @jscutlery/semver

* chore(qwik-nx): misc updates

* test(qwik-nx): update snapshots
  • Loading branch information
dmitry-stepanenko authored Nov 5, 2023
1 parent 887ca75 commit 1cbf329
Show file tree
Hide file tree
Showing 38 changed files with 381 additions and 527 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ Thumbs.db

# Local Netlify folder
.netlify

# Nx
.nx/cache
migrations.json
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

/dist
/coverage
CHANGELOG.md
CHANGELOG.md
/.nx/cache
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ This plugin supports Nx migrations and provides necessary version and code updat

| qwik-nx version | Nx version |
| ------------------ | ---------- |
| ^2.0.0 | ^17.0.0 |
| ^1.1.0 | ^16.8.0 |
| ^1.0.0 | ^16.0.0 |
| ^0.16.0 | ^16.0.0 |
Expand Down
2 changes: 1 addition & 1 deletion e2e/qwik-nx-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/qwik-nx-e2e/**/*.ts"]
Expand Down
8 changes: 4 additions & 4 deletions e2e/qwik-nx-e2e/tests/chore.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ describe('misc checks', () => {

expect(packageJson.peerDependencies).toBeUndefined();
expect(packageJson.dependencies).toEqual({
'@nx/devkit': '^16.0.0',
'@nx/js': '^16.0.0',
'@nx/linter': '^16.0.0',
'@nx/vite': '^16.0.0',
'@nx/devkit': '^17.0.0',
'@nx/js': '^17.0.0',
'@nx/eslint': '^17.0.0',
'@nx/vite': '^17.0.0',
});
},
DEFAULT_E2E_TIMEOUT
Expand Down
21 changes: 12 additions & 9 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"npmScope": "qwikifiers",
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"runtimeCacheInputs": [
"node ./scripts/get-cache-input.js --type=node",
"node ./scripts/get-cache-input.js --type=os"
],
"accessToken": "MmI5MzJhMDctNGYwMi00OTI1LWJiZjUtNWIwNTQ4NmY2ZjhjfHJlYWQtd3JpdGU="
]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
"dependsOn": ["^build"],
"cache": true
},
"version": {
"dependsOn": ["build"]
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
},
"test": {
"inputs": ["default", "^default", "{workspaceRoot}/jest.preset.js"]
"inputs": ["default", "^default", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"e2e": {
"cache": true
}
},
"workspaceLayout": {
"appsDir": "e2e",
"libsDir": "packages"
}
},
"nxCloudAccessToken": "MmI5MzJhMDctNGYwMi00OTI1LWJiZjUtNWIwNTQ4NmY2ZjhjfHJlYWQtd3JpdGU="
}
31 changes: 15 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
"@commitlint/cli": "^17.3.0",
"@commitlint/config-angular": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"@jscutlery/semver": "^3.1.0",
"@nx/cypress": "16.10.0",
"@nx/devkit": "16.10.0",
"@nx/eslint-plugin": "16.10.0",
"@nx/jest": "16.10.0",
"@nx/js": "16.10.0",
"@nx/linter": "16.10.0",
"@nx/playwright": "16.10.0",
"@nx/plugin": "16.10.0",
"@nx/storybook": "16.10.0",
"@nx/vite": "16.10.0",
"@nx/workspace": "16.10.0",
"@jscutlery/semver": "^4.0.0",
"@nx/cypress": "17.0.3",
"@nx/devkit": "17.0.3",
"@nx/eslint": "17.0.3",
"@nx/eslint-plugin": "17.0.3",
"@nx/jest": "17.0.3",
"@nx/js": "17.0.3",
"@nx/playwright": "17.0.3",
"@nx/plugin": "17.0.3",
"@nx/storybook": "17.0.3",
"@nx/vite": "17.0.3",
"@nx/workspace": "17.0.3",
"@swc-node/register": "1.6.8",
"@swc/cli": "0.1.62",
"@swc/core": "^1.3.95",
Expand All @@ -49,11 +49,11 @@
"chalk": "^4.1.0",
"commitizen": "^4.2.5",
"commitlint": "^17.3.0",
"create-nx-workspace": "16.0.0",
"create-nx-workspace": "17.0.3",
"cz-conventional-changelog": "^3.3.0",
"enquirer": "2.3.6",
"eslint": "8.46.0",
"eslint-config-prettier": "8.1.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-unused-imports": "2.0.0",
"fs-extra": "11.1.0",
"husky": "^8.0.1",
Expand All @@ -64,8 +64,7 @@
"jsonc-eslint-parser": "^2.1.0",
"kill-port": "2.0.1",
"ngx-deploy-npm": "^6.0.0",
"nx": "16.10.0",
"nx-cloud": "16.5.2",
"nx": "17.0.3",
"prettier": "^2.8.0",
"pretty-quick": "^3.1.3",
"tcp-port-used": "1.0.2",
Expand Down
3 changes: 1 addition & 2 deletions packages/add-nx-to-qwik/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["packages/add-nx-to-qwik/**/*.ts"]
}
Expand All @@ -26,7 +26,6 @@
"tsConfig": "packages/add-nx-to-qwik/tsconfig.lib.json",
"packageJson": "packages/add-nx-to-qwik/package.json",
"main": "packages/add-nx-to-qwik/src/index.ts",
"updateBuildableProjectDepsInPackageJson": false,
"assets": [
"packages/add-nx-to-qwik/*.md",
{
Expand Down
2 changes: 1 addition & 1 deletion packages/create-qwik-nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"homepage": "https://github.com/qwikifiers/qwik-nx",
"dependencies": {
"create-nx-workspace": "^16.0.0"
"create-nx-workspace": "^17.0.0"
},
"publishConfig": {
"access": "public",
Expand Down
5 changes: 2 additions & 3 deletions packages/create-qwik-nx/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@
"glob": "LICENSE",
"output": "/"
}
],
"updateBuildableProjectDepsInPackageJson": true
]
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"packages/create-qwik-nx/**/*.ts",
Expand Down
8 changes: 4 additions & 4 deletions packages/qwik-nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"generators": "./generators.json",
"executors": "./executors.json",
"dependencies": {
"@nx/devkit": "^16.0.0",
"@nx/js": "^16.0.0",
"@nx/linter": "^16.0.0",
"@nx/vite": "^16.0.0"
"@nx/devkit": "^17.0.0",
"@nx/js": "^17.0.0",
"@nx/vite": "^17.0.0",
"@nx/eslint": "^17.0.0"
},
"nx-migrations": {
"migrations": "./migrations.json"
Expand Down
3 changes: 1 addition & 2 deletions packages/qwik-nx/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"options": {
"outputPath": "dist/packages/qwik-nx",
"main": "packages/qwik-nx/src/index.ts",
"updateBuildableProjectDepsInPackageJson": false,
"tsConfig": "packages/qwik-nx/tsconfig.lib.json",
"assets": [
"README.md",
Expand Down Expand Up @@ -48,7 +47,7 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Tree, joinPathFragments, readProjectConfiguration } from '@nx/devkit';

import generator from './generator';
import { QwikAppGeneratorSchema } from './schema';
import { Linter } from '@nx/linter';
import { Linter } from '@nx/eslint';
import { getFormattedListChanges } from './../../utils/testing-generators';

// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand Down
2 changes: 1 addition & 1 deletion packages/qwik-nx/src/generators/application/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Tree,
runTasksInSerial,
} from '@nx/devkit';
import { Linter } from '@nx/linter';
import { Linter } from '@nx/eslint';
import { initGenerator } from '@nx/vite';
import { initGenerator as jsInitGenerator } from '@nx/js';
import { addCommonQwikDependencies } from '../../utils/add-common-qwik-dependencies';
Expand Down
2 changes: 1 addition & 1 deletion packages/qwik-nx/src/generators/application/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Linter } from '@nx/linter';
import { Linter } from '@nx/eslint';
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';

export interface QwikAppGeneratorSchema {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@nx/devkit';
import { getInstalledNxVersion } from '../../../utils/get-installed-nx-version';
import { NormalizedSchema } from '../schema';
import { Linter } from '@nx/linter';
import { Linter } from '@nx/eslint';

export async function addE2eProject(
tree: Tree,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function getTestTarget(
): TargetConfiguration {
return {
executor: '@nx/vite:test',
outputs: [`${params.offsetFromRoot}coverage/${params.projectRoot}`],
outputs: ['{options.reportsDirectory}'],
options: {
passWithNoTests: true,
reportsDirectory: `${params.offsetFromRoot}coverage/${params.projectRoot}`,
Expand Down
Loading

0 comments on commit 1cbf329

Please sign in to comment.