Skip to content

chore: migrate to nx 16.10 #29617

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

Merged
merged 3 commits into from
Oct 26, 2023
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
100 changes: 46 additions & 54 deletions migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,83 @@
"migrations": [
{
"cli": "nx",
"version": "16.0.0-beta.0",
"description": "Remove @nrwl/cli.",
"implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli",
"version": "16.2.0-beta.0",
"description": "Remove outputPath from run commands",
"implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path",
"package": "nx",
"name": "16.0.0-remove-nrwl-cli"
"name": "16.2.0-remove-output-path-from-run-commands"
},
{
"cli": "nx",
"version": "16.0.0-beta.9",
"description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.",
"implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens",
"version": "16.6.0-beta.6",
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
"implementation": "./src/migrations/update-15-0-0/prefix-outputs",
"package": "nx",
"name": "16.0.0-tokens-for-depends-on"
"name": "16.6.0-prefix-outputs"
},
{
"cli": "nx",
"version": "16.0.0-beta.0",
"description": "Replace @nrwl/nx-cloud with nx-cloud",
"implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner",
"version": "16.8.0-beta.3",
"description": "Escape $ in env variables",
"implementation": "./src/migrations/update-16-8-0/escape-dollar-sign-env-variables",
"package": "nx",
"name": "16.0.0-update-nx-cloud-runner"
"name": "16.8.0-escape-dollar-sign-env"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/devkit with @nx/devkit",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"package": "@nx/devkit",
"name": "update-16-0-0-add-nx-packages"
"version": "16.3.1-beta.0",
"description": "Replace @nrwl/node:webpack and @nx/node:webpack with @nx/webpack:webpack for all project targets",
"implementation": "./src/migrations/update-16-3-1/update-webpack-executor",
"package": "@nx/node",
"name": "update-16-3-1-update-executor"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/workspace with @nx/workspace",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"package": "@nx/workspace",
"name": "update-16-0-0-add-nx-packages"
"version": "16.4.0-beta.8",
"description": "Replace @nx/node:node with @nx/js:node for all project targets",
"implementation": "./src/migrations/update-16-4-0/replace-node-executor",
"package": "@nx/node",
"name": "update-16-4-0-replace-node-executor"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/js with @nx/js",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"version": "16.6.0-beta.0",
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps",
"package": "@nx/js",
"name": "update-16-0-0-add-nx-packages"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/jest with @nx/jest",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"package": "@nx/jest",
"name": "update-16-0-0-add-nx-packages"
"name": "explicitly-set-projects-to-update-buildable-deps"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/node with @nx/node",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"package": "@nx/node",
"name": "update-16-0-0-add-nx-packages"
"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"
},
{
"cli": "nx",
"version": "16.0.0-beta.5",
"description": "Replace @nx/node:webpack with @nx/node:webpack",
"implementation": "./src/migrations/update-16-0-0/update-webpack-executor",
"package": "@nx/node",
"name": "update-16-0-0-update-executor"
"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": "16.0.0-beta.9",
"description": "Fix .babelrc presets if it contains an invalid entry for @nx/web/babel.",
"cli": "nx",
"implementation": "./src/migrations/update-16-0-0/fix-invalid-babelrc",
"package": "@nx/workspace",
"name": "16-0-0-fix-invalid-babelrc"
"version": "16.5.0-beta.2",
"description": "Add test-setup.ts to ignored files in production input",
"implementation": "./src/migrations/update-16-5-0/add-test-setup-to-inputs-ignore",
"package": "@nx/jest",
"name": "add-test-setup-to-inputs-ignore"
},
{
"version": "16.0.0-beta.4",
"description": "Generates a plugin called 'workspace-plugin' containing your workspace generators.",
"cli": "nx",
"implementation": "./src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin",
"package": "@nx/workspace",
"name": "16-0-0-move-workspace-generators-into-local-plugin"
"version": "16.2.0-beta.0",
"description": "Replace @nx/plugin:e2e with @nx/jest",
"implementation": "./src/migrations/update-16-2-0/replace-e2e-executor",
"package": "@nx/plugin",
"name": "update-16-2-0-replace-e2e-executor"
}
]
}
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s"
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s"
]
}
}
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@
"devDependencies": {
"@actions/core": "1.9.1",
"@actions/github": "5.0.3",
"@babel/core": "7.21.8",
"@babel/generator": "7.21.5",
"@babel/parser": "7.21.8",
"@babel/core": "7.23.2",
"@babel/generator": "7.23.0",
"@babel/parser": "7.23.0",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-decorators": "7.21.0",
"@babel/plugin-proposal-decorators": "7.23.2",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-object-rest-spread": "7.8.3",
"@babel/plugin-transform-runtime": "7.21.4",
"@babel/preset-env": "7.21.5",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.21.5",
"@babel/register": "7.21.0",
"@babel/standalone": "7.21.8",
"@babel/traverse": "7.21.5",
"@babel/types": "7.21.5",
"@babel/plugin-transform-runtime": "7.23.2",
"@babel/preset-env": "7.23.2",
"@babel/preset-react": "7.22.15",
"@babel/preset-typescript": "7.23.2",
"@babel/register": "7.22.15",
"@babel/standalone": "7.23.2",
"@babel/traverse": "7.23.2",
"@babel/types": "7.23.0",
"@cactuslab/usepubsub": "^1.0.2",
"@ctrl/tinycolor": "3.3.4",
"@cypress/react": "5.12.4",
Expand All @@ -102,12 +102,12 @@
"@microsoft/load-themed-styles": "1.10.26",
"@microsoft/loader-load-themed-styles": "2.0.17",
"@microsoft/tsdoc": "0.14.1",
"@nx/devkit": "16.1.4",
"@nx/jest": "16.1.4",
"@nx/js": "16.1.4",
"@nx/node": "16.1.4",
"@nx/plugin": "16.1.4",
"@nx/workspace": "16.1.4",
"@nx/devkit": "16.10.0",
"@nx/jest": "16.10.0",
"@nx/js": "16.10.0",
"@nx/node": "16.10.0",
"@nx/plugin": "16.10.0",
"@nx/workspace": "16.10.0",
"@octokit/rest": "18.12.0",
"@phenomnomnominal/tsquery": "6.1.2",
"@storybook/addon-a11y": "6.5.15",
Expand Down Expand Up @@ -136,10 +136,10 @@
"@testing-library/react-hooks": "7.0.2",
"@testing-library/user-event": "13.5.0",
"@tsconfig/node14": "1.0.3",
"@types/babel__core": "7.1.18",
"@types/babel__helper-plugin-utils": "7.10.0",
"@types/babel__register": "7.17.0",
"@types/babel__traverse": "7.18.3",
"@types/babel__core": "7.20.3",
"@types/babel__helper-plugin-utils": "7.10.2",
"@types/babel__register": "7.17.2",
"@types/babel__traverse": "7.20.3",
"@types/chrome-remote-interface": "0.30.0",
"@types/circular-dependency-plugin": "5.0.5",
"@types/copy-webpack-plugin": "6.4.0",
Expand All @@ -153,7 +153,7 @@
"@types/glob": "7.1.1",
"@types/graphviz": "0.0.34",
"@types/gulp": "4.0.9",
"@types/gulp-babel": "6.1.30",
"@types/gulp-babel": "6.1.32",
"@types/gulp-cache": "0.4.5",
"@types/gulp-remember": "0.0.31",
"@types/gulp-sourcemaps": "0.0.35",
Expand Down Expand Up @@ -194,7 +194,7 @@
"ajv": "8.4.0",
"autoprefixer": "10.2.1",
"babel-jest": "29.7.0",
"babel-loader": "8.2.2",
"babel-loader": "8.3.0",
"babel-plugin-annotate-pure-calls": "0.4.0",
"babel-plugin-annotate-pure-imports": "1.0.0-1",
"babel-plugin-iife-wrap-react-components": "1.0.0-5",
Expand Down Expand Up @@ -284,7 +284,7 @@
"monosize-storage-azure": "0.0.3",
"node-plop": "0.25.0",
"node-polyfill-webpack-plugin": "1.0.2",
"nx": "16.1.4",
"nx": "16.10.0",
"p-queue": "6.6.2",
"parallel-webpack": "2.6.0",
"parse-diff": "0.7.1",
Expand Down
31 changes: 14 additions & 17 deletions scripts/gulp/src/plugins/util/getShorthandInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as Babel from '@babel/core';
import { NodePath } from '@babel/traverse';
import * as t from '@babel/types';
import type * as t from '@babel/types';
import { assertStringLiteral, isIdentifier } from '@babel/types';

import { ComponentInfo } from './docs-types';

Expand Down Expand Up @@ -74,26 +75,24 @@ const getShorthandInfo = (componentFile: t.File, componentName: string): Shortha
});

