chore(repo): replace references to @nrwl in e2e tests (#16441)
This commit is contained in:
parent
5d8839a7dd
commit
a0d18bb588
@ -6,14 +6,14 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('angular.json v1 config', () => {
|
describe('angular.json v1 config', () => {
|
||||||
const app1 = uniq('app1');
|
const app1 = uniq('app1');
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
newProject();
|
newProject();
|
||||||
runCLI(`generate @nrwl/angular:app ${app1} --no-interactive`);
|
runCLI(`generate @nx/angular:app ${app1} --no-interactive`);
|
||||||
// reset workspace to use v1 config
|
// reset workspace to use v1 config
|
||||||
updateFile(`angular.json`, angularV1Json(app1));
|
updateFile(`angular.json`, angularV1Json(app1));
|
||||||
removeFile(`apps/${app1}/project.json`);
|
removeFile(`apps/${app1}/project.json`);
|
||||||
@ -31,7 +31,7 @@ describe('angular.json v1 config', () => {
|
|||||||
it('should generate new app with project.json and keep the existing in angular.json', async () => {
|
it('should generate new app with project.json and keep the existing in angular.json', async () => {
|
||||||
// create new app
|
// create new app
|
||||||
const app2 = uniq('app2');
|
const app2 = uniq('app2');
|
||||||
runCLI(`generate @nrwl/angular:app ${app2} --no-interactive`);
|
runCLI(`generate @nx/angular:app ${app2} --no-interactive`);
|
||||||
|
|
||||||
// should generate project.json for new projects
|
// should generate project.json for new projects
|
||||||
checkFilesExist(`apps/${app2}/project.json`);
|
checkFilesExist(`apps/${app2}/project.json`);
|
||||||
@ -116,7 +116,7 @@ const angularV1Json = (appName: string) => `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@nrwl/linter:eslint",
|
"builder": "@nx/linter:eslint",
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": [
|
"lintFilePatterns": [
|
||||||
"apps/${appName}/src/**/*.ts",
|
"apps/${appName}/src/**/*.ts",
|
||||||
@ -125,7 +125,7 @@ const angularV1Json = (appName: string) => `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"builder": "@nrwl/jest:jest",
|
"builder": "@nx/jest:jest",
|
||||||
"outputs": ["coverage/apps/${appName}"],
|
"outputs": ["coverage/apps/${appName}"],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "apps/${appName}/jest.config.ts",
|
"jestConfig": "apps/${appName}/jest.config.ts",
|
||||||
@ -141,7 +141,7 @@ const angularV1Json = (appName: string) => `{
|
|||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"architect": {
|
"architect": {
|
||||||
"e2e": {
|
"e2e": {
|
||||||
"builder": "@nrwl/cypress:cypress",
|
"builder": "@nx/cypress:cypress",
|
||||||
"options": {
|
"options": {
|
||||||
"cypressConfig": "apps/${appName}-e2e/cypress.json",
|
"cypressConfig": "apps/${appName}-e2e/cypress.json",
|
||||||
"devServerTarget": "${appName}:serve:development",
|
"devServerTarget": "${appName}:serve:development",
|
||||||
@ -154,7 +154,7 @@ const angularV1Json = (appName: string) => `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@nrwl/linter:eslint",
|
"builder": "@nx/linter:eslint",
|
||||||
"outputs": ["{options.outputFile}"],
|
"outputs": ["{options.outputFile}"],
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": ["apps/${appName}-e2e/**/*.{js,ts}"]
|
"lintFilePatterns": ["apps/${appName}-e2e/**/*.{js,ts}"]
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
runCommandUntil,
|
runCommandUntil,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Angular Module Federation', () => {
|
describe('Angular Module Federation', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
@ -33,12 +33,10 @@ describe('Angular Module Federation', () => {
|
|||||||
const remotePort = 4301;
|
const remotePort = 4301;
|
||||||
|
|
||||||
// generate host app
|
// generate host app
|
||||||
runCLI(
|
runCLI(`generate @nx/angular:host ${hostApp} --style=css --no-interactive`);
|
||||||
`generate @nrwl/angular:host ${hostApp} --style=css --no-interactive`
|
|
||||||
);
|
|
||||||
// generate remote app
|
// generate remote app
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:remote ${remoteApp1} --host=${hostApp} --port=${remotePort} --style=css --no-interactive`
|
`generate @nx/angular:remote ${remoteApp1} --host=${hostApp} --port=${remotePort} --style=css --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
// check default generated host is built successfully
|
// check default generated host is built successfully
|
||||||
@ -47,10 +45,10 @@ describe('Angular Module Federation', () => {
|
|||||||
|
|
||||||
// generate a shared lib with a seconary entry point
|
// generate a shared lib with a seconary entry point
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:library ${sharedLib} --buildable --no-interactive`
|
`generate @nx/angular:library ${sharedLib} --buildable --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:library-secondary-entry-point --library=${sharedLib} --name=${secondaryEntry} --no-interactive`
|
`generate @nx/angular:library-secondary-entry-point --library=${sharedLib} --name=${secondaryEntry} --no-interactive`
|
||||||
);
|
);
|
||||||
// update host & remote files to use shared library
|
// update host & remote files to use shared library
|
||||||
updateFile(
|
updateFile(
|
||||||
@ -139,16 +137,16 @@ describe('Angular Module Federation', () => {
|
|||||||
|
|
||||||
// generate apps
|
// generate apps
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:application ${app1} --routing --no-interactive`
|
`generate @nx/angular:application ${app1} --routing --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(`generate @nrwl/angular:application ${app2} --no-interactive`);
|
runCLI(`generate @nx/angular:application ${app2} --no-interactive`);
|
||||||
|
|
||||||
// convert apps
|
// convert apps
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:setup-mf ${app1} --mfType=host --port=${app1Port} --no-interactive`
|
`generate @nx/angular:setup-mf ${app1} --mfType=host --port=${app1Port} --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:setup-mf ${app2} --mfType=remote --host=${app1} --port=${app2Port} --no-interactive`
|
`generate @nx/angular:setup-mf ${app2} --mfType=remote --host=${app1} --port=${app2Port} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const process = await runCommandUntil(
|
const process = await runCommandUntil(
|
||||||
@ -170,7 +168,7 @@ describe('Angular Module Federation', () => {
|
|||||||
|
|
||||||
// generate remote apps
|
// generate remote apps
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:host ${host} --ssr --remotes=${remote1},${remote2} --no-interactive`
|
`generate @nx/angular:host ${host} --ssr --remotes=${remote1},${remote2} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
// ports
|
// ports
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import {
|
|||||||
runNgNew,
|
runNgNew,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { PackageManager } from 'nx/src/utils/package-manager';
|
import { PackageManager } from 'nx/src/utils/package-manager';
|
||||||
|
|
||||||
describe('convert Angular CLI workspace to an Nx workspace', () => {
|
describe('convert Angular CLI workspace to an Nx workspace', () => {
|
||||||
@ -101,11 +101,11 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
|
|||||||
];
|
];
|
||||||
updateFile('angular.json', JSON.stringify(angularJson, null, 2));
|
updateFile('angular.json', JSON.stringify(angularJson, null, 2));
|
||||||
|
|
||||||
// confirm that @nrwl dependencies do not exist yet
|
// confirm that @nx dependencies do not exist yet
|
||||||
expect(packageJson.devDependencies['@nx/workspace']).not.toBeDefined();
|
expect(packageJson.devDependencies['@nx/workspace']).not.toBeDefined();
|
||||||
|
|
||||||
// run ng add
|
// run ng add
|
||||||
runNgAdd('@nrwl/angular', '--npm-scope projscope --default-base main');
|
runNgAdd('@nx/angular', '--npm-scope projscope --default-base main');
|
||||||
|
|
||||||
// check that prettier config exits and that files have been moved
|
// check that prettier config exits and that files have been moved
|
||||||
checkFilesExist(
|
checkFilesExist(
|
||||||
@ -268,7 +268,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
|
|||||||
it('should handle a workspace with cypress v9', () => {
|
it('should handle a workspace with cypress v9', () => {
|
||||||
addCypress9();
|
addCypress9();
|
||||||
|
|
||||||
runNgAdd('@nrwl/angular', '--npm-scope projscope --skip-install');
|
runNgAdd('@nx/angular', '--npm-scope projscope --skip-install');
|
||||||
|
|
||||||
const e2eProject = `${project}-e2e`;
|
const e2eProject = `${project}-e2e`;
|
||||||
//check e2e project files
|
//check e2e project files
|
||||||
@ -335,7 +335,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
|
|||||||
it('should handle a workspace with cypress v10', () => {
|
it('should handle a workspace with cypress v10', () => {
|
||||||
addCypress10();
|
addCypress10();
|
||||||
|
|
||||||
runNgAdd('@nrwl/angular', '--npm-scope projscope --skip-install');
|
runNgAdd('@nx/angular', '--npm-scope projscope --skip-install');
|
||||||
|
|
||||||
const e2eProject = `${project}-e2e`;
|
const e2eProject = `${project}-e2e`;
|
||||||
//check e2e project files
|
//check e2e project files
|
||||||
@ -400,12 +400,12 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// TODO(leo): The current Verdaccio setup fails to resolve older versions
|
// TODO(leo): The current Verdaccio setup fails to resolve older versions
|
||||||
// of @nrwl/* packages, the @angular-eslint/builder package depends on an
|
// of @nx/* packages, the @angular-eslint/builder package depends on an
|
||||||
// older version of @nrwl/devkit so we skip this test for now.
|
// older version of @nx/devkit so we skip this test for now.
|
||||||
it.skip('should handle a workspace with ESLint', () => {
|
it.skip('should handle a workspace with ESLint', () => {
|
||||||
addEsLint();
|
addEsLint();
|
||||||
|
|
||||||
runNgAdd('@nrwl/angular', '--npm-scope projscope');
|
runNgAdd('@nx/angular', '--npm-scope projscope');
|
||||||
|
|
||||||
checkFilesExist(`apps/${project}/.eslintrc.json`, `.eslintrc.json`);
|
checkFilesExist(`apps/${project}/.eslintrc.json`, `.eslintrc.json`);
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
|
|||||||
runCommand(`ng g @schematics/angular:application ${app1}`);
|
runCommand(`ng g @schematics/angular:application ${app1}`);
|
||||||
runCommand(`ng g @schematics/angular:library ${lib1}`);
|
runCommand(`ng g @schematics/angular:library ${lib1}`);
|
||||||
|
|
||||||
runNgAdd('@nrwl/angular', '--npm-scope projscope');
|
runNgAdd('@nx/angular', '--npm-scope projscope');
|
||||||
|
|
||||||
// check angular.json does not exist
|
// check angular.json does not exist
|
||||||
checkFilesDoNotExist('angular.json');
|
checkFilesDoNotExist('angular.json');
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { normalize } from 'path';
|
import { normalize } from 'path';
|
||||||
|
|
||||||
describe('Angular Projects', () => {
|
describe('Angular Projects', () => {
|
||||||
@ -27,9 +27,9 @@ describe('Angular Projects', () => {
|
|||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
proj = newProject();
|
proj = newProject();
|
||||||
runCLI(`generate @nrwl/angular:app ${app1} --no-interactive`);
|
runCLI(`generate @nx/angular:app ${app1} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:lib ${lib1} --add-module-spec --no-interactive`
|
`generate @nx/angular:lib ${lib1} --add-module-spec --no-interactive`
|
||||||
);
|
);
|
||||||
app1DefaultModule = readFile(`apps/${app1}/src/app/app.module.ts`);
|
app1DefaultModule = readFile(`apps/${app1}/src/app/app.module.ts`);
|
||||||
app1DefaultComponentTemplate = readFile(
|
app1DefaultComponentTemplate = readFile(
|
||||||
@ -50,7 +50,7 @@ describe('Angular Projects', () => {
|
|||||||
it('should successfully generate apps and libs and work correctly', async () => {
|
it('should successfully generate apps and libs and work correctly', async () => {
|
||||||
const standaloneApp = uniq('standalone-app');
|
const standaloneApp = uniq('standalone-app');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:app ${standaloneApp} --directory=myDir --standalone=true --no-interactive`
|
`generate @nx/angular:app ${standaloneApp} --directory=myDir --standalone=true --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
@ -162,10 +162,10 @@ describe('Angular Projects', () => {
|
|||||||
const buildableChildLib = uniq('buildlib2');
|
const buildableChildLib = uniq('buildlib2');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:library ${buildableLib} --buildable=true --no-interactive`
|
`generate @nx/angular:library ${buildableLib} --buildable=true --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:library ${buildableChildLib} --buildable=true --no-interactive`
|
`generate @nx/angular:library ${buildableChildLib} --buildable=true --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
// update the app module to include a ref to the buildable lib
|
// update the app module to include a ref to the buildable lib
|
||||||
@ -211,7 +211,7 @@ describe('Angular Projects', () => {
|
|||||||
|
|
||||||
// update the angular.json
|
// update the angular.json
|
||||||
updateProjectConfig(app1, (config) => {
|
updateProjectConfig(app1, (config) => {
|
||||||
config.targets.build.executor = '@nrwl/angular:webpack-browser';
|
config.targets.build.executor = '@nx/angular:webpack-browser';
|
||||||
config.targets.build.options = {
|
config.targets.build.options = {
|
||||||
...config.targets.build.options,
|
...config.targets.build.options,
|
||||||
buildLibsFromSource: false,
|
buildLibsFromSource: false,
|
||||||
@ -241,17 +241,17 @@ describe('Angular Projects', () => {
|
|||||||
const entryPoint = uniq('entrypoint');
|
const entryPoint = uniq('entrypoint');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:lib ${lib} --publishable --importPath=@${proj}/${lib} --no-interactive`
|
`generate @nx/angular:lib ${lib} --publishable --importPath=@${proj}/${lib} --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:secondary-entry-point --name=${entryPoint} --library=${lib} --no-interactive`
|
`generate @nx/angular:secondary-entry-point --name=${entryPoint} --library=${lib} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:library ${childLib} --publishable=true --importPath=@${proj}/${childLib} --no-interactive`
|
`generate @nx/angular:library ${childLib} --publishable=true --importPath=@${proj}/${childLib} --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:secondary-entry-point --name=sub --library=${childLib} --no-interactive`
|
`generate @nx/angular:secondary-entry-point --name=sub --library=${childLib} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const moduleContent = `
|
const moduleContent = `
|
||||||
|
|||||||
@ -37,7 +37,7 @@ describe('Angular Cypress Component Tests', () => {
|
|||||||
|
|
||||||
it('should test app', () => {
|
it('should test app', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive`
|
`generate @nx/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive`
|
||||||
);
|
);
|
||||||
if (runCypressTests()) {
|
if (runCypressTests()) {
|
||||||
expect(runCLI(`component-test ${appName} --no-watch`)).toContain(
|
expect(runCLI(`component-test ${appName} --no-watch`)).toContain(
|
||||||
@ -48,7 +48,7 @@ describe('Angular Cypress Component Tests', () => {
|
|||||||
|
|
||||||
it('should successfully component test lib being used in app', () => {
|
it('should successfully component test lib being used in app', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive`
|
`generate @nx/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive`
|
||||||
);
|
);
|
||||||
if (runCypressTests()) {
|
if (runCypressTests()) {
|
||||||
expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain(
|
expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain(
|
||||||
@ -61,14 +61,14 @@ describe('Angular Cypress Component Tests', () => {
|
|||||||
expect(() => {
|
expect(() => {
|
||||||
// should error since no edge in graph between lib and app
|
// should error since no edge in graph between lib and app
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --no-interactive`
|
`generate @nx/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --no-interactive`
|
||||||
);
|
);
|
||||||
}).toThrow();
|
}).toThrow();
|
||||||
|
|
||||||
updateTestToAssertTailwindIsNotApplied(buildableLibName);
|
updateTestToAssertTailwindIsNotApplied(buildableLibName);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build --no-interactive`
|
`generate @nx/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build --no-interactive`
|
||||||
);
|
);
|
||||||
if (runCypressTests()) {
|
if (runCypressTests()) {
|
||||||
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
|
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
|
||||||
@ -76,9 +76,7 @@ describe('Angular Cypress Component Tests', () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// add tailwind
|
// add tailwind
|
||||||
runCLI(
|
runCLI(`generate @nx/angular:setup-tailwind --project=${buildableLibName}`);
|
||||||
`generate @nrwl/angular:setup-tailwind --project=${buildableLibName}`
|
|
||||||
);
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${buildableLibName}/src/lib/input/input.component.cy.ts`,
|
`libs/${buildableLibName}/src/lib/input/input.component.cy.ts`,
|
||||||
(content) => {
|
(content) => {
|
||||||
@ -133,19 +131,19 @@ describe('Angular Cypress Component Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function createApp(appName: string) {
|
function createApp(appName: string) {
|
||||||
runCLI(`generate @nrwl/angular:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/angular:app ${appName} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:component fancy-component --project=${appName} --no-interactive`
|
`generate @nx/angular:component fancy-component --project=${appName} --no-interactive`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createLib(projectName: string, appName: string, libName: string) {
|
function createLib(projectName: string, appName: string, libName: string) {
|
||||||
runCLI(`generate @nrwl/angular:lib ${libName} --no-interactive`);
|
runCLI(`generate @nx/angular:lib ${libName} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:component btn --project=${libName} --inlineTemplate --inlineStyle --export --no-interactive`
|
`generate @nx/angular:component btn --project=${libName} --inlineTemplate --inlineStyle --export --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:component btn-standalone --project=${libName} --inlineTemplate --inlineStyle --export --standalone --no-interactive`
|
`generate @nx/angular:component btn-standalone --project=${libName} --inlineTemplate --inlineStyle --export --standalone --no-interactive`
|
||||||
);
|
);
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${libName}/src/lib/btn/btn.component.ts`,
|
`libs/${libName}/src/lib/btn/btn.component.ts`,
|
||||||
@ -183,14 +181,14 @@ export class BtnStandaloneComponent {
|
|||||||
|
|
||||||
function createBuildableLib(projectName: string, libName: string) {
|
function createBuildableLib(projectName: string, libName: string) {
|
||||||
// create lib
|
// create lib
|
||||||
runCLI(`generate @nrwl/angular:lib ${libName} --buildable --no-interactive`);
|
runCLI(`generate @nx/angular:lib ${libName} --buildable --no-interactive`);
|
||||||
// create cmp for lib
|
// create cmp for lib
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:component input --project=${libName} --inlineTemplate --inlineStyle --export --no-interactive`
|
`generate @nx/angular:component input --project=${libName} --inlineTemplate --inlineStyle --export --no-interactive`
|
||||||
);
|
);
|
||||||
// create standlone cmp for lib
|
// create standlone cmp for lib
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:component input-standalone --project=${libName} --inlineTemplate --inlineStyle --export --standalone --no-interactive`
|
`generate @nx/angular:component input-standalone --project=${libName} --inlineTemplate --inlineStyle --export --standalone --no-interactive`
|
||||||
);
|
);
|
||||||
// update cmp implmentation to use tailwind clasasserting in tests
|
// update cmp implmentation to use tailwind clasasserting in tests
|
||||||
updateFile(
|
updateFile(
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { classify } from '@nx/devkit/src/utils/string-utils';
|
import { classify } from '@nx/devkit/src/utils/string-utils';
|
||||||
|
|
||||||
describe('Move Angular Project', () => {
|
describe('Move Angular Project', () => {
|
||||||
@ -20,7 +20,7 @@ describe('Move Angular Project', () => {
|
|||||||
app1 = uniq('app1');
|
app1 = uniq('app1');
|
||||||
app2 = uniq('app2');
|
app2 = uniq('app2');
|
||||||
newPath = `subfolder/${app2}`;
|
newPath = `subfolder/${app2}`;
|
||||||
runCLI(`generate @nrwl/angular:app ${app1} --no-interactive`);
|
runCLI(`generate @nx/angular:app ${app1} --no-interactive`);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => cleanupProject());
|
afterAll(() => cleanupProject());
|
||||||
@ -30,7 +30,7 @@ describe('Move Angular Project', () => {
|
|||||||
*/
|
*/
|
||||||
it('should work for apps', () => {
|
it('should work for apps', () => {
|
||||||
const moveOutput = runCLI(
|
const moveOutput = runCLI(
|
||||||
`generate @nrwl/angular:move --project ${app1} ${newPath}`
|
`generate @nx/angular:move --project ${app1} ${newPath}`
|
||||||
);
|
);
|
||||||
|
|
||||||
// just check the output
|
// just check the output
|
||||||
@ -64,7 +64,7 @@ describe('Move Angular Project', () => {
|
|||||||
`apps/${app1}-e2e/cypress.config.ts`,
|
`apps/${app1}-e2e/cypress.config.ts`,
|
||||||
`
|
`
|
||||||
import { defineConfig } from 'cypress';
|
import { defineConfig } from 'cypress';
|
||||||
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
|
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
e2e: {
|
e2e: {
|
||||||
@ -76,7 +76,7 @@ describe('Move Angular Project', () => {
|
|||||||
`
|
`
|
||||||
);
|
);
|
||||||
const moveOutput = runCLI(
|
const moveOutput = runCLI(
|
||||||
`generate @nrwl/angular:move --projectName=${app1}-e2e --destination=${newPath}-e2e`
|
`generate @nx/angular:move --projectName=${app1}-e2e --destination=${newPath}-e2e`
|
||||||
);
|
);
|
||||||
|
|
||||||
// just check that the cypress.config.ts is updated correctly
|
// just check that the cypress.config.ts is updated correctly
|
||||||
@ -99,13 +99,13 @@ describe('Move Angular Project', () => {
|
|||||||
it('should work for libraries', () => {
|
it('should work for libraries', () => {
|
||||||
const lib1 = uniq('mylib');
|
const lib1 = uniq('mylib');
|
||||||
const lib2 = uniq('mylib');
|
const lib2 = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/angular:lib ${lib1} --no-interactive`);
|
runCLI(`generate @nx/angular:lib ${lib1} --no-interactive`);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a library which imports the module from the other lib
|
* Create a library which imports the module from the other lib
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/angular:lib ${lib2} --no-interactive`);
|
runCLI(`generate @nx/angular:lib ${lib2} --no-interactive`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${lib2}/src/lib/${lib2}.module.ts`,
|
`libs/${lib2}/src/lib/${lib2}.module.ts`,
|
||||||
@ -115,7 +115,7 @@ describe('Move Angular Project', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const moveOutput = runCLI(
|
const moveOutput = runCLI(
|
||||||
`generate @nrwl/angular:move --projectName=${lib1} --destination=shared/${lib1}`
|
`generate @nx/angular:move --projectName=${lib1} --destination=shared/${lib1}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const newPath = `libs/shared/${lib1}`;
|
const newPath = `libs/shared/${lib1}`;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Angular Package', () => {
|
describe('Angular Package', () => {
|
||||||
describe('ngrx', () => {
|
describe('ngrx', () => {
|
||||||
@ -20,11 +20,11 @@ describe('Angular Package', () => {
|
|||||||
|
|
||||||
it('should work', async () => {
|
it('should work', async () => {
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --no-interactive`);
|
runCLI(`generate @nx/angular:app ${myapp} --no-interactive`);
|
||||||
|
|
||||||
// Generate root ngrx state management
|
// Generate root ngrx state management
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root --minimal=false`
|
`generate @nx/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root --minimal=false`
|
||||||
);
|
);
|
||||||
const packageJson = readJson('package.json');
|
const packageJson = readJson('package.json');
|
||||||
expect(packageJson.dependencies['@ngrx/store']).toBeDefined();
|
expect(packageJson.dependencies['@ngrx/store']).toBeDefined();
|
||||||
@ -34,9 +34,9 @@ describe('Angular Package', () => {
|
|||||||
|
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
// Generate feature library and ngrx state within that library
|
// Generate feature library and ngrx state within that library
|
||||||
runCLI(`g @nrwl/angular:lib ${mylib} --prefix=fl`);
|
runCLI(`g @nx/angular:lib ${mylib} --prefix=fl`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:ngrx flights --parent=libs/${mylib}/src/lib/${mylib}.module.ts --facade`
|
`generate @nx/angular:ngrx flights --parent=libs/${mylib}/src/lib/${mylib}.module.ts --facade`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/);
|
expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/);
|
||||||
@ -49,11 +49,11 @@ describe('Angular Package', () => {
|
|||||||
|
|
||||||
it('should work with creators', async () => {
|
it('should work with creators', async () => {
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --routing --no-interactive`);
|
runCLI(`generate @nx/angular:app ${myapp} --routing --no-interactive`);
|
||||||
|
|
||||||
// Generate root ngrx state management
|
// Generate root ngrx state management
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root`
|
`generate @nx/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root`
|
||||||
);
|
);
|
||||||
const packageJson = readJson('package.json');
|
const packageJson = readJson('package.json');
|
||||||
expect(packageJson.dependencies['@ngrx/entity']).toBeDefined();
|
expect(packageJson.dependencies['@ngrx/entity']).toBeDefined();
|
||||||
@ -65,11 +65,11 @@ describe('Angular Package', () => {
|
|||||||
|
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
// Generate feature library and ngrx state within that library
|
// Generate feature library and ngrx state within that library
|
||||||
runCLI(`g @nrwl/angular:lib ${mylib} --prefix=fl`);
|
runCLI(`g @nx/angular:lib ${mylib} --prefix=fl`);
|
||||||
|
|
||||||
const flags = `--facade --barrels`;
|
const flags = `--facade --barrels`;
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:ngrx flights --parent=libs/${mylib}/src/lib/${mylib}.module.ts ${flags}`
|
`generate @nx/angular:ngrx flights --parent=libs/${mylib}/src/lib/${mylib}.module.ts ${flags}`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/);
|
expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/);
|
||||||
@ -82,11 +82,11 @@ describe('Angular Package', () => {
|
|||||||
|
|
||||||
it('should work with creators using --module', async () => {
|
it('should work with creators using --module', async () => {
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/angular:app ${myapp} --routing --no-interactive`);
|
runCLI(`generate @nx/angular:app ${myapp} --routing --no-interactive`);
|
||||||
|
|
||||||
// Generate root ngrx state management
|
// Generate root ngrx state management
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root`
|
`generate @nx/angular:ngrx users --parent=apps/${myapp}/src/app/app.module.ts --root`
|
||||||
);
|
);
|
||||||
const packageJson = readJson('package.json');
|
const packageJson = readJson('package.json');
|
||||||
expect(packageJson.dependencies['@ngrx/entity']).toBeDefined();
|
expect(packageJson.dependencies['@ngrx/entity']).toBeDefined();
|
||||||
@ -98,11 +98,11 @@ describe('Angular Package', () => {
|
|||||||
|
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
// Generate feature library and ngrx state within that library
|
// Generate feature library and ngrx state within that library
|
||||||
runCLI(`g @nrwl/angular:lib ${mylib} --prefix=fl`);
|
runCLI(`g @nx/angular:lib ${mylib} --prefix=fl`);
|
||||||
|
|
||||||
const flags = `--facade --barrels`;
|
const flags = `--facade --barrels`;
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:ngrx flights --module=libs/${mylib}/src/lib/${mylib}.module.ts ${flags}`
|
`generate @nx/angular:ngrx flights --module=libs/${mylib}/src/lib/${mylib}.module.ts ${flags}`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/);
|
expect(runCLI(`build ${myapp}`)).toMatch(/main\.[a-z0-9]+\.js/);
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
// TODO(Colum or Leosvel): Investigate and fix these tests
|
// TODO(Colum or Leosvel): Investigate and fix these tests
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ describe('Tailwind support', () => {
|
|||||||
|
|
||||||
it('should generate a buildable library with tailwind and build correctly', () => {
|
it('should generate a buildable library with tailwind and build correctly', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:lib ${buildLibWithTailwind.name} --buildable --add-tailwind --no-interactive`
|
`generate @nx/angular:lib ${buildLibWithTailwind.name} --buildable --add-tailwind --no-interactive`
|
||||||
);
|
);
|
||||||
updateTailwindConfig(
|
updateTailwindConfig(
|
||||||
`libs/${buildLibWithTailwind.name}/tailwind.config.js`,
|
`libs/${buildLibWithTailwind.name}/tailwind.config.js`,
|
||||||
@ -210,10 +210,10 @@ describe('Tailwind support', () => {
|
|||||||
it('should set up tailwind in a previously generated buildable library and build correctly', () => {
|
it('should set up tailwind in a previously generated buildable library and build correctly', () => {
|
||||||
const buildLibSetupTailwind = uniq('build-lib-setup-tailwind');
|
const buildLibSetupTailwind = uniq('build-lib-setup-tailwind');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:lib ${buildLibSetupTailwind} --buildable --no-interactive`
|
`generate @nx/angular:lib ${buildLibSetupTailwind} --buildable --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:setup-tailwind ${buildLibSetupTailwind} --no-interactive`
|
`generate @nx/angular:setup-tailwind ${buildLibSetupTailwind} --no-interactive`
|
||||||
);
|
);
|
||||||
updateTailwindConfig(
|
updateTailwindConfig(
|
||||||
`libs/${buildLibSetupTailwind}/tailwind.config.js`,
|
`libs/${buildLibSetupTailwind}/tailwind.config.js`,
|
||||||
@ -229,7 +229,7 @@ describe('Tailwind support', () => {
|
|||||||
it('should correctly build a buildable library with a tailwind.config.js file in the project root or workspace root', () => {
|
it('should correctly build a buildable library with a tailwind.config.js file in the project root or workspace root', () => {
|
||||||
const buildLibNoProjectConfig = uniq('build-lib-no-project-config');
|
const buildLibNoProjectConfig = uniq('build-lib-no-project-config');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:lib ${buildLibNoProjectConfig} --buildable --no-interactive`
|
`generate @nx/angular:lib ${buildLibNoProjectConfig} --buildable --no-interactive`
|
||||||
);
|
);
|
||||||
createTailwindConfigFile(
|
createTailwindConfigFile(
|
||||||
`libs/${buildLibNoProjectConfig}/tailwind.config.js`,
|
`libs/${buildLibNoProjectConfig}/tailwind.config.js`,
|
||||||
@ -254,7 +254,7 @@ describe('Tailwind support', () => {
|
|||||||
|
|
||||||
it('should generate a publishable library with tailwind and build correctly', () => {
|
it('should generate a publishable library with tailwind and build correctly', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:lib ${pubLibWithTailwind.name} --publishable --add-tailwind --importPath=@${project}/${pubLibWithTailwind.name} --no-interactive`
|
`generate @nx/angular:lib ${pubLibWithTailwind.name} --publishable --add-tailwind --importPath=@${project}/${pubLibWithTailwind.name} --no-interactive`
|
||||||
);
|
);
|
||||||
updateTailwindConfig(
|
updateTailwindConfig(
|
||||||
`libs/${pubLibWithTailwind.name}/tailwind.config.js`,
|
`libs/${pubLibWithTailwind.name}/tailwind.config.js`,
|
||||||
@ -276,10 +276,10 @@ describe('Tailwind support', () => {
|
|||||||
it('should set up tailwind in a previously generated publishable library and build correctly', () => {
|
it('should set up tailwind in a previously generated publishable library and build correctly', () => {
|
||||||
const pubLibSetupTailwind = uniq('pub-lib-setup-tailwind');
|
const pubLibSetupTailwind = uniq('pub-lib-setup-tailwind');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:lib ${pubLibSetupTailwind} --publishable --importPath=@${project}/${pubLibSetupTailwind} --no-interactive`
|
`generate @nx/angular:lib ${pubLibSetupTailwind} --publishable --importPath=@${project}/${pubLibSetupTailwind} --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:setup-tailwind ${pubLibSetupTailwind} --no-interactive`
|
`generate @nx/angular:setup-tailwind ${pubLibSetupTailwind} --no-interactive`
|
||||||
);
|
);
|
||||||
updateTailwindConfig(
|
updateTailwindConfig(
|
||||||
`libs/${pubLibSetupTailwind}/tailwind.config.js`,
|
`libs/${pubLibSetupTailwind}/tailwind.config.js`,
|
||||||
@ -295,7 +295,7 @@ describe('Tailwind support', () => {
|
|||||||
it('should correctly build a publishable library with a tailwind.config.js file in the project root or workspace root', () => {
|
it('should correctly build a publishable library with a tailwind.config.js file in the project root or workspace root', () => {
|
||||||
const pubLibNoProjectConfig = uniq('pub-lib-no-project-config');
|
const pubLibNoProjectConfig = uniq('pub-lib-no-project-config');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:lib ${pubLibNoProjectConfig} --publishable --importPath=@${project}/${pubLibNoProjectConfig} --no-interactive`
|
`generate @nx/angular:lib ${pubLibNoProjectConfig} --publishable --importPath=@${project}/${pubLibNoProjectConfig} --no-interactive`
|
||||||
);
|
);
|
||||||
createTailwindConfigFile(
|
createTailwindConfigFile(
|
||||||
`libs/${pubLibNoProjectConfig}/tailwind.config.js`,
|
`libs/${pubLibNoProjectConfig}/tailwind.config.js`,
|
||||||
@ -358,10 +358,10 @@ describe('Tailwind support', () => {
|
|||||||
it('should build correctly and only output the tailwind utilities used', async () => {
|
it('should build correctly and only output the tailwind utilities used', async () => {
|
||||||
const appWithTailwind = uniq('app-with-tailwind');
|
const appWithTailwind = uniq('app-with-tailwind');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:app ${appWithTailwind} --add-tailwind --no-interactive`
|
`generate @nx/angular:app ${appWithTailwind} --add-tailwind --no-interactive`
|
||||||
);
|
);
|
||||||
updateProjectConfig(appWithTailwind, (config) => {
|
updateProjectConfig(appWithTailwind, (config) => {
|
||||||
config.targets.build.executor = '@nrwl/angular:webpack-browser';
|
config.targets.build.executor = '@nx/angular:webpack-browser';
|
||||||
config.targets.build.options = {
|
config.targets.build.options = {
|
||||||
...config.targets.build.options,
|
...config.targets.build.options,
|
||||||
buildLibsFromSource: false,
|
buildLibsFromSource: false,
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateJson,
|
updateJson,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Cypress E2E Test runner', () => {
|
describe('Cypress E2E Test runner', () => {
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
@ -25,7 +25,7 @@ describe('Cypress E2E Test runner', () => {
|
|||||||
|
|
||||||
it('should generate an app with the Cypress as e2e test runner', () => {
|
it('should generate an app with the Cypress as e2e test runner', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint`
|
`generate @nx/react:app ${myapp} --e2eTestRunner=cypress --linter=eslint`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Making sure the package.json file contains the Cypress dependency
|
// Making sure the package.json file contains the Cypress dependency
|
||||||
@ -97,7 +97,7 @@ describe('env vars', () => {
|
|||||||
`apps/${myapp}-e2e/cypress.config.ts`,
|
`apps/${myapp}-e2e/cypress.config.ts`,
|
||||||
`
|
`
|
||||||
import { defineConfig } from 'cypress';
|
import { defineConfig } from 'cypress';
|
||||||
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
|
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
e2e: {
|
e2e: {
|
||||||
@ -146,7 +146,7 @@ describe('env vars', () => {
|
|||||||
it('should run e2e in parallel', () => {
|
it('should run e2e in parallel', () => {
|
||||||
const ngAppName = uniq('ng-app');
|
const ngAppName = uniq('ng-app');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:app ${ngAppName} --e2eTestRunner=cypress --linter=eslint --no-interactive`
|
`generate @nx/angular:app ${ngAppName} --e2eTestRunner=cypress --linter=eslint --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const results = runCLI(
|
const results = runCLI(
|
||||||
@ -156,8 +156,8 @@ describe('env vars', () => {
|
|||||||
expect(results).toContain('Using port 4201');
|
expect(results).toContain('Using port 4201');
|
||||||
expect(results).toContain('Successfully ran target e2e for 2 projects');
|
expect(results).toContain('Successfully ran target e2e for 2 projects');
|
||||||
checkFilesDoNotExist(
|
checkFilesDoNotExist(
|
||||||
`node_modules/@nrwl/cypress/src/executors/cypress/4200.txt`,
|
`node_modules/@nx/cypress/src/executors/cypress/4200.txt`,
|
||||||
`node_modules/@nrwl/cypress/src/executors/cypress/4201.txt`
|
`node_modules/@nx/cypress/src/executors/cypress/4201.txt`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
killPorts,
|
killPorts,
|
||||||
cleanupProject,
|
cleanupProject,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Detox', () => {
|
describe('Detox', () => {
|
||||||
const appName = uniq('myapp');
|
const appName = uniq('myapp');
|
||||||
@ -20,7 +20,7 @@ describe('Detox', () => {
|
|||||||
|
|
||||||
it('should create files and run lint command for react-native apps', async () => {
|
it('should create files and run lint command for react-native apps', async () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react-native:app ${appName} --e2eTestRunner=detox --linter=eslint --install=false`
|
`generate @nx/react-native:app ${appName} --e2eTestRunner=detox --linter=eslint --install=false`
|
||||||
);
|
);
|
||||||
checkFilesExist(`apps/${appName}-e2e/.detoxrc.json`);
|
checkFilesExist(`apps/${appName}-e2e/.detoxrc.json`);
|
||||||
checkFilesExist(`apps/${appName}-e2e/tsconfig.json`);
|
checkFilesExist(`apps/${appName}-e2e/tsconfig.json`);
|
||||||
@ -35,7 +35,7 @@ describe('Detox', () => {
|
|||||||
it('should create files and run lint command for expo apps', async () => {
|
it('should create files and run lint command for expo apps', async () => {
|
||||||
const expoAppName = uniq('myapp');
|
const expoAppName = uniq('myapp');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/expo:app ${expoAppName} --e2eTestRunner=detox --linter=eslint`
|
`generate @nx/expo:app ${expoAppName} --e2eTestRunner=detox --linter=eslint`
|
||||||
);
|
);
|
||||||
checkFilesExist(`apps/${expoAppName}-e2e/.detoxrc.json`);
|
checkFilesExist(`apps/${expoAppName}-e2e/.detoxrc.json`);
|
||||||
checkFilesExist(`apps/${expoAppName}-e2e/tsconfig.json`);
|
checkFilesExist(`apps/${expoAppName}-e2e/tsconfig.json`);
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import {
|
|||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
waitUntil,
|
waitUntil,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('EsBuild Plugin', () => {
|
describe('EsBuild Plugin', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
@ -25,7 +25,7 @@ describe('EsBuild Plugin', () => {
|
|||||||
|
|
||||||
it('should setup and build projects using build', async () => {
|
it('should setup and build projects using build', async () => {
|
||||||
const myPkg = uniq('my-pkg');
|
const myPkg = uniq('my-pkg');
|
||||||
runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=esbuild`);
|
runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`);
|
||||||
updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`);
|
updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`);
|
||||||
updateProjectConfig(myPkg, (json) => {
|
updateProjectConfig(myPkg, (json) => {
|
||||||
json.targets.build.options.assets = [`libs/${myPkg}/assets/*`];
|
json.targets.build.options.assets = [`libs/${myPkg}/assets/*`];
|
||||||
@ -114,8 +114,8 @@ describe('EsBuild Plugin', () => {
|
|||||||
packageInstall('lodash', undefined, '~4.14.0', 'prod');
|
packageInstall('lodash', undefined, '~4.14.0', 'prod');
|
||||||
const parentLib = uniq('parent-lib');
|
const parentLib = uniq('parent-lib');
|
||||||
const childLib = uniq('child-lib');
|
const childLib = uniq('child-lib');
|
||||||
runCLI(`generate @nrwl/js:lib ${parentLib} --bundler=esbuild`);
|
runCLI(`generate @nx/js:lib ${parentLib} --bundler=esbuild`);
|
||||||
runCLI(`generate @nrwl/js:lib ${childLib} --bundler=none`);
|
runCLI(`generate @nx/js:lib ${childLib} --bundler=none`);
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${parentLib}/src/index.ts`,
|
`libs/${parentLib}/src/index.ts`,
|
||||||
`
|
`
|
||||||
@ -162,7 +162,7 @@ describe('EsBuild Plugin', () => {
|
|||||||
|
|
||||||
it('should support non-bundle builds', () => {
|
it('should support non-bundle builds', () => {
|
||||||
const myPkg = uniq('my-pkg');
|
const myPkg = uniq('my-pkg');
|
||||||
runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=esbuild`);
|
runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`);
|
||||||
updateFile(`libs/${myPkg}/src/lib/${myPkg}.ts`, `console.log('Hello');\n`);
|
updateFile(`libs/${myPkg}/src/lib/${myPkg}.ts`, `console.log('Hello');\n`);
|
||||||
updateFile(`libs/${myPkg}/src/index.ts`, `import './lib/${myPkg}.js';\n`);
|
updateFile(`libs/${myPkg}/src/index.ts`, `import './lib/${myPkg}.js';\n`);
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ describe('EsBuild Plugin', () => {
|
|||||||
|
|
||||||
it('should support additional entry points', () => {
|
it('should support additional entry points', () => {
|
||||||
const myPkg = uniq('my-pkg');
|
const myPkg = uniq('my-pkg');
|
||||||
runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=esbuild`);
|
runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`);
|
||||||
updateFile(`libs/${myPkg}/src/index.ts`, `console.log('main');\n`);
|
updateFile(`libs/${myPkg}/src/index.ts`, `console.log('main');\n`);
|
||||||
updateFile(`libs/${myPkg}/src/extra.ts`, `console.log('extra');\n`);
|
updateFile(`libs/${myPkg}/src/extra.ts`, `console.log('extra');\n`);
|
||||||
updateProjectConfig(myPkg, (json) => {
|
updateProjectConfig(myPkg, (json) => {
|
||||||
@ -198,7 +198,7 @@ describe('EsBuild Plugin', () => {
|
|||||||
|
|
||||||
it('should support external esbuild.config.js file', async () => {
|
it('should support external esbuild.config.js file', async () => {
|
||||||
const myPkg = uniq('my-pkg');
|
const myPkg = uniq('my-pkg');
|
||||||
runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=esbuild`);
|
runCLI(`generate @nx/js:lib ${myPkg} --bundler=esbuild`);
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${myPkg}/esbuild.config.js`,
|
`libs/${myPkg}/esbuild.config.js`,
|
||||||
`console.log('custom config loaded');\nmodule.exports = {};\n`
|
`console.log('custom config loaded');\nmodule.exports = {};\n`
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import {
|
|||||||
runCommandUntil,
|
runCommandUntil,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|
||||||
describe('expo', () => {
|
describe('expo', () => {
|
||||||
@ -22,9 +22,9 @@ describe('expo', () => {
|
|||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
proj = newProject();
|
proj = newProject();
|
||||||
runCLI(`generate @nrwl/expo:application ${appName} --no-interactive`);
|
runCLI(`generate @nx/expo:application ${appName} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/expo:library ${libName} --buildable --publishable --importPath=${proj}/${libName}`
|
`generate @nx/expo:library ${libName} --buildable --publishable --importPath=${proj}/${libName}`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
afterAll(() => cleanupProject());
|
afterAll(() => cleanupProject());
|
||||||
@ -33,7 +33,7 @@ describe('expo', () => {
|
|||||||
const componentName = uniq('component');
|
const componentName = uniq('component');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/expo:component ${componentName} --project=${libName} --export --no-interactive`
|
`generate @nx/expo:component ${componentName} --project=${libName} --export --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(`apps/${appName}/src/app/App.tsx`, (content) => {
|
updateFile(`apps/${appName}/src/app/App.tsx`, (content) => {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { newProject, runCLI, runCLIAsync, uniq } from '@nrwl/e2e/utils';
|
import { newProject, runCLI, runCLIAsync, uniq } from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Jest root projects', () => {
|
describe('Jest root projects', () => {
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
@ -11,7 +11,7 @@ describe('Jest root projects', () => {
|
|||||||
|
|
||||||
it('should test root level app projects', async () => {
|
it('should test root level app projects', async () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:app ${myapp} --rootProject=true --no-interactive`
|
`generate @nx/angular:app ${myapp} --rootProject=true --no-interactive`
|
||||||
);
|
);
|
||||||
const rootProjectTestResults = await runCLIAsync(`test ${myapp}`);
|
const rootProjectTestResults = await runCLIAsync(`test ${myapp}`);
|
||||||
expect(rootProjectTestResults.combinedOutput).toContain(
|
expect(rootProjectTestResults.combinedOutput).toContain(
|
||||||
@ -20,9 +20,9 @@ describe('Jest root projects', () => {
|
|||||||
}, 300_000);
|
}, 300_000);
|
||||||
|
|
||||||
it('should add lib project and tests should still work', async () => {
|
it('should add lib project and tests should still work', async () => {
|
||||||
runCLI(`generate @nrwl/angular:lib ${mylib} --no-interactive`);
|
runCLI(`generate @nx/angular:lib ${mylib} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:component ${mylib} --export --standalone --project=${mylib} --no-interactive`
|
`generate @nx/angular:component ${mylib} --export --standalone --project=${mylib} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const libProjectTestResults = await runCLIAsync(`test ${mylib}`);
|
const libProjectTestResults = await runCLIAsync(`test ${mylib}`);
|
||||||
@ -45,7 +45,7 @@ describe('Jest root projects', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should test root level app projects', async () => {
|
it('should test root level app projects', async () => {
|
||||||
runCLI(`generate @nrwl/react:app ${myapp} --rootProject=true`);
|
runCLI(`generate @nx/react:app ${myapp} --rootProject=true`);
|
||||||
|
|
||||||
const rootProjectTestResults = await runCLIAsync(`test ${myapp}`);
|
const rootProjectTestResults = await runCLIAsync(`test ${myapp}`);
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ describe('Jest root projects', () => {
|
|||||||
}, 300_000);
|
}, 300_000);
|
||||||
|
|
||||||
it('should add lib project and tests should still work', async () => {
|
it('should add lib project and tests should still work', async () => {
|
||||||
runCLI(`generate @nrwl/react:lib ${mylib} --unitTestRunner=jest`);
|
runCLI(`generate @nx/react:lib ${mylib} --unitTestRunner=jest`);
|
||||||
|
|
||||||
const libProjectTestResults = await runCLIAsync(`test ${mylib}`);
|
const libProjectTestResults = await runCLIAsync(`test ${mylib}`);
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
updateFile,
|
updateFile,
|
||||||
expectJestTestsToPass,
|
expectJestTestsToPass,
|
||||||
cleanupProject,
|
cleanupProject,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Jest', () => {
|
describe('Jest', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
@ -17,15 +17,15 @@ describe('Jest', () => {
|
|||||||
afterAll(() => cleanupProject());
|
afterAll(() => cleanupProject());
|
||||||
|
|
||||||
it('should be able test projects using jest', async () => {
|
it('should be able test projects using jest', async () => {
|
||||||
await expectJestTestsToPass('@nrwl/js:lib');
|
await expectJestTestsToPass('@nx/js:lib');
|
||||||
}, 500000);
|
}, 500000);
|
||||||
|
|
||||||
it('should merge with jest config globals', async () => {
|
it('should merge with jest config globals', async () => {
|
||||||
const testGlobal = `'My Test Global'`;
|
const testGlobal = `'My Test Global'`;
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
const utilLib = uniq('util-lib');
|
const utilLib = uniq('util-lib');
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib} --unit-test-runner jest`);
|
runCLI(`generate @nx/js:lib ${mylib} --unit-test-runner jest`);
|
||||||
runCLI(`generate @nrwl/js:lib ${utilLib} --importPath=@global-fun/globals`);
|
runCLI(`generate @nx/js:lib ${utilLib} --importPath=@global-fun/globals`);
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${utilLib}/src/index.ts`,
|
`libs/${utilLib}/src/index.ts`,
|
||||||
stripIndents`
|
stripIndents`
|
||||||
@ -95,7 +95,7 @@ describe('Jest', () => {
|
|||||||
|
|
||||||
it('should set the NODE_ENV to `test`', async () => {
|
it('should set the NODE_ENV to `test`', async () => {
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib} --unit-test-runner jest`);
|
runCLI(`generate @nx/js:lib ${mylib} --unit-test-runner jest`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${mylib}/src/lib/${mylib}.spec.ts`,
|
`libs/${mylib}/src/lib/${mylib}.spec.ts`,
|
||||||
@ -113,7 +113,7 @@ describe('Jest', () => {
|
|||||||
|
|
||||||
it('should support multiple `coverageReporters` through CLI', async () => {
|
it('should support multiple `coverageReporters` through CLI', async () => {
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib} --unit-test-runner jest`);
|
runCLI(`generate @nx/js:lib ${mylib} --unit-test-runner jest`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${mylib}/src/lib/${mylib}.spec.ts`,
|
`libs/${mylib}/src/lib/${mylib}.spec.ts`,
|
||||||
@ -136,7 +136,7 @@ describe('Jest', () => {
|
|||||||
it('should be able to test node lib with babel-jest', async () => {
|
it('should be able to test node lib with babel-jest', async () => {
|
||||||
const libName = uniq('babel-test-lib');
|
const libName = uniq('babel-test-lib');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/node:lib ${libName} --buildable --importPath=@some-org/babel-test --publishable --babelJest`
|
`generate @nx/node:lib ${libName} --buildable --importPath=@some-org/babel-test --publishable --babelJest`
|
||||||
);
|
);
|
||||||
|
|
||||||
const cliResults = await runCLIAsync(`test ${libName}`);
|
const cliResults = await runCLIAsync(`test ${libName}`);
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import {
|
|||||||
newProject,
|
newProject,
|
||||||
runCLI,
|
runCLI,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('bundling libs', () => {
|
describe('bundling libs', () => {
|
||||||
let scope: string;
|
let scope: string;
|
||||||
@ -20,9 +20,9 @@ describe('bundling libs', () => {
|
|||||||
const viteLib = uniq('vitelib');
|
const viteLib = uniq('vitelib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${esbuildLib} --bundler=esbuild --no-interactive`
|
`generate @nx/js:lib ${esbuildLib} --bundler=esbuild --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(`generate @nrwl/js:lib ${viteLib} --bundler=vite --no-interactive`);
|
runCLI(`generate @nx/js:lib ${viteLib} --bundler=vite --no-interactive`);
|
||||||
|
|
||||||
runCLI(`build ${esbuildLib}`);
|
runCLI(`build ${esbuildLib}`);
|
||||||
runCLI(`build ${viteLib}`);
|
runCLI(`build ${viteLib}`);
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
|
|
||||||
describe('inlining', () => {
|
describe('inlining', () => {
|
||||||
@ -23,22 +23,22 @@ describe('inlining', () => {
|
|||||||
async (bundler) => {
|
async (bundler) => {
|
||||||
const parent = uniq('parent');
|
const parent = uniq('parent');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${parent} --bundler=${bundler} --no-interactive`
|
`generate @nx/js:lib ${parent} --bundler=${bundler} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const buildable = uniq('buildable');
|
const buildable = uniq('buildable');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${buildable} --bundler=${bundler} --no-interactive`
|
`generate @nx/js:lib ${buildable} --bundler=${bundler} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const buildableTwo = uniq('buildabletwo');
|
const buildableTwo = uniq('buildabletwo');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${buildableTwo} --bundler=${bundler} --no-interactive`
|
`generate @nx/js:lib ${buildableTwo} --bundler=${bundler} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const nonBuildable = uniq('nonbuildable');
|
const nonBuildable = uniq('nonbuildable');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${nonBuildable} --bundler=none --no-interactive`
|
`generate @nx/js:lib ${nonBuildable} --bundler=none --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(`libs/${parent}/src/lib/${parent}.ts`, () => {
|
updateFile(`libs/${parent}/src/lib/${parent}.ts`, () => {
|
||||||
@ -102,15 +102,13 @@ describe('inlining', () => {
|
|||||||
|
|
||||||
it('should inline nesting libraries', async () => {
|
it('should inline nesting libraries', async () => {
|
||||||
const parent = uniq('parent');
|
const parent = uniq('parent');
|
||||||
runCLI(`generate @nrwl/js:lib ${parent} --no-interactive`);
|
runCLI(`generate @nx/js:lib ${parent} --no-interactive`);
|
||||||
|
|
||||||
const child = uniq('child');
|
const child = uniq('child');
|
||||||
runCLI(`generate @nrwl/js:lib ${child} --bundler=none --no-interactive`);
|
runCLI(`generate @nx/js:lib ${child} --bundler=none --no-interactive`);
|
||||||
|
|
||||||
const grandChild = uniq('grandchild');
|
const grandChild = uniq('grandchild');
|
||||||
runCLI(
|
runCLI(`generate @nx/js:lib ${grandChild} --bundler=none --no-interactive`);
|
||||||
`generate @nrwl/js:lib ${grandChild} --bundler=none --no-interactive`
|
|
||||||
);
|
|
||||||
|
|
||||||
updateFile(`libs/${parent}/src/lib/${parent}.ts`, () => {
|
updateFile(`libs/${parent}/src/lib/${parent}.ts`, () => {
|
||||||
return `
|
return `
|
||||||
|
|||||||
@ -29,7 +29,7 @@ describe('js e2e', () => {
|
|||||||
|
|
||||||
it('should create libs with js executors (--bundler=swc)', async () => {
|
it('should create libs with js executors (--bundler=swc)', async () => {
|
||||||
const lib = uniq('lib');
|
const lib = uniq('lib');
|
||||||
runCLI(`generate @nrwl/js:lib ${lib} --bundler=swc --no-interactive`);
|
runCLI(`generate @nx/js:lib ${lib} --bundler=swc --no-interactive`);
|
||||||
|
|
||||||
const libPackageJson = readJson(`libs/${lib}/package.json`);
|
const libPackageJson = readJson(`libs/${lib}/package.json`);
|
||||||
expect(libPackageJson.scripts).toBeUndefined();
|
expect(libPackageJson.scripts).toBeUndefined();
|
||||||
@ -48,7 +48,7 @@ describe('js e2e', () => {
|
|||||||
checkFilesDoNotExist(`libs/${lib}/.babelrc`);
|
checkFilesDoNotExist(`libs/${lib}/.babelrc`);
|
||||||
|
|
||||||
const parentLib = uniq('parentlib');
|
const parentLib = uniq('parentlib');
|
||||||
runCLI(`generate @nrwl/js:lib ${parentLib} --bundler=swc --no-interactive`);
|
runCLI(`generate @nx/js:lib ${parentLib} --bundler=swc --no-interactive`);
|
||||||
const parentLibPackageJson = readJson(`libs/${parentLib}/package.json`);
|
const parentLibPackageJson = readJson(`libs/${parentLib}/package.json`);
|
||||||
expect(parentLibPackageJson.scripts).toBeUndefined();
|
expect(parentLibPackageJson.scripts).toBeUndefined();
|
||||||
expect((await runCLIAsync(`test ${parentLib}`)).combinedOutput).toContain(
|
expect((await runCLIAsync(`test ${parentLib}`)).combinedOutput).toContain(
|
||||||
@ -120,7 +120,7 @@ describe('js e2e', () => {
|
|||||||
|
|
||||||
it('should handle swcrc path mappings', async () => {
|
it('should handle swcrc path mappings', async () => {
|
||||||
const lib = uniq('lib');
|
const lib = uniq('lib');
|
||||||
runCLI(`generate @nrwl/js:lib ${lib} --bundler=swc --no-interactive`);
|
runCLI(`generate @nx/js:lib ${lib} --bundler=swc --no-interactive`);
|
||||||
|
|
||||||
// add a dummy x.ts file for path mappings
|
// add a dummy x.ts file for path mappings
|
||||||
updateFile(
|
updateFile(
|
||||||
|
|||||||
@ -28,7 +28,7 @@ describe('js e2e', () => {
|
|||||||
|
|
||||||
it('should create libs with js executors (--compiler=tsc)', async () => {
|
it('should create libs with js executors (--compiler=tsc)', async () => {
|
||||||
const lib = uniq('lib');
|
const lib = uniq('lib');
|
||||||
runCLI(`generate @nrwl/js:lib ${lib} --bundler=tsc --no-interactive`);
|
runCLI(`generate @nx/js:lib ${lib} --bundler=tsc --no-interactive`);
|
||||||
const libPackageJson = readJson(`libs/${lib}/package.json`);
|
const libPackageJson = readJson(`libs/${lib}/package.json`);
|
||||||
expect(libPackageJson.scripts).toBeUndefined();
|
expect(libPackageJson.scripts).toBeUndefined();
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ describe('js e2e', () => {
|
|||||||
libBuildProcess.kill();
|
libBuildProcess.kill();
|
||||||
|
|
||||||
const parentLib = uniq('parentlib');
|
const parentLib = uniq('parentlib');
|
||||||
runCLI(`generate @nrwl/js:lib ${parentLib} --bundler=tsc --no-interactive`);
|
runCLI(`generate @nx/js:lib ${parentLib} --bundler=tsc --no-interactive`);
|
||||||
const parentLibPackageJson = readJson(`libs/${parentLib}/package.json`);
|
const parentLibPackageJson = readJson(`libs/${parentLib}/package.json`);
|
||||||
expect(parentLibPackageJson.scripts).toBeUndefined();
|
expect(parentLibPackageJson.scripts).toBeUndefined();
|
||||||
expect((await runCLIAsync(`test ${parentLib}`)).combinedOutput).toContain(
|
expect((await runCLIAsync(`test ${parentLib}`)).combinedOutput).toContain(
|
||||||
@ -154,7 +154,7 @@ describe('js e2e', () => {
|
|||||||
it('should not create a `.babelrc` file when creating libs with js executors (--compiler=tsc)', () => {
|
it('should not create a `.babelrc` file when creating libs with js executors (--compiler=tsc)', () => {
|
||||||
const lib = uniq('lib');
|
const lib = uniq('lib');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${lib} --compiler=tsc --includeBabelRc=false --no-interactive`
|
`generate @nx/js:lib ${lib} --compiler=tsc --includeBabelRc=false --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
checkFilesDoNotExist(`libs/${lib}/.babelrc`);
|
checkFilesDoNotExist(`libs/${lib}/.babelrc`);
|
||||||
@ -169,7 +169,7 @@ describe('package.json updates', () => {
|
|||||||
it('should update package.json with detected dependencies', async () => {
|
it('should update package.json with detected dependencies', async () => {
|
||||||
const pmc = getPackageManagerCommand();
|
const pmc = getPackageManagerCommand();
|
||||||
const lib = uniq('lib');
|
const lib = uniq('lib');
|
||||||
runCLI(`generate @nrwl/js:lib ${lib} --bundler=tsc --no-interactive`);
|
runCLI(`generate @nx/js:lib ${lib} --bundler=tsc --no-interactive`);
|
||||||
|
|
||||||
// Add a dependency for this lib to check the built package.json
|
// Add a dependency for this lib to check the built package.json
|
||||||
runCommand(`${pmc.addProd} react`);
|
runCommand(`${pmc.addProd} react`);
|
||||||
|
|||||||
@ -24,7 +24,7 @@ describe('js e2e', () => {
|
|||||||
it('should create libs with npm scripts', () => {
|
it('should create libs with npm scripts', () => {
|
||||||
const npmScriptsLib = uniq('npmscriptslib');
|
const npmScriptsLib = uniq('npmscriptslib');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${npmScriptsLib} --config=npm-scripts --no-interactive`
|
`generate @nx/js:lib ${npmScriptsLib} --config=npm-scripts --no-interactive`
|
||||||
);
|
);
|
||||||
const libPackageJson = readJson(`libs/${npmScriptsLib}/package.json`);
|
const libPackageJson = readJson(`libs/${npmScriptsLib}/package.json`);
|
||||||
expect(libPackageJson.scripts.test).toBeDefined();
|
expect(libPackageJson.scripts.test).toBeDefined();
|
||||||
@ -39,10 +39,10 @@ describe('js e2e', () => {
|
|||||||
|
|
||||||
it('should allow wildcard ts path alias', async () => {
|
it('should allow wildcard ts path alias', async () => {
|
||||||
const base = uniq('base');
|
const base = uniq('base');
|
||||||
runCLI(`generate @nrwl/js:lib ${base} --bundler=tsc --no-interactive`);
|
runCLI(`generate @nx/js:lib ${base} --bundler=tsc --no-interactive`);
|
||||||
|
|
||||||
const lib = uniq('lib');
|
const lib = uniq('lib');
|
||||||
runCLI(`generate @nrwl/js:lib ${lib} --bundler=tsc --no-interactive`);
|
runCLI(`generate @nx/js:lib ${lib} --bundler=tsc --no-interactive`);
|
||||||
|
|
||||||
updateFile(`libs/${base}/src/index.ts`, () => {
|
updateFile(`libs/${base}/src/index.ts`, () => {
|
||||||
return `
|
return `
|
||||||
@ -93,7 +93,7 @@ export function ${lib}Wildcard() {
|
|||||||
const libName = uniq('mylib');
|
const libName = uniq('mylib');
|
||||||
const dirName = uniq('dir');
|
const dirName = uniq('dir');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${libName} --directory ${dirName}`);
|
runCLI(`generate @nx/js:lib ${libName} --directory ${dirName}`);
|
||||||
|
|
||||||
checkFilesExist(
|
checkFilesExist(
|
||||||
`libs/${dirName}/${libName}/src/index.ts`,
|
`libs/${dirName}/${libName}/src/index.ts`,
|
||||||
@ -117,8 +117,8 @@ export function ${lib}Wildcard() {
|
|||||||
const consumerLib = uniq('consumer');
|
const consumerLib = uniq('consumer');
|
||||||
const producerLib = uniq('producer');
|
const producerLib = uniq('producer');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${consumerLib} --bundler=none`);
|
runCLI(`generate @nx/js:lib ${consumerLib} --bundler=none`);
|
||||||
runCLI(`generate @nrwl/js:lib ${producerLib} --bundler=none`);
|
runCLI(`generate @nx/js:lib ${producerLib} --bundler=none`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${producerLib}/src/lib/${producerLib}.ts`,
|
`libs/${producerLib}/src/lib/${producerLib}.ts`,
|
||||||
@ -151,7 +151,7 @@ export function ${lib}Wildcard() {
|
|||||||
|
|
||||||
it('should not be able to be built when it has no bundler', () => {
|
it('should not be able to be built when it has no bundler', () => {
|
||||||
const nonBuildable = uniq('buildable');
|
const nonBuildable = uniq('buildable');
|
||||||
runCLI(`generate @nrwl/js:lib ${nonBuildable} --bundler=none`);
|
runCLI(`generate @nx/js:lib ${nonBuildable} --bundler=none`);
|
||||||
|
|
||||||
expect(() => runCLI(`build ${nonBuildable}`)).toThrow();
|
expect(() => runCLI(`build ${nonBuildable}`)).toThrow();
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* These minimal smoke tests are here to ensure that we do not break assumptions on the lerna side
|
* These minimal smoke tests are here to ensure that we do not break assumptions on the lerna side
|
||||||
* when making updates to nx or @nrwl/devkit.
|
* when making updates to nx or @nx/devkit.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -9,7 +9,7 @@ import {
|
|||||||
runLernaCLI,
|
runLernaCLI,
|
||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
updateJson,
|
updateJson,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
expect.addSnapshotSerializer({
|
expect.addSnapshotSerializer({
|
||||||
serialize(str: string) {
|
serialize(str: string) {
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -28,8 +28,8 @@ describe('Linter', () => {
|
|||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
projScope = newProject();
|
projScope = newProject();
|
||||||
runCLI(`generate @nrwl/react:app ${myapp} --tags=validtag`);
|
runCLI(`generate @nx/react:app ${myapp} --tags=validtag`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
});
|
});
|
||||||
afterAll(() => cleanupProject());
|
afterAll(() => cleanupProject());
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ describe('Linter', () => {
|
|||||||
|
|
||||||
// Generate a new rule (should also scaffold the required workspace project and tests)
|
// Generate a new rule (should also scaffold the required workspace project and tests)
|
||||||
const newRuleName = 'e2e-test-rule-name';
|
const newRuleName = 'e2e-test-rule-name';
|
||||||
runCLI(`generate @nrwl/linter:workspace-rule ${newRuleName}`);
|
runCLI(`generate @nx/linter:workspace-rule ${newRuleName}`);
|
||||||
|
|
||||||
// Ensure that the unit tests for the new rule are runnable
|
// Ensure that the unit tests for the new rule are runnable
|
||||||
const unitTestsOutput = runCLI(`test eslint-rules`);
|
const unitTestsOutput = runCLI(`test eslint-rules`);
|
||||||
@ -192,10 +192,10 @@ describe('Linter', () => {
|
|||||||
const invalidtaglib = uniq('invalidtaglib');
|
const invalidtaglib = uniq('invalidtaglib');
|
||||||
const validtaglib = uniq('validtaglib');
|
const validtaglib = uniq('validtaglib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${myapp2}`);
|
runCLI(`generate @nx/react:app ${myapp2}`);
|
||||||
runCLI(`generate @nrwl/react:lib ${lazylib}`);
|
runCLI(`generate @nx/react:lib ${lazylib}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${invalidtaglib} --tags=invalidtag`);
|
runCLI(`generate @nx/js:lib ${invalidtaglib} --tags=invalidtag`);
|
||||||
runCLI(`generate @nrwl/js:lib ${validtaglib} --tags=validtag`);
|
runCLI(`generate @nx/js:lib ${validtaglib} --tags=validtag`);
|
||||||
|
|
||||||
const eslint = readJson('.eslintrc.json');
|
const eslint = readJson('.eslintrc.json');
|
||||||
eslint.overrides[0].rules[
|
eslint.overrides[0].rules[
|
||||||
@ -253,9 +253,9 @@ describe('Linter', () => {
|
|||||||
const libC = uniq('tslib-c');
|
const libC = uniq('tslib-c');
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
runCLI(`generate @nrwl/js:lib ${libA}`);
|
runCLI(`generate @nx/js:lib ${libA}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${libB}`);
|
runCLI(`generate @nx/js:lib ${libB}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${libC}`);
|
runCLI(`generate @nx/js:lib ${libC}`);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create tslib-a structure
|
* create tslib-a structure
|
||||||
@ -493,7 +493,7 @@ describe('Linter', () => {
|
|||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${myapp} --rootProject=true`);
|
runCLI(`generate @nx/react:app ${myapp} --rootProject=true`);
|
||||||
verifySuccessfulStandaloneSetup(myapp);
|
verifySuccessfulStandaloneSetup(myapp);
|
||||||
|
|
||||||
let appEslint = readJson('.eslintrc.json');
|
let appEslint = readJson('.eslintrc.json');
|
||||||
@ -504,7 +504,7 @@ describe('Linter', () => {
|
|||||||
expect(appEslint.overrides[1].extends).toBeDefined();
|
expect(appEslint.overrides[1].extends).toBeDefined();
|
||||||
expect(e2eEslint.overrides[0].extends).toBeDefined();
|
expect(e2eEslint.overrides[0].extends).toBeDefined();
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib} --unitTestRunner=jest`);
|
runCLI(`generate @nx/js:lib ${mylib} --unitTestRunner=jest`);
|
||||||
verifySuccessfulMigratedSetup(myapp, mylib);
|
verifySuccessfulMigratedSetup(myapp, mylib);
|
||||||
|
|
||||||
appEslint = readJson(`.eslintrc.json`);
|
appEslint = readJson(`.eslintrc.json`);
|
||||||
@ -521,7 +521,7 @@ describe('Linter', () => {
|
|||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:app ${myapp} --rootProject=true --no-interactive`
|
`generate @nx/angular:app ${myapp} --rootProject=true --no-interactive`
|
||||||
);
|
);
|
||||||
verifySuccessfulStandaloneSetup(myapp);
|
verifySuccessfulStandaloneSetup(myapp);
|
||||||
|
|
||||||
@ -533,7 +533,7 @@ describe('Linter', () => {
|
|||||||
expect(appEslint.overrides[1].extends).toBeDefined();
|
expect(appEslint.overrides[1].extends).toBeDefined();
|
||||||
expect(e2eEslint.overrides[0].extends).toBeDefined();
|
expect(e2eEslint.overrides[0].extends).toBeDefined();
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib} --no-interactive`);
|
runCLI(`generate @nx/js:lib ${mylib} --no-interactive`);
|
||||||
verifySuccessfulMigratedSetup(myapp, mylib);
|
verifySuccessfulMigratedSetup(myapp, mylib);
|
||||||
|
|
||||||
appEslint = readJson(`.eslintrc.json`);
|
appEslint = readJson(`.eslintrc.json`);
|
||||||
@ -552,7 +552,7 @@ describe('Linter', () => {
|
|||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/node:app ${myapp} --rootProject=true --no-interactive`
|
`generate @nx/node:app ${myapp} --rootProject=true --no-interactive`
|
||||||
);
|
);
|
||||||
verifySuccessfulStandaloneSetup(myapp);
|
verifySuccessfulStandaloneSetup(myapp);
|
||||||
|
|
||||||
@ -564,7 +564,7 @@ describe('Linter', () => {
|
|||||||
expect(appEslint.overrides[1].extends).toBeDefined();
|
expect(appEslint.overrides[1].extends).toBeDefined();
|
||||||
expect(e2eEslint.overrides[0].extends).toBeDefined();
|
expect(e2eEslint.overrides[0].extends).toBeDefined();
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib} --no-interactive`);
|
runCLI(`generate @nx/js:lib ${mylib} --no-interactive`);
|
||||||
verifySuccessfulMigratedSetup(myapp, mylib);
|
verifySuccessfulMigratedSetup(myapp, mylib);
|
||||||
|
|
||||||
appEslint = readJson(`.eslintrc.json`);
|
appEslint = readJson(`.eslintrc.json`);
|
||||||
|
|||||||
@ -2,11 +2,10 @@ import {
|
|||||||
createFile,
|
createFile,
|
||||||
newProject,
|
newProject,
|
||||||
runCLI,
|
runCLI,
|
||||||
|
runCypressTests,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
runCypressTests,
|
} from '@nx/e2e/utils';
|
||||||
updateJson,
|
|
||||||
} from '@nrwl/e2e/utils';
|
|
||||||
|
|
||||||
describe('NextJs Component Testing', () => {
|
describe('NextJs Component Testing', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
@ -66,9 +65,9 @@ describe('NextJs Component Testing', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function createAppWithCt(appName: string) {
|
function createAppWithCt(appName: string) {
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/next:app ${appName} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:component button --project=${appName} --directory=components --flat --no-interactive`
|
`generate @nx/next:component button --project=${appName} --directory=components --flat --no-interactive`
|
||||||
);
|
);
|
||||||
createFile(
|
createFile(
|
||||||
`apps/${appName}/public/data.json`,
|
`apps/${appName}/public/data.json`,
|
||||||
@ -100,13 +99,13 @@ export default function Button(props: ButtonProps) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:cypress-component-configuration --project=${appName} --generate-tests --no-interactive`
|
`generate @nx/next:cypress-component-configuration --project=${appName} --generate-tests --no-interactive`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addTailwindToApp(appName: string) {
|
function addTailwindToApp(appName: string) {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:setup-tailwind --project=${appName} --no-interactive`
|
`generate @nx/react:setup-tailwind --project=${appName} --no-interactive`
|
||||||
);
|
);
|
||||||
updateFile(`apps/${appName}/cypress/support/component.ts`, (content) => {
|
updateFile(`apps/${appName}/cypress/support/component.ts`, (content) => {
|
||||||
return `${content}
|
return `${content}
|
||||||
@ -134,11 +133,11 @@ describe(Button.name, () => {
|
|||||||
|
|
||||||
function createLibWithCt(libName: string, buildable: boolean) {
|
function createLibWithCt(libName: string, buildable: boolean) {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:lib ${libName} --buildable=${buildable} --no-interactive`
|
`generate @nx/next:lib ${libName} --buildable=${buildable} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:component button --project=${libName} --flat --export --no-interactive`
|
`generate @nx/next:component button --project=${libName} --flat --export --no-interactive`
|
||||||
);
|
);
|
||||||
updateFile(`libs/${libName}/src/lib/button.tsx`, (content) => {
|
updateFile(`libs/${libName}/src/lib/button.tsx`, (content) => {
|
||||||
return `import { useEffect, useState } from 'react';
|
return `import { useEffect, useState } from 'react';
|
||||||
@ -155,13 +154,13 @@ export default Button;
|
|||||||
});
|
});
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:cypress-component-configuration --project=${libName} --generate-tests --no-interactive`
|
`generate @nx/next:cypress-component-configuration --project=${libName} --generate-tests --no-interactive`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function addTailwindToLib(libName: string) {
|
function addTailwindToLib(libName: string) {
|
||||||
createFile(`libs/${libName}/src/lib/styles.css`, ``);
|
createFile(`libs/${libName}/src/lib/styles.css`, ``);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:setup-tailwind --project=${libName} --no-interactive`
|
`generate @nx/react:setup-tailwind --project=${libName} --no-interactive`
|
||||||
);
|
);
|
||||||
updateFile(`libs/${libName}/src/lib/button.cy.tsx`, (content) => {
|
updateFile(`libs/${libName}/src/lib/button.cy.tsx`, (content) => {
|
||||||
return `import * as React from 'react';
|
return `import * as React from 'react';
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
runCommand,
|
runCommand,
|
||||||
uniq,
|
uniq,
|
||||||
updateJson,
|
updateJson,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Next.js Applications', () => {
|
describe('Next.js Applications', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
@ -24,14 +24,14 @@ describe('Next.js Applications', () => {
|
|||||||
it('should run a Next.js based Storybook setup', async () => {
|
it('should run a Next.js based Storybook setup', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/next:app ${appName} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:component Foo --project=${appName} --no-interactive`
|
`generate @nx/next:component Foo --project=${appName} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Currently due to auto-installing peer deps in pnpm, the generator can fail while installing deps with unmet peet deps.
|
// Currently due to auto-installing peer deps in pnpm, the generator can fail while installing deps with unmet peet deps.
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:storybook-configuration ${appName} --generateStories --no-interactive`,
|
`generate @nx/react:storybook-configuration ${appName} --generateStories --no-interactive`,
|
||||||
{
|
{
|
||||||
silenceError: true,
|
silenceError: true,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { cleanupProject, newProject, runCLI, uniq } from '@nrwl/e2e/utils';
|
import { cleanupProject, newProject, runCLI, uniq } from '@nx/e2e/utils';
|
||||||
import { checkApp } from './utils';
|
import { checkApp } from './utils';
|
||||||
|
|
||||||
describe('Next.js apps', () => {
|
describe('Next.js apps', () => {
|
||||||
@ -22,7 +22,7 @@ describe('Next.js apps', () => {
|
|||||||
xit('should support different --style options', async () => {
|
xit('should support different --style options', async () => {
|
||||||
const lessApp = uniq('app');
|
const lessApp = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${lessApp} --no-interactive --style=less`);
|
runCLI(`generate @nx/next:app ${lessApp} --no-interactive --style=less`);
|
||||||
|
|
||||||
await checkApp(lessApp, {
|
await checkApp(lessApp, {
|
||||||
checkUnitTest: false,
|
checkUnitTest: false,
|
||||||
@ -33,9 +33,7 @@ describe('Next.js apps', () => {
|
|||||||
|
|
||||||
const stylusApp = uniq('app');
|
const stylusApp = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(`generate @nx/next:app ${stylusApp} --no-interactive --style=styl`);
|
||||||
`generate @nrwl/next:app ${stylusApp} --no-interactive --style=styl`
|
|
||||||
);
|
|
||||||
|
|
||||||
await checkApp(stylusApp, {
|
await checkApp(stylusApp, {
|
||||||
checkUnitTest: false,
|
checkUnitTest: false,
|
||||||
@ -47,7 +45,7 @@ describe('Next.js apps', () => {
|
|||||||
const scApp = uniq('app');
|
const scApp = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:app ${scApp} --no-interactive --style=styled-components`
|
`generate @nx/next:app ${scApp} --no-interactive --style=styled-components`
|
||||||
);
|
);
|
||||||
|
|
||||||
await checkApp(scApp, {
|
await checkApp(scApp, {
|
||||||
@ -60,7 +58,7 @@ describe('Next.js apps', () => {
|
|||||||
const emotionApp = uniq('app');
|
const emotionApp = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:app ${emotionApp} --no-interactive --style=@emotion/styled`
|
`generate @nx/next:app ${emotionApp} --no-interactive --style=@emotion/styled`
|
||||||
);
|
);
|
||||||
|
|
||||||
await checkApp(emotionApp, {
|
await checkApp(emotionApp, {
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import * as http from 'http';
|
import * as http from 'http';
|
||||||
import { checkApp } from './utils';
|
import { checkApp } from './utils';
|
||||||
|
|
||||||
@ -44,11 +44,11 @@ describe('Next.js Applications', () => {
|
|||||||
const jsLib = uniq('tslib');
|
const jsLib = uniq('tslib');
|
||||||
const buildableLib = uniq('buildablelib');
|
const buildableLib = uniq('buildablelib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive --style=css`);
|
runCLI(`generate @nx/next:app ${appName} --no-interactive --style=css`);
|
||||||
runCLI(`generate @nrwl/next:lib ${nextLib} --no-interactive`);
|
runCLI(`generate @nx/next:lib ${nextLib} --no-interactive`);
|
||||||
runCLI(`generate @nrwl/js:lib ${jsLib} --no-interactive`);
|
runCLI(`generate @nx/js:lib ${jsLib} --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${buildableLib} --no-interactive --bundler=vite`
|
`generate @nx/js:lib ${buildableLib} --no-interactive --bundler=vite`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create file in public that should be copied to dist
|
// Create file in public that should be copied to dist
|
||||||
@ -71,7 +71,7 @@ describe('Next.js Applications', () => {
|
|||||||
// create a css file in node_modules so that it can be imported in a lib
|
// create a css file in node_modules so that it can be imported in a lib
|
||||||
// to test that it works as expected
|
// to test that it works as expected
|
||||||
updateFile(
|
updateFile(
|
||||||
'node_modules/@nrwl/next/test-styles.css',
|
'node_modules/@nx/next/test-styles.css',
|
||||||
'h1 { background-color: red; }'
|
'h1 { background-color: red; }'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ describe('Next.js Applications', () => {
|
|||||||
cwd: distPath,
|
cwd: distPath,
|
||||||
});
|
});
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/workspace:run-commands serve-prod --project ${appName} --cwd=dist/apps/${appName} --command="npx next start --port=${selfContainedPort}"`
|
`generate @nx/workspace:run-commands serve-prod --project ${appName} --cwd=dist/apps/${appName} --command="npx next start --port=${selfContainedPort}"`
|
||||||
);
|
);
|
||||||
const selfContainedProcess = await runCommandUntil(
|
const selfContainedProcess = await runCommandUntil(
|
||||||
`run ${appName}:serve-prod`,
|
`run ${appName}:serve-prod`,
|
||||||
@ -201,7 +201,7 @@ describe('Next.js Applications', () => {
|
|||||||
|
|
||||||
it('should build and install pruned lock file', () => {
|
it('should build and install pruned lock file', () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive --style=css`);
|
runCLI(`generate @nx/next:app ${appName} --no-interactive --style=css`);
|
||||||
|
|
||||||
const result = runCLI(`build ${appName} --generateLockfile=true`);
|
const result = runCLI(`build ${appName} --generateLockfile=true`);
|
||||||
expect(result).not.toMatch(/Graph is not consistent/);
|
expect(result).not.toMatch(/Graph is not consistent/);
|
||||||
@ -220,8 +220,8 @@ describe('Next.js Applications', () => {
|
|||||||
|
|
||||||
const port = 4200;
|
const port = 4200;
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName}`);
|
runCLI(`generate @nx/next:app ${appName}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${jsLib} --no-interactive`);
|
runCLI(`generate @nx/js:lib ${jsLib} --no-interactive`);
|
||||||
|
|
||||||
const proxyConf = {
|
const proxyConf = {
|
||||||
'/external-api': {
|
'/external-api': {
|
||||||
@ -286,7 +286,7 @@ describe('Next.js Applications', () => {
|
|||||||
it('should support custom next.config.js and output it in dist', async () => {
|
it('should support custom next.config.js and output it in dist', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive --style=css`);
|
runCLI(`generate @nx/next:app ${appName} --no-interactive --style=css`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`apps/${appName}/next.config.js`,
|
`apps/${appName}/next.config.js`,
|
||||||
@ -343,7 +343,7 @@ describe('Next.js Applications', () => {
|
|||||||
it('should support --js flag', async () => {
|
it('should support --js flag', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive --js`);
|
runCLI(`generate @nx/next:app ${appName} --no-interactive --js`);
|
||||||
|
|
||||||
checkFilesExist(`apps/${appName}/pages/index.js`);
|
checkFilesExist(`apps/${appName}/pages/index.js`);
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ describe('Next.js Applications', () => {
|
|||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:lib ${libName} --no-interactive --style=none --js`
|
`generate @nx/next:lib ${libName} --no-interactive --style=none --js`
|
||||||
);
|
);
|
||||||
|
|
||||||
const mainPath = `apps/${appName}/pages/index.js`;
|
const mainPath = `apps/${appName}/pages/index.js`;
|
||||||
@ -395,7 +395,7 @@ describe('Next.js Applications', () => {
|
|||||||
it('should support --no-swc flag', async () => {
|
it('should support --no-swc flag', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive --no-swc`);
|
runCLI(`generate @nx/next:app ${appName} --no-interactive --no-swc`);
|
||||||
|
|
||||||
// Next.js enables SWC when custom .babelrc is not provided.
|
// Next.js enables SWC when custom .babelrc is not provided.
|
||||||
checkFilesExist(`apps/${appName}/.babelrc`);
|
checkFilesExist(`apps/${appName}/.babelrc`);
|
||||||
@ -413,7 +413,7 @@ describe('Next.js Applications', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:app ${appName} --style=css --no-interactive --custom-server`
|
`generate @nx/next:app ${appName} --style=css --no-interactive --custom-server`
|
||||||
);
|
);
|
||||||
|
|
||||||
checkFilesExist(`apps/${appName}/server/main.ts`);
|
checkFilesExist(`apps/${appName}/server/main.ts`);
|
||||||
@ -430,7 +430,7 @@ describe('Next.js Applications', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/next:app ${appName} --style=css --appDir --no-interactive`
|
`generate @nx/next:app ${appName} --style=css --appDir --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
checkFilesExist(`apps/${appName}/app/api/hello/route.ts`);
|
checkFilesExist(`apps/${appName}/app/api/hello/route.ts`);
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
|
|
||||||
describe('Node Applications + esbuild', () => {
|
describe('Node Applications + esbuild', () => {
|
||||||
@ -19,7 +19,7 @@ describe('Node Applications + esbuild', () => {
|
|||||||
it('should generate an app using esbuild', async () => {
|
it('should generate an app using esbuild', async () => {
|
||||||
const app = uniq('nodeapp');
|
const app = uniq('nodeapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/node:app ${app} --bundler=esbuild --no-interactive`);
|
runCLI(`generate @nx/node:app ${app} --bundler=esbuild --no-interactive`);
|
||||||
|
|
||||||
checkFilesDoNotExist(`apps/${app}/webpack.config.js`);
|
checkFilesDoNotExist(`apps/${app}/webpack.config.js`);
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import {
|
|||||||
runCommandUntil,
|
runCommandUntil,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Node Applications + webpack', () => {
|
describe('Node Applications + webpack', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
@ -66,19 +66,17 @@ describe('Node Applications + webpack', () => {
|
|||||||
const koaApp = uniq('koaapp');
|
const koaApp = uniq('koaapp');
|
||||||
const nestApp = uniq('koaapp');
|
const nestApp = uniq('koaapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/node:lib ${testLib1}`);
|
runCLI(`generate @nx/node:lib ${testLib1}`);
|
||||||
runCLI(`generate @nrwl/node:lib ${testLib2} --importPath=@acme/test2`);
|
runCLI(`generate @nx/node:lib ${testLib2} --importPath=@acme/test2`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/node:app ${expressApp} --framework=express --no-interactive`
|
`generate @nx/node:app ${expressApp} --framework=express --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/node:app ${fastifyApp} --framework=fastify --no-interactive`
|
`generate @nx/node:app ${fastifyApp} --framework=fastify --no-interactive`
|
||||||
);
|
);
|
||||||
|
runCLI(`generate @nx/node:app ${koaApp} --framework=koa --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/node:app ${koaApp} --framework=koa --no-interactive`
|
`generate @nx/node:app ${nestApp} --framework=nest --bundler=webpack --no-interactive`
|
||||||
);
|
|
||||||
runCLI(
|
|
||||||
`generate @nrwl/node:app ${nestApp} --framework=nest --bundler=webpack --no-interactive`
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Use esbuild by default
|
// Use esbuild by default
|
||||||
@ -122,7 +120,7 @@ describe('Node Applications + webpack', () => {
|
|||||||
const expressApp = uniq('expressapp');
|
const expressApp = uniq('expressapp');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/node:app ${expressApp} --framework=express --docker --no-interactive`
|
`generate @nx/node:app ${expressApp} --framework=express --docker --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
checkFilesExist(`apps/${expressApp}/Dockerfile`);
|
checkFilesExist(`apps/${expressApp}/Dockerfile`);
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
|
|
||||||
describe('Node Applications + webpack', () => {
|
describe('Node Applications + webpack', () => {
|
||||||
@ -19,7 +19,7 @@ describe('Node Applications + webpack', () => {
|
|||||||
it('should generate an app using webpack', async () => {
|
it('should generate an app using webpack', async () => {
|
||||||
const app = uniq('nodeapp');
|
const app = uniq('nodeapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/node:app ${app} --bundler=webpack --no-interactive`);
|
runCLI(`generate @nx/node:app ${app} --bundler=webpack --no-interactive`);
|
||||||
|
|
||||||
checkFilesExist(`apps/${app}/webpack.config.js`);
|
checkFilesExist(`apps/${app}/webpack.config.js`);
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { exec, execSync } from 'child_process';
|
import { exec, execSync } from 'child_process';
|
||||||
import * as http from 'http';
|
import * as http from 'http';
|
||||||
import { getLockFileName } from '@nx/js';
|
import { getLockFileName } from '@nx/js';
|
||||||
@ -55,7 +55,7 @@ describe('Node Applications', () => {
|
|||||||
it('should be able to generate an empty application', async () => {
|
it('should be able to generate an empty application', async () => {
|
||||||
const nodeapp = uniq('nodeapp');
|
const nodeapp = uniq('nodeapp');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/node:app ${nodeapp} --linter=eslint`);
|
runCLI(`generate @nx/node:app ${nodeapp} --linter=eslint`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nodeapp}`);
|
const lintResults = runCLI(`lint ${nodeapp}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -72,7 +72,7 @@ describe('Node Applications', () => {
|
|||||||
|
|
||||||
it('should be able to generate the correct outputFileName in options', async () => {
|
it('should be able to generate the correct outputFileName in options', async () => {
|
||||||
const nodeapp = uniq('nodeapp');
|
const nodeapp = uniq('nodeapp');
|
||||||
runCLI(`generate @nrwl/node:app ${nodeapp} --linter=eslint`);
|
runCLI(`generate @nx/node:app ${nodeapp} --linter=eslint`);
|
||||||
|
|
||||||
updateProjectConfig(nodeapp, (config) => {
|
updateProjectConfig(nodeapp, (config) => {
|
||||||
config.targets.build.options.outputFileName = 'index.js';
|
config.targets.build.options.outputFileName = 'index.js';
|
||||||
@ -87,7 +87,7 @@ describe('Node Applications', () => {
|
|||||||
const nodeapp = uniq('nodeapp');
|
const nodeapp = uniq('nodeapp');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/node:app ${nodeapp} --linter=eslint --bundler=webpack`
|
`generate @nx/node:app ${nodeapp} --linter=eslint --bundler=webpack`
|
||||||
);
|
);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nodeapp}`);
|
const lintResults = runCLI(`lint ${nodeapp}`);
|
||||||
@ -134,7 +134,7 @@ describe('Node Applications', () => {
|
|||||||
const port = 3456;
|
const port = 3456;
|
||||||
process.env.PORT = `${port}`;
|
process.env.PORT = `${port}`;
|
||||||
|
|
||||||
runCLI(`generate @nrwl/express:app ${nodeapp} --linter=eslint`);
|
runCLI(`generate @nx/express:app ${nodeapp} --linter=eslint`);
|
||||||
const lintResults = runCLI(`lint ${nodeapp}`);
|
const lintResults = runCLI(`lint ${nodeapp}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ describe('Node Applications', () => {
|
|||||||
xit('should be able to generate a nest application', async () => {
|
xit('should be able to generate a nest application', async () => {
|
||||||
const nestapp = uniq('nestapp');
|
const nestapp = uniq('nestapp');
|
||||||
const port = 3335;
|
const port = 3335;
|
||||||
runCLI(`generate @nrwl/nest:app ${nestapp} --linter=eslint`);
|
runCLI(`generate @nx/nest:app ${nestapp} --linter=eslint`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nestapp}`);
|
const lintResults = runCLI(`lint ${nestapp}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -241,7 +241,7 @@ describe('Build Node apps', () => {
|
|||||||
const scope = newProject();
|
const scope = newProject();
|
||||||
const packageManager = detectPackageManager(tmpProjPath());
|
const packageManager = detectPackageManager(tmpProjPath());
|
||||||
const nestapp = uniq('nestapp');
|
const nestapp = uniq('nestapp');
|
||||||
runCLI(`generate @nrwl/nest:app ${nestapp} --linter=eslint`);
|
runCLI(`generate @nx/nest:app ${nestapp} --linter=eslint`);
|
||||||
|
|
||||||
await runCLIAsync(`build ${nestapp} --generatePackageJson`);
|
await runCLIAsync(`build ${nestapp} --generatePackageJson`);
|
||||||
|
|
||||||
@ -302,10 +302,10 @@ describe('Build Node apps', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const nodeapp = uniq('nodeapp');
|
const nodeapp = uniq('nodeapp');
|
||||||
runCLI(`generate @nrwl/node:app ${nodeapp} --bundler=webpack`);
|
runCLI(`generate @nx/node:app ${nodeapp} --bundler=webpack`);
|
||||||
|
|
||||||
const jslib = uniq('jslib');
|
const jslib = uniq('jslib');
|
||||||
runCLI(`generate @nrwl/js:lib ${jslib} --bundler=tsc`);
|
runCLI(`generate @nx/js:lib ${jslib} --bundler=tsc`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`apps/${nodeapp}/src/main.ts`,
|
`apps/${nodeapp}/src/main.ts`,
|
||||||
@ -342,7 +342,7 @@ ${jslib}();
|
|||||||
it('should remove previous output before building with the --deleteOutputPath option set', async () => {
|
it('should remove previous output before building with the --deleteOutputPath option set', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/node:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/node:app ${appName} --no-interactive`);
|
||||||
|
|
||||||
// deleteOutputPath should default to true
|
// deleteOutputPath should default to true
|
||||||
createFile(`dist/apps/${appName}/_should_remove.txt`);
|
createFile(`dist/apps/${appName}/_should_remove.txt`);
|
||||||
@ -378,7 +378,7 @@ ${jslib}();
|
|||||||
it('should have plugin output if specified in `tsPlugins`', async () => {
|
it('should have plugin output if specified in `tsPlugins`', async () => {
|
||||||
newProject();
|
newProject();
|
||||||
const nestapp = uniq('nestapp');
|
const nestapp = uniq('nestapp');
|
||||||
runCLI(`generate @nrwl/nest:app ${nestapp} --linter=eslint`);
|
runCLI(`generate @nx/nest:app ${nestapp} --linter=eslint`);
|
||||||
|
|
||||||
packageInstall('@nestjs/swagger', undefined, '^6.0.0');
|
packageInstall('@nestjs/swagger', undefined, '^6.0.0');
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ describe('nest libraries', function () {
|
|||||||
|
|
||||||
it('should be able to generate a nest library', async () => {
|
it('should be able to generate a nest library', async () => {
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib}`);
|
runCLI(`generate @nx/nest:lib ${nestlib}`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nestlib}`);
|
const lintResults = runCLI(`lint ${nestlib}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -449,7 +449,7 @@ describe('nest libraries', function () {
|
|||||||
it('should be able to generate a nest library w/ service', async () => {
|
it('should be able to generate a nest library w/ service', async () => {
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib} --service`);
|
runCLI(`generate @nx/nest:lib ${nestlib} --service`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nestlib}`);
|
const lintResults = runCLI(`lint ${nestlib}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -463,7 +463,7 @@ describe('nest libraries', function () {
|
|||||||
it('should be able to generate a nest library w/ controller', async () => {
|
it('should be able to generate a nest library w/ controller', async () => {
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib} --controller`);
|
runCLI(`generate @nx/nest:lib ${nestlib} --controller`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nestlib}`);
|
const lintResults = runCLI(`lint ${nestlib}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -477,7 +477,7 @@ describe('nest libraries', function () {
|
|||||||
it('should be able to generate a nest library w/ controller and service', async () => {
|
it('should be able to generate a nest library w/ controller and service', async () => {
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib} --controller --service`);
|
runCLI(`generate @nx/nest:lib ${nestlib} --controller --service`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${nestlib}`);
|
const lintResults = runCLI(`lint ${nestlib}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -491,7 +491,7 @@ describe('nest libraries', function () {
|
|||||||
it('should have plugin output if specified in `transformers`', async () => {
|
it('should have plugin output if specified in `transformers`', async () => {
|
||||||
newProject();
|
newProject();
|
||||||
const nestlib = uniq('nestlib');
|
const nestlib = uniq('nestlib');
|
||||||
runCLI(`generate @nrwl/nest:lib ${nestlib} --buildable`);
|
runCLI(`generate @nx/nest:lib ${nestlib} --buildable`);
|
||||||
|
|
||||||
packageInstall('@nestjs/swagger', undefined, '~6.0.0');
|
packageInstall('@nestjs/swagger', undefined, '~6.0.0');
|
||||||
|
|
||||||
@ -537,6 +537,6 @@ exports.FooModel = FooModel;
|
|||||||
}, 300000);
|
}, 300000);
|
||||||
|
|
||||||
it('should run default jest tests', async () => {
|
it('should run default jest tests', async () => {
|
||||||
await expectJestTestsToPass('@nrwl/node:lib');
|
await expectJestTestsToPass('@nx/node:lib');
|
||||||
}, 100000);
|
}, 100000);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
runCommand,
|
runCommand,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('nx init (Monorepo)', () => {
|
describe('nx init (Monorepo)', () => {
|
||||||
const pmc = getPackageManagerCommand({
|
const pmc = getPackageManagerCommand({
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import {
|
|||||||
getPackageManagerCommand,
|
getPackageManagerCommand,
|
||||||
getPublishedVersion,
|
getPublishedVersion,
|
||||||
runCLI,
|
runCLI,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
import { removeSync } from 'fs-extra';
|
import { removeSync } from 'fs-extra';
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
runCommand,
|
runCommand,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('nx init (NPM repo)', () => {
|
describe('nx init (NPM repo)', () => {
|
||||||
const pmc = getPackageManagerCommand({
|
const pmc = getPackageManagerCommand({
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
runCommand,
|
runCommand,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { copySync, renameSync } from 'fs-extra';
|
import { copySync, renameSync } from 'fs-extra';
|
||||||
import { sync as globSync } from 'glob';
|
import { sync as globSync } from 'glob';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
uniq,
|
uniq,
|
||||||
updateJson,
|
updateJson,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('project graph creation', () => {
|
describe('project graph creation', () => {
|
||||||
beforeEach(() => newProject());
|
beforeEach(() => newProject());
|
||||||
@ -14,7 +14,7 @@ describe('project graph creation', () => {
|
|||||||
|
|
||||||
it('should correctly build the nxdeps.json containing files for the project', () => {
|
it('should correctly build the nxdeps.json containing files for the project', () => {
|
||||||
const libName = uniq('mylib');
|
const libName = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/js:lib ${libName}`);
|
runCLI(`generate @nx/js:lib ${libName}`);
|
||||||
|
|
||||||
runCLI(`graph --file=graph.json`);
|
runCLI(`graph --file=graph.json`);
|
||||||
const { graph: graphJson } = readJson('graph.json');
|
const { graph: graphJson } = readJson('graph.json');
|
||||||
@ -25,7 +25,7 @@ describe('project graph creation', () => {
|
|||||||
it("should correctly build the nxdeps.json containing files for the project when root is ''", () => {
|
it("should correctly build the nxdeps.json containing files for the project when root is ''", () => {
|
||||||
const libName = uniq('mylib');
|
const libName = uniq('mylib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${libName}`);
|
runCLI(`generate @nx/js:lib ${libName}`);
|
||||||
updateJson(`libs/${libName}/project.json`, (json) => ({
|
updateJson(`libs/${libName}/project.json`, (json) => ({
|
||||||
...json,
|
...json,
|
||||||
root: '',
|
root: '',
|
||||||
@ -41,8 +41,8 @@ describe('project graph creation', () => {
|
|||||||
const libName = uniq('mylib');
|
const libName = uniq('mylib');
|
||||||
const secondLibName = uniq('mysecondlib');
|
const secondLibName = uniq('mysecondlib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${libName}`);
|
runCLI(`generate @nx/js:lib ${libName}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${secondLibName}`);
|
runCLI(`generate @nx/js:lib ${secondLibName}`);
|
||||||
updateJson(`libs/${libName}/project.json`, (json) => ({
|
updateJson(`libs/${libName}/project.json`, (json) => ({
|
||||||
...json,
|
...json,
|
||||||
root: '',
|
root: '',
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Extra Nx Misc Tests', () => {
|
describe('Extra Nx Misc Tests', () => {
|
||||||
beforeAll(() => newProject());
|
beforeAll(() => newProject());
|
||||||
@ -17,7 +17,7 @@ describe('Extra Nx Misc Tests', () => {
|
|||||||
describe('Output Style', () => {
|
describe('Output Style', () => {
|
||||||
it('should stream output', async () => {
|
it('should stream output', async () => {
|
||||||
const myapp = 'abcdefghijklmon';
|
const myapp = 'abcdefghijklmon';
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
updateProjectConfig(myapp, (c) => {
|
updateProjectConfig(myapp, (c) => {
|
||||||
c.targets['inner'] = {
|
c.targets['inner'] = {
|
||||||
command: 'echo inner',
|
command: 'echo inner',
|
||||||
@ -99,7 +99,7 @@ describe('Extra Nx Misc Tests', () => {
|
|||||||
describe('Run Commands', () => {
|
describe('Run Commands', () => {
|
||||||
const mylib = uniq('lib');
|
const mylib = uniq('lib');
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not override environment variables already set when setting a custom env file path', async () => {
|
it('should not override environment variables already set when setting a custom env file path', async () => {
|
||||||
@ -115,7 +115,7 @@ describe('Extra Nx Misc Tests', () => {
|
|||||||
|
|
||||||
const envFile = `apps/${mylib}/.custom.env`;
|
const envFile = `apps/${mylib}/.custom.env`;
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/workspace:run-commands echoEnvVariables --command=echo --envFile=${envFile} --project=${mylib}`
|
`generate @nx/workspace:run-commands echoEnvVariables --command=echo --envFile=${envFile} --project=${mylib}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const command =
|
const command =
|
||||||
@ -229,10 +229,10 @@ describe('Extra Nx Misc Tests', () => {
|
|||||||
|
|
||||||
const folder = `dist/libs/${mylib}/some-folder`;
|
const folder = `dist/libs/${mylib}/some-folder`;
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/workspace:run-commands build --command=echo --outputs=${folder}/ --project=${mylib}`
|
`generate @nx/workspace:run-commands build --command=echo --outputs=${folder}/ --project=${mylib}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
@ -263,7 +263,7 @@ describe('Extra Nx Misc Tests', () => {
|
|||||||
|
|
||||||
describe('generate --quiet', () => {
|
describe('generate --quiet', () => {
|
||||||
it('should not log tree operations or install tasks', () => {
|
it('should not log tree operations or install tasks', () => {
|
||||||
const output = runCLI('generate @nrwl/react:app --quiet test-project', {
|
const output = runCLI('generate @nx/react:app --quiet test-project', {
|
||||||
verbose: false,
|
verbose: false,
|
||||||
});
|
});
|
||||||
expect(output).not.toContain('CREATE');
|
expect(output).not.toContain('CREATE');
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateJson,
|
updateJson,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { renameSync, writeFileSync } from 'fs';
|
import { renameSync, writeFileSync } from 'fs';
|
||||||
import { ensureDirSync } from 'fs-extra';
|
import { ensureDirSync } from 'fs-extra';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
@ -36,8 +36,8 @@ describe('Nx Commands', () => {
|
|||||||
runCLI('show projects').replace(/.*nx show projects( --verbose)?\n/, '')
|
runCLI('show projects').replace(/.*nx show projects( --verbose)?\n/, '')
|
||||||
).toEqual('');
|
).toEqual('');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${app1}`);
|
runCLI(`generate @nx/web:app ${app1}`);
|
||||||
runCLI(`generate @nrwl/web:app ${app2}`);
|
runCLI(`generate @nx/web:app ${app2}`);
|
||||||
|
|
||||||
const s = runCLI('show projects').split('\n');
|
const s = runCLI('show projects').split('\n');
|
||||||
|
|
||||||
@ -55,10 +55,10 @@ describe('Nx Commands', () => {
|
|||||||
|
|
||||||
expect(reportOutput).toEqual(
|
expect(reportOutput).toEqual(
|
||||||
expect.stringMatching(
|
expect.stringMatching(
|
||||||
new RegExp(`\@nrwl\/workspace.*:.*${getPublishedVersion()}`)
|
new RegExp(`\@nx\/workspace.*:.*${getPublishedVersion()}`)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
expect(reportOutput).toContain('@nrwl/workspace');
|
expect(reportOutput).toContain('@nx/workspace');
|
||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it(`should list plugins`, async () => {
|
it(`should list plugins`, async () => {
|
||||||
@ -71,8 +71,8 @@ describe('Nx Commands', () => {
|
|||||||
|
|
||||||
// temporarily make it look like this isn't installed
|
// temporarily make it look like this isn't installed
|
||||||
renameSync(
|
renameSync(
|
||||||
tmpProjPath('node_modules/@nrwl/angular'),
|
tmpProjPath('node_modules/@nx/angular'),
|
||||||
tmpProjPath('node_modules/@nrwl/angular_tmp')
|
tmpProjPath('node_modules/@nx/angular_tmp')
|
||||||
);
|
);
|
||||||
|
|
||||||
listOutput = runCLI('list');
|
listOutput = runCLI('list');
|
||||||
@ -106,8 +106,8 @@ describe('Nx Commands', () => {
|
|||||||
|
|
||||||
// put back the @nx/angular module (or all the other e2e tests after this will fail)
|
// put back the @nx/angular module (or all the other e2e tests after this will fail)
|
||||||
renameSync(
|
renameSync(
|
||||||
tmpProjPath('node_modules/@nrwl/angular_tmp'),
|
tmpProjPath('node_modules/@nx/angular_tmp'),
|
||||||
tmpProjPath('node_modules/@nrwl/angular')
|
tmpProjPath('node_modules/@nx/angular')
|
||||||
);
|
);
|
||||||
}, 120000);
|
}, 120000);
|
||||||
});
|
});
|
||||||
@ -117,8 +117,8 @@ describe('Nx Commands', () => {
|
|||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
readJson,
|
readJson,
|
||||||
readFile,
|
readFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { bold } from 'chalk';
|
import { bold } from 'chalk';
|
||||||
|
|
||||||
describe('nx wrapper / .nx installation', () => {
|
describe('nx wrapper / .nx installation', () => {
|
||||||
@ -42,7 +42,7 @@ describe('nx wrapper / .nx installation', () => {
|
|||||||
updateJson<NxJsonConfiguration>('nx.json', (json) => {
|
updateJson<NxJsonConfiguration>('nx.json', (json) => {
|
||||||
json.tasksRunnerOptions.default.options.cacheableOperations = ['echo'];
|
json.tasksRunnerOptions.default.options.cacheableOperations = ['echo'];
|
||||||
json.installation.plugins = {
|
json.installation.plugins = {
|
||||||
'@nrwl/js': getPublishedVersion(),
|
'@nx/js': getPublishedVersion(),
|
||||||
};
|
};
|
||||||
return json;
|
return json;
|
||||||
});
|
});
|
||||||
@ -66,8 +66,8 @@ describe('nx wrapper / .nx installation', () => {
|
|||||||
it('should work with nx report', () => {
|
it('should work with nx report', () => {
|
||||||
const output = runNxWrapper('report');
|
const output = runNxWrapper('report');
|
||||||
expect(output).toMatch(new RegExp(`nx.*:.*${getPublishedVersion()}`));
|
expect(output).toMatch(new RegExp(`nx.*:.*${getPublishedVersion()}`));
|
||||||
expect(output).toMatch(new RegExp(`@nrwl/js.*:.*${getPublishedVersion()}`));
|
expect(output).toMatch(new RegExp(`@nx/js.*:.*${getPublishedVersion()}`));
|
||||||
expect(output).not.toContain('@nrwl/express');
|
expect(output).not.toContain('@nx/express');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work with nx list', () => {
|
it('should work with nx list', () => {
|
||||||
@ -85,16 +85,16 @@ describe('nx wrapper / .nx installation', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(installedPluginLines.some((x) => x.includes(`${bold('nx')}`)));
|
expect(installedPluginLines.some((x) => x.includes(`${bold('nx')}`)));
|
||||||
expect(installedPluginLines.some((x) => x.includes(`${bold('@nrwl/js')}`)));
|
expect(installedPluginLines.some((x) => x.includes(`${bold('@nx/js')}`)));
|
||||||
|
|
||||||
output = runNxWrapper('list @nrwl/js');
|
output = runNxWrapper('list @nx/js');
|
||||||
expect(output).toContain('Capabilities in @nrwl/js');
|
expect(output).toContain('Capabilities in @nx/js');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work with basic generators', () => {
|
it('should work with basic generators', () => {
|
||||||
updateJson<NxJsonConfiguration>('nx.json', (j) => {
|
updateJson<NxJsonConfiguration>('nx.json', (j) => {
|
||||||
j.installation.plugins ??= {};
|
j.installation.plugins ??= {};
|
||||||
j.installation.plugins['@nrwl/workspace'] = getPublishedVersion();
|
j.installation.plugins['@nx/workspace'] = getPublishedVersion();
|
||||||
return j;
|
return j;
|
||||||
});
|
});
|
||||||
expect(() => runNxWrapper(`g npm-package ${uniq('pkg')}`)).not.toThrow();
|
expect(() => runNxWrapper(`g npm-package ${uniq('pkg')}`)).not.toThrow();
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
getStrippedEnvironmentVariables,
|
getStrippedEnvironmentVariables,
|
||||||
updateJson,
|
updateJson,
|
||||||
isVerboseE2ERun,
|
isVerboseE2ERun,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { spawn } from 'child_process';
|
import { spawn } from 'child_process';
|
||||||
|
|
||||||
describe('Nx Commands', () => {
|
describe('Nx Commands', () => {
|
||||||
@ -17,9 +17,9 @@ describe('Nx Commands', () => {
|
|||||||
let proj3 = uniq('proj3');
|
let proj3 = uniq('proj3');
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
newProject({ packageManager: 'npm' });
|
newProject({ packageManager: 'npm' });
|
||||||
runCLI(`generate @nrwl/js:lib ${proj1}`);
|
runCLI(`generate @nx/js:lib ${proj1}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${proj2}`);
|
runCLI(`generate @nx/js:lib ${proj2}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${proj3}`);
|
runCLI(`generate @nx/js:lib ${proj3}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => cleanupProject());
|
afterAll(() => cleanupProject());
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import {
|
|||||||
getSelectedPackageManager,
|
getSelectedPackageManager,
|
||||||
runCommand,
|
runCommand,
|
||||||
runCreateWorkspace,
|
runCreateWorkspace,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
let proj: string;
|
let proj: string;
|
||||||
|
|
||||||
@ -27,11 +27,11 @@ describe('Workspace Tests', () => {
|
|||||||
|
|
||||||
afterAll(() => cleanupProject());
|
afterAll(() => cleanupProject());
|
||||||
|
|
||||||
describe('@nrwl/workspace:npm-package', () => {
|
describe('@nx/workspace:npm-package', () => {
|
||||||
it('should create a minimal npm package', () => {
|
it('should create a minimal npm package', () => {
|
||||||
const npmPackage = uniq('npm-package');
|
const npmPackage = uniq('npm-package');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/workspace:npm-package ${npmPackage}`);
|
runCLI(`generate @nx/workspace:npm-package ${npmPackage}`);
|
||||||
|
|
||||||
updateFile('package.json', (content) => {
|
updateFile('package.json', (content) => {
|
||||||
const json = JSON.parse(content);
|
const json = JSON.parse(content);
|
||||||
@ -58,7 +58,7 @@ describe('Workspace Tests', () => {
|
|||||||
const lib1 = uniq('mylib');
|
const lib1 = uniq('mylib');
|
||||||
const lib2 = uniq('mylib');
|
const lib2 = uniq('mylib');
|
||||||
const lib3 = uniq('mylib');
|
const lib3 = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/js:lib ${lib1}/data-access`);
|
runCLI(`generate @nx/js:lib ${lib1}/data-access`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${lib1}/data-access/src/lib/${lib1}-data-access.ts`,
|
`libs/${lib1}/data-access/src/lib/${lib1}-data-access.ts`,
|
||||||
@ -74,7 +74,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which imports a class from lib1
|
* Create a library which imports a class from lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib2}/ui`);
|
runCLI(`generate @nx/js:lib ${lib2}/ui`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
`libs/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
||||||
@ -87,7 +87,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which has an implicit dependency on lib1
|
* Create a library which has an implicit dependency on lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib3}`);
|
runCLI(`generate @nx/js:lib ${lib3}`);
|
||||||
updateProjectConfig(lib3, (config) => {
|
updateProjectConfig(lib3, (config) => {
|
||||||
config.implicitDependencies = [`${lib1}-data-access`];
|
config.implicitDependencies = [`${lib1}-data-access`];
|
||||||
return config;
|
return config;
|
||||||
@ -98,7 +98,7 @@ describe('Workspace Tests', () => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const moveOutput = runCLI(
|
const moveOutput = runCLI(
|
||||||
`generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
|
`generate @nx/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`);
|
expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`);
|
||||||
@ -194,7 +194,7 @@ describe('Workspace Tests', () => {
|
|||||||
const lib2 = uniq('mylib');
|
const lib2 = uniq('mylib');
|
||||||
const lib3 = uniq('mylib');
|
const lib3 = uniq('mylib');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${lib1}/data-access --importPath=${importPath}`
|
`generate @nx/js:lib ${lib1}/data-access --importPath=${importPath}`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
@ -211,7 +211,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which imports a class from lib1
|
* Create a library which imports a class from lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib2}/ui`);
|
runCLI(`generate @nx/js:lib ${lib2}/ui`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
`libs/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
||||||
@ -224,7 +224,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which has an implicit dependency on lib1
|
* Create a library which has an implicit dependency on lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib3}`);
|
runCLI(`generate @nx/js:lib ${lib3}`);
|
||||||
updateProjectConfig(lib3, (config) => {
|
updateProjectConfig(lib3, (config) => {
|
||||||
config.implicitDependencies = [`${lib1}-data-access`];
|
config.implicitDependencies = [`${lib1}-data-access`];
|
||||||
return config;
|
return config;
|
||||||
@ -235,7 +235,7 @@ describe('Workspace Tests', () => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const moveOutput = runCLI(
|
const moveOutput = runCLI(
|
||||||
`generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
|
`generate @nx/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`);
|
expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`);
|
||||||
@ -327,7 +327,7 @@ describe('Workspace Tests', () => {
|
|||||||
nxJson.workspaceLayout = { libsDir: 'packages' };
|
nxJson.workspaceLayout = { libsDir: 'packages' };
|
||||||
updateFile('nx.json', JSON.stringify(nxJson));
|
updateFile('nx.json', JSON.stringify(nxJson));
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib1}/data-access`);
|
runCLI(`generate @nx/js:lib ${lib1}/data-access`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`packages/${lib1}/data-access/src/lib/${lib1}-data-access.ts`,
|
`packages/${lib1}/data-access/src/lib/${lib1}-data-access.ts`,
|
||||||
@ -343,7 +343,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which imports a class from lib1
|
* Create a library which imports a class from lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib2}/ui`);
|
runCLI(`generate @nx/js:lib ${lib2}/ui`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`packages/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
`packages/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
||||||
@ -356,7 +356,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which has an implicit dependency on lib1
|
* Create a library which has an implicit dependency on lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib3}`);
|
runCLI(`generate @nx/js:lib ${lib3}`);
|
||||||
updateProjectConfig(lib3, (config) => {
|
updateProjectConfig(lib3, (config) => {
|
||||||
config.implicitDependencies = [`${lib1}-data-access`];
|
config.implicitDependencies = [`${lib1}-data-access`];
|
||||||
return config;
|
return config;
|
||||||
@ -367,7 +367,7 @@ describe('Workspace Tests', () => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const moveOutput = runCLI(
|
const moveOutput = runCLI(
|
||||||
`generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
|
`generate @nx/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(moveOutput).toContain(`DELETE packages/${lib1}/data-access`);
|
expect(moveOutput).toContain(`DELETE packages/${lib1}/data-access`);
|
||||||
@ -455,7 +455,7 @@ describe('Workspace Tests', () => {
|
|||||||
const lib1 = uniq('lib1');
|
const lib1 = uniq('lib1');
|
||||||
const lib2 = uniq('lib2');
|
const lib2 = uniq('lib2');
|
||||||
const lib3 = uniq('lib3');
|
const lib3 = uniq('lib3');
|
||||||
runCLI(`generate @nrwl/js:lib ${lib1}`);
|
runCLI(`generate @nx/js:lib ${lib1}`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${lib1}/src/lib/${lib1}.ts`,
|
`libs/${lib1}/src/lib/${lib1}.ts`,
|
||||||
@ -471,7 +471,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which imports a class from lib1
|
* Create a library which imports a class from lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib2}/ui`);
|
runCLI(`generate @nx/js:lib ${lib2}/ui`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
`libs/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
||||||
@ -484,7 +484,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which has an implicit dependency on lib1
|
* Create a library which has an implicit dependency on lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib3}`);
|
runCLI(`generate @nx/js:lib ${lib3}`);
|
||||||
updateProjectConfig(lib3, (config) => {
|
updateProjectConfig(lib3, (config) => {
|
||||||
config.implicitDependencies = [lib1];
|
config.implicitDependencies = [lib1];
|
||||||
return config;
|
return config;
|
||||||
@ -495,7 +495,7 @@ describe('Workspace Tests', () => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const moveOutput = runCLI(
|
const moveOutput = runCLI(
|
||||||
`generate @nrwl/workspace:move --project ${lib1} ${lib1}/data-access`
|
`generate @nx/workspace:move --project ${lib1} ${lib1}/data-access`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(moveOutput).toContain(`DELETE libs/${lib1}/project.json`);
|
expect(moveOutput).toContain(`DELETE libs/${lib1}/project.json`);
|
||||||
@ -589,7 +589,7 @@ describe('Workspace Tests', () => {
|
|||||||
const lib1 = uniq('mylib');
|
const lib1 = uniq('mylib');
|
||||||
const lib2 = uniq('mylib');
|
const lib2 = uniq('mylib');
|
||||||
const lib3 = uniq('mylib');
|
const lib3 = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/js:lib ${lib1}/data-access`);
|
runCLI(`generate @nx/js:lib ${lib1}/data-access`);
|
||||||
let rootTsConfig = readJson('tsconfig.base.json');
|
let rootTsConfig = readJson('tsconfig.base.json');
|
||||||
expect(
|
expect(
|
||||||
rootTsConfig.compilerOptions.paths[`@${proj}/${lib1}/data-access`]
|
rootTsConfig.compilerOptions.paths[`@${proj}/${lib1}/data-access`]
|
||||||
@ -612,7 +612,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which imports a class from lib1
|
* Create a library which imports a class from lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib2}/ui`);
|
runCLI(`generate @nx/js:lib ${lib2}/ui`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
`libs/${lib2}/ui/src/lib/${lib2}-ui.ts`,
|
||||||
@ -625,7 +625,7 @@ describe('Workspace Tests', () => {
|
|||||||
* Create a library which has an implicit dependency on lib1
|
* Create a library which has an implicit dependency on lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib3}`);
|
runCLI(`generate @nx/js:lib ${lib3}`);
|
||||||
updateProjectConfig(lib3, (config) => {
|
updateProjectConfig(lib3, (config) => {
|
||||||
config.implicitDependencies = [`${lib1}-data-access`];
|
config.implicitDependencies = [`${lib1}-data-access`];
|
||||||
return config;
|
return config;
|
||||||
@ -636,7 +636,7 @@ describe('Workspace Tests', () => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const moveOutput = runCLI(
|
const moveOutput = runCLI(
|
||||||
`generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
|
`generate @nx/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`);
|
expect(moveOutput).toContain(`DELETE libs/${lib1}/data-access`);
|
||||||
@ -703,14 +703,14 @@ describe('Workspace Tests', () => {
|
|||||||
const lib1 = uniq('myliba');
|
const lib1 = uniq('myliba');
|
||||||
const lib2 = uniq('mylibb');
|
const lib2 = uniq('mylibb');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib1}`);
|
runCLI(`generate @nx/js:lib ${lib1}`);
|
||||||
expect(exists(tmpProjPath(`libs/${lib1}`))).toBeTruthy();
|
expect(exists(tmpProjPath(`libs/${lib1}`))).toBeTruthy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a library which has an implicit dependency on lib1
|
* Create a library which has an implicit dependency on lib1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${lib2}`);
|
runCLI(`generate @nx/js:lib ${lib2}`);
|
||||||
updateProjectConfig(lib2, (config) => {
|
updateProjectConfig(lib2, (config) => {
|
||||||
config.implicitDependencies = [lib1];
|
config.implicitDependencies = [lib1];
|
||||||
return config;
|
return config;
|
||||||
@ -722,9 +722,7 @@ describe('Workspace Tests', () => {
|
|||||||
|
|
||||||
let error;
|
let error;
|
||||||
try {
|
try {
|
||||||
console.log(
|
console.log(runCLI(`generate @nx/workspace:remove --project ${lib1}`));
|
||||||
runCLI(`generate @nrwl/workspace:remove --project ${lib1}`)
|
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = e;
|
error = e;
|
||||||
}
|
}
|
||||||
@ -740,7 +738,7 @@ describe('Workspace Tests', () => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const removeOutputForced = runCLI(
|
const removeOutputForced = runCLI(
|
||||||
`generate @nrwl/workspace:remove --project ${lib1} --forceRemove`
|
`generate @nx/workspace:remove --project ${lib1} --forceRemove`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(removeOutputForced).toContain(`DELETE libs/${lib1}`);
|
expect(removeOutputForced).toContain(`DELETE libs/${lib1}`);
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import {
|
|||||||
fileExists,
|
fileExists,
|
||||||
removeFile,
|
removeFile,
|
||||||
readResolvedConfiguration,
|
readResolvedConfiguration,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Nx Affected and Graph Tests', () => {
|
describe('Nx Affected and Graph Tests', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
@ -33,12 +33,12 @@ describe('Nx Affected and Graph Tests', () => {
|
|||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
const mylib2 = uniq('mylib2');
|
const mylib2 = uniq('mylib2');
|
||||||
const mypublishablelib = uniq('mypublishablelib');
|
const mypublishablelib = uniq('mypublishablelib');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
runCLI(`generate @nrwl/web:app ${myapp2}`);
|
runCLI(`generate @nx/web:app ${myapp2}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib2}`);
|
runCLI(`generate @nx/js:lib ${mylib2}`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${mypublishablelib} --publishable --importPath=@${proj}/${mypublishablelib} --tags=ui`
|
`generate @nx/js:lib ${mypublishablelib} --publishable --importPath=@${proj}/${mypublishablelib} --tags=ui`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
@ -187,26 +187,26 @@ describe('Nx Affected and Graph Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function generateAll() {
|
function generateAll() {
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
runCLI(`generate @nrwl/web:app ${myapp2}`);
|
runCLI(`generate @nx/web:app ${myapp2}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
runCommand(`git add . && git commit -am "add all"`);
|
runCommand(`git add . && git commit -am "add all"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
it('should not affect other projects by generating a new project', () => {
|
it('should not affect other projects by generating a new project', () => {
|
||||||
// TODO: investigate why affected gives different results on windows
|
// TODO: investigate why affected gives different results on windows
|
||||||
if (isNotWindows()) {
|
if (isNotWindows()) {
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
expect(runCLI('print-affected --select projects')).toContain(myapp);
|
expect(runCLI('print-affected --select projects')).toContain(myapp);
|
||||||
runCommand(`git add . && git commit -am "add ${myapp}"`);
|
runCommand(`git add . && git commit -am "add ${myapp}"`);
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${myapp2}`);
|
runCLI(`generate @nx/web:app ${myapp2}`);
|
||||||
let output = runCLI('print-affected --select projects');
|
let output = runCLI('print-affected --select projects');
|
||||||
expect(output).not.toContain(myapp);
|
expect(output).not.toContain(myapp);
|
||||||
expect(output).toContain(myapp2);
|
expect(output).toContain(myapp2);
|
||||||
runCommand(`git add . && git commit -am "add ${myapp2}"`);
|
runCommand(`git add . && git commit -am "add ${myapp2}"`);
|
||||||
|
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
output = runCLI('print-affected --select projects');
|
output = runCLI('print-affected --select projects');
|
||||||
expect(output).not.toContain(myapp);
|
expect(output).not.toContain(myapp);
|
||||||
expect(output).not.toContain(myapp2);
|
expect(output).not.toContain(myapp2);
|
||||||
@ -294,11 +294,11 @@ describe('Nx Affected and Graph Tests', () => {
|
|||||||
const mylib2 = uniq('mylib2');
|
const mylib2 = uniq('mylib2');
|
||||||
const mypublishablelib = uniq('mypublishablelib');
|
const mypublishablelib = uniq('mypublishablelib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
runCLI(`generate @nrwl/web:app ${myapp2}`);
|
runCLI(`generate @nx/web:app ${myapp2}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib2}`);
|
runCLI(`generate @nx/js:lib ${mylib2}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mypublishablelib}`);
|
runCLI(`generate @nx/js:lib ${mypublishablelib}`);
|
||||||
|
|
||||||
const app1ElementSpec = readFile(
|
const app1ElementSpec = readFile(
|
||||||
`apps/${myapp}/src/app/app.element.spec.ts`
|
`apps/${myapp}/src/app/app.element.spec.ts`
|
||||||
@ -412,11 +412,11 @@ describe('Nx Affected and Graph Tests', () => {
|
|||||||
mylib = uniq('mylib');
|
mylib = uniq('mylib');
|
||||||
mylib2 = uniq('mylib2');
|
mylib2 = uniq('mylib2');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
runCLI(`generate @nrwl/web:app ${myapp2}`);
|
runCLI(`generate @nx/web:app ${myapp2}`);
|
||||||
runCLI(`generate @nrwl/web:app ${myapp3}`);
|
runCLI(`generate @nx/web:app ${myapp3}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib2}`);
|
runCLI(`generate @nx/js:lib ${mylib2}`);
|
||||||
|
|
||||||
runCommand(`git init`);
|
runCommand(`git init`);
|
||||||
runCommand(`git config user.email "test@test.com"`);
|
runCommand(`git config user.email "test@test.com"`);
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
updateFile,
|
updateFile,
|
||||||
updateJson,
|
updateJson,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('cache', () => {
|
describe('cache', () => {
|
||||||
beforeEach(() => newProject());
|
beforeEach(() => newProject());
|
||||||
@ -19,8 +19,8 @@ describe('cache', () => {
|
|||||||
it('should cache command execution', async () => {
|
it('should cache command execution', async () => {
|
||||||
const myapp1 = uniq('myapp1');
|
const myapp1 = uniq('myapp1');
|
||||||
const myapp2 = uniq('myapp2');
|
const myapp2 = uniq('myapp2');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp1}`);
|
runCLI(`generate @nx/web:app ${myapp1}`);
|
||||||
runCLI(`generate @nrwl/web:app ${myapp2}`);
|
runCLI(`generate @nx/web:app ${myapp2}`);
|
||||||
const files = `--files="apps/${myapp1}/src/main.ts,apps/${myapp2}/src/main.ts"`;
|
const files = `--files="apps/${myapp1}/src/main.ts,apps/${myapp2}/src/main.ts"`;
|
||||||
|
|
||||||
// run build with caching
|
// run build with caching
|
||||||
@ -144,7 +144,7 @@ describe('cache', () => {
|
|||||||
|
|
||||||
it('should support using globs as outputs', async () => {
|
it('should support using globs as outputs', async () => {
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/js:library ${mylib}`);
|
runCLI(`generate @nx/js:library ${mylib}`);
|
||||||
updateProjectConfig(mylib, (c) => {
|
updateProjectConfig(mylib, (c) => {
|
||||||
c.targets.build = {
|
c.targets.build = {
|
||||||
executor: 'nx:run-commands',
|
executor: 'nx:run-commands',
|
||||||
@ -216,9 +216,9 @@ describe('cache', () => {
|
|||||||
const parent = uniq('parent');
|
const parent = uniq('parent');
|
||||||
const child1 = uniq('child1');
|
const child1 = uniq('child1');
|
||||||
const child2 = uniq('child2');
|
const child2 = uniq('child2');
|
||||||
runCLI(`generate @nrwl/js:lib ${parent}`);
|
runCLI(`generate @nx/js:lib ${parent}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${child1}`);
|
runCLI(`generate @nx/js:lib ${child1}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${child2}`);
|
runCLI(`generate @nx/js:lib ${child2}`);
|
||||||
updateJson(`nx.json`, (c) => {
|
updateJson(`nx.json`, (c) => {
|
||||||
c.namedInputs = {
|
c.namedInputs = {
|
||||||
default: ['{projectRoot}/**/*'],
|
default: ['{projectRoot}/**/*'],
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Invoke Runner', () => {
|
describe('Invoke Runner', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
@ -15,7 +15,7 @@ describe('Invoke Runner', () => {
|
|||||||
|
|
||||||
it('should invoke runner imperatively ', async () => {
|
it('should invoke runner imperatively ', async () => {
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib}`);
|
runCLI(`generate @nx/js:lib ${mylib}`);
|
||||||
updateProjectConfig(mylib, (c) => {
|
updateProjectConfig(mylib, (c) => {
|
||||||
c.targets['prebuild'] = {
|
c.targets['prebuild'] = {
|
||||||
command: 'echo prebuild',
|
command: 'echo prebuild',
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import {
|
|||||||
updateFile,
|
updateFile,
|
||||||
updateJson,
|
updateJson,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { PackageJson } from 'nx/src/utils/package-json';
|
import { PackageJson } from 'nx/src/utils/package-json';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ describe('Nx Running Tests', () => {
|
|||||||
describe('(forwarding params)', () => {
|
describe('(forwarding params)', () => {
|
||||||
let proj = uniq('proj');
|
let proj = uniq('proj');
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
runCLI(`generate @nrwl/js:lib ${proj}`);
|
runCLI(`generate @nx/js:lib ${proj}`);
|
||||||
updateProjectConfig(proj, (c) => {
|
updateProjectConfig(proj, (c) => {
|
||||||
c.targets['echo'] = {
|
c.targets['echo'] = {
|
||||||
command: 'echo ECHO:',
|
command: 'echo ECHO:',
|
||||||
@ -56,10 +56,10 @@ describe('Nx Running Tests', () => {
|
|||||||
|
|
||||||
it('should execute long running tasks', async () => {
|
it('should execute long running tasks', async () => {
|
||||||
const myapp = uniq('myapp');
|
const myapp = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
updateProjectConfig(myapp, (c) => {
|
updateProjectConfig(myapp, (c) => {
|
||||||
c.targets['counter'] = {
|
c.targets['counter'] = {
|
||||||
executor: '@nrwl/workspace:counter',
|
executor: '@nx/workspace:counter',
|
||||||
options: {
|
options: {
|
||||||
to: 2,
|
to: 2,
|
||||||
},
|
},
|
||||||
@ -76,7 +76,7 @@ describe('Nx Running Tests', () => {
|
|||||||
|
|
||||||
it('should run npm scripts', async () => {
|
it('should run npm scripts', async () => {
|
||||||
const mylib = uniq('mylib');
|
const mylib = uniq('mylib');
|
||||||
runCLI(`generate @nrwl/node:lib ${mylib}`);
|
runCLI(`generate @nx/node:lib ${mylib}`);
|
||||||
|
|
||||||
// Used to restore targets to lib after test
|
// Used to restore targets to lib after test
|
||||||
const original = readProjectConfig(mylib);
|
const original = readProjectConfig(mylib);
|
||||||
@ -121,8 +121,8 @@ describe('Nx Running Tests', () => {
|
|||||||
it('should stop executing all tasks when one of the tasks fails', async () => {
|
it('should stop executing all tasks when one of the tasks fails', async () => {
|
||||||
const myapp1 = uniq('a');
|
const myapp1 = uniq('a');
|
||||||
const myapp2 = uniq('b');
|
const myapp2 = uniq('b');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp1}`);
|
runCLI(`generate @nx/web:app ${myapp1}`);
|
||||||
runCLI(`generate @nrwl/web:app ${myapp2}`);
|
runCLI(`generate @nx/web:app ${myapp2}`);
|
||||||
updateProjectConfig(myapp1, (c) => {
|
updateProjectConfig(myapp1, (c) => {
|
||||||
c.targets['error'] = {
|
c.targets['error'] = {
|
||||||
command: 'echo boom1 && exit 1',
|
command: 'echo boom1 && exit 1',
|
||||||
@ -173,14 +173,14 @@ describe('Nx Running Tests', () => {
|
|||||||
describe('run-one', () => {
|
describe('run-one', () => {
|
||||||
it('should build a specific project', () => {
|
it('should build a specific project', () => {
|
||||||
const myapp = uniq('app');
|
const myapp = uniq('app');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
|
|
||||||
runCLI(`build ${myapp}`);
|
runCLI(`build ${myapp}`);
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
it('should support project name positional arg non-consecutive to target', () => {
|
it('should support project name positional arg non-consecutive to target', () => {
|
||||||
const myapp = uniq('app');
|
const myapp = uniq('app');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
|
|
||||||
runCLI(`build --verbose ${myapp}`);
|
runCLI(`build --verbose ${myapp}`);
|
||||||
}, 10000);
|
}, 10000);
|
||||||
@ -190,7 +190,7 @@ describe('Nx Running Tests', () => {
|
|||||||
const target = uniq('script');
|
const target = uniq('script');
|
||||||
const expectedOutput = uniq('myEchoedString');
|
const expectedOutput = uniq('myEchoedString');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
updateFile(
|
updateFile(
|
||||||
`apps/${myapp}/package.json`,
|
`apps/${myapp}/package.json`,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@ -207,7 +207,7 @@ describe('Nx Running Tests', () => {
|
|||||||
it('should run targets inferred from plugin-specified project files', () => {
|
it('should run targets inferred from plugin-specified project files', () => {
|
||||||
// Setup an app to extend
|
// Setup an app to extend
|
||||||
const myapp = uniq('app');
|
const myapp = uniq('app');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
|
|
||||||
// Register an Nx plugin
|
// Register an Nx plugin
|
||||||
const plugin = `module.exports = {
|
const plugin = `module.exports = {
|
||||||
@ -236,7 +236,7 @@ describe('Nx Running Tests', () => {
|
|||||||
|
|
||||||
it('should build a specific project with the daemon disabled', () => {
|
it('should build a specific project with the daemon disabled', () => {
|
||||||
const myapp = uniq('app');
|
const myapp = uniq('app');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
|
|
||||||
const buildWithDaemon = runCLI(`build ${myapp}`, {
|
const buildWithDaemon = runCLI(`build ${myapp}`, {
|
||||||
env: { ...process.env, NX_DAEMON: 'false' },
|
env: { ...process.env, NX_DAEMON: 'false' },
|
||||||
@ -253,7 +253,7 @@ describe('Nx Running Tests', () => {
|
|||||||
|
|
||||||
it('should build the project when within the project root', () => {
|
it('should build the project when within the project root', () => {
|
||||||
const myapp = uniq('app');
|
const myapp = uniq('app');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
|
|
||||||
// Should work within the project directory
|
// Should work within the project directory
|
||||||
expect(runCommand(`cd apps/${myapp}/src && npx nx build`)).toContain(
|
expect(runCommand(`cd apps/${myapp}/src && npx nx build`)).toContain(
|
||||||
@ -332,9 +332,9 @@ describe('Nx Running Tests', () => {
|
|||||||
myapp = uniq('myapp');
|
myapp = uniq('myapp');
|
||||||
mylib1 = uniq('mylib1');
|
mylib1 = uniq('mylib1');
|
||||||
mylib2 = uniq('mylib1');
|
mylib2 = uniq('mylib1');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
runCLI(`generate @nx/web:app ${myapp}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib1}`);
|
runCLI(`generate @nx/js:lib ${mylib1}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${mylib2}`);
|
runCLI(`generate @nx/js:lib ${mylib2}`);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`apps/${myapp}/src/main.ts`,
|
`apps/${myapp}/src/main.ts`,
|
||||||
@ -419,15 +419,15 @@ describe('Nx Running Tests', () => {
|
|||||||
const libC = uniq('libc-rand');
|
const libC = uniq('libc-rand');
|
||||||
const libD = uniq('libd-rand');
|
const libD = uniq('libd-rand');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${appA}`);
|
runCLI(`generate @nx/web:app ${appA}`);
|
||||||
runCLI(`generate @nrwl/js:lib ${libA} --bundler=tsc --defaults`);
|
runCLI(`generate @nx/js:lib ${libA} --bundler=tsc --defaults`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${libB} --bundler=tsc --defaults --tags=ui-a`
|
`generate @nx/js:lib ${libB} --bundler=tsc --defaults --tags=ui-a`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${libC} --bundler=tsc --defaults --tags=ui-b,shared`
|
`generate @nx/js:lib ${libC} --bundler=tsc --defaults --tags=ui-b,shared`
|
||||||
);
|
);
|
||||||
runCLI(`generate @nrwl/node:lib ${libD} --defaults --tags=api`);
|
runCLI(`generate @nx/node:lib ${libD} --defaults --tags=api`);
|
||||||
|
|
||||||
// libA depends on libC
|
// libA depends on libC
|
||||||
updateFile(
|
updateFile(
|
||||||
@ -532,8 +532,8 @@ describe('Nx Running Tests', () => {
|
|||||||
it('should run multiple targets', () => {
|
it('should run multiple targets', () => {
|
||||||
const myapp1 = uniq('myapp');
|
const myapp1 = uniq('myapp');
|
||||||
const myapp2 = uniq('myapp');
|
const myapp2 = uniq('myapp');
|
||||||
runCLI(`generate @nrwl/web:app ${myapp1}`);
|
runCLI(`generate @nx/web:app ${myapp1}`);
|
||||||
runCLI(`generate @nrwl/web:app ${myapp2}`);
|
runCLI(`generate @nx/web:app ${myapp2}`);
|
||||||
|
|
||||||
let outputs = runCLI(
|
let outputs = runCLI(
|
||||||
// Options with lists can be specified using multiple args or with a delimiter (comma or space).
|
// Options with lists can be specified using multiple args or with a delimiter (comma or space).
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
export const ASYNC_GENERATOR_EXECUTOR_CONTENTS = `import { ExecutorContext } from '@nrwl/devkit';
|
export const ASYNC_GENERATOR_EXECUTOR_CONTENTS = `import { ExecutorContext } from '@nx/devkit';
|
||||||
|
|
||||||
async function* asyncGenerator(
|
async function* asyncGenerator(
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateJson,
|
updateJson,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import type { PackageJson } from 'nx/src/utils/package-json';
|
import type { PackageJson } from 'nx/src/utils/package-json';
|
||||||
|
|
||||||
import { ASYNC_GENERATOR_EXECUTOR_CONTENTS } from './nx-plugin.fixtures';
|
import { ASYNC_GENERATOR_EXECUTOR_CONTENTS } from './nx-plugin.fixtures';
|
||||||
@ -31,7 +31,7 @@ describe('Nx Plugin', () => {
|
|||||||
it('should be able to generate a Nx Plugin ', async () => {
|
it('should be able to generate a Nx Plugin ', async () => {
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
|
runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
|
||||||
const lintResults = runCLI(`lint ${plugin}`);
|
const lintResults = runCLI(`lint ${plugin}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
|
|
||||||
@ -51,9 +51,9 @@ describe('Nx Plugin', () => {
|
|||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
const version = '1.0.0';
|
const version = '1.0.0';
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
|
runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:migration --project=${plugin} --packageVersion=${version} --packageJsonUpdates=false`
|
`generate @nx/plugin:migration --project=${plugin} --packageVersion=${version} --packageJsonUpdates=false`
|
||||||
);
|
);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${plugin}`);
|
const lintResults = runCLI(`lint ${plugin}`);
|
||||||
@ -84,10 +84,8 @@ describe('Nx Plugin', () => {
|
|||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
const generator = uniq('generator');
|
const generator = uniq('generator');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
|
runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
|
||||||
runCLI(
|
runCLI(`generate @nx/plugin:generator ${generator} --project=${plugin}`);
|
||||||
`generate @nrwl/nx-plugin:generator ${generator} --project=${plugin}`
|
|
||||||
);
|
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${plugin}`);
|
const lintResults = runCLI(`lint ${plugin}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -121,9 +119,9 @@ describe('Nx Plugin', () => {
|
|||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
const executor = uniq('executor');
|
const executor = uniq('executor');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
|
runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:executor ${executor} --project=${plugin} --includeHasher`
|
`generate @nx/plugin:executor ${executor} --project=${plugin} --includeHasher`
|
||||||
);
|
);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${plugin}`);
|
const lintResults = runCLI(`lint ${plugin}`);
|
||||||
@ -169,34 +167,32 @@ describe('Nx Plugin', () => {
|
|||||||
|
|
||||||
// Generating the plugin results in a generator also called {plugin},
|
// Generating the plugin results in a generator also called {plugin},
|
||||||
// as well as an executor called "build"
|
// as well as an executor called "build"
|
||||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
|
runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:generator ${goodGenerator} --project=${plugin}`
|
`generate @nx/plugin:generator ${goodGenerator} --project=${plugin}`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:generator ${badFactoryPath} --project=${plugin}`
|
`generate @nx/plugin:generator ${badFactoryPath} --project=${plugin}`
|
||||||
|
);
|
||||||
|
|
||||||
|
runCLI(`generate @nx/plugin:executor ${goodExecutor} --project=${plugin}`);
|
||||||
|
|
||||||
|
runCLI(
|
||||||
|
`generate @nx/plugin:executor ${badExecutorBadImplPath} --project=${plugin}`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:executor ${goodExecutor} --project=${plugin}`
|
`generate @nx/plugin:migration ${badMigrationVersion} --project=${plugin} --packageVersion="invalid"`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:executor ${badExecutorBadImplPath} --project=${plugin}`
|
`generate @nx/plugin:migration ${missingMigrationVersion} --project=${plugin} --packageVersion="0.1.0"`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:migration ${badMigrationVersion} --project=${plugin} --packageVersion="invalid"`
|
`generate @nx/plugin:migration ${goodMigration} --project=${plugin} --packageVersion="0.1.0"`
|
||||||
);
|
|
||||||
|
|
||||||
runCLI(
|
|
||||||
`generate @nrwl/nx-plugin:migration ${missingMigrationVersion} --project=${plugin} --packageVersion="0.1.0"`
|
|
||||||
);
|
|
||||||
|
|
||||||
runCLI(
|
|
||||||
`generate @nrwl/nx-plugin:migration ${goodMigration} --project=${plugin} --packageVersion="0.1.0"`
|
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(`libs/${plugin}/generators.json`, (f) => {
|
updateFile(`libs/${plugin}/generators.json`, (f) => {
|
||||||
@ -262,7 +258,7 @@ describe('Nx Plugin', () => {
|
|||||||
let plugin: string;
|
let plugin: string;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
plugin = uniq('plugin');
|
plugin = uniq('plugin');
|
||||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);
|
runCLI(`generate @nx/plugin:plugin ${plugin} --linter=eslint`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to infer projects and targets', async () => {
|
it('should be able to infer projects and targets', async () => {
|
||||||
@ -310,13 +306,9 @@ describe('Nx Plugin', () => {
|
|||||||
const executor = uniq('executor');
|
const executor = uniq('executor');
|
||||||
const generatedProject = uniq('project');
|
const generatedProject = uniq('project');
|
||||||
|
|
||||||
runCLI(
|
runCLI(`generate @nx/plugin:generator ${generator} --project=${plugin}`);
|
||||||
`generate @nrwl/nx-plugin:generator ${generator} --project=${plugin}`
|
|
||||||
);
|
|
||||||
|
|
||||||
runCLI(
|
runCLI(`generate @nx/plugin:executor ${executor} --project=${plugin}`);
|
||||||
`generate @nrwl/nx-plugin:executor ${executor} --project=${plugin}`
|
|
||||||
);
|
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${plugin}/src/executors/${executor}/executor.ts`,
|
`libs/${plugin}/src/executors/${executor}/executor.ts`,
|
||||||
@ -352,7 +344,7 @@ describe('Nx Plugin', () => {
|
|||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:generator ${generator} --project=${plugin}`
|
`generate @nx/plugin:generator ${generator} --project=${plugin}`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
@ -370,9 +362,9 @@ describe('Nx Plugin', () => {
|
|||||||
it('should work with generate wrapper', () => {
|
it('should work with generate wrapper', () => {
|
||||||
custom = uniq('custom');
|
custom = uniq('custom');
|
||||||
const project = uniq('generated-project');
|
const project = uniq('generated-project');
|
||||||
runCLI(`g @nrwl/nx-plugin:plugin workspace-plugin --no-interactive`);
|
runCLI(`g @nx/plugin:plugin workspace-plugin --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`g @nrwl/nx-plugin:generator ${custom} --project workspace-plugin --no-interactive`
|
`g @nx/plugin:generator ${custom} --project workspace-plugin --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`workspace-generator ${custom} --name ${project} --no-interactive`
|
`workspace-generator ${custom} --name ${project} --no-interactive`
|
||||||
@ -390,7 +382,7 @@ describe('Nx Plugin', () => {
|
|||||||
it('should create a plugin in the specified directory', () => {
|
it('should create a plugin in the specified directory', () => {
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --directory subdir --e2eTestRunner=jest`
|
`generate @nx/plugin:plugin ${plugin} --linter=eslint --directory subdir --e2eTestRunner=jest`
|
||||||
);
|
);
|
||||||
checkFilesExist(`libs/subdir/${plugin}/package.json`);
|
checkFilesExist(`libs/subdir/${plugin}/package.json`);
|
||||||
const pluginProject = readProjectConfig(`subdir-${plugin}`);
|
const pluginProject = readProjectConfig(`subdir-${plugin}`);
|
||||||
@ -403,7 +395,7 @@ describe('Nx Plugin', () => {
|
|||||||
it('should add tags to project configuration', async () => {
|
it('should add tags to project configuration', async () => {
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint --tags=e2etag,e2ePackage `
|
`generate @nx/plugin:plugin ${plugin} --linter=eslint --tags=e2etag,e2ePackage `
|
||||||
);
|
);
|
||||||
const pluginProject = readProjectConfig(plugin);
|
const pluginProject = readProjectConfig(plugin);
|
||||||
expect(pluginProject.tags).toEqual(['e2etag', 'e2ePackage']);
|
expect(pluginProject.tags).toEqual(['e2etag', 'e2ePackage']);
|
||||||
@ -413,9 +405,9 @@ describe('Nx Plugin', () => {
|
|||||||
it('should be able to generate a create-package plugin ', async () => {
|
it('should be able to generate a create-package plugin ', async () => {
|
||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
const createAppName = `create-${plugin}-app`;
|
const createAppName = `create-${plugin}-app`;
|
||||||
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin}`);
|
runCLI(`generate @nx/plugin:plugin ${plugin}`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:create-package ${createAppName} --project=${plugin}`
|
`generate @nx/plugin:create-package ${createAppName} --project=${plugin}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const buildResults = runCLI(`build ${createAppName}`);
|
const buildResults = runCLI(`build ${createAppName}`);
|
||||||
@ -432,7 +424,7 @@ describe('Nx Plugin', () => {
|
|||||||
const plugin = uniq('plugin');
|
const plugin = uniq('plugin');
|
||||||
expect(() =>
|
expect(() =>
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:create-package ${plugin} --project=invalid-plugin`
|
`generate @nx/plugin:create-package ${plugin} --project=invalid-plugin`
|
||||||
)
|
)
|
||||||
).toThrow();
|
).toThrow();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import {
|
|||||||
runCypressTests,
|
runCypressTests,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('React Module Federation', () => {
|
describe('React Module Federation', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
@ -25,15 +25,15 @@ describe('React Module Federation', () => {
|
|||||||
const remote2 = uniq('remote2');
|
const remote2 = uniq('remote2');
|
||||||
const remote3 = uniq('remote3');
|
const remote3 = uniq('remote3');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:host ${shell} --style=css --no-interactive`);
|
runCLI(`generate @nx/react:host ${shell} --style=css --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:remote ${remote1} --style=css --host=${shell} --no-interactive`
|
`generate @nx/react:remote ${remote1} --style=css --host=${shell} --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:remote ${remote2} --style=css --host=${shell} --no-interactive`
|
`generate @nx/react:remote ${remote2} --style=css --host=${shell} --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:remote ${remote3} --style=css --host=${shell} --no-interactive`
|
`generate @nx/react:remote ${remote3} --style=css --host=${shell} --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
checkFilesExist(`apps/${shell}/module-federation.config.js`);
|
checkFilesExist(`apps/${shell}/module-federation.config.js`);
|
||||||
@ -48,10 +48,10 @@ describe('React Module Federation', () => {
|
|||||||
updateFile(
|
updateFile(
|
||||||
`apps/${shell}/webpack.config.js`,
|
`apps/${shell}/webpack.config.js`,
|
||||||
stripIndents`
|
stripIndents`
|
||||||
import { ModuleFederationConfig } from '@nrwl/devkit';
|
import { ModuleFederationConfig } from '@nx/devkit';
|
||||||
import { composePlugins, withNx } from '@nrwl/webpack';
|
import { composePlugins, withNx } from '@nx/webpack';
|
||||||
import { withReact } from '@nrwl/react';
|
import { withReact } from '@nx/react';
|
||||||
import { withModuleFederation } from '@nrwl/react/module-federation');
|
import { withModuleFederation } from '@nx/react/module-federation');
|
||||||
|
|
||||||
const baseConfig = require('./module-federation.config');
|
const baseConfig = require('./module-federation.config');
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import {
|
|||||||
updateFile,
|
updateFile,
|
||||||
updateJson,
|
updateJson,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { names } from '@nx/devkit';
|
import { names } from '@nx/devkit';
|
||||||
|
|
||||||
describe('Build React libraries and apps', () => {
|
describe('Build React libraries and apps', () => {
|
||||||
@ -65,12 +65,12 @@ describe('Build React libraries and apps', () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
runCLI(`generate @nrwl/react:app ${app} `);
|
runCLI(`generate @nx/react:app ${app} `);
|
||||||
updateJson('nx.json', (json) => ({
|
updateJson('nx.json', (json) => ({
|
||||||
...json,
|
...json,
|
||||||
generators: {
|
generators: {
|
||||||
...json.generators,
|
...json.generators,
|
||||||
'@nrwl/react': {
|
'@nx/react': {
|
||||||
library: {
|
library: {
|
||||||
unitTestRunner: 'none',
|
unitTestRunner: 'none',
|
||||||
},
|
},
|
||||||
@ -79,13 +79,13 @@ describe('Build React libraries and apps', () => {
|
|||||||
}));
|
}));
|
||||||
// generate buildable libs
|
// generate buildable libs
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:library ${parentLib} --bundler=rollup --importPath=@${proj}/${parentLib} --no-interactive --unitTestRunner=jest`
|
`generate @nx/react:library ${parentLib} --bundler=rollup --importPath=@${proj}/${parentLib} --no-interactive --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:library ${childLib} --bundler=rollup --importPath=@${proj}/${childLib} --no-interactive --unitTestRunner=jest`
|
`generate @nx/react:library ${childLib} --bundler=rollup --importPath=@${proj}/${childLib} --no-interactive --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:library ${childLib2} --bundler=rollup --importPath=@${proj}/${childLib2} --no-interactive --unitTestRunner=jest`
|
`generate @nx/react:library ${childLib2} --bundler=rollup --importPath=@${proj}/${childLib2} --no-interactive --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
|
|
||||||
createDep(parentLib, [childLib, childLib2]);
|
createDep(parentLib, [childLib, childLib2]);
|
||||||
@ -190,7 +190,7 @@ export async function h() { return 'c'; }
|
|||||||
// Setup
|
// Setup
|
||||||
const myLib = uniq('my-lib');
|
const myLib = uniq('my-lib');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:library ${myLib} --bundler=rollup --publishable --importPath="@mproj/${myLib}" --no-interactive --unitTestRunner=jest`
|
`generate @nx/react:library ${myLib} --bundler=rollup --publishable --importPath="@mproj/${myLib}" --no-interactive --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -249,7 +249,7 @@ export async function h() { return 'c'; }
|
|||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${libName} --bundler=rollup --importPath=@${proj}/${libName} --no-interactive --unitTestRunner=jest`
|
`generate @nx/react:lib ${libName} --bundler=rollup --importPath=@${proj}/${libName} --no-interactive --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
|
|
||||||
const mainPath = `libs/${libName}/src/lib/${libName}.tsx`;
|
const mainPath = `libs/${libName}/src/lib/${libName}.tsx`;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import {
|
|||||||
updateFile,
|
updateFile,
|
||||||
updateJson,
|
updateJson,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { readFileSync } from 'fs-extra';
|
import { readFileSync } from 'fs-extra';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|
||||||
@ -35,13 +35,13 @@ describe('React Applications', () => {
|
|||||||
const logoSvg = readFileSync(join(__dirname, 'logo.svg')).toString();
|
const logoSvg = readFileSync(join(__dirname, 'logo.svg')).toString();
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${appName} --style=css --bundler=webpack --no-interactive`
|
`generate @nx/react:app ${appName} --style=css --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${libName} --style=css --no-interactive --unit-test-runner=jest`
|
`generate @nx/react:lib ${libName} --style=css --no-interactive --unit-test-runner=jest`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${libWithNoComponents} --no-interactive --no-component --unit-test-runner=jest`
|
`generate @nx/react:lib ${libWithNoComponents} --no-interactive --no-component --unit-test-runner=jest`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Libs should not include package.json by default
|
// Libs should not include package.json by default
|
||||||
@ -107,7 +107,7 @@ describe('React Applications', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Set up SSR and check app
|
// Set up SSR and check app
|
||||||
runCLI(`generate @nrwl/react:setup-ssr ${appName}`);
|
runCLI(`generate @nx/react:setup-ssr ${appName}`);
|
||||||
checkFilesExist(`apps/${appName}/src/main.server.tsx`);
|
checkFilesExist(`apps/${appName}/src/main.server.tsx`);
|
||||||
checkFilesExist(`apps/${appName}/server.ts`);
|
checkFilesExist(`apps/${appName}/server.ts`);
|
||||||
|
|
||||||
@ -129,15 +129,15 @@ describe('React Applications', () => {
|
|||||||
const plainJsLib = uniq('jslib');
|
const plainJsLib = uniq('jslib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${appName} --bundler=webpack --no-interactive --js`
|
`generate @nx/react:app ${appName} --bundler=webpack --no-interactive --js`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${libName} --no-interactive --js --unit-test-runner=none`
|
`generate @nx/react:lib ${libName} --no-interactive --js --unit-test-runner=none`
|
||||||
);
|
);
|
||||||
// Make sure plain JS libs can be imported as well.
|
// Make sure plain JS libs can be imported as well.
|
||||||
// There was an issue previously: https://github.com/nrwl/nx/issues/10990
|
// There was an issue previously: https://github.com/nrwl/nx/issues/10990
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/js:lib ${plainJsLib} --js --unit-test-runner=none --bundler=none --compiler=tsc --no-interactive`
|
`generate @nx/js:lib ${plainJsLib} --js --unit-test-runner=none --bundler=none --compiler=tsc --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const mainPath = `apps/${appName}/src/main.js`;
|
const mainPath = `apps/${appName}/src/main.js`;
|
||||||
@ -159,11 +159,9 @@ describe('React Applications', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
|
runCLI(`generate @nx/react:app ${appName} --bundler=vite --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${appName} --bundler=vite --no-interactive`
|
`generate @nx/react:lib ${libName} --bundler=none --no-interactive --unit-test-runner=vitest`
|
||||||
);
|
|
||||||
runCLI(
|
|
||||||
`generate @nrwl/react:lib ${libName} --bundler=none --no-interactive --unit-test-runner=vitest`
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Library generated with Vite
|
// Library generated with Vite
|
||||||
@ -191,7 +189,7 @@ describe('React Applications', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${appName} --routing --bundler=webpack --no-interactive`
|
`generate @nx/react:app ${appName} --routing --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(`build ${appName} --outputHashing none`);
|
runCLI(`build ${appName} --outputHashing none`);
|
||||||
@ -207,12 +205,12 @@ describe('React Applications', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(`g @nrwl/react:app ${appName} --bundler=webpack --no-interactive`);
|
runCLI(`g @nx/react:app ${appName} --bundler=webpack --no-interactive`);
|
||||||
runCLI(`g @nrwl/react:redux lemon --project=${appName}`);
|
runCLI(`g @nx/react:redux lemon --project=${appName}`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`g @nrwl/react:lib ${libName} --unit-test-runner=jest --no-interactive`
|
`g @nx/react:lib ${libName} --unit-test-runner=jest --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(`g @nrwl/react:redux orange --project=${libName}`);
|
runCLI(`g @nx/react:redux orange --project=${libName}`);
|
||||||
|
|
||||||
const appTestResults = await runCLIAsync(`test ${appName}`);
|
const appTestResults = await runCLIAsync(`test ${appName}`);
|
||||||
expect(appTestResults.combinedOutput).toContain(
|
expect(appTestResults.combinedOutput).toContain(
|
||||||
@ -235,7 +233,7 @@ describe('React Applications', () => {
|
|||||||
`('should support global and css modules', ({ style }) => {
|
`('should support global and css modules', ({ style }) => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${appName} --style=${style} --bundler=webpack --no-interactive`
|
`generate @nx/react:app ${appName} --style=${style} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
// make sure stylePreprocessorOptions works
|
// make sure stylePreprocessorOptions works
|
||||||
@ -271,9 +269,9 @@ describe('React Applications', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(`g @nrwl/react:app ${appName} --bundler=webpack --no-interactive`);
|
runCLI(`g @nx/react:app ${appName} --bundler=webpack --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`g @nrwl/react:lib ${libName} --no-interactive --unit-test-runner=none`
|
`g @nx/react:lib ${libName} --no-interactive --unit-test-runner=none`
|
||||||
);
|
);
|
||||||
|
|
||||||
const mainPath = `apps/${appName}/src/main.tsx`;
|
const mainPath = `apps/${appName}/src/main.tsx`;
|
||||||
|
|||||||
@ -21,14 +21,14 @@ describe('React Cypress Component Tests', () => {
|
|||||||
ensureCypressInstallation();
|
ensureCypressInstallation();
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${appName} --bundler=webpack --no-interactive`
|
`generate @nx/react:app ${appName} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateJson('nx.json', (json) => ({
|
updateJson('nx.json', (json) => ({
|
||||||
...json,
|
...json,
|
||||||
generators: {
|
generators: {
|
||||||
...json.generators,
|
...json.generators,
|
||||||
'@nrwl/react': {
|
'@nx/react': {
|
||||||
library: {
|
library: {
|
||||||
unitTestRunner: 'jest',
|
unitTestRunner: 'jest',
|
||||||
},
|
},
|
||||||
@ -37,13 +37,13 @@ describe('React Cypress Component Tests', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:component fancy-cmp --project=${appName} --no-interactive`
|
`generate @nx/react:component fancy-cmp --project=${appName} --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${usedInAppLibName} --no-interactive --unitTestRunner=jest`
|
`generate @nx/react:lib ${usedInAppLibName} --no-interactive --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:component btn --project=${usedInAppLibName} --export --no-interactive`
|
`generate @nx/react:component btn --project=${usedInAppLibName} --export --no-interactive`
|
||||||
);
|
);
|
||||||
// makes sure custom webpack is loading
|
// makes sure custom webpack is loading
|
||||||
createFile(
|
createFile(
|
||||||
@ -102,10 +102,10 @@ export default App;`
|
|||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${buildableLibName} --buildable --no-interactive --unitTestRunner=jest`
|
`generate @nx/react:lib ${buildableLibName} --buildable --no-interactive --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:component input --project=${buildableLibName} --export --no-interactive`
|
`generate @nx/react:component input --project=${buildableLibName} --export --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(
|
updateFile(
|
||||||
@ -144,7 +144,7 @@ export default Input;
|
|||||||
|
|
||||||
it('should test app', () => {
|
it('should test app', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:cypress-component-configuration --project=${appName} --generate-tests`
|
`generate @nx/react:cypress-component-configuration --project=${appName} --generate-tests`
|
||||||
);
|
);
|
||||||
expect(runCLI(`component-test ${appName} --no-watch`)).toContain(
|
expect(runCLI(`component-test ${appName} --no-watch`)).toContain(
|
||||||
'All specs passed!'
|
'All specs passed!'
|
||||||
@ -153,7 +153,7 @@ export default Input;
|
|||||||
|
|
||||||
it('should successfully component test lib being used in app', () => {
|
it('should successfully component test lib being used in app', () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:cypress-component-configuration --project=${usedInAppLibName} --generate-tests`
|
`generate @nx/react:cypress-component-configuration --project=${usedInAppLibName} --generate-tests`
|
||||||
);
|
);
|
||||||
expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain(
|
expect(runCLI(`component-test ${usedInAppLibName} --no-watch`)).toContain(
|
||||||
'All specs passed!'
|
'All specs passed!'
|
||||||
@ -182,14 +182,14 @@ describe(Input.name, () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build`
|
`generate @nx/react:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build`
|
||||||
);
|
);
|
||||||
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
|
expect(runCLI(`component-test ${buildableLibName} --no-watch`)).toContain(
|
||||||
'All specs passed!'
|
'All specs passed!'
|
||||||
);
|
);
|
||||||
|
|
||||||
// add tailwind
|
// add tailwind
|
||||||
runCLI(`generate @nrwl/react:setup-tailwind --project=${buildableLibName}`);
|
runCLI(`generate @nx/react:setup-tailwind --project=${buildableLibName}`);
|
||||||
updateFile(
|
updateFile(
|
||||||
`libs/${buildableLibName}/src/styles.css`,
|
`libs/${buildableLibName}/src/styles.css`,
|
||||||
`
|
`
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Build React applications and libraries with Vite', () => {
|
describe('Build React applications and libraries with Vite', () => {
|
||||||
let proj: string;
|
let proj: string;
|
||||||
@ -23,7 +23,7 @@ describe('Build React applications and libraries with Vite', () => {
|
|||||||
const viteApp = uniq('viteapp');
|
const viteApp = uniq('viteapp');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${viteApp} --bundler=vite --unitTestRunner=vitest --no-interactive`
|
`generate @nx/react:app ${viteApp} --bundler=vite --unitTestRunner=vitest --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const appTestResults = await runCLIAsync(`test ${viteApp}`);
|
const appTestResults = await runCLIAsync(`test ${viteApp}`);
|
||||||
@ -45,7 +45,7 @@ describe('Build React applications and libraries with Vite', () => {
|
|||||||
const viteLib = uniq('vitelib');
|
const viteLib = uniq('vitelib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${viteApp} --bundler=vite --unitTestRunner=vitest --inSourceTests --no-interactive`
|
`generate @nx/react:app ${viteApp} --bundler=vite --unitTestRunner=vitest --inSourceTests --no-interactive`
|
||||||
);
|
);
|
||||||
expect(() => {
|
expect(() => {
|
||||||
checkFilesExist(`apps/${viteApp}/src/app/app.spec.tsx`);
|
checkFilesExist(`apps/${viteApp}/src/app/app.spec.tsx`);
|
||||||
@ -65,21 +65,21 @@ describe('Build React applications and libraries with Vite', () => {
|
|||||||
checkFilesExist(`dist/apps/${viteApp}/index.html`);
|
checkFilesExist(`dist/apps/${viteApp}/index.html`);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${viteLib} --bundler=vite --inSourceTests --unitTestRunner=vitest --no-interactive`
|
`generate @nx/react:lib ${viteLib} --bundler=vite --inSourceTests --unitTestRunner=vitest --no-interactive`
|
||||||
);
|
);
|
||||||
expect(() => {
|
expect(() => {
|
||||||
checkFilesExist(`libs/${viteLib}/src/lib/${viteLib}.spec.tsx`);
|
checkFilesExist(`libs/${viteLib}/src/lib/${viteLib}.spec.tsx`);
|
||||||
}).toThrow();
|
}).toThrow();
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:component comp1 --inSourceTests --export --project=${viteLib} --no-interactive`
|
`generate @nx/react:component comp1 --inSourceTests --export --project=${viteLib} --no-interactive`
|
||||||
);
|
);
|
||||||
expect(() => {
|
expect(() => {
|
||||||
checkFilesExist(`libs/${viteLib}/src/lib/comp1/comp1.spec.tsx`);
|
checkFilesExist(`libs/${viteLib}/src/lib/comp1/comp1.spec.tsx`);
|
||||||
}).toThrow();
|
}).toThrow();
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:component comp2 --export --project=${viteLib} --no-interactive`
|
`generate @nx/react:component comp2 --export --project=${viteLib} --no-interactive`
|
||||||
);
|
);
|
||||||
checkFilesExist(`libs/${viteLib}/src/lib/comp2/comp2.spec.tsx`);
|
checkFilesExist(`libs/${viteLib}/src/lib/comp2/comp2.spec.tsx`);
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ describe('Build React applications and libraries with Vite', () => {
|
|||||||
const viteLib = uniq('vitelib');
|
const viteLib = uniq('vitelib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${viteLib} --bundler=vite --no-interactive --unit-test-runner=none`
|
`generate @nx/react:lib ${viteLib} --bundler=vite --no-interactive --unit-test-runner=none`
|
||||||
);
|
);
|
||||||
|
|
||||||
const packageJson = readJson('package.json');
|
const packageJson = readJson('package.json');
|
||||||
@ -125,10 +125,10 @@ describe('Build React applications and libraries with Vite', () => {
|
|||||||
// Convert non-buildable lib to buildable one
|
// Convert non-buildable lib to buildable one
|
||||||
const nonBuildableLib = uniq('nonbuildablelib');
|
const nonBuildableLib = uniq('nonbuildablelib');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${nonBuildableLib} --no-interactive --unitTestRunner=jest`
|
`generate @nx/react:lib ${nonBuildableLib} --no-interactive --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/vite:configuration ${nonBuildableLib} --uiFramework=react --no-interactive`
|
`generate @nx/vite:configuration ${nonBuildableLib} --uiFramework=react --no-interactive`
|
||||||
);
|
);
|
||||||
await runCLIAsync(`build ${nonBuildableLib}`);
|
await runCLIAsync(`build ${nonBuildableLib}`);
|
||||||
checkFilesExist(
|
checkFilesExist(
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import {
|
|||||||
runCommandUntil,
|
runCommandUntil,
|
||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { ChildProcess } from 'child_process';
|
import { ChildProcess } from 'child_process';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|
||||||
@ -24,10 +24,10 @@ describe('react native', () => {
|
|||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
proj = newProject();
|
proj = newProject();
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react-native:application ${appName} --install=false --no-interactive`
|
`generate @nx/react-native:application ${appName} --install=false --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react-native:library ${libName} --buildable --publishable --importPath=${proj}/${libName} --no-interactive`
|
`generate @nx/react-native:library ${libName} --buildable --publishable --importPath=${proj}/${libName} --no-interactive`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
afterAll(() => cleanupProject());
|
afterAll(() => cleanupProject());
|
||||||
@ -35,7 +35,7 @@ describe('react native', () => {
|
|||||||
it('should test and lint', async () => {
|
it('should test and lint', async () => {
|
||||||
const componentName = uniq('component');
|
const componentName = uniq('component');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react-native:component ${componentName} --project=${libName} --export --no-interactive`
|
`generate @nx/react-native:component ${componentName} --project=${libName} --export --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(`apps/${appName}/src/app/App.tsx`, (content) => {
|
updateFile(`apps/${appName}/src/app/App.tsx`, (content) => {
|
||||||
@ -119,7 +119,7 @@ describe('react native', () => {
|
|||||||
|
|
||||||
it('should create storybook with application', async () => {
|
it('should create storybook with application', async () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react-native:storybook-configuration ${appName} --generateStories --no-interactive`
|
`generate @nx/react-native:storybook-configuration ${appName} --generateStories --no-interactive`
|
||||||
);
|
);
|
||||||
expect(() =>
|
expect(() =>
|
||||||
checkFilesExist(
|
checkFilesExist(
|
||||||
@ -145,7 +145,7 @@ describe('react native', () => {
|
|||||||
it('should upgrade native for application', async () => {
|
it('should upgrade native for application', async () => {
|
||||||
expect(() =>
|
expect(() =>
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react-native:upgrade-native ${appName} --install=false`
|
`generate @nx/react-native:upgrade-native ${appName} --install=false`
|
||||||
)
|
)
|
||||||
).not.toThrow();
|
).not.toThrow();
|
||||||
});
|
});
|
||||||
@ -154,7 +154,7 @@ describe('react native', () => {
|
|||||||
const componentName = uniq('component');
|
const componentName = uniq('component');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react-native:component ${componentName} --project=${libName} --export`
|
`generate @nx/react-native:component ${componentName} --project=${libName} --export`
|
||||||
);
|
);
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`build ${libName}`);
|
runCLI(`build ${libName}`);
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Rollup Plugin', () => {
|
describe('Rollup Plugin', () => {
|
||||||
beforeAll(() => newProject());
|
beforeAll(() => newProject());
|
||||||
@ -15,12 +15,12 @@ describe('Rollup Plugin', () => {
|
|||||||
|
|
||||||
it('should be able to setup project to build node programs with rollup and different compilers', async () => {
|
it('should be able to setup project to build node programs with rollup and different compilers', async () => {
|
||||||
const myPkg = uniq('my-pkg');
|
const myPkg = uniq('my-pkg');
|
||||||
runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=none`);
|
runCLI(`generate @nx/js:lib ${myPkg} --bundler=none`);
|
||||||
updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`);
|
updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`);
|
||||||
|
|
||||||
// babel (default)
|
// babel (default)
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts`
|
`generate @nx/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts`
|
||||||
);
|
);
|
||||||
rmDist();
|
rmDist();
|
||||||
runCLI(`build ${myPkg}`);
|
runCLI(`build ${myPkg}`);
|
||||||
@ -34,7 +34,7 @@ describe('Rollup Plugin', () => {
|
|||||||
|
|
||||||
// swc
|
// swc
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=swc`
|
`generate @nx/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=swc`
|
||||||
);
|
);
|
||||||
rmDist();
|
rmDist();
|
||||||
runCLI(`build ${myPkg}`);
|
runCLI(`build ${myPkg}`);
|
||||||
@ -48,7 +48,7 @@ describe('Rollup Plugin', () => {
|
|||||||
|
|
||||||
// tsc
|
// tsc
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=tsc`
|
`generate @nx/rollup:rollup-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=tsc`
|
||||||
);
|
);
|
||||||
rmDist();
|
rmDist();
|
||||||
runCLI(`build ${myPkg}`);
|
runCLI(`build ${myPkg}`);
|
||||||
@ -56,9 +56,9 @@ describe('Rollup Plugin', () => {
|
|||||||
expect(output).toMatch(/Hello/);
|
expect(output).toMatch(/Hello/);
|
||||||
}, 500000);
|
}, 500000);
|
||||||
|
|
||||||
it('should be able to build libs generated with @nrwl/js:lib --bundler rollup', () => {
|
it('should be able to build libs generated with @nx/js:lib --bundler rollup', () => {
|
||||||
const jsLib = uniq('jslib');
|
const jsLib = uniq('jslib');
|
||||||
runCLI(`generate @nrwl/js:lib ${jsLib} --bundler rollup`);
|
runCLI(`generate @nx/js:lib ${jsLib} --bundler rollup`);
|
||||||
expect(() => runCLI(`build ${jsLib}`)).not.toThrow();
|
expect(() => runCLI(`build ${jsLib}`)).not.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
runCypressTests,
|
runCypressTests,
|
||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { writeFileSync } from 'fs';
|
import { writeFileSync } from 'fs';
|
||||||
|
|
||||||
describe('Storybook executors for Angular', () => {
|
describe('Storybook executors for Angular', () => {
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
runCreateWorkspace,
|
runCreateWorkspace,
|
||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { writeFileSync } from 'fs';
|
import { writeFileSync } from 'fs';
|
||||||
import { createFileSync } from 'fs-extra';
|
import { createFileSync } from 'fs-extra';
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
runCommandUntil,
|
runCommandUntil,
|
||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { writeFileSync } from 'fs';
|
import { writeFileSync } from 'fs';
|
||||||
|
|
||||||
// TODO: re-enable once the issue is fixed with long build times
|
// TODO: re-enable once the issue is fixed with long build times
|
||||||
|
|||||||
@ -48,9 +48,9 @@ export function setMaxWorkers() {
|
|||||||
|
|
||||||
const executor = build.executor as string;
|
const executor = build.executor as string;
|
||||||
if (
|
if (
|
||||||
executor.startsWith('@nrwl/node') ||
|
executor.startsWith('@nx/node') ||
|
||||||
executor.startsWith('@nrwl/web') ||
|
executor.startsWith('@nx/web') ||
|
||||||
executor.startsWith('@nrwl/jest')
|
executor.startsWith('@nx/jest')
|
||||||
) {
|
) {
|
||||||
build.options.maxWorkers = 4;
|
build.options.maxWorkers = 4;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,25 +61,25 @@ export function newProject({
|
|||||||
|
|
||||||
// TODO(jack): we should tag the projects (e.g. tags: ['package']) and filter from that rather than hard-code packages.
|
// TODO(jack): we should tag the projects (e.g. tags: ['package']) and filter from that rather than hard-code packages.
|
||||||
const packages = [
|
const packages = [
|
||||||
`@nrwl/angular`,
|
`@nx/angular`,
|
||||||
`@nrwl/eslint-plugin-nx`,
|
`@nx/eslint-plugin`,
|
||||||
`@nrwl/express`,
|
`@nx/express`,
|
||||||
`@nrwl/esbuild`,
|
`@nx/esbuild`,
|
||||||
`@nrwl/jest`,
|
`@nx/jest`,
|
||||||
`@nrwl/js`,
|
`@nx/js`,
|
||||||
`@nrwl/linter`,
|
`@nx/linter`,
|
||||||
`@nrwl/nest`,
|
`@nx/nest`,
|
||||||
`@nrwl/next`,
|
`@nx/next`,
|
||||||
`@nrwl/node`,
|
`@nx/node`,
|
||||||
`@nrwl/nx-plugin`,
|
`@nx/plugin`,
|
||||||
`@nrwl/rollup`,
|
`@nx/rollup`,
|
||||||
`@nrwl/react`,
|
`@nx/react`,
|
||||||
`@nrwl/storybook`,
|
`@nx/storybook`,
|
||||||
`@nrwl/vite`,
|
`@nx/vite`,
|
||||||
`@nrwl/web`,
|
`@nx/web`,
|
||||||
`@nrwl/webpack`,
|
`@nx/webpack`,
|
||||||
`@nrwl/react-native`,
|
`@nx/react-native`,
|
||||||
`@nrwl/expo`,
|
`@nx/expo`,
|
||||||
];
|
];
|
||||||
packageInstall(packages.join(` `), projScope);
|
packageInstall(packages.join(` `), projScope);
|
||||||
|
|
||||||
@ -400,6 +400,7 @@ export function newLernaWorkspace({
|
|||||||
...json.overrides,
|
...json.overrides,
|
||||||
nx: nxVersion,
|
nx: nxVersion,
|
||||||
'@nrwl/devkit': nxVersion,
|
'@nrwl/devkit': nxVersion,
|
||||||
|
'@nx/devkit': nxVersion,
|
||||||
};
|
};
|
||||||
if (packageManager === 'pnpm') {
|
if (packageManager === 'pnpm') {
|
||||||
json.pnpm = {
|
json.pnpm = {
|
||||||
|
|||||||
@ -9,13 +9,13 @@ import { uniq } from './create-project-utils';
|
|||||||
import { readFile } from './file-utils';
|
import { readFile } from './file-utils';
|
||||||
|
|
||||||
type GeneratorsWithDefaultTests =
|
type GeneratorsWithDefaultTests =
|
||||||
| '@nrwl/js:lib'
|
| '@nx/js:lib'
|
||||||
| '@nrwl/node:lib'
|
| '@nx/node:lib'
|
||||||
| '@nrwl/react:lib'
|
| '@nx/react:lib'
|
||||||
| '@nrwl/react:app'
|
| '@nx/react:app'
|
||||||
| '@nrwl/next:app'
|
| '@nx/next:app'
|
||||||
| '@nrwl/angular:app'
|
| '@nx/angular:app'
|
||||||
| '@nrwl/web:app';
|
| '@nx/web:app';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs the pass in generator and then runs test on
|
* Runs the pass in generator and then runs test on
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
const myApp = uniq('my-app');
|
const myApp = uniq('my-app');
|
||||||
|
|
||||||
@ -28,8 +28,8 @@ describe('Vite Plugin', () => {
|
|||||||
describe('convert React webpack app to vite using the vite:configuration generator', () => {
|
describe('convert React webpack app to vite using the vite:configuration generator', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
proj = newProject();
|
proj = newProject();
|
||||||
runCLI(`generate @nrwl/react:app ${myApp} --bundler=webpack`);
|
runCLI(`generate @nx/react:app ${myApp} --bundler=webpack`);
|
||||||
runCLI(`generate @nrwl/vite:configuration ${myApp}`);
|
runCLI(`generate @nx/vite:configuration ${myApp}`);
|
||||||
});
|
});
|
||||||
afterEach(() => cleanupProject());
|
afterEach(() => cleanupProject());
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ describe('Vite Plugin', () => {
|
|||||||
describe('set up new React app with --bundler=vite option', () => {
|
describe('set up new React app with --bundler=vite option', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
proj = newProject();
|
proj = newProject();
|
||||||
runCLI(`generate @nrwl/react:app ${myApp} --bundler=vite`);
|
runCLI(`generate @nx/react:app ${myApp} --bundler=vite`);
|
||||||
createFile(`apps/${myApp}/public/hello.md`, `# Hello World`);
|
createFile(`apps/${myApp}/public/hello.md`, `# Hello World`);
|
||||||
updateFile(
|
updateFile(
|
||||||
`apps/${myApp}/src/environments/environment.prod.ts`,
|
`apps/${myApp}/src/environments/environment.prod.ts`,
|
||||||
@ -127,10 +127,10 @@ describe('Vite Plugin', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Vite on Web apps', () => {
|
describe('Vite on Web apps', () => {
|
||||||
describe('set up new @nrwl/web app with --bundler=vite option', () => {
|
describe('set up new @nx/web app with --bundler=vite option', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
proj = newProject();
|
proj = newProject();
|
||||||
runCLI(`generate @nrwl/web:app ${myApp} --bundler=vite`);
|
runCLI(`generate @nx/web:app ${myApp} --bundler=vite`);
|
||||||
});
|
});
|
||||||
afterEach(() => cleanupProject());
|
afterEach(() => cleanupProject());
|
||||||
it('should build application', async () => {
|
it('should build application', async () => {
|
||||||
@ -146,11 +146,11 @@ describe('Vite Plugin', () => {
|
|||||||
}, 200_000);
|
}, 200_000);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('convert @nrwl/web webpack app to vite using the vite:configuration generator', () => {
|
describe('convert @nx/web webpack app to vite using the vite:configuration generator', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
proj = newProject();
|
proj = newProject();
|
||||||
runCLI(`generate @nrwl/web:app ${myApp} --bundler=webpack`);
|
runCLI(`generate @nx/web:app ${myApp} --bundler=webpack`);
|
||||||
runCLI(`generate @nrwl/vite:configuration ${myApp}`);
|
runCLI(`generate @nx/vite:configuration ${myApp}`);
|
||||||
});
|
});
|
||||||
afterEach(() => cleanupProject());
|
afterEach(() => cleanupProject());
|
||||||
it('should build application', async () => {
|
it('should build application', async () => {
|
||||||
@ -198,7 +198,7 @@ describe('Vite Plugin', () => {
|
|||||||
100_000;
|
100_000;
|
||||||
|
|
||||||
it('should be able to run tests', async () => {
|
it('should be able to run tests', async () => {
|
||||||
runCLI(`generate @nrwl/react:lib ${lib} --unitTestRunner=vitest`);
|
runCLI(`generate @nx/react:lib ${lib} --unitTestRunner=vitest`);
|
||||||
expect(exists(tmpProjPath(`libs/${lib}/vite.config.ts`))).toBeTruthy();
|
expect(exists(tmpProjPath(`libs/${lib}/vite.config.ts`))).toBeTruthy();
|
||||||
|
|
||||||
const result = await runCLIAsync(`test ${lib}`);
|
const result = await runCLIAsync(`test ${lib}`);
|
||||||
@ -216,7 +216,7 @@ describe('Vite Plugin', () => {
|
|||||||
}, 100_000);
|
}, 100_000);
|
||||||
|
|
||||||
it('should collect coverage', () => {
|
it('should collect coverage', () => {
|
||||||
runCLI(`generate @nrwl/react:lib ${lib} --unitTestRunner=vitest`);
|
runCLI(`generate @nx/react:lib ${lib} --unitTestRunner=vitest`);
|
||||||
updateFile(`libs/${lib}/vite.config.ts`, () => {
|
updateFile(`libs/${lib}/vite.config.ts`, () => {
|
||||||
return `/// <reference types="vitest" />
|
return `/// <reference types="vitest" />
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
@ -267,8 +267,8 @@ export default defineConfig({
|
|||||||
|
|
||||||
it('should not delete the project directory when coverage is enabled', () => {
|
it('should not delete the project directory when coverage is enabled', () => {
|
||||||
// when coverage is enabled in the vite.config.ts but reportsDirectory is removed
|
// when coverage is enabled in the vite.config.ts but reportsDirectory is removed
|
||||||
// from the @nrwl/vite:test executor options, vite will delete the project root directory
|
// from the @nx/vite:test executor options, vite will delete the project root directory
|
||||||
runCLI(`generate @nrwl/react:lib ${lib} --unitTestRunner=vitest`);
|
runCLI(`generate @nx/react:lib ${lib} --unitTestRunner=vitest`);
|
||||||
updateFile(`libs/${lib}/vite.config.ts`, () => {
|
updateFile(`libs/${lib}/vite.config.ts`, () => {
|
||||||
return `import { defineConfig } from 'vite';
|
return `import { defineConfig } from 'vite';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
@ -320,7 +320,7 @@ export default defineConfig({
|
|||||||
|
|
||||||
it('should be able to run tests with inSourceTests set to true', async () => {
|
it('should be able to run tests with inSourceTests set to true', async () => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${lib} --unitTestRunner=vitest --inSourceTests`
|
`generate @nx/react:lib ${lib} --unitTestRunner=vitest --inSourceTests`
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
exists(tmpProjPath(`libs/${lib}/src/lib/${lib}.spec.tsx`))
|
exists(tmpProjPath(`libs/${lib}/src/lib/${lib}.spec.tsx`))
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
runCommandUntil,
|
runCommandUntil,
|
||||||
uniq,
|
uniq,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('file-server', () => {
|
describe('file-server', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
@ -19,9 +19,9 @@ describe('file-server', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const port = 4301;
|
const port = 4301;
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/web:app ${appName} --no-interactive`);
|
||||||
updateProjectConfig(appName, (config) => {
|
updateProjectConfig(appName, (config) => {
|
||||||
config.targets['serve'].executor = '@nrwl/web:file-server';
|
config.targets['serve'].executor = '@nx/web:file-server';
|
||||||
return config;
|
return config;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -45,16 +45,16 @@ describe('file-server', () => {
|
|||||||
const reactAppName = uniq('react-app');
|
const reactAppName = uniq('react-app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/angular:app ${ngAppName} --no-interactive --e2eTestRunner=none`
|
`generate @nx/angular:app ${ngAppName} --no-interactive --e2eTestRunner=none`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:app ${reactAppName} --no-interactive --e2eTestRunner=none`
|
`generate @nx/react:app ${reactAppName} --no-interactive --e2eTestRunner=none`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:static-config --buildTarget=${ngAppName}:build --no-interactive`
|
`generate @nx/web:static-config --buildTarget=${ngAppName}:build --no-interactive`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:static-config --buildTarget=${reactAppName}:build --targetName=custom-serve-static --no-interactive`
|
`generate @nx/web:static-config --buildTarget=${reactAppName}:build --targetName=custom-serve-static --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const port = 6200;
|
const port = 6200;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import {
|
|||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
runCypressTests,
|
runCypressTests,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Web Components Applications with bundler set as vite', () => {
|
describe('Web Components Applications with bundler set as vite', () => {
|
||||||
beforeEach(() => newProject());
|
beforeEach(() => newProject());
|
||||||
@ -19,7 +19,7 @@ describe('Web Components Applications with bundler set as vite', () => {
|
|||||||
|
|
||||||
it('should be able to generate a web app', async () => {
|
it('should be able to generate a web app', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
runCLI(`generate @nrwl/web:app ${appName} --bundler=vite --no-interactive`);
|
runCLI(`generate @nx/web:app ${appName} --bundler=vite --no-interactive`);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${appName}`);
|
const lintResults = runCLI(`lint ${appName}`);
|
||||||
expect(lintResults).toContain('All files pass linting.');
|
expect(lintResults).toContain('All files pass linting.');
|
||||||
@ -46,9 +46,9 @@ describe('Web Components Applications with bundler set as vite', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(`generate @nrwl/web:app ${appName} --bundler=vite --no-interactive`);
|
runCLI(`generate @nx/web:app ${appName} --bundler=vite --no-interactive`);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${libName} --bundler=vite --no-interactive --unitTestRunner=vitest`
|
`generate @nx/react:lib ${libName} --bundler=vite --no-interactive --unitTestRunner=vitest`
|
||||||
);
|
);
|
||||||
|
|
||||||
createFile(`dist/apps/${appName}/_should_remove.txt`);
|
createFile(`dist/apps/${appName}/_should_remove.txt`);
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import {
|
|||||||
runCLI,
|
runCLI,
|
||||||
runCommandUntil,
|
runCommandUntil,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Web Components Applications with bundler set as webpack', () => {
|
describe('Web Components Applications with bundler set as webpack', () => {
|
||||||
beforeEach(() => newProject());
|
beforeEach(() => newProject());
|
||||||
@ -13,7 +13,7 @@ describe('Web Components Applications with bundler set as webpack', () => {
|
|||||||
it('should support https for dev-server', async () => {
|
it('should support https for dev-server', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
|
`generate @nx/web:app ${appName} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
await runCommandUntil(`serve ${appName} --port=5000 --ssl`, (output) => {
|
await runCommandUntil(`serve ${appName} --port=5000 --ssl`, (output) => {
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Web Components Applications', () => {
|
describe('Web Components Applications', () => {
|
||||||
beforeEach(() => newProject());
|
beforeEach(() => newProject());
|
||||||
@ -24,7 +24,7 @@ describe('Web Components Applications', () => {
|
|||||||
it('should be able to generate a web app', async () => {
|
it('should be able to generate a web app', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
|
`generate @nx/web:app ${appName} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const lintResults = runCLI(`lint ${appName}`);
|
const lintResults = runCLI(`lint ${appName}`);
|
||||||
@ -64,10 +64,10 @@ describe('Web Components Applications', () => {
|
|||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive --compiler swc`
|
`generate @nx/web:app ${appName} --bundler=webpack --no-interactive --compiler swc`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react:lib ${libName} --bundler=rollup --no-interactive --compiler swc --unitTestRunner=jest`
|
`generate @nx/react:lib ${libName} --bundler=rollup --no-interactive --compiler swc --unitTestRunner=jest`
|
||||||
);
|
);
|
||||||
|
|
||||||
createFile(`dist/apps/${appName}/_should_remove.txt`);
|
createFile(`dist/apps/${appName}/_should_remove.txt`);
|
||||||
@ -103,7 +103,7 @@ describe('Web Components Applications', () => {
|
|||||||
it('should emit decorator metadata when it is enabled in tsconfig', async () => {
|
it('should emit decorator metadata when it is enabled in tsconfig', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
|
`generate @nx/web:app ${appName} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateFile(`apps/${appName}/src/app/app.element.ts`, (content) => {
|
updateFile(`apps/${appName}/src/app/app.element.ts`, (content) => {
|
||||||
@ -158,7 +158,7 @@ describe('Web Components Applications', () => {
|
|||||||
it('should support custom webpackConfig option', async () => {
|
it('should support custom webpackConfig option', async () => {
|
||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
|
`generate @nx/web:app ${appName} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
updateProjectConfig(appName, (config) => {
|
updateProjectConfig(appName, (config) => {
|
||||||
@ -257,7 +257,7 @@ describe('CLI - Environment Variables', () => {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
|
`generate @nx/web:app ${appName} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const content = readFile(main);
|
const content = readFile(main);
|
||||||
@ -282,7 +282,7 @@ describe('CLI - Environment Variables', () => {
|
|||||||
const newCode2 = `const envVars = [process.env.NODE_ENV, process.env.NX_BUILD, process.env.NX_API, process.env.NX_WS_BASE, process.env.NX_WS_ENV_LOCAL, process.env.NX_WS_LOCAL_ENV, process.env.NX_APP_BASE, process.env.NX_APP_ENV_LOCAL, process.env.NX_APP_LOCAL_ENV, process.env.NX_SHARED_ENV];`;
|
const newCode2 = `const envVars = [process.env.NODE_ENV, process.env.NX_BUILD, process.env.NX_API, process.env.NX_WS_BASE, process.env.NX_WS_ENV_LOCAL, process.env.NX_WS_LOCAL_ENV, process.env.NX_APP_BASE, process.env.NX_APP_ENV_LOCAL, process.env.NX_APP_LOCAL_ENV, process.env.NX_SHARED_ENV];`;
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName2} --bundler=webpack --no-interactive`
|
`generate @nx/web:app ${appName2} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const content2 = readFile(main2);
|
const content2 = readFile(main2);
|
||||||
@ -316,7 +316,7 @@ describe('Build Options', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
|
`generate @nx/web:app ${appName} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const srcPath = `apps/${appName}/src`;
|
const srcPath = `apps/${appName}/src`;
|
||||||
@ -395,7 +395,7 @@ describe('index.html interpolation', () => {
|
|||||||
const appName = uniq('app');
|
const appName = uniq('app');
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/web:app ${appName} --bundler=webpack --no-interactive`
|
`generate @nx/web:app ${appName} --bundler=webpack --no-interactive`
|
||||||
);
|
);
|
||||||
|
|
||||||
const srcPath = `apps/${appName}/src`;
|
const srcPath = `apps/${appName}/src`;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
uniq,
|
uniq,
|
||||||
updateFile,
|
updateFile,
|
||||||
updateProjectConfig,
|
updateProjectConfig,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('Webpack Plugin', () => {
|
describe('Webpack Plugin', () => {
|
||||||
beforeEach(() => newProject());
|
beforeEach(() => newProject());
|
||||||
@ -15,12 +15,12 @@ describe('Webpack Plugin', () => {
|
|||||||
|
|
||||||
it('should be able to setup project to build node programs with webpack and different compilers', async () => {
|
it('should be able to setup project to build node programs with webpack and different compilers', async () => {
|
||||||
const myPkg = uniq('my-pkg');
|
const myPkg = uniq('my-pkg');
|
||||||
runCLI(`generate @nrwl/js:lib ${myPkg} --bundler=none`);
|
runCLI(`generate @nx/js:lib ${myPkg} --bundler=none`);
|
||||||
updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`);
|
updateFile(`libs/${myPkg}/src/index.ts`, `console.log('Hello');\n`);
|
||||||
|
|
||||||
// babel (default)
|
// babel (default)
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts`
|
`generate @nx/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Test `scriptType` later during during.
|
// Test `scriptType` later during during.
|
||||||
@ -53,7 +53,7 @@ module.exports = composePlugins(withNx(), (config) => {
|
|||||||
|
|
||||||
// swc
|
// swc
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=swc`
|
`generate @nx/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=swc`
|
||||||
);
|
);
|
||||||
rmDist();
|
rmDist();
|
||||||
runCLI(`build ${myPkg}`);
|
runCLI(`build ${myPkg}`);
|
||||||
@ -67,7 +67,7 @@ module.exports = composePlugins(withNx(), (config) => {
|
|||||||
|
|
||||||
// tsc
|
// tsc
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=tsc`
|
`generate @nx/webpack:webpack-project ${myPkg} --target=node --tsConfig=libs/${myPkg}/tsconfig.lib.json --main=libs/${myPkg}/src/index.ts --compiler=tsc`
|
||||||
);
|
);
|
||||||
rmDist();
|
rmDist();
|
||||||
runCLI(`build ${myPkg}`);
|
runCLI(`build ${myPkg}`);
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
runCommand,
|
runCommand,
|
||||||
runCreateWorkspace,
|
runCreateWorkspace,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('create-nx-workspace --preset=npm', () => {
|
describe('create-nx-workspace --preset=npm', () => {
|
||||||
const wsName = uniq('npm');
|
const wsName = uniq('npm');
|
||||||
@ -38,21 +38,21 @@ describe('create-nx-workspace --preset=npm', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should add angular application', () => {
|
it('should add angular application', () => {
|
||||||
packageInstall('@nrwl/angular', wsName);
|
packageInstall('@nx/angular', wsName);
|
||||||
const appName = uniq('my-app');
|
const appName = uniq('my-app');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/angular:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/angular:app ${appName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
}, 1_000_000);
|
}, 1_000_000);
|
||||||
|
|
||||||
it('should add angular library', () => {
|
it('should add angular library', () => {
|
||||||
packageInstall('@nrwl/angular', wsName);
|
packageInstall('@nx/angular', wsName);
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/angular:lib ${libName} --no-interactive`);
|
runCLI(`generate @nx/angular:lib ${libName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
const tsconfig = readJson(`tsconfig.base.json`);
|
const tsconfig = readJson(`tsconfig.base.json`);
|
||||||
@ -62,12 +62,12 @@ describe('create-nx-workspace --preset=npm', () => {
|
|||||||
}, 1_000_000);
|
}, 1_000_000);
|
||||||
|
|
||||||
it('should add js library', () => {
|
it('should add js library', () => {
|
||||||
packageInstall('@nrwl/js', wsName);
|
packageInstall('@nx/js', wsName);
|
||||||
|
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
expect(() =>
|
expect(() =>
|
||||||
runCLI(`generate @nrwl/js:library ${libName} --no-interactive`)
|
runCLI(`generate @nx/js:library ${libName} --no-interactive`)
|
||||||
).not.toThrowError();
|
).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
const tsconfig = readJson(`tsconfig.base.json`);
|
const tsconfig = readJson(`tsconfig.base.json`);
|
||||||
@ -77,34 +77,34 @@ describe('create-nx-workspace --preset=npm', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should add web application', () => {
|
it('should add web application', () => {
|
||||||
packageInstall('@nrwl/web', wsName);
|
packageInstall('@nx/web', wsName);
|
||||||
|
|
||||||
const appName = uniq('my-app');
|
const appName = uniq('my-app');
|
||||||
|
|
||||||
expect(() =>
|
expect(() =>
|
||||||
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`)
|
runCLI(`generate @nx/web:app ${appName} --no-interactive`)
|
||||||
).not.toThrowError();
|
).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add react application', () => {
|
it('should add react application', () => {
|
||||||
packageInstall('@nrwl/react', wsName);
|
packageInstall('@nx/react', wsName);
|
||||||
|
|
||||||
const appName = uniq('my-app');
|
const appName = uniq('my-app');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/react:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/react:app ${appName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add react library', () => {
|
it('should add react library', () => {
|
||||||
packageInstall('@nrwl/react', wsName);
|
packageInstall('@nx/react', wsName);
|
||||||
|
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/react:lib ${libName} --no-interactive`);
|
runCLI(`generate @nx/react:lib ${libName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
const tsconfig = readJson(`tsconfig.base.json`);
|
const tsconfig = readJson(`tsconfig.base.json`);
|
||||||
@ -114,23 +114,23 @@ describe('create-nx-workspace --preset=npm', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should add next application', () => {
|
it('should add next application', () => {
|
||||||
packageInstall('@nrwl/next', wsName);
|
packageInstall('@nx/next', wsName);
|
||||||
|
|
||||||
const appName = uniq('my-app');
|
const appName = uniq('my-app');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/next:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/next:app ${appName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add next library', () => {
|
it('should add next library', () => {
|
||||||
packageInstall('@nrwl/next', wsName);
|
packageInstall('@nx/next', wsName);
|
||||||
|
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/next:lib ${libName} --no-interactive`);
|
runCLI(`generate @nx/next:lib ${libName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
const tsconfig = readJson(`tsconfig.base.json`);
|
const tsconfig = readJson(`tsconfig.base.json`);
|
||||||
@ -141,25 +141,25 @@ describe('create-nx-workspace --preset=npm', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should add react-native application', () => {
|
it('should add react-native application', () => {
|
||||||
packageInstall('@nrwl/react-native', wsName);
|
packageInstall('@nx/react-native', wsName);
|
||||||
|
|
||||||
const appName = uniq('my-app');
|
const appName = uniq('my-app');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/react-native:app ${appName} --install=false --no-interactive`
|
`generate @nx/react-native:app ${appName} --install=false --no-interactive`
|
||||||
);
|
);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add react-native library', () => {
|
it('should add react-native library', () => {
|
||||||
packageInstall('@nrwl/react-native', wsName);
|
packageInstall('@nx/react-native', wsName);
|
||||||
|
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/react-native:lib ${libName} --no-interactive`);
|
runCLI(`generate @nx/react-native:lib ${libName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
const tsconfig = readJson(`tsconfig.base.json`);
|
const tsconfig = readJson(`tsconfig.base.json`);
|
||||||
@ -169,23 +169,23 @@ describe('create-nx-workspace --preset=npm', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should add node application', () => {
|
it('should add node application', () => {
|
||||||
packageInstall('@nrwl/node', wsName);
|
packageInstall('@nx/node', wsName);
|
||||||
|
|
||||||
const appName = uniq('my-app');
|
const appName = uniq('my-app');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/node:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/node:app ${appName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add node library', () => {
|
it('should add node library', () => {
|
||||||
packageInstall('@nrwl/node', wsName);
|
packageInstall('@nx/node', wsName);
|
||||||
|
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/node:lib ${libName} --no-interactive`);
|
runCLI(`generate @nx/node:lib ${libName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
const tsconfig = readJson(`tsconfig.base.json`);
|
const tsconfig = readJson(`tsconfig.base.json`);
|
||||||
@ -195,23 +195,23 @@ describe('create-nx-workspace --preset=npm', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should add nest application', () => {
|
it('should add nest application', () => {
|
||||||
packageInstall('@nrwl/nest', wsName);
|
packageInstall('@nx/nest', wsName);
|
||||||
|
|
||||||
const appName = uniq('my-app');
|
const appName = uniq('my-app');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/nest:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/nest:app ${appName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add nest library', () => {
|
it('should add nest library', () => {
|
||||||
packageInstall('@nrwl/nest', wsName);
|
packageInstall('@nx/nest', wsName);
|
||||||
|
|
||||||
const libName = uniq('lib');
|
const libName = uniq('lib');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/nest:lib ${libName} --no-interactive`);
|
runCLI(`generate @nx/nest:lib ${libName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
const tsconfig = readJson(`tsconfig.base.json`);
|
const tsconfig = readJson(`tsconfig.base.json`);
|
||||||
@ -221,12 +221,12 @@ describe('create-nx-workspace --preset=npm', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should add express application', () => {
|
it('should add express application', () => {
|
||||||
packageInstall('@nrwl/express', wsName);
|
packageInstall('@nx/express', wsName);
|
||||||
|
|
||||||
const appName = uniq('my-app');
|
const appName = uniq('my-app');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
runCLI(`generate @nrwl/express:app ${appName} --no-interactive`);
|
runCLI(`generate @nx/express:app ${appName} --no-interactive`);
|
||||||
}).not.toThrowError();
|
}).not.toThrowError();
|
||||||
checkFilesExist('tsconfig.base.json');
|
checkFilesExist('tsconfig.base.json');
|
||||||
});
|
});
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
runCreatePlugin,
|
runCreatePlugin,
|
||||||
cleanupProject,
|
cleanupProject,
|
||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('create-nx-plugin', () => {
|
describe('create-nx-plugin', () => {
|
||||||
const packageManager = getSelectedPackageManager() || 'pnpm';
|
const packageManager = getSelectedPackageManager() || 'pnpm';
|
||||||
@ -38,10 +38,10 @@ describe('create-nx-plugin', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:generator ${generatorName} --project=${pluginName}`
|
`generate @nx/plugin:generator ${generatorName} --project=${pluginName}`
|
||||||
);
|
);
|
||||||
runCLI(
|
runCLI(
|
||||||
`generate @nrwl/nx-plugin:executor ${executorName} --project=${pluginName}`
|
`generate @nx/plugin:executor ${executorName} --project=${pluginName}`
|
||||||
);
|
);
|
||||||
|
|
||||||
runCLI(`build ${pluginName}`);
|
runCLI(`build ${pluginName}`);
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import {
|
|||||||
readJson,
|
readJson,
|
||||||
runCreateWorkspace,
|
runCreateWorkspace,
|
||||||
uniq,
|
uniq,
|
||||||
} from '@nrwl/e2e/utils';
|
} from '@nx/e2e/utils';
|
||||||
import { existsSync, mkdirSync } from 'fs-extra';
|
import { existsSync, mkdirSync } from 'fs-extra';
|
||||||
|
|
||||||
describe('create-nx-workspace', () => {
|
describe('create-nx-workspace', () => {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { uniq } from '@nrwl/e2e/utils';
|
import { uniq } from '@nx/e2e/utils';
|
||||||
|
|
||||||
describe('nx-dev: Recipes pages', () => {
|
describe('nx-dev: Recipes pages', () => {
|
||||||
it('should list related recipes based on tags', () => {
|
it('should list related recipes based on tags', () => {
|
||||||
|
|||||||
@ -17,7 +17,6 @@
|
|||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@nrwl/e2e/utils": ["e2e/utils"],
|
|
||||||
"@nrwl/graph/ui-components": ["graph/ui-components/src/index.ts"],
|
"@nrwl/graph/ui-components": ["graph/ui-components/src/index.ts"],
|
||||||
"@nrwl/graph/ui-graph": ["graph/ui-graph/src/index.ts"],
|
"@nrwl/graph/ui-graph": ["graph/ui-graph/src/index.ts"],
|
||||||
"@nrwl/graph/ui-tooltips": ["graph/ui-tooltips/src/index.ts"],
|
"@nrwl/graph/ui-tooltips": ["graph/ui-tooltips/src/index.ts"],
|
||||||
@ -74,6 +73,7 @@
|
|||||||
"@nx/detox": ["packages/detox"],
|
"@nx/detox": ["packages/detox"],
|
||||||
"@nx/devkit": ["packages/devkit"],
|
"@nx/devkit": ["packages/devkit"],
|
||||||
"@nx/devkit/*": ["packages/devkit/*"],
|
"@nx/devkit/*": ["packages/devkit/*"],
|
||||||
|
"@nx/e2e/utils": ["e2e/utils"],
|
||||||
"@nx/esbuild": ["packages/esbuild"],
|
"@nx/esbuild": ["packages/esbuild"],
|
||||||
"@nx/eslint-plugin": ["packages/eslint-plugin/src"],
|
"@nx/eslint-plugin": ["packages/eslint-plugin/src"],
|
||||||
"@nx/expo": ["packages/expo"],
|
"@nx/expo": ["packages/expo"],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user