Compare commits

...

32 Commits

Author SHA1 Message Date
FrozenPandaz 66c54fbd12 chore(misc): publish 16.0.3 2023-05-02 18:20:26 -04:00
Jason Jean a34cb029ea fix(devkit): use the old package dependency version for new package (#16709)
(cherry picked from commit fa55ca4f5f)
2023-05-02 18:07:40 -04:00
Craigory Coppola 36f9f7d961 fix(core): task runner parallel should read from taskRunnerOptions (#16707)
(cherry picked from commit d084e678bd)
2023-05-02 17:49:42 -04:00
Nicholas Cunningham 7f060aeb21 fix(node): ensure that bundlers for node is webpack/esbuild (#16702)
(cherry picked from commit 8dec11ecbe)
2023-05-02 17:49:31 -04:00
Craigory Coppola 236686aed5 feat(misc): list should link to nx.dev/community for more plugins (#16673)
(cherry picked from commit a425f5b7d5)
2023-05-02 17:49:27 -04:00
Leosvel Pérez Espinosa b94bb35eb6 fix(angular): clean up ssr main.server.ts generation (#16699)
(cherry picked from commit 4be6f7401c)
2023-05-02 17:49:18 -04:00
FrozenPandaz e48d7d1835 chore(misc): publish 16.0.2 2023-05-02 10:39:39 -04:00
Nicholas Cunningham 4a7700f690 docs(core): fix deprecation message so that it shows correctly that @nrwl is being deprecated instead of @nx (#16698)
(cherry picked from commit 0e4fe4488d)
2023-05-02 10:37:15 -04:00
Dominik Pieper a2fbffeb26 chore(core): nx plugin change (#16694)
(cherry picked from commit c2541ad66d)
2023-05-02 10:34:28 -04:00
James Henry 9d8d5cd5db fix(core): only modify angular.json on read when @nx/angular is present (#16693)
(cherry picked from commit 32cbab7d26)
2023-05-02 10:34:20 -04:00
Craigory Coppola 333ce39a05 fix(misc): show proper messaging when generating a workspace generator (#16683)
(cherry picked from commit 4e97ee94e1)
2023-05-01 18:39:37 -04:00
Craigory Coppola c8b64b0696 fix(devkit): ensurePackage should obey npmrc and yarnrc.yml (#16652)
(cherry picked from commit 2381dd3cf6)
2023-05-01 18:39:35 -04:00
Caleb Ukle d71da8257a fix(testing): add --quiet cypress executor option (#16680)
(cherry picked from commit 179930fe18)
2023-05-01 16:51:10 -04:00
Vinit Neogi c9f37feab0 fix(core): add support for .mts and .mjs files when creating pro… (#16679)
(cherry picked from commit 13aaa20cd9)
2023-05-01 16:51:08 -04:00
Jason Jean 15bfd52512 fix(core): improve touched projects locator performance (#16682)
(cherry picked from commit 96fca453b4)
2023-05-01 16:51:05 -04:00
Jason Jean 9007d5ee5a fix(misc): publish legacy readmes (#16678)
(cherry picked from commit 9de97d0cfe)
2023-05-01 16:50:54 -04:00
Juri Strumpflohner 5f69351756 cleanup(nx-dev): remove debug logs (#16654)
(cherry picked from commit c51e6d5b42)
2023-05-01 16:50:50 -04:00
Craigory Coppola a09a2f9459 fix(core): cmd window flickers on save when on windows (#16671)
(cherry picked from commit e7229d1442)
2023-05-01 16:50:46 -04:00
khalilou88 997182714f chore(core): nx plugin submission @jnxplus/nx-quarkus-maven (#16329)
(cherry picked from commit dbeeaa4ee3)
2023-05-01 16:50:36 -04:00
Craigory Coppola c0faeb0ab4 fix(repo): local registry is not available during issue-notifier script (#16669)
(cherry picked from commit db1b5ddb0d)
2023-05-01 16:50:33 -04:00
Juri fdf243a065 fix(core): have child process exit properly in case of error
(cherry picked from commit 85ddd8b7d1)
2023-05-01 16:50:28 -04:00
FrozenPandaz b06bc241ea chore(misc): publish 16.0.1 2023-04-28 17:57:49 -04:00
Craigory Coppola 58d089ced0 fix(core): prefer NX_TASKS_RUNNER over NX_RUNNER (#16618)
(cherry picked from commit 22c0047b63)
2023-04-28 17:09:56 -04:00
Caleb Ukle 4554f65c6e fix(testing): fix react CT w/ vite and dependant projects (#16475)
(cherry picked from commit ebcc4363d0)
2023-04-28 17:09:54 -04:00
Caleb Ukle 39ae390692 docs(testing): add example of extending CT preset (#16641)
(cherry picked from commit a3875cc873)
2023-04-28 17:09:53 -04:00
Isaac Mann 81fb58b38a docs(core): remove ci var from gitlab example (#16604)
(cherry picked from commit 0b39480f63)
2023-04-28 17:09:51 -04:00
Emily Xiong d384415d7d fix(core): preserve deps in package.json for nx init react (#16528) 2023-04-28 16:56:20 -04:00
Craigory Coppola 2695e9764d fix(core): empty exclude pattern should not result in error (#16645) 2023-04-28 16:56:19 -04:00
Craigory Coppola e09c05573c fix(core): nx report should not display duplicate packages (#16647) 2023-04-28 16:56:19 -04:00
Miroslav Jonaš 2fc5d33059 fix(testing): ensure e2e cypress can use 4200 port in the test (#16646) 2023-04-28 16:56:18 -04:00
Nicholas Cunningham 99b69b8281 fix(react): Fix .module css being generated when --globalCss is passed (#16648) 2023-04-28 16:56:18 -04:00
Benjamin Cabanes f559e675d1 feat(nx-dev): change code-fences and code-output styles (#16649) 2023-04-28 16:56:17 -04:00
115 changed files with 1255 additions and 465 deletions
-1
View File
@@ -27,7 +27,6 @@ jobs:
with:
node-version: '18'
cache: 'pnpm'
registry-url: http://localhost:4872
- name: Cache node_modules
id: cache-modules
+11 -6
View File
@@ -55,19 +55,19 @@
"url": "https://github.com/Phillip9587/nx-stylelint"
},
{
"name": "@nxtend/ionic-react",
"name": "@nxext/ionic-react",
"description": "An Nx plugin for developing Ionic React applications and libraries",
"url": "https://github.com/nxtend-team/nxtend/tree/main/packages/ionic-react"
"url": "https://github.com/nxext/nx-extensions/tree/main/packages/ionic-react"
},
{
"name": "@nxtend/ionic-angular",
"name": "@nxext/ionic-angular",
"description": "An Nx plugin for developing Ionic Angular applications and libraries",
"url": "https://github.com/nxtend-team/nxtend/tree/main/packages/ionic-angular"
"url": "https://github.com/nxext/nx-extensions/tree/main/packages/ionic-angular"
},
{
"name": "@nxtend/capacitor",
"name": "@nxext/capacitor",
"description": "An Nx plugin for developing cross-platform applications using Capacitor",
"url": "https://github.com/nxtend-team/nxtend/tree/main/packages/capacitor"
"url": "https://github.com/nxext/nx-extensions/tree/main/packages/capacitor"
},
{
"name": "@nxtend/firebase",
@@ -438,5 +438,10 @@
"name": "@jnxplus/nx-quarkus-gradle",
"description": "Nx plugin to add Quarkus and Gradle multi-project builds support to Nx workspace",
"url": "https://github.com/khalilou88/jnxplus/tree/main/packages/nx-quarkus-gradle"
},
{
"name": "@jnxplus/nx-quarkus-maven",
"description": "Nx plugin to add Quarkus and Maven multi-module project support to Nx workspace",
"url": "https://github.com/khalilou88/jnxplus/tree/main/packages/nx-quarkus-maven"
}
]
@@ -34,6 +34,21 @@ The build target option can be changed later via updating the `devServerTarget`
When using component testing make sure to set `skipServe: true` in the component test target options, otherwise `@nx/cypress` will attempt to run the build first which can slow down your component tests. `skipServe: true` is automatically set when using the `cypress-component-configuration` generator.
{% /callout %}
## Configuration
When using the `cypress-component-configuration` generator, a helper function is used in the `cypress.config.ts` to setup the ideal settings for your project.
If you need to add additional configuration properties, you can spread the returned object from the helper function.
```ts {%filename="cypress.config.ts"}
export default defineConfig({
component: {
...nxComponentTestingPreset(__filename),
// add your own config here
},
});
```
## Testing Projects
Run `nx component-test your-lib` to execute the component tests with Cypress.
@@ -138,6 +138,12 @@
{ "type": "number" }
],
"description": "Pass a specified port value to the devServerTarget, if the value is 'cypress-auto' a free port will automatically be picked for the devServerTarget."
},
"quiet": {
"aliases": ["q"],
"type": "boolean",
"description": "If passed, Cypress output will not be printed to stdout. Only output from the configured Mocha reporter will print.",
"default": false
}
},
"additionalProperties": true,
@@ -73,7 +73,7 @@
"bundler": {
"description": "The bundler to use for building the application.",
"type": "string",
"enum": ["webpack", "vite", "rspack"],
"enum": ["webpack", "vite", "rspack", "esbuild"],
"default": "vite"
},
"docker": {
@@ -8,7 +8,7 @@
"description": "Create a custom generator.",
"type": "object",
"properties": {},
"required": ["name"],
"required": [],
"presets": []
},
"aliases": ["workspace-schematic"],
+1 -3
View File
@@ -3,7 +3,7 @@
Below is an example of a GitLab pipeline setup for an Nx workspace - building and testing only what is affected.
```yaml
image: node:16
image: node:18
stages:
- test
@@ -63,8 +63,6 @@ Read more about [Distributed Task Execution (DTE)](/core-features/distribute-tas
```yaml
image: node:18
variables:
CI: 'true'
# Creating template for DTE agents
.dte-agent:
@@ -34,6 +34,21 @@ The build target option can be changed later via updating the `devServerTarget`
When using component testing make sure to set `skipServe: true` in the component test target options, otherwise `@nx/cypress` will attempt to run the build first which can slow down your component tests. `skipServe: true` is automatically set when using the `cypress-component-configuration` generator.
{% /callout %}
## Configuration
When using the `cypress-component-configuration` generator, a helper function is used in the `cypress.config.ts` to setup the ideal settings for your project.
If you need to add additional configuration properties, you can spread the returned object from the helper function.
```ts {%filename="cypress.config.ts"}
export default defineConfig({
component: {
...nxComponentTestingPreset(__filename),
// add your own config here
},
});
```
## Testing Projects
Run `nx component-test your-lib` to execute the component tests with Cypress.
@@ -14,8 +14,9 @@ The following environment variables are ones that you can set to change the beha
| NX_PROFILE | string | Prepend `NX_PROFILE=profile.json` before running targets with Nx to generate a file that be [loaded in Chrome dev tools](/recipes/other/performance-profiling) to visualize the performance of Nx across multiple processes. |
| NX_PROJECT_GRAPH_CACHE_DIRECTORY | string | The project graph cache is stored in `node_modules/.cache/nx` by default. Set this variable to use a different directory. |
| NX_PROJECT_GRAPH_MAX_WORKERS | number | The number of workers to use when calculating the project graph. |
| NX_RUNNER | string | The name of task runner from the config to use. Can be overridden on the command line with `--runner`. |
| NX_RUNNER | string | The name of task runner from the config to use. Can be overridden on the command line with `--runner`. Not read if NX_TASKS_RUNNER is set. |
| NX_SKIP_NX_CACHE | boolean | Rerun the tasks even when the results are available in the cache |
| NX_TASKS_RUNNER | string | The name of task runner from the config to use. Can be overridden on the command line with `--runner`. Preferred over NX_RUNNER. |
| NX_TASKS_RUNNER_DYNAMIC_OUTPUT | boolean | If set to `false`, will use non-dynamic terminal output strategy (what you see in CI), even when you terminal can support the dynamic version |
| NX_VERBOSE_LOGGING | boolean | If set to `true`, will print debug information useful for troubleshooting |
| NX_DRY_RUN | boolean | If set to `true`, will perform a dry run of the generator. No files will be created and no packages will be installed. |
+8 -5
View File
@@ -4,7 +4,7 @@ import {
cleanupProject,
createFile,
ensureCypressInstallation,
killPorts,
killPort,
newProject,
readJson,
runCLI,
@@ -91,7 +91,7 @@ describe('env vars', () => {
`e2e ${myapp}-e2e --no-watch --env.cliArg="i am from the cli args"`
);
expect(run1).toContain('All specs passed!');
await killPorts(4200);
await killPort(4200);
// tests should not fail because of a config change
updateFile(
`apps/${myapp}-e2e/cypress.config.ts`,
@@ -111,7 +111,7 @@ export default defineConfig({
`e2e ${myapp}-e2e --no-watch --env.cliArg="i am from the cli args"`
);
expect(run2).toContain('All specs passed!');
await killPorts(4200);
await killPort(4200);
// make sure project.json env vars also work
updateFile(
@@ -140,10 +140,13 @@ describe('env vars', () => {
const run3 = runCLI(`e2e ${myapp}-e2e --no-watch`);
expect(run3).toContain('All specs passed!');
expect(await killPorts(4200)).toBeTruthy();
expect(await killPort(4200)).toBeTruthy();
}, 1000000);
it('should run e2e in parallel', () => {
it('should run e2e in parallel', async () => {
// ensure ports are free before running tests
await killPort(4200);
const ngAppName = uniq('ng-app');
runCLI(
`generate @nx/angular:app ${ngAppName} --e2eTestRunner=cypress --linter=eslint --no-interactive`
+5
View File
@@ -40,6 +40,8 @@ describe('nx init (for React)', () => {
expect(packageJson.devDependencies['@nx/jest']).toBeDefined();
expect(packageJson.devDependencies['@nx/vite']).toBeUndefined();
expect(packageJson.devDependencies['@nx/webpack']).toBeDefined();
expect(packageJson.dependencies['redux']).toBeDefined();
expect(packageJson.name).toEqual(appName);
runCLI(`build ${appName}`, {
env: {
@@ -149,6 +151,8 @@ describe('nx init (for React)', () => {
const packageJson = readJson('package.json');
expect(packageJson.devDependencies['@nx/jest']).toBeUndefined();
expect(packageJson.dependencies['redux']).toBeDefined();
expect(packageJson.name).toEqual(appName);
const viteConfig = readFile(`vite.config.js`);
expect(viteConfig).toContain('port: 4200'); // default port
@@ -186,6 +190,7 @@ function createReactApp(appName: string) {
'react-dom': '^18.2.0',
'react-scripts': '5.0.1',
'web-vitals': '2.1.4',
redux: '^3.6.0',
},
scripts: {
start: 'react-scripts start',
@@ -4,6 +4,7 @@ import {
ensureCypressInstallation,
newProject,
runCLI,
runCypressTests,
uniq,
updateFile,
updateJson,
@@ -146,18 +147,22 @@ export default Input;
runCLI(
`generate @nx/react:cypress-component-configuration --project=${appName} --generate-tests`
);
expect(runCLI(`component-test ${appName} --no-watch`)).toContain(
'All specs passed!'
);
if (runCypressTests()) {
expect(runCLI(`component-test ${appName} --no-watch`)).toContain(
'All specs passed!'
);
}
}, 300_000);
it('should successfully component test lib being used in app', () => {
runCLI(
`generate @nx/react:cypress-component-configuration --project=${usedInAppLibName} --generate-tests`
);
expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain(
'All specs passed!'
);
if (runCypressTests()) {
expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain(
'All specs passed!'
);
}
}, 300_000);
it('should test buildable lib not being used in app', () => {
@@ -184,9 +189,12 @@ describe(Input.name, () => {
runCLI(
`generate @nx/react:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build`
);
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
'All specs passed!'
);
if (runCypressTests()) {
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
'All specs passed!'
);
}
// add tailwind
runCLI(`generate @nx/react:setup-tailwind --project=${buildableLibName}`);
@@ -213,9 +221,11 @@ ${content}`;
}
);
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
'All specs passed!'
);
if (runCypressTests()) {
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
'All specs passed!'
);
}
}, 300_000);
it('should work with async webpack config', () => {
@@ -250,8 +260,41 @@ ${content}`;
return config;
});
const results = runCLI(`component-test ${appName}`);
expect(results).toContain('I am from the custom async Webpack config');
expect(results).toContain('All specs passed!');
if (runCypressTests()) {
const results = runCLI(`component-test ${appName}`);
expect(results).toContain('I am from the custom async Webpack config');
expect(results).toContain('All specs passed!');
}
});
// flaky bc of upstream issue https://github.com/cypress-io/cypress/issues/25913
it.skip('should CT vite projects importing other projects', () => {
const viteLibName = uniq('vite-lib');
runCLI(
`generate @nrwl/react:lib ${viteLibName} --bundler=vite --no-interactive`
);
updateFile(`libs/${viteLibName}/src/lib/${viteLibName}.tsx`, () => {
return `import { Btn } from '@${projectName}/${usedInAppLibName}';
export function MyComponent() {
return (
<>
<Btn text={'I am the app'}/>
<p>hello</p>
</>
);
}
export default MyComponent;`;
});
runCLI(
`generate @nrwl/react:cypress-component-configuration --project=${viteLibName} --generate-tests --bundler=vite --build-target=${appName}:build`
);
if (runCypressTests()) {
expect(runCLI(`component-test ${viteLibName}`)).toContain(
'All specs passed!'
);
}
});
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"packages": ["build/packages/*", "build/packages/nx/native-packages/*"],
"version": "16.0.0",
"version": "16.0.3",
"granularPathspec": false,
"command": {
"publish": {
-9
View File
@@ -1,18 +1,9 @@
const path = require('path');
const { createGlobPatternsForDependencies } = require('@nx/next/tailwind');
const {
readCachedProjectGraph,
} = require('nx/src/project-graph/project-graph');
if (!createGlobPatternsForDependencies(__dirname).length)
throw Error('GRAPH ISSUE: No dependency found when many are expected.');
// TODO(@FrozenPandaz): remove this once the issue is solved
const projectGraph = readCachedProjectGraph();
console.log({ projectGraph });
console.log({ nodes: projectGraph.nodes });
console.log({ dependencies: projectGraph.dependencies });
module.exports = {
experimental: {
optimizeUniversalDefaults: true,
@@ -1,14 +1,14 @@
import {
CheckCircleIcon,
ClipboardDocumentCheckIcon,
ClipboardDocumentIcon,
InformationCircleIcon,
} from '@heroicons/react/24/outline';
import React, { ReactNode, useEffect, useState } from 'react';
// @ts-ignore
import { CopyToClipboard } from 'react-copy-to-clipboard';
// @ts-ignore
import SyntaxHighlighter from 'react-syntax-highlighter';
import { CodeOutput } from './fences/codeOutput.component';
import { CodeOutput } from './fences/code-output.component';
import { TerminalOutput } from './fences/terminal-output.component';
function resolveLanguage(lang: string) {
@@ -74,7 +74,7 @@ export function Fence({
children.includes('@nx/') || command.includes('@nx/');
return (
<div className="my-8 w-full">
<div className="code-block group relative inline-flex w-auto min-w-[50%] max-w-full">
<div className="code-block group relative w-full">
<div>
<CopyToClipboard
text={children}
@@ -84,7 +84,7 @@ export function Fence({
>
<button
type="button"
className="not-prose absolute top-0 right-0 z-10 flex rounded-tr-lg border border-slate-200 bg-slate-50/50 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:border-slate-700 dark:bg-slate-800"
className="not-prose absolute top-0 right-0 z-10 flex rounded-tr-lg border border-slate-200 bg-slate-50/50 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:border-slate-700 dark:bg-slate-800/60"
>
{copied ? (
<ClipboardDocumentCheckIcon className="h-5 w-5 text-blue-500 dark:text-sky-500" />
@@ -106,12 +106,12 @@ export function Fence({
/>
{showRescopeMessage && (
<a
className="relative block rounded-b-md border border-green-100 bg-green-50 px-4 py-2 text-xs font-medium text-green-600 no-underline hover:underline dark:border-green-900 dark:bg-green-900/30 dark:text-green-400"
className="relative block rounded-b-md border border-slate-200 bg-slate-50 px-4 py-2 text-xs font-medium no-underline hover:underline dark:border-slate-700 dark:bg-slate-800"
href="/recipes/other/rescope"
title="Nx 16 package name changes"
>
<CheckCircleIcon
className="mr-2 inline-block h-5 w-5 text-green-500 dark:text-green-400"
<InformationCircleIcon
className="mr-2 inline-block h-5 w-5"
aria-hidden="true"
/>
Nx 15 and lower use @nrwl/ instead of @nx/
@@ -1,3 +1,4 @@
import { cx } from '@nx/nx-dev/ui-primitives';
import { ReactNode } from 'react';
export function CodeOutput({
@@ -11,10 +12,10 @@ export function CodeOutput({
}): JSX.Element {
return (
<div
className={
'hljs not-prose w-full overflow-x-auto border border-slate-200 bg-slate-50/50 font-mono text-sm dark:border-slate-700 dark:bg-slate-800/60 ' +
(isMessageBelow ? 'rounded-t-lg border-b-0' : 'rounded-lg')
}
className={cx(
'hljs not-prose w-full overflow-x-auto border border-slate-200 bg-slate-50/50 font-mono text-sm dark:border-slate-700 dark:bg-slate-800/60',
isMessageBelow ? 'rounded-t-lg border-b-0' : 'rounded-lg'
)}
>
{!!fileName && (
<div className="flex border-b border-slate-200 bg-slate-50 px-4 py-2 italic text-slate-400 dark:border-slate-700 dark:bg-slate-800/80 dark:text-slate-500">
@@ -1,3 +1,4 @@
import { cx } from '@nx/nx-dev/ui-primitives';
import { ReactNode } from 'react';
export function TerminalOutput({
@@ -13,10 +14,10 @@ export function TerminalOutput({
}): JSX.Element {
return (
<div
className={
'coding not-prose overflow-hidden border border-slate-200 bg-slate-50 font-mono text-sm leading-normal subpixel-antialiased dark:border-slate-700 dark:bg-slate-800 ' +
(isMessageBelow ? 'rounded-t-lg border-b-0' : 'rounded-lg')
}
className={cx(
'hljs not-prose w-full overflow-x-auto border border-slate-200 bg-slate-50/50 font-mono text-sm dark:border-slate-700 dark:bg-slate-800/60',
isMessageBelow ? 'rounded-t-lg border-b-0' : 'rounded-lg'
)}
>
<div className="relative flex justify-center border-b border-slate-200 bg-slate-100/50 p-2 text-slate-400 dark:border-slate-700 dark:bg-slate-700/50 dark:text-slate-500">
<div className="absolute left-2 top-3 flex items-center gap-2">
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/angular has been deprecated!
## @nrwl/angular has been deprecated!
@nx/angular has been deprecated in favor of [@nx/angular](https://www.npmjs.com/package/@nx/angular). Please use that instead.
@nrwl/angular has been deprecated in favor of [@nx/angular](https://www.npmjs.com/package/@nx/angular). Please use that instead.
@nx/angular will no longer be published in Nx v17.
@nrwl/angular will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+8 -1
View File
@@ -45,7 +45,14 @@
"dependsOn": ["build-ng", "build-base", "^build"],
"executor": "nx:run-commands",
"options": {
"command": "echo 'Built angular-legacy'"
"commands": [
{
"command": "node ./scripts/copy-readme.js angular-legacy"
},
{
"command": "echo 'Built angular-legacy'"
}
]
}
}
},
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/cypress has been deprecated!
## @nrwl/cypress has been deprecated!
@nx/cypress has been deprecated in favor of [@nx/cypress](https://www.npmjs.com/package/@nx/cypress). Please use that instead.
@nrwl/cypress has been deprecated in favor of [@nx/cypress](https://www.npmjs.com/package/@nx/cypress). Please use that instead.
@nx/cypress will no longer be published in Nx v17.
@nrwl/cypress will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js cypress-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/cypress/index.ts",
"tsConfig": "packages-legacy/cypress/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/detox has been deprecated!
## @nrwl/detox has been deprecated!
@nx/detox has been deprecated in favor of [@nx/detox](https://www.npmjs.com/package/@nx/detox). Please use that instead.
@nrwl/detox has been deprecated in favor of [@nx/detox](https://www.npmjs.com/package/@nx/detox). Please use that instead.
@nx/detox will no longer be published in Nx v17.
@nrwl/detox will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js detox-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/detox/index.ts",
"tsConfig": "packages-legacy/detox/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/devkit has been deprecated!
## @nrwl/devkit has been deprecated!
@nx/devkit has been deprecated in favor of [@nx/devkit](https://www.npmjs.com/package/@nx/devkit). Please use that instead.
@nrwl/devkit has been deprecated in favor of [@nx/devkit](https://www.npmjs.com/package/@nx/devkit). Please use that instead.
@nx/devkit will no longer be published in Nx v17.
@nrwl/devkit will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js devkit-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/devkit/index.ts",
"tsConfig": "packages-legacy/devkit/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/esbuild has been deprecated!
## @nrwl/esbuild has been deprecated!
@nx/esbuild has been deprecated in favor of [@nx/esbuild](https://www.npmjs.com/package/@nx/esbuild). Please use that instead.
@nrwl/esbuild has been deprecated in favor of [@nx/esbuild](https://www.npmjs.com/package/@nx/esbuild). Please use that instead.
@nx/esbuild will no longer be published in Nx v17.
@nrwl/esbuild will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js esbuild-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/esbuild/index.ts",
"tsConfig": "packages-legacy/esbuild/tsconfig.json",
+1 -1
View File
@@ -1,4 +1,4 @@
## @nx/eslint-plugin-nx has been deprecated!
## @nrwl/eslint-plugin-nx has been deprecated!
@nrwl/eslint-plugin-nx has been deprecated in favor of [@nx/eslint-plugin](https://www.npmjs.com/package/@nx/eslint-plugin). Please use that instead.
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js eslint-plugin-nx-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/eslint-plugin-nx/index.ts",
"tsConfig": "packages-legacy/eslint-plugin-nx/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/expo has been deprecated!
## @nrwl/expo has been deprecated!
@nx/expo has been deprecated in favor of [@nx/expo](https://www.npmjs.com/package/@nx/expo). Please use that instead.
@nrwl/expo has been deprecated in favor of [@nx/expo](https://www.npmjs.com/package/@nx/expo). Please use that instead.
@nx/expo will no longer be published in Nx v17.
@nrwl/expo will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js expo-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/expo/index.ts",
"tsConfig": "packages-legacy/expo/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/express has been deprecated!
## @nrwl/express has been deprecated!
@nx/express has been deprecated in favor of [@nx/express](https://www.npmjs.com/package/@nx/express). Please use that instead.
@nrwl/express has been deprecated in favor of [@nx/express](https://www.npmjs.com/package/@nx/express). Please use that instead.
@nx/express will no longer be published in Nx v17.
@nrwl/express will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js express-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/express/index.ts",
"tsConfig": "packages-legacy/express/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/jest has been deprecated!
## @nrwl/jest has been deprecated!
@nx/jest has been deprecated in favor of [@nx/jest](https://www.npmjs.com/package/@nx/jest). Please use that instead.
@nrwl/jest has been deprecated in favor of [@nx/jest](https://www.npmjs.com/package/@nx/jest). Please use that instead.
@nx/jest will no longer be published in Nx v17.
@nrwl/jest will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js jest-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/jest/index.ts",
"tsConfig": "packages-legacy/jest/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/js has been deprecated!
## @nrwl/js has been deprecated!
@nx/js has been deprecated in favor of [@nx/js](https://www.npmjs.com/package/@nx/js). Please use that instead.
@nrwl/js has been deprecated in favor of [@nx/js](https://www.npmjs.com/package/@nx/js). Please use that instead.
@nx/js will no longer be published in Nx v17.
@nrwl/js will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js js-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/js/index.ts",
"tsConfig": "packages-legacy/js/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/linter has been deprecated!
## @nrwl/linter has been deprecated!
@nx/linter has been deprecated in favor of [@nx/linter](https://www.npmjs.com/package/@nx/linter). Please use that instead.
@nrwl/linter has been deprecated in favor of [@nx/linter](https://www.npmjs.com/package/@nx/linter). Please use that instead.
@nx/linter will no longer be published in Nx v17.
@nrwl/linter will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js linter-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/linter/index.ts",
"tsConfig": "packages-legacy/linter/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/nest has been deprecated!
## @nrwl/nest has been deprecated!
@nx/nest has been deprecated in favor of [@nx/nest](https://www.npmjs.com/package/@nx/nest). Please use that instead.
@nrwl/nest has been deprecated in favor of [@nx/nest](https://www.npmjs.com/package/@nx/nest). Please use that instead.
@nx/nest will no longer be published in Nx v17.
@nrwl/nest will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js nest-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/nest/index.ts",
"tsConfig": "packages-legacy/nest/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/next has been deprecated!
## @nrwl/next has been deprecated!
@nx/next has been deprecated in favor of [@nx/next](https://www.npmjs.com/package/@nx/next). Please use that instead.
@nrwl/next has been deprecated in favor of [@nx/next](https://www.npmjs.com/package/@nx/next). Please use that instead.
@nx/next will no longer be published in Nx v17.
@nrwl/next will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js next-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/next/index.ts",
"tsConfig": "packages-legacy/next/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/node has been deprecated!
## @nrwl/node has been deprecated!
@nx/node has been deprecated in favor of [@nx/node](https://www.npmjs.com/package/@nx/node). Please use that instead.
@nrwl/node has been deprecated in favor of [@nx/node](https://www.npmjs.com/package/@nx/node). Please use that instead.
@nx/node will no longer be published in Nx v17.
@nrwl/node will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js node-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/node/index.ts",
"tsConfig": "packages-legacy/node/tsconfig.json",
+1 -1
View File
@@ -2,7 +2,7 @@
@nrwl/nx-plugin has been deprecated in favor of [@nx/plugin](https://www.npmjs.com/package/@nx/plugin). Please use that instead.
@nx/nx-plugin will no longer be published in Nx v17.
@nrwl/nx-plugin will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js nx-plugin-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/nx-plugin/index.ts",
"tsConfig": "packages-legacy/nx-plugin/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/react-native has been deprecated!
## @nrwl/react-native has been deprecated!
@nx/react-native has been deprecated in favor of [@nx/react-native](https://www.npmjs.com/package/@nx/react-native). Please use that instead.
@nrwl/react-native has been deprecated in favor of [@nx/react-native](https://www.npmjs.com/package/@nx/react-native). Please use that instead.
@nx/react-native will no longer be published in Nx v17.
@nrwl/react-native will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js react-native-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/react-native/index.ts",
"tsConfig": "packages-legacy/react-native/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/react has been deprecated!
## @nrwl/react has been deprecated!
@nx/react has been deprecated in favor of [@nx/react](https://www.npmjs.com/package/@nx/react). Please use that instead.
@nrwl/react has been deprecated in favor of [@nx/react](https://www.npmjs.com/package/@nx/react). Please use that instead.
@nx/react will no longer be published in Nx v17.
@nrwl/react will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js react-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/react/index.ts",
"tsConfig": "packages-legacy/react/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/rollup has been deprecated!
## @nrwl/rollup has been deprecated!
@nx/rollup has been deprecated in favor of [@nx/rollup](https://www.npmjs.com/package/@nx/rollup). Please use that instead.
@nrwl/rollup has been deprecated in favor of [@nx/rollup](https://www.npmjs.com/package/@nx/rollup). Please use that instead.
@nx/rollup will no longer be published in Nx v17.
@nrwl/rollup will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js rollup-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/rollup/index.ts",
"tsConfig": "packages-legacy/rollup/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/storybook has been deprecated!
## @nrwl/storybook has been deprecated!
@nx/storybook has been deprecated in favor of [@nx/storybook](https://www.npmjs.com/package/@nx/storybook). Please use that instead.
@nrwl/storybook has been deprecated in favor of [@nx/storybook](https://www.npmjs.com/package/@nx/storybook). Please use that instead.
@nx/storybook will no longer be published in Nx v17.
@nrwl/storybook will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js storybook-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/storybook/index.ts",
"tsConfig": "packages-legacy/storybook/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/vite has been deprecated!
## @nrwl/vite has been deprecated!
@nx/vite has been deprecated in favor of [@nx/vite](https://www.npmjs.com/package/@nx/vite). Please use that instead.
@nrwl/vite has been deprecated in favor of [@nx/vite](https://www.npmjs.com/package/@nx/vite). Please use that instead.
@nx/vite will no longer be published in Nx v17.
@nrwl/vite will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js vite-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/vite/index.ts",
"tsConfig": "packages-legacy/vite/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/web has been deprecated!
## @nrwl/web has been deprecated!
@nx/web has been deprecated in favor of [@nx/web](https://www.npmjs.com/package/@nx/web). Please use that instead.
@nrwl/web has been deprecated in favor of [@nx/web](https://www.npmjs.com/package/@nx/web). Please use that instead.
@nx/web will no longer be published in Nx v17.
@nrwl/web will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js web-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/web/index.ts",
"tsConfig": "packages-legacy/web/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/webpack has been deprecated!
## @nrwl/webpack has been deprecated!
@nx/webpack has been deprecated in favor of [@nx/webpack](https://www.npmjs.com/package/@nx/webpack). Please use that instead.
@nrwl/webpack has been deprecated in favor of [@nx/webpack](https://www.npmjs.com/package/@nx/webpack). Please use that instead.
@nx/webpack will no longer be published in Nx v17.
@nrwl/webpack will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js webpack-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/webpack/index.ts",
"tsConfig": "packages-legacy/webpack/tsconfig.json",
+3 -3
View File
@@ -1,8 +1,8 @@
## @nx/workspace has been deprecated!
## @nrwl/workspace has been deprecated!
@nx/workspace has been deprecated in favor of [@nx/workspace](https://www.npmjs.com/package/@nx/workspace). Please use that instead.
@nrwl/workspace has been deprecated in favor of [@nx/workspace](https://www.npmjs.com/package/@nx/workspace). Please use that instead.
@nx/workspace will no longer be published in Nx v17.
@nrwl/workspace will no longer be published in Nx v17.
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
+4 -1
View File
@@ -5,8 +5,11 @@
"projectType": "library",
"targets": {
"build": {
"command": "node ./scripts/copy-readme.js workspace-legacy"
},
"build-base": {
"executor": "@nx/js:tsc",
"dependsOn": ["^build"],
"dependsOn": ["^build-base"],
"options": {
"main": "packages-legacy/workspace/index.ts",
"tsConfig": "packages-legacy/workspace/tsconfig.json",
+9
View File
@@ -191,6 +191,15 @@
"version": "16.0.0-beta.6",
"description": "Remove karma as default unitTestRunner from nxJson and project configurations",
"implementation": "./src/migrations/update-16-0-0/remove-karma-defaults"
},
"remove-render-module-platform-server-exports": {
"cli": "nx",
"version": "16.1.0-beta.0",
"requires": {
"@angular/core": ">=15.0.0"
},
"description": "Remove exported `@angular/platform-server` `renderModule` method. The `renderModule` method is now exported by the Angular CLI.",
"factory": "./src/migrations/update-16-1-0/remove-render-module-platform-server-exports"
}
},
"packageJsonUpdates": {
@@ -41,17 +41,7 @@ if (document.readyState !== 'loading') {
`;
exports[`Host App Generator --ssr should generate the correct files 3`] = `
"/***************************************************************************************************
* Initialize the server environment - for example, adding DOM built-in types to the global scope.
*
* NOTE:
* This import must come before any imports (direct or transitive) that rely on DOM built-ins being
* available, such as \`@angular/elements\`.
*/
import '@angular/platform-server/init';
export { AppServerModule } from './app/app.server.module';
export { renderModule } from '@angular/platform-server';
"export { AppServerModule } from './app/app.server.module';
"
`;
@@ -41,17 +41,7 @@ platformBrowserDynamic()
`;
exports[`MF Remote App Generator --ssr should generate the correct files 3`] = `
"/***************************************************************************************************
* Initialize the server environment - for example, adding DOM built-in types to the global scope.
*
* NOTE:
* This import must come before any imports (direct or transitive) that rely on DOM built-ins being
* available, such as \`@angular/elements\`.
*/
import '@angular/platform-server/init';
export { AppServerModule } from './app/app.server.module';
export { renderModule } from '@angular/platform-server';
"export { AppServerModule } from './app/app.server.module';
"
`;
@@ -0,0 +1 @@
export { <%= rootModuleClassName %> } from './app/<%= rootModuleFileName.slice(0, -3) %>';
@@ -4,12 +4,26 @@ import {
joinPathFragments,
readProjectConfiguration,
} from '@nx/devkit';
import { getInstalledAngularMajorVersion } from '../../utils/version-utils';
import type { Schema } from '../schema';
export function generateSSRFiles(tree: Tree, schema: Schema) {
const projectRoot = readProjectConfiguration(tree, schema.project).root;
const pathToFiles = joinPathFragments(__dirname, '../', 'files');
generateFiles(
tree,
joinPathFragments(__dirname, '..', 'files', 'base'),
projectRoot,
{ ...schema, tpl: '' }
);
generateFiles(tree, pathToFiles, projectRoot, { ...schema, tpl: '' });
const angularMajorVersion = getInstalledAngularMajorVersion(tree);
if (angularMajorVersion < 15) {
generateFiles(
tree,
joinPathFragments(__dirname, '..', 'files', 'v14'),
projectRoot,
{ ...schema, tpl: '' }
);
}
}
@@ -30,17 +30,7 @@ describe('setupSSR', () => {
expect(tree.read('apps/app1/server.ts', 'utf-8')).toMatchSnapshot();
expect(tree.read('apps/app1/src/main.server.ts', 'utf-8'))
.toMatchInlineSnapshot(`
"/***************************************************************************************************
* Initialize the server environment - for example, adding DOM built-in types to the global scope.
*
* NOTE:
* This import must come before any imports (direct or transitive) that rely on DOM built-ins being
* available, such as \`@angular/elements\`.
*/
import '@angular/platform-server/init';
export { AppServerModule } from './app/app.server.module';
export { renderModule } from '@angular/platform-server';
"export { AppServerModule } from './app/app.server.module';
"
`);
expect(tree.read('apps/app1/src/main.ts', 'utf-8')).toMatchInlineSnapshot(`
@@ -167,30 +157,68 @@ describe('setupSSR', () => {
).toMatchSnapshot();
});
it('should install the correct versions when using older versions of Angular', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
describe('compat', () => {
it('should install the correct versions when using older versions of Angular', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await generateTestApplication(tree, {
name: 'app1',
await generateTestApplication(tree, {
name: 'app1',
});
updateJson(tree, 'package.json', (json) => ({
...json,
dependencies: {
'@angular/core': '14.2.0',
},
}));
// ACT
await setupSsr(tree, { project: 'app1' });
// ASSERT
const pkgJson = readJson(tree, 'package.json');
expect(pkgJson.dependencies['@angular/platform-server']).toEqual(
'~14.2.0'
);
expect(pkgJson.dependencies['@nguniversal/express-engine']).toEqual(
'~14.2.0'
);
expect(pkgJson.devDependencies['@nguniversal/builders']).toEqual(
'~14.2.0'
);
});
updateJson(tree, 'package.json', (json) => ({
...json,
dependencies: {
'@angular/core': '14.2.0',
},
}));
it('should create the main.server.ts file correctly for Angular v14', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await generateTestApplication(tree, {
name: 'app1',
});
updateJson(tree, 'package.json', (json) => ({
...json,
dependencies: { '@angular/core': '14.2.0' },
}));
// ACT
await setupSsr(tree, { project: 'app1' });
// ACT
await setupSsr(tree, { project: 'app1' });
// ASSERT
const pkgJson = readJson(tree, 'package.json');
expect(pkgJson.dependencies['@angular/platform-server']).toEqual('~14.2.0');
expect(pkgJson.dependencies['@nguniversal/express-engine']).toEqual(
'~14.2.0'
);
expect(pkgJson.devDependencies['@nguniversal/builders']).toEqual('~14.2.0');
// ASSERT
expect(tree.read('apps/app1/src/main.server.ts', 'utf-8'))
.toMatchInlineSnapshot(`
"/***************************************************************************************************
* Initialize the server environment - for example, adding DOM built-in types to the global scope.
*
* NOTE:
* This import must come before any imports (direct or transitive) that rely on DOM built-ins being
* available, such as \`@angular/elements\`.
*/
import '@angular/platform-server/init';
export { AppServerModule } from './app/app.server.module';
export { renderModule } from '@angular/platform-server';
"
`);
});
});
});
@@ -0,0 +1,85 @@
import type { Tree } from '@nx/devkit';
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing-pre16';
import migration from './remove-render-module-platform-server-exports';
describe('remove-render-module-platform-server-exports migration', () => {
let tree: Tree;
const testTypeScriptFilePath = 'test.ts';
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
});
describe(`Migration to remove '@angular/platform-server' exports`, () => {
it(`should delete '@angular/platform-server' export when 'renderModule' is the only exported symbol`, async () => {
tree.write(
testTypeScriptFilePath,
`
import { Path, join } from '@angular-devkit/core';
export { renderModule } from '@angular/platform-server';
`
);
await migration(tree);
const content = tree.read(testTypeScriptFilePath, 'utf-8');
expect(content).not.toContain('@angular/platform-server');
expect(content).toContain(
`import { Path, join } from '@angular-devkit/core';`
);
});
it(`should delete only 'renderModule' when there are additional exports`, async () => {
tree.write(
testTypeScriptFilePath,
`
import { Path, join } from '@angular-devkit/core';
export { renderModule, ServerModule } from '@angular/platform-server';
`
);
await migration(tree);
const content = tree.read(testTypeScriptFilePath, 'utf-8');
expect(content).toContain(
`import { Path, join } from '@angular-devkit/core';`
);
expect(content).toContain(
`export { ServerModule } from '@angular/platform-server';`
);
});
it(`should not delete 'renderModule' when it's exported from another module`, async () => {
tree.write(
testTypeScriptFilePath,
`
export { renderModule } from '@angular/core';
`
);
await migration(tree);
const content = tree.read(testTypeScriptFilePath, 'utf-8');
expect(content).toContain(
`export { renderModule } from '@angular/core';`
);
});
it(`should not delete 'renderModule' when it's imported from '@angular/platform-server'`, async () => {
tree.write(
testTypeScriptFilePath,
`
import { renderModule } from '@angular/platform-server';
`
);
await migration(tree);
const content = tree.read(testTypeScriptFilePath, 'utf-8');
expect(content).toContain(
`import { renderModule } from '@angular/platform-server'`
);
});
});
});
@@ -0,0 +1,87 @@
import type { Tree } from '@nx/devkit';
import { formatFiles, visitNotIgnoredFiles } from '@nx/devkit';
import * as ts from 'typescript';
import { FileChangeRecorder } from '../../utils/file-change-recorder';
export default async function (tree: Tree) {
visitNotIgnoredFiles(tree, '/', (path) => {
if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {
const content = tree.read(path, 'utf8');
if (
content.includes('@angular/platform-server') &&
content.includes('renderModule')
) {
const source = ts.createSourceFile(
path,
content.toString().replace(/^\uFEFF/, ''),
ts.ScriptTarget.Latest,
true
);
let recorder: FileChangeRecorder | undefined;
let printer: ts.Printer | undefined;
ts.forEachChild(source, function analyze(node) {
if (
!(
ts.isExportDeclaration(node) &&
node.moduleSpecifier &&
ts.isStringLiteral(node.moduleSpecifier) &&
node.moduleSpecifier.text === '@angular/platform-server' &&
node.exportClause &&
ts.isNamedExports(node.exportClause)
)
) {
// Not a @angular/platform-server named export.
return;
}
const exportClause = node.exportClause;
const newElements: ts.ExportSpecifier[] = [];
for (const element of exportClause.elements) {
if (element.name.text !== 'renderModule') {
newElements.push(element);
}
}
if (newElements.length === exportClause.elements.length) {
// No changes
return;
}
recorder ??= new FileChangeRecorder(tree, path);
if (newElements.length) {
// Update named exports as there are leftovers.
const newExportClause = ts.factory.updateNamedExports(
exportClause,
newElements
);
printer ??= ts.createPrinter();
const fix = printer.printNode(
ts.EmitHint.Unspecified,
newExportClause,
source
);
const index = exportClause.getStart();
const length = exportClause.getWidth();
recorder.remove(index, index + length);
recorder.insertLeft(index, fix);
} else {
// Delete export as no exports remain.
recorder.remove(node.getStart(), node.getStart() + node.getWidth());
}
ts.forEachChild(node, analyze);
});
if (recorder) {
recorder.applyChanges();
}
}
}
});
await formatFiles(tree);
}
@@ -52,6 +52,7 @@ export interface CypressExecutorOptions extends Json {
testingType?: 'component' | 'e2e';
tag?: string;
port?: number | 'cypress-auto';
quiet?: boolean;
}
interface NormalizedCypressExecutorOptions extends CypressExecutorOptions {
@@ -291,6 +292,9 @@ async function runCypress(
if (opts.reporterOptions) {
options.reporterOptions = opts.reporterOptions;
}
if (opts.quiet) {
options.quiet = opts.quiet;
}
options.testingType = opts.testingType;
@@ -150,6 +150,12 @@
}
],
"description": "Pass a specified port value to the devServerTarget, if the value is 'cypress-auto' a free port will automatically be picked for the devServerTarget."
},
"quiet": {
"aliases": ["q"],
"type": "boolean",
"description": "If passed, Cypress output will not be printed to stdout. Only output from the configured Mocha reporter will print.",
"default": false
}
},
"additionalProperties": true,
+26 -28
View File
@@ -1,34 +1,34 @@
{
"extends": "../../.eslintrc",
"rules": {
"@typescript-eslint/no-restricted-imports": [
"error",
{
"paths": [
"@nx/workspace",
"@angular-devkit/core",
"@angular-devkit/architect",
"@angular-devkit/schematics"
],
"patterns": [
{
"group": ["nx/**/*"],
"message": "Use requireNx() from packages/devkit/nx.ts OR use a type import instead.",
"allowTypeImports": true
},
{
"group": ["@nx/devkit/**/*"],
"message": "Use a relative import"
}
]
}
]
},
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
"rules": {
"@typescript-eslint/explicit-module-boundary-types": ["error"],
"@typescript-eslint/no-restricted-imports": [
"error",
{
"paths": [
"@nx/workspace",
"@angular-devkit/core",
"@angular-devkit/architect",
"@angular-devkit/schematics"
],
"patterns": [
{
"group": ["nx/**/*"],
"message": "Use requireNx() from packages/devkit/nx.ts OR use a type import instead.",
"allowTypeImports": true
},
{
"group": ["@nx/devkit/**/*"],
"message": "Use a relative import"
}
]
}
]
}
},
{
"files": ["*.spec.ts"],
@@ -38,9 +38,7 @@
},
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": ["error"]
}
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
+15 -2
View File
@@ -1,7 +1,20 @@
export function requireNx(): typeof import('nx/src/devkit-exports') {
// After Nx v18, this can be removed and replaced with either:
// - import {} from 'nx/src/devkit-exports'
// - import {} from 'nx/src/devkit-internals'
export function requireNx(): typeof import('nx/src/devkit-exports') &
Partial<typeof import('nx/src/devkit-internals')> {
try {
return require('nx/src/devkit-exports');
let result = { ...require('nx/src/devkit-exports') };
try {
result = {
...result,
// Remove in Nx v18, devkit should not support Nx v16.0.2 at that point.
...require('nx/src/devkit-internals'),
};
} catch {}
return result;
} catch {
// Remove in Nx V17, devkit should not support Nx < 16 at that point.
return require('./nx-reexports-pre16');
}
}
+4 -1
View File
@@ -17,6 +17,7 @@ const {
getPackageManagerCommand,
workspaceRoot,
detectPackageManager,
createTempNpmDirectory,
} = requireNx();
const UNIDENTIFIED_VERSION = 'UNIDENTIFIED_VERSION';
@@ -450,7 +451,9 @@ export function ensurePackage<T extends any = any>(
);
}
const tempDir = dirSync().name;
const { dir: tempDir } = createTempNpmDirectory?.() ?? {
dir: dirSync().name,
};
console.log(`Fetching ${pkg}...`);
const packageManager = detectPackageManager();
+1 -2
View File
@@ -1,7 +1,6 @@
import type { Tree } from 'nx/src/generators/tree';
import type { PackageJson } from 'nx/src/utils/package-json';
import { requireNx } from '../../nx';
import { NX_VERSION } from './package-json';
import { visitNotIgnoredFiles } from '../generators/visit-not-ignored-files';
import { basename } from 'path';
import { isBinaryPath } from './binary-extensions';
@@ -46,7 +45,7 @@ function replacePackageInDependencies(
packageJson.optionalDependencies ?? {},
]) {
if (oldPackageName in deps) {
deps[newPackageName] = NX_VERSION;
deps[newPackageName] = deps[oldPackageName];
delete deps[oldPackageName];
}
}
@@ -306,11 +306,9 @@ function addProjectDependencies(
const frameworkDependencies = {
express: {
express: expressVersion,
'@types/express': expressTypingsVersion,
},
koa: {
koa: koaVersion,
'@types/koa': koaTypingsVersion,
},
fastify: {
fastify: fastifyVersion,
+3 -3
View File
@@ -122,7 +122,7 @@
"@nrwl/next",
"@nx/node",
"@nrwl/node",
"@nx/nx-plugin",
"@nx/plugin",
"@nrwl/nx-plugin",
"@nx/react",
"@nrwl/react",
@@ -140,11 +140,11 @@
"@nx/webpack",
"@nrwl/webpack",
{
"package": "@nrwl/nx-cloud",
"package": "nx-cloud",
"version": "latest"
},
{
"package": "nx-cloud",
"package": "@nrwl/nx-cloud",
"version": "latest"
}
]
+8 -2
View File
@@ -353,7 +353,10 @@ export class NxScopedHost extends virtualFs.ScopedHost<any> {
}
read(path: Path): Observable<FileBuffer> {
if (path === 'angular.json' || path === '/angular.json') {
if (
(path === 'angular.json' || path === '/angular.json') &&
isAngularPluginInstalled()
) {
return this.readMergedWorkspaceConfiguration().pipe(
map((r) => Buffer.from(JSON.stringify(toOldFormat(r))))
);
@@ -566,7 +569,10 @@ export class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
}
read(path: Path): Observable<FileBuffer> {
if (path == 'angular.json' || path == '/angular.json') {
if (
(path === 'angular.json' || path === '/angular.json') &&
isAngularPluginInstalled()
) {
const projectJsonConfig = toOldFormat({
projects: Object.fromEntries(getProjects(this.host)),
});
+9 -11
View File
@@ -1,10 +1,8 @@
import { workspaceRoot } from '../utils/workspace-root';
import { output } from '../utils/output';
import {
fetchCommunityPlugins,
fetchCorePlugins,
getInstalledPluginsAndCapabilities,
listCommunityPlugins,
listCorePlugins,
listInstalledPlugins,
listPluginCapabilities,
@@ -36,14 +34,6 @@ export async function listHandler(args: ListArgs): Promise<void> {
await listPluginCapabilities(args.plugin);
} else {
const corePlugins = fetchCorePlugins();
const communityPlugins = await fetchCommunityPlugins().catch(() => {
output.warn({
title: `Community plugins:`,
bodyLines: [`Error fetching plugins.`],
});
return [];
});
const projectGraph = await createProjectGraphAsync({ exitOnError: true });
const localPlugins = await getLocalWorkspacePlugins(
@@ -58,7 +48,15 @@ export async function listHandler(args: ListArgs): Promise<void> {
}
listInstalledPlugins(installedPlugins);
listCorePlugins(installedPlugins, corePlugins);
listCommunityPlugins(installedPlugins, communityPlugins);
output.note({
title: 'Community Plugins',
bodyLines: [
'Looking for a technology / framework not listed above?',
'There are many excellent plugins matintained by the Nx community.',
'Search for the one you need here: https://nx.dev/community.',
],
});
output.note({
title: `Use "nx list [plugin]" to find out more`,
+36 -7
View File
@@ -197,13 +197,15 @@ describe('report', () => {
describe('findInstalledPackagesWeCareAbout', () => {
it('should not list packages that are not installed', () => {
const installed: [string, packageJsonUtils.PackageJson][] =
packagesWeCareAbout.map((x) => [
x,
{
name: x,
version: '1.0.0',
},
]);
packagesWeCareAbout
.filter((x) => !x.startsWith('@nrwl'))
.map((x) => [
x,
{
name: x,
version: '1.0.0',
},
]);
const uninstalled: [string, packageJsonUtils.PackageJson][] = [
installed.pop(),
installed.pop(),
@@ -225,6 +227,33 @@ describe('report', () => {
expect(result).toContain(pkg);
}
});
it('should not list @nrwl packages that are the same version as their equivalent @nx package', () => {
jest.spyOn(packageJsonUtils, 'readModulePackageJson').mockImplementation(
provideMockPackages({
'@nrwl/nx-plugin': { version: '16.0.0' },
'@nx/plugin': { version: '16.0.0' },
'@nrwl/linter': { version: '16.0.0' },
'@nx/linter': { version: '16.0.0' },
'@nrwl/workspace': { version: '16.0.0' },
'@nx/workspace': { version: '16.0.2' },
'@nrwl/tao': { version: '16.0.0' },
'@nrwl/nx-cloud': { version: '16.0.0' },
'nx-cloud': { version: '16.0.0' },
})
);
const result = findInstalledPackagesWeCareAbout().map((x) => x.package);
expect(result).not.toContain('@nrwl/nx-plugin');
expect(result).toContain('@nx/plugin');
expect(result).not.toContain('@nrwl/linter');
expect(result).toContain('@nx/linter');
expect(result).toContain('@nrwl/workspace');
expect(result).toContain('@nx/workspace');
expect(result).toContain('@nrwl/tao');
expect(result).toContain('nx-cloud');
expect(result).not.toContain('@nrwl/nx-cloud');
});
});
describe('findMisalignedPackagesForPackage', () => {
+40 -5
View File
@@ -275,11 +275,46 @@ export function findInstalledCommunityPlugins(): PackageJson[] {
);
}
export function findInstalledPackagesWeCareAbout() {
return packagesWeCareAbout.reduce((acc, next) => {
const v = readPackageVersion(next);
const packagesWeMayCareAbout: Record<string, string> = {};
// TODO (v17): Remove workaround for hiding @nrwl packages when matching @nx package is found.
const packageChangeMap: Record<string, string> = {
'@nrwl/nx-plugin': '@nx/plugin',
'@nx/plugin': '@nrwl/nx-plugin',
'@nrwl/eslint-plugin-nx': '@nx/eslint-plugin',
'@nx/eslint-plugin': '@nrwl/eslint-plugin-nx',
'@nrwl/nx-cloud': 'nx-cloud',
};
for (const pkg of packagesWeCareAbout) {
const v = readPackageVersion(pkg);
if (v) {
acc.push({ package: next, version: v });
// If its a @nrwl scoped package, keep the version if there is no
// corresponding @nx scoped package, or it has a different version.
if (pkg.startsWith('@nrwl/')) {
const otherPackage =
packageChangeMap[pkg] ?? pkg.replace('@nrwl/', '@nx/');
const otherVersion = packagesWeMayCareAbout[otherPackage];
if (!otherVersion || v !== otherVersion) {
packagesWeMayCareAbout[pkg] = v;
}
// If its a @nx scoped package, always keep the version, and
// remove the corresponding @nrwl scoped package if it exists.
} else if (pkg.startsWith('@nx/')) {
const otherPackage =
packageChangeMap[pkg] ?? pkg.replace('@nx/', '@nrwl/');
const otherVersion = packagesWeMayCareAbout[otherPackage];
if (otherVersion && v === otherVersion) {
delete packagesWeMayCareAbout[otherPackage];
}
packagesWeMayCareAbout[pkg] = v;
} else {
packagesWeMayCareAbout[pkg] = v;
}
}
return acc;
}, [] as { package: string; version: string }[]);
}
return Object.entries(packagesWeMayCareAbout).map(([pkg, version]) => ({
package: pkg,
version,
}));
}
@@ -112,7 +112,9 @@ function computeWorkspaceConfigHash(projectsConfigurations: any) {
function filterUpdatedFiles(files: string[]) {
try {
const quoted = files.map((f) => '"' + f + '"');
const ignored = execSync(`git check-ignore ${quoted.join(' ')}`)
const ignored = execSync(`git check-ignore ${quoted.join(' ')}`, {
windowsHide: true,
})
.toString()
.split('\n');
return files.filter((f) => ignored.indexOf(f) === -1);
+6
View File
@@ -0,0 +1,6 @@
/**
* Note to developers: STOP! These exports are available via requireNx in @nx/devkit.
*
* These may not be available in certain version of Nx, so be sure to check them first.
*/
export { createTempNpmDirectory } from './utils/package-manager';
@@ -282,6 +282,27 @@ describe('Run Commands', () => {
expect(normalize(readFile(f))).toBe(childFolder);
});
it('should terminate properly with an error if the cwd is not valid', async () => {
const root = dirSync().name;
const cwd = 'bla';
const result = await runCommands(
{
commands: [
{
command: `echo "command does not run"`,
},
],
cwd,
parallel: true,
__unparsed__: [],
},
{ root } as any
);
expect(result).toEqual(expect.objectContaining({ success: false }));
}, 1000);
it('should run the task in the specified absolute cwd', async () => {
const root = dirSync().name;
const childFolder = dirSync({ dir: root }).name;
@@ -233,6 +233,10 @@ function createProcess(
res(true);
}
});
childProcess.on('error', (err) => {
process.stderr.write(addColorAndPrefix(err.toString(), commandConfig));
res(false);
});
childProcess.on('exit', (code) => {
if (!readyWhen) {
res(code === 0);
+62 -4
View File
@@ -2,13 +2,14 @@ import { execSync } from 'child_process';
import { copySync, moveSync, readdirSync, removeSync } from 'fs-extra';
import { join } from 'path';
import { InitArgs } from '../../command-line/init';
import { fileExists, readJsonFile } from '../../utils/fileutils';
import { fileExists, readJsonFile, writeJsonFile } from '../../utils/fileutils';
import { output } from '../../utils/output';
import {
detectPackageManager,
getPackageManagerCommand,
PackageManagerCommands,
} from '../../utils/package-manager';
import { PackageJson } from '../../utils/package-json';
import { askAboutNxCloud, printFinalMessage } from '../utils';
import { checkForCustomWebpackSetup } from './check-for-custom-webpack-setup';
import { checkForUncommittedChanges } from './check-for-uncommitted-changes';
@@ -76,7 +77,7 @@ async function normalizeOptions(options: Options): Promise<NormalizedOptions> {
const appIsJs = !fileExists(`tsconfig.json`);
const reactAppName = readNameFromPackageJson();
const packageJson = readJsonFile('package.json');
const packageJson = readJsonFile(join(process.cwd(), 'package.json'));
const deps = {
...packageJson.dependencies,
...packageJson.devDependencies,
@@ -105,6 +106,13 @@ async function normalizeOptions(options: Options): Promise<NormalizedOptions> {
};
}
/**
* - Create a temp workspace
* - Move all files to temp workspace
* - Add bundler to temp workspace
* - Move files back to root
* - Clean up unused files
*/
async function reorgnizeWorkspaceStructure(options: NormalizedOptions) {
createTempWorkspace(options);
@@ -162,6 +170,8 @@ async function reorgnizeWorkspaceStructure(options: NormalizedOptions) {
}
function createTempWorkspace(options: NormalizedOptions) {
removeSync('temp-workspace');
execSync(
`npx ${
options.npxYesFlagNeeded ? '-y' : ''
@@ -187,12 +197,60 @@ function createTempWorkspace(options: NormalizedOptions) {
removeSync('node_modules');
}
function copyPackageJsonDepsFromTempWorkspace() {
const repoRoot = process.cwd();
let rootPackageJson = readJsonFile(join(repoRoot, 'package.json'));
const tempWorkspacePackageJson = readJsonFile(
join(repoRoot, 'temp-workspace', 'package.json')
);
rootPackageJson = overridePackageDeps(
'dependencies',
rootPackageJson,
tempWorkspacePackageJson
);
rootPackageJson = overridePackageDeps(
'devDependencies',
rootPackageJson,
tempWorkspacePackageJson
);
rootPackageJson.scripts = {}; // remove existing scripts
writeJsonFile(join(repoRoot, 'package.json'), rootPackageJson);
writeJsonFile(
join(repoRoot, 'temp-workspace', 'package.json'),
rootPackageJson
);
}
function overridePackageDeps(
depConfigName: 'dependencies' | 'devDependencies',
base: PackageJson,
override: PackageJson
): PackageJson {
if (!base[depConfigName]) {
base[depConfigName] = override[depConfigName];
return base;
}
const deps = override[depConfigName];
Object.keys(deps).forEach((dep) => {
if (base.dependencies?.[dep]) {
delete base.dependencies[dep];
}
if (base.devDependencies?.[dep]) {
delete base.devDependencies[dep];
}
base[depConfigName][dep] = deps[dep];
});
return base;
}
function moveFilesToTempWorkspace(options: NormalizedOptions) {
output.log({ title: '🚚 Moving your React app in your new Nx workspace' });
copyPackageJsonDepsFromTempWorkspace();
const requiredCraFiles = [
'project.json',
options.isStandalone ? null : 'package.json',
'package.json',
'src',
'public',
options.appIsJs ? null : 'tsconfig.json',
@@ -292,7 +350,7 @@ function cleanUpUnusedFilesAndAddConfigFiles(options: NormalizedOptions) {
setupE2eProject(options.reactAppName);
} else {
removeSync(join('apps', `${options.reactAppName}-e2e`));
execSync(`${options.pmc.rm} @nx/cypress eslint-plugin-cypress`);
execSync(`${options.pmc.rm} cypress @nx/cypress eslint-plugin-cypress`);
}
if (options.isStandalone) {
@@ -112,6 +112,48 @@ describe('explicit project dependencies', () => {
]);
});
it('should build explicit dependencies for static exports in .mts files', async () => {
const sourceProjectName = 'proj';
const { ctx, builder } = await createVirtualWorkspace({
sourceProjectName,
sourceProjectFiles: [
{
path: 'libs/proj/index.mts',
content: `
export {a} from '@proj/my-second-proj';
export * as project3 from '@proj/project-3';
export * from '@proj/proj4ab';
`,
},
],
});
const res = buildExplicitTypeScriptDependencies(
builder.graph,
ctx.filesToProcess
);
expect(res).toEqual([
{
sourceProjectName,
sourceProjectFile: 'libs/proj/index.mts',
targetProjectName: 'proj2',
type: 'static',
},
{
sourceProjectName,
sourceProjectFile: 'libs/proj/index.mts',
targetProjectName: 'proj3a',
type: 'static',
},
{
sourceProjectName,
sourceProjectFile: 'libs/proj/index.mts',
targetProjectName: 'proj4ab',
type: 'static',
},
]);
});
it(`should build explicit dependencies for TypeScript's import/export require syntax, and side-effectful import`, async () => {
const sourceProjectName = 'proj';
const { ctx, builder } = await createVirtualWorkspace({
@@ -25,8 +25,10 @@ export class TypeScriptImportLocator {
const extension = path.extname(filePath);
if (
extension !== '.ts' &&
extension !== '.mts' &&
extension !== '.tsx' &&
extension !== '.js' &&
extension !== '.mjs' &&
extension !== '.jsx'
) {
return;
@@ -1,9 +1,3 @@
import {
DeletedFileChange,
isDeletedFileChange,
WholeFileChange,
} from '../../file-utils';
import { JsonChange } from '../../../utils/json-diff';
import { TouchedProjectLocator } from '../affected-project-graph-models';
import minimatch = require('minimatch');
import {
@@ -12,40 +6,42 @@ import {
} from '../../../config/workspaces';
import { workspaceRoot } from '../../../utils/workspace-root';
import { getNxRequirePaths } from '../../../utils/installation-directory';
import { join } from 'path';
import { existsSync } from 'fs';
export const getTouchedProjectsFromProjectGlobChanges: TouchedProjectLocator<
WholeFileChange | JsonChange | DeletedFileChange
> = async (touchedFiles, projectGraphNodes, nxJson): Promise<string[]> => {
const pluginGlobPatterns = await getGlobPatternsFromPluginsAsync(
nxJson,
getNxRequirePaths(),
workspaceRoot
);
const workspacesGlobPatterns =
getGlobPatternsFromPackageManagerWorkspaces(workspaceRoot) || [];
export const getTouchedProjectsFromProjectGlobChanges: TouchedProjectLocator =
async (touchedFiles, projectGraphNodes, nxJson): Promise<string[]> => {
const pluginGlobPatterns = await getGlobPatternsFromPluginsAsync(
nxJson,
getNxRequirePaths(),
workspaceRoot
);
const workspacesGlobPatterns =
getGlobPatternsFromPackageManagerWorkspaces(workspaceRoot) || [];
const patterns = [
'**/project.json',
...pluginGlobPatterns,
...workspacesGlobPatterns,
];
const combinedGlobPattern =
patterns.length === 1 ? '**/project.json' : '{' + patterns.join(',') + '}';
const touchedProjects = new Set<string>();
for (const touchedFile of touchedFiles) {
const isProjectFile = minimatch(touchedFile.file, combinedGlobPattern);
if (isProjectFile) {
if (
touchedFile.getChanges().some((change) => isDeletedFileChange(change))
) {
// If any project has been deleted, we must assume all projects were affected
return Object.keys(projectGraphNodes);
const patterns = [
'**/project.json',
...pluginGlobPatterns,
...workspacesGlobPatterns,
];
const combinedGlobPattern =
patterns.length === 1
? '**/project.json'
: '{' + patterns.join(',') + '}';
const touchedProjects = new Set<string>();
for (const touchedFile of touchedFiles) {
const isProjectFile = minimatch(touchedFile.file, combinedGlobPattern);
if (isProjectFile) {
// If the file no longer exists on disk, then it was deleted
if (!existsSync(join(workspaceRoot, touchedFile.file))) {
// If any project has been deleted, we must assume all projects were affected
return Object.keys(projectGraphNodes);
}
// Modified project config files are under a project's root, and implicitly
// mark it as affected. Thus, we don't need to handle it here.
}
// Modified project config files are under a project's root, and implicitly
// mark it as affected. Thus, we don't need to handle it here.
}
}
return Array.from(touchedProjects);
};
return Array.from(touchedProjects);
};
@@ -50,7 +50,8 @@ export const defaultTasksRunner: TasksRunner<
} else if (
(options as any)['parallel'] === 'true' ||
(options as any)['parallel'] === true ||
(options as any)['parallel'] === undefined
(options as any)['parallel'] === undefined ||
(options as any)['parallel'] === ''
) {
(options as any)['parallel'] = Number((options as any)['maxParallel'] || 3);
}
+184 -103
View File
@@ -20,7 +20,6 @@ describe('splitArgs', () => {
base: 'sha1',
head: 'sha2',
skipNxCache: false,
parallel: 3,
});
});
@@ -52,7 +51,6 @@ describe('splitArgs', () => {
).toEqual({
base: 'main',
skipNxCache: false,
parallel: 3,
});
});
@@ -70,7 +68,6 @@ describe('splitArgs', () => {
).toEqual({
base: 'develop',
skipNxCache: false,
parallel: 3,
});
});
@@ -88,7 +85,6 @@ describe('splitArgs', () => {
).toEqual({
base: 'main',
skipNxCache: false,
parallel: 3,
});
});
@@ -178,107 +174,194 @@ describe('splitArgs', () => {
{} as any
).nxArgs
).toEqual({
parallel: 3,
projects: ['aaa', 'bbb'],
skipNxCache: false,
});
});
it('should set base and head based on environment variables in affected mode, if they are not provided directly on the command', () => {
const originalNxBase = process.env.NX_BASE;
process.env.NX_BASE = 'envVarSha1';
const originalNxHead = process.env.NX_HEAD;
process.env.NX_HEAD = 'envVarSha2';
withEnvironment(
{
NX_BASE: 'envVarSha1',
NX_HEAD: 'envVarSha2',
},
() => {
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
},
'affected',
{} as any,
{} as any
).nxArgs
).toEqual({
base: 'envVarSha1',
head: 'envVarSha2',
skipNxCache: false,
});
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
},
'affected',
{} as any,
{} as any
).nxArgs
).toEqual({
base: 'envVarSha1',
head: 'envVarSha2',
skipNxCache: false,
parallel: 3,
});
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
head: 'directlyOnCommandSha1', // higher priority than $NX_HEAD
},
'affected',
{} as any,
{} as any
).nxArgs
).toEqual({
base: 'envVarSha1',
head: 'directlyOnCommandSha1',
skipNxCache: false,
});
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
head: 'directlyOnCommandSha1', // higher priority than $NX_HEAD
},
'affected',
{} as any,
{} as any
).nxArgs
).toEqual({
base: 'envVarSha1',
head: 'directlyOnCommandSha1',
skipNxCache: false,
parallel: 3,
});
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
base: 'directlyOnCommandSha2', // higher priority than $NX_BASE
},
'affected',
{} as any,
{} as any
).nxArgs
).toEqual({
base: 'directlyOnCommandSha2',
head: 'envVarSha2',
skipNxCache: false,
parallel: 3,
});
// Reset process data
process.env.NX_BASE = originalNxBase;
process.env.NX_HEAD = originalNxHead;
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
base: 'directlyOnCommandSha2', // higher priority than $NX_BASE
},
'affected',
{} as any,
{} as any
).nxArgs
).toEqual({
base: 'directlyOnCommandSha2',
head: 'envVarSha2',
skipNxCache: false,
});
}
);
});
it('should set runner based on environment variables, if it is not provided directly on the command', () => {
const originalRunner = process.env.NX_RUNNER;
process.env.NX_RUNNER = 'some-env-runner-name';
describe('--runner environment handling', () => {
it('should set runner based on environment NX_RUNNER, if it is not provided directly on the command', () => {
withEnvironment({ NX_RUNNER: 'some-env-runner-name' }, () => {
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
},
'run-one',
{} as any,
{
tasksRunnerOptions: {
'some-env-runner-name': { runner: '' },
},
}
).nxArgs.runner
).toEqual('some-env-runner-name');
expect(
splitArgsIntoNxArgsAndOverrides(
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
runner: 'directlyOnCommand', // higher priority than $NX_RUNNER
},
'run-one',
{} as any,
{
tasksRunnerOptions: {
'some-env-runner-name': { runner: '' },
},
}
).nxArgs.runner
).toEqual('directlyOnCommand');
});
});
it('should set runner based on environment NX_TASKS_RUNNER, if it is not provided directly on the command', () => {
withEnvironment({ NX_TASKS_RUNNER: 'some-env-runner-name' }, () => {
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
},
'run-one',
{} as any,
{
tasksRunnerOptions: {
'some-env-runner-name': { runner: '' },
},
}
).nxArgs.runner
).toEqual('some-env-runner-name');
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
runner: 'directlyOnCommand', // higher priority than $NX_RUNNER
},
'run-one',
{} as any,
{
tasksRunnerOptions: {
'some-env-runner-name': { runner: '' },
},
}
).nxArgs.runner
).toEqual('directlyOnCommand');
});
});
it('should prefer NX_TASKS_RUNNER', () => {
withEnvironment(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
NX_TASKS_RUNNER: 'some-env-runner-name',
NX_RUNNER: 'some-other-runner',
},
'run-one',
{} as any,
{} as any
).nxArgs.runner
).toEqual('some-env-runner-name');
() => {
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
},
'run-one',
{} as any,
{
tasksRunnerOptions: {
'some-env-runner-name': { runner: '' },
'some-other-runner': { runner: '' },
},
}
).nxArgs.runner
).toEqual('some-env-runner-name');
}
);
});
expect(
splitArgsIntoNxArgsAndOverrides(
it('should ignore runners based on environment, if it is valid', () => {
withEnvironment(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
runner: 'directlyOnCommand', // higher priority than $NX_RUNNER
NX_TASKS_RUNNER: 'some-env-runner-name',
NX_RUNNER: 'some-other-runner',
},
'run-one',
{} as any,
{} as any
).nxArgs.runner
).toEqual('directlyOnCommand');
// Reset process data
process.env.NX_RUNNER = originalRunner;
() => {
expect(
splitArgsIntoNxArgsAndOverrides(
{
__overrides_unparsed__: ['--notNxArg', 'true', '--override'],
$0: '',
},
'run-one',
{} as any,
{} as any
).nxArgs.runner
).not.toBeDefined();
}
);
});
});
describe('--parallel', () => {
@@ -297,20 +380,6 @@ describe('splitArgs', () => {
expect(parallel).toEqual(5);
});
it('should default to 3 when not specified', () => {
const parallel = splitArgsIntoNxArgsAndOverrides(
{
$0: '',
__overrides_unparsed__: [],
},
'affected',
{} as any,
{} as any
).nxArgs.parallel;
expect(parallel).toEqual(3);
});
it('should default to 3 when used with no value specified', () => {
const parallel = splitArgsIntoNxArgsAndOverrides(
{
@@ -389,3 +458,15 @@ describe('splitArgs', () => {
});
});
});
function withEnvironment(env: Record<string, string>, callback: () => void) {
const originalValues: Record<string, string> = {};
for (const key in env) {
originalValues[key] = process.env[key];
process.env[key] = env[key];
}
callback();
for (const key in env) {
process.env[key] = originalValues[key];
}
}
+54 -12
View File
@@ -181,24 +181,14 @@ export function splitArgsIntoNxArgsAndOverrides(
nxArgs.skipNxCache = process.env.NX_SKIP_NX_CACHE === 'true';
}
if (!nxArgs.runner && process.env.NX_RUNNER) {
nxArgs.runner = process.env.NX_RUNNER;
if (options.printWarnings) {
output.note({
title: `No explicit --runner argument provided, but found environment variable NX_RUNNER so using its value: ${output.bold(
`${nxArgs.runner}`
)}`,
});
}
}
normalizeNxArgsRunner(nxArgs, nxJson, options);
if (args['parallel'] === 'false' || args['parallel'] === false) {
nxArgs['parallel'] = 1;
} else if (
args['parallel'] === 'true' ||
args['parallel'] === true ||
args['parallel'] === '' ||
args['parallel'] === undefined
args['parallel'] === ''
) {
nxArgs['parallel'] = Number(
nxArgs['maxParallel'] || nxArgs['max-parallel'] || 3
@@ -210,6 +200,58 @@ export function splitArgsIntoNxArgsAndOverrides(
return { nxArgs, overrides } as any;
}
function normalizeNxArgsRunner(
nxArgs: RawNxArgs,
nxJson: NxJsonConfiguration<string[] | '*'>,
options: { printWarnings: boolean }
) {
if (!nxArgs.runner) {
// TODO: Remove NX_RUNNER environment variable support in Nx v17
for (const envKey of ['NX_TASKS_RUNNER', 'NX_RUNNER']) {
const runner = process.env[envKey];
if (runner) {
const runnerExists = nxJson.tasksRunnerOptions?.[runner];
if (options.printWarnings) {
if (runnerExists) {
output.note({
title: `No explicit --runner argument provided, but found environment variable ${envKey} so using its value: ${output.bold(
`${runner}`
)}`,
});
} else if (
nxArgs.verbose ||
process.env.NX_VERBOSE_LOGGING === 'true'
) {
output.warn({
title: `Could not find ${output.bold(
`${runner}`
)} within \`nx.json\` tasksRunnerOptions.`,
bodyLines: [
`${output.bold(`${runner}`)} was set by ${envKey}`,
``,
`To suppress this message, either:`,
` - provide a valid task runner with --runner`,
` - ensure NX_TASKS_RUNNER matches a task runner defined in nx.json`,
],
});
}
}
if (runnerExists) {
// TODO: Remove in v17
if (envKey === 'NX_RUNNER' && options.printWarnings) {
output.warn({
title:
'NX_RUNNER is deprecated, please use NX_TASKS_RUNNER instead.',
});
}
nxArgs.runner = runner;
}
break;
}
}
}
}
export function parseFiles(options: NxArgs): { files: string[] } {
const { files, uncommitted, untracked, base, head } = options;
@@ -54,6 +54,18 @@ describe('findMatchingProjects', () => {
},
};
it('should return no projects when passed no patterns', () => {
expect(findMatchingProjects([], projectGraph)).toEqual([]);
});
it('should return no projects when passed empty string', () => {
expect(findMatchingProjects([''], projectGraph)).toEqual([]);
});
it('should not throw when a pattern is empty string', () => {
expect(findMatchingProjects(['', 'a'], projectGraph)).toEqual(['a']);
});
it('should expand "*"', () => {
expect(findMatchingProjects(['*'], projectGraph)).toEqual([
'test-project',

Some files were not shown because too many files have changed in this diff Show More