if (mappedProperty) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
t.assertStringLiteral(mappedProperty.node.value);
mappedShorthandProp = (mappedProperty.node.value as t.StringLiteral).value;
assertStringLiteral(mappedProperty.node.value);
mappedShorthandProp = mappedProperty.node.value.value;
}
} else if (isShorthandExpression(componentName, path)) {
implementsCreateShorthand = true;

const config = path.get('right.arguments.0') as NodePath<t.ObjectExpression>;
// why is explicit annotation + assertion needed ? https://github.com/microsoft/TypeScript/issues/47945
const config: NodePath = path.get('right.arguments.0') as NodePath;

config.assertObjectExpression();

const mappedProperty = (config.node.properties as any[]).find((property: t.ObjectProperty) => {
return t.isIdentifier(property.key, { name: 'mappedProp' });
}) as t.ObjectProperty | undefined;
const mappedProperty = (config.node.properties as t.ObjectProperty[]).find(property => {
return isIdentifier(property.key, { name: 'mappedProp' });
});

if (mappedProperty) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
t.assertStringLiteral(mappedProperty.value);
mappedShorthandProp = (mappedProperty.value as t.StringLiteral).value;
assertStringLiteral(mappedProperty.value);
mappedShorthandProp = mappedProperty.value.value;
}
}
},
Expand All @@ -119,10 +118,8 @@ const getShorthandInfo = (componentFile: t.File, componentName: string): Shortha
);

if (shorthandMappedPropertyPath) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
t.assertStringLiteral(shorthandMappedPropertyPath.node.value);
mappedShorthandProp = (shorthandMappedPropertyPath.node.value as t.StringLiteral).value;
assertStringLiteral(shorthandMappedPropertyPath.node.value);
mappedShorthandProp = shorthandMappedPropertyPath.node.value.value;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion tools/workspace-plugin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"glob": "executors.json",
"output": "."
}
]
],
"updateBuildableProjectDepsInPackageJson": true
}
},
"lint": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ function createProject(
graphMock.nodes[packageName] = {
name: packageName,
type: projectType === 'library' ? 'lib' : 'app',
data: { name: packageName, root: rootPath, files: [] },
data: { name: packageName, root: rootPath },
};

return tree;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ These are not production-ready components and **should never be used in product*
graphMock.nodes[npmName] = {
name: npmName,
type: projectType === 'library' ? 'lib' : 'app',
data: { name: npmName, root: npmName, files: [] },
data: { name: npmName, root: npmName },
};

if (options.files) {
Expand Down
2 changes: 1 addition & 1 deletion tools/workspace-plugin/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function parseArgs<T extends Record<string, any>>(args: string[]) {
return parsedArguments;
}

export { updateJestConfig } from '@nx/jest/src/generators/jest-project/lib/update-jestconfig';
export { updateJestConfig } from '@nx/jest/src/generators/configuration/lib/update-jestconfig';

export function getProjectConfig(tree: Tree, options: { packageName: string }) {
const projectConfig = readProjectConfiguration(tree, options.packageName);
Expand Down
Loading