Skip to content

Commit

Permalink
chore(nxext): update to Nx 17
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikPieper committed Oct 23, 2023
1 parent 67c7419 commit 6456774
Show file tree
Hide file tree
Showing 115 changed files with 859 additions and 940 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ e2e/stencil-e2e/tests/dev.test.ts

# Vitepress
/docs/.vitepress/cache

.nx/cache
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/tmp
.docusaurus/
/build

/.nx/cache
2 changes: 1 addition & 1 deletion e2e/preact-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/preact-e2e/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion e2e/solid-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/solid-e2e/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion e2e/stencil-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/stencil-e2e/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion e2e/svelte-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/svelte-e2e/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion e2e/sveltekit-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/sveltekit-e2e/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion e2e/vue-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/vue-e2e/**/*.ts"]
Expand Down
34 changes: 24 additions & 10 deletions migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@
"migrations": [
{
"cli": "nx",
"version": "16.9.0-beta.1",
"description": "Replace imports of Module Federation utils frm @nx/devkit to @nx/webpack",
"implementation": "./src/migrations/update-16-9-0/migrate-mf-util-usage",
"package": "@nx/devkit",
"name": "update-16-9-0-migrate-mf-usage-to-webpack"
"version": "17.0.0-beta.1",
"description": "Updates the default cache directory to .nx/cache",
"implementation": "./src/migrations/update-17-0-0/move-cache-directory",
"package": "nx",
"name": "17.0.0-move-cache-directory"
},
{
"cli": "nx",
"version": "16.8.2-beta.0",
"description": "Remove invalid options (strict, noInterop) for ES6 type modules.",
"factory": "./src/migrations/update-16-8-2/update-swcrc",
"package": "@nx/js",
"name": "16-8-2-update-swcrc"
"version": "17.0.0-beta.3",
"description": "Use minimal config for tasksRunnerOptions",
"implementation": "./src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options",
"package": "nx",
"name": "17.0.0-use-minimal-config-for-tasks-runner-options"
},
{
"version": "17.0.0-rc.1",
"description": "Migration for v17.0.0-rc.1",
"implementation": "./src/migrations/update-17-0-0/rm-default-collection-npm-scope",
"package": "nx",
"name": "rm-default-collection-npm-scope"
},
{
"version": "17.0.0-beta.7",
"description": "update-17-0-0-rename-to-eslint",
"implementation": "./src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint",
"package": "@nx/eslint",
"name": "update-17-0-0-rename-to-eslint"
}
]
}
23 changes: 13 additions & 10 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
{
"npmScope": "nxext",
"workspaceLayout": {
"appsDir": "e2e",
"libsDir": "packages"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"accessToken": "NTlhMGE3ZTYtYjk5OC00Mzc5LWE2ZTAtNzE4ODEzNDY5MjlmfHJlYWQ=",
"useLightClient": true,
"cacheableOperations": ["build", "test", "lint", "e2e"],
"canTrackAnalytics": true,
"showUsageWarnings": true,
"parallel": 1
"showUsageWarnings": true
}
}
},
Expand Down Expand Up @@ -79,17 +74,20 @@
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"lint": {
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/eslint.config.js"
]
],
"cache": true
},
"build-storybook": {
"inputs": [
Expand All @@ -98,6 +96,9 @@
"{projectRoot}/.storybook/**/*",
"{projectRoot}/tsconfig.storybook.json"
]
},
"e2e": {
"cache": true
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
Expand All @@ -121,5 +122,7 @@
"!{projectRoot}/tsconfig.storybook.json",
"!{projectRoot}/eslint.config.js"
]
}
},
"nxCloudAccessToken": "NTlhMGE3ZTYtYjk5OC00Mzc5LWE2ZTAtNzE4ODEzNDY5MjlmfHJlYWQ=",
"parallel": 1
}
39 changes: 19 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,20 @@
"@eslint/eslintrc": "^2.1.1",
"@eslint/js": "8.49.0",
"@nuxt/kit": "3.6.5",
"@nx/angular": "16.10.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/node": "16.10.0",
"@nx/playwright": "16.10.0",
"@nx/plugin": "16.10.0",
"@nx/react": "16.10.0",
"@nx/storybook": "16.10.0",
"@nx/vite": "16.10.0",
"@nx/web": "16.10.0",
"@nx/workspace": "16.10.0",
"@nx/angular": "17.0.1",
"@nx/cypress": "17.0.1",
"@nx/devkit": "17.0.1",
"@nx/eslint-plugin": "17.0.1",
"@nx/jest": "17.0.1",
"@nx/js": "17.0.1",
"@nx/node": "17.0.1",
"@nx/playwright": "17.0.1",
"@nx/plugin": "17.0.1",
"@nx/react": "17.0.1",
"@nx/storybook": "17.0.1",
"@nx/vite": "17.0.1",
"@nx/web": "17.0.1",
"@nx/workspace": "17.0.1",
"@phenomnomnominal/tsquery": "~5.0.1",
"@preact/preset-vite": "^2.5.0",
"@schematics/angular": "16.0.0",
Expand All @@ -95,7 +94,7 @@
"cz-customizable": "^6.9.1",
"dotenv": "16.3.1",
"eslint": "8.46.0",
"eslint-config-prettier": "8.8.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-cypress": "2.14.0",
"eslint-plugin-svelte3": "^4.0.0",
"file-type": "^18.5.0",
Expand All @@ -113,8 +112,7 @@
"lint-staged": "13.2.3",
"nuxi": "3.6.5",
"nuxt": "3.6.5",
"nx": "16.10.0",
"nx-cloud": "16.4.0",
"nx": "17.0.1",
"prettier": "2.7.1",
"pretty-quick": "^3.1.3",
"svelte": "^4.2.1",
Expand All @@ -128,9 +126,10 @@
"verdaccio": "5.18.0",
"verdaccio-auth-memory": "^10.2.2",
"vite-plugin-solid": "^2.7.0",
"vitepress": "^1.0.0-rc.20",
"vitepress": "^1.0.0-rc.23",
"yargs": "^17.7.2",
"yargs-parser": "^21.1.1"
"yargs-parser": "^21.1.1",
"@nx/eslint": "17.0.1"
},
"peerDependencies": {
"rxjs": "^7.4.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"dependencies": {
"tslib": "^2.3.0",
"@nx/devkit": "^16.9.1",
"@nx/devkit": "17.0.1",
"typescript": "5.1.6",
"nx": "^16.9.1"
"nx": "17.0.1"
}
}
2 changes: 1 addition & 1 deletion packages/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
Expand Down
12 changes: 6 additions & 6 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
"builders": "./executors.json",
"executors": "./executors.json",
"dependencies": {
"@nx/devkit": "^16.9.1",
"@nx/devkit": "17.0.1",
"tslib": "^2.3.0",
"@nx/workspace": "^16.9.1",
"@nx/workspace": "17.0.1",
"@nuxt/kit": "3.6.5",
"nuxi": "3.6.5",
"@nxext/core": "^16.7.0"
},
"peerDependencies": {
"@nx/js": "^16.9.1",
"@nx/linter": "^16.9.1",
"@nx/cypress": "^16.9.1",
"@nx/playwright": "^16.9.1"
"@nx/js": "17.0.1",
"@nx/cypress": "17.0.1",
"@nx/playwright": "17.0.1",
"@nx/eslint": "17.0.1"
},
"peerDependenciesMeta": {
"@nx/cypress": {
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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 @@ -2,7 +2,7 @@ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import { readJson, readProjectConfiguration, Tree } from '@nx/devkit';
import { applicationGenerator } from './application';
import { Schema } from './schema';
import { Linter } from '@nx/linter';
import { Linter } from '@nx/eslint';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const devkit = require('@nx/devkit');
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/generators/application/lib/add-linting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { mapLintPattern } from '@nxext/core';
export async function addLinting(host: Tree, options: NormalizedSchema) {
const tasks: GeneratorCallback[] = [];
if (options.linter === 'eslint') {
ensurePackage('@nx/linter', NX_VERSION);
const { lintProjectGenerator } = await import('@nx/linter');
ensurePackage('@nx/eslint', NX_VERSION);
const { lintProjectGenerator } = await import('@nx/eslint');
const lintTask = await lintProjectGenerator(host, {
linter: options.linter,
project: options.appProjectName,
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/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';

export interface Schema {
name: string;
Expand Down
12 changes: 6 additions & 6 deletions packages/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
"main": "src/index.js",
"generators": "./generators.json",
"peerDependencies": {
"@nx/linter": "^16.9.1",
"@nx/jest": "^16.9.1",
"@nx/vite": "^16.9.1",
"@nx/cypress": "^16.9.1",
"@nx/jest": "17.0.1",
"@nx/vite": "17.0.1",
"@nx/cypress": "17.0.1",
"typescript": "5.1.6",
"nx": "^16.9.1"
"nx": "17.0.1",
"@nx/eslint": "17.0.1"
},
"dependencies": {
"tslib": "^2.3.0",
"@nx/devkit": "^16.9.1"
"@nx/devkit": "17.0.1"
}
}
2 changes: 1 addition & 1 deletion packages/preact/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"generators": {},
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"packages/preact/**/*.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PreactApplicationSchema } from './schema';
import { Linter } from '@nx/linter';
import { Linter } from '@nx/eslint';
import applicationGenerator from './application';
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import { Tree } from '@nx/devkit';
Expand Down
17 changes: 15 additions & 2 deletions packages/preact/src/generators/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { addCypress } from './lib/add-cypress';
import { addJest } from './lib/add-jest';
import { updateJestConfig } from './lib/update-jest-config';
import { addVite } from './lib/add-vite';
import { updateViteConfig } from './lib/update-vite-config';
import { createOrEditViteConfig } from '@nx/vite';

function normalizeOptions(
tree: Tree,
Expand Down Expand Up @@ -73,11 +73,24 @@ export async function applicationGenerator(
createFiles(tree, options);

const viteTask = await addVite(tree, options);
createOrEditViteConfig(
tree,
{
project: options.name,
includeLib: false,
includeVitest: options.unitTestRunner === 'vitest',
inSourceTests: false,
rollupOptionsExternal: [],
imports: [`import preact from '@preact/preset-vite'`],
plugins: [`preact()`],
},
false
);

const lintTask = await addLinting(tree, options);
const jestTask = await addJest(tree, options);
const cypressTask = await addCypress(tree, options);
updateJestConfig(tree, options);
updateViteConfig(tree, options);

if (!options.skipFormat) {
await formatFiles(tree);
Expand Down
Loading

0 comments on commit 6456774

Please sign in to comment.