feat(misc): derive workspace layout dynamically

This commit is contained in:
Victor Savkin 2022-11-22 15:00:58 -05:00
parent 2d74f4c1dc
commit 16fd4374d6
165 changed files with 371 additions and 285 deletions

View File

@ -234,7 +234,7 @@ jobs:
name: Run E2E Tests
command: |
if $E2E_AFFECTED; then
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-make-angular-cli-faster,e2e-detox,e2e-js,e2e-next,e2e-workspace-create,e2e-nx-run,e2e-nx-misc,e2e-react,e2e-web,e2e-webpack,e2e-rollup,e2e-esbuild,e2e-angular-extensions,e2e-angular-core,e2e-nx-plugin,e2e-cypress,e2e-node,e2e-linter,e2e-jest,e2e-add-nx-to-monorepo,nx-dev-e2e,e2e-nx-init,e2e-graph-client,e2e-vite,e2e-cra-to-nx --parallel=1;
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-make-angular-cli-faster,e2e-detox,e2e-js,e2e-next,e2e-workspace-create,e2e-nx-run,e2e-nx-misc,e2e-react,e2e-web,e2e-webpack,e2e-rollup,e2e-esbuild,e2e-angular-extensions,e2e-angular-core,e2e-nx-plugin,e2e-cypress,e2e-node,e2e-linter,e2e-jest,e2e-add-nx-to-monorepo,nx-dev-e2e,e2e-nx-init,e2e-graph-client,e2e-vite,e2e-cra-to-nx,e2e-storybook,e2e-storybook-angular --parallel=1;
else
echo "Skipping E2E tests";
fi

View File

@ -292,7 +292,8 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
// runCommand('mv src-bak src');
});
it('should handle a workspace with cypress v9', () => {
//TODO: reenable
xit('should handle a workspace with cypress v9', () => {
addCypress9();
// Remove cypress.json
@ -379,7 +380,8 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
});
});
it('should handle a workspace with cypress v10', () => {
//TODO: reenable
xit('should handle a workspace with cypress v10', () => {
addCypress10();
// Remove cypress.config.ts

View File

@ -25,8 +25,8 @@
}
},
"workspaceLayout": {
"libsDir": "",
"appsDir": ""
"appsDir": "",
"libsDir": ""
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],

View File

@ -348,7 +348,7 @@ describe('app', () => {
describe('at the root', () => {
beforeEach(() => {
appTree = createTreeWithEmptyWorkspace();
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
updateJson(appTree, 'nx.json', (json) => ({
...json,
workspaceLayout: { appsDir: '' },
@ -739,7 +739,7 @@ describe('app', () => {
describe('--e2e-test-runner', () => {
describe(E2eTestRunner.Protractor, () => {
it('should create the e2e project in v2 workspace', async () => {
appTree = createTreeWithEmptyWorkspace();
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
expect(
async () =>

View File

@ -13,7 +13,7 @@ describe('Angular Cypress Component Test Generator', () => {
ReturnType<typeof assertMinimumCypressVersion>
> = assertMinimumCypressVersion as never;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// silence warnings about missing .gitignore file
tree.write('.gitignore', '');
mockedAssertMinimumCypressVersion.mockReturnValue();

View File

@ -5,7 +5,7 @@ import componentGenerator from './component';
describe('component Generator', () => {
it('should create the component correctly and export it in the entry point when "export=true"', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -44,7 +44,7 @@ describe('component Generator', () => {
it('should create the component correctly and export it in the entry point when is standalone and "export=true"', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -86,7 +86,7 @@ describe('component Generator', () => {
it('should create the component correctly and not export it in the entry point when "export=false"', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -127,7 +127,7 @@ describe('component Generator', () => {
it('should create the component correctly and not export it in the entry point when is standalone and "export=false"', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -169,7 +169,7 @@ describe('component Generator', () => {
it('should create the component correctly and not export it when "--skip-import=true"', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -210,7 +210,7 @@ describe('component Generator', () => {
it('should create the component correctly but not export it in the entry point when it does not exist', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -248,7 +248,7 @@ describe('component Generator', () => {
it('should not export the component in the entry point when the module it belongs to is not exported', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -282,7 +282,7 @@ describe('component Generator', () => {
describe('--flat', () => {
it('should create the component correctly and export it in the entry point', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -322,7 +322,7 @@ describe('component Generator', () => {
it('should create the component correctly and not export it when "export=false"', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -366,7 +366,7 @@ describe('component Generator', () => {
describe('--path', () => {
it('should create the component correctly and export it in the entry point', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -408,7 +408,7 @@ describe('component Generator', () => {
it('should throw if the path specified is not under the project root', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -451,7 +451,7 @@ describe('component Generator', () => {
'should export it in the entry point when "--module" is set to "%s"',
async (module) => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -491,7 +491,7 @@ describe('component Generator', () => {
it('should not export it in the entry point when the module it belong to is not exported', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -540,7 +540,7 @@ describe('component Generator', () => {
describe('secondary entry points', () => {
it('should create the component correctly and export it in the entry point', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -603,7 +603,7 @@ describe('component Generator', () => {
it('should not export the component in the entry point when the module it belongs to is not exported', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',

View File

@ -12,7 +12,7 @@ import convertToWithMF from './convert-to-with-mf';
describe('convertToWithMF', () => {
it('should migrate a standard previous generated host config correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'host1', {
name: 'host1',
root: 'apps/host1',
@ -43,7 +43,7 @@ describe('convertToWithMF', () => {
it('should migrate a standard previous generated remote config correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'remote1', {
name: 'remote1',
root: 'apps/remote1',
@ -74,7 +74,7 @@ describe('convertToWithMF', () => {
it('should migrate a standard previous generated remote config using object shared syntax correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'remote1', {
name: 'remote1',
root: 'apps/remote1',
@ -105,7 +105,7 @@ describe('convertToWithMF', () => {
it('should throw when the uniqueName doesnt match the project name', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'remote1', {
name: 'remote1',
root: 'apps/remote1',
@ -134,7 +134,7 @@ describe('convertToWithMF', () => {
it('should throw when the shared npm packages configs has been modified', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'host1', {
name: 'host1',
root: 'apps/host1',

View File

@ -29,7 +29,7 @@ describe('Cypress Component Testing Configuration', () => {
> = installedCypressVersion as never;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write('.gitignore', '');
mockedInstalledCypressVersion.mockReturnValue(10);
});

View File

@ -7,7 +7,7 @@ import { getProjects } from 'nx/src/generators/utils/project-configuration';
describe('Host App Generator', () => {
it('should generate a host app with no remotes', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await host(tree, {
@ -20,7 +20,7 @@ describe('Host App Generator', () => {
it('should generate a host app with a remote', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await remote(tree, {
name: 'remote',
@ -41,7 +41,7 @@ describe('Host App Generator', () => {
it('should generate a host and any remotes that dont exist with correct routing setup', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
@ -71,7 +71,7 @@ describe('Host App Generator', () => {
it('should generate a host, integrate existing remotes and generate any remotes that dont exist', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await remote(tree, {
name: 'remote1',
});
@ -93,7 +93,7 @@ describe('Host App Generator', () => {
it('should generate a host, integrate existing remotes and generate any remotes that dont exist, in a directory', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await remote(tree, {
name: 'remote1',
});
@ -116,7 +116,7 @@ describe('Host App Generator', () => {
it('should generate a host with remotes using standalone components', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await host(tree, {
@ -136,7 +136,7 @@ describe('Host App Generator', () => {
it('should generate the correct app component spec file', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await host(tree, {
@ -153,7 +153,7 @@ describe('Host App Generator', () => {
it('should generate the correct app component spec file with a directory', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await host(tree, {
@ -171,7 +171,7 @@ describe('Host App Generator', () => {
it('should not generate an e2e project when e2eTestRunner is none', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await host(tree, {

View File

@ -7,7 +7,7 @@ describe('karma', () => {
let tree: devkit.Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should do nothing when karma is already installed and karma.conf.js exists', () => {

View File

@ -12,7 +12,7 @@ describe('librarySecondaryEntryPoint generator', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should throw when the library does not exist in the workspace', async () => {

View File

@ -47,7 +47,7 @@ describe('lib', () => {
describe('workspace v2', () => {
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should run the library generator without erroring if the directory has a trailing slash', async () => {
@ -708,7 +708,7 @@ describe('lib', () => {
describe('at the root', () => {
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
updateJson(tree, 'nx.json', (json) => ({
...json,
workspaceLayout: { libsDir: '' },

View File

@ -8,7 +8,7 @@ describe('ngAdd generator', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
jest
.spyOn(angularCliMigrator, 'migrateFromAngularCli')
.mockImplementation(() => Promise.resolve(() => {}));

View File

@ -32,7 +32,7 @@ describe('ngrx', () => {
beforeEach(() => {
jest.clearAllMocks();
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
createApp(tree, 'myapp');
appConfig = getAppConfig();
statePath = `${dirname(appConfig.appModule)}/+state`;

View File

@ -11,7 +11,7 @@ import { E2eTestRunner } from '@nrwl/angular/src/utils/test-runners';
describe('MF Remote App Generator', () => {
it('should generate a remote mf app with no host', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await remote(tree, {
@ -25,7 +25,7 @@ describe('MF Remote App Generator', () => {
it('should generate a remote mf app with a host', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await host(tree, {
name: 'host',
@ -44,7 +44,7 @@ describe('MF Remote App Generator', () => {
it('should error when a remote app is attempted to be generated with an incorrect host', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
try {
@ -62,7 +62,7 @@ describe('MF Remote App Generator', () => {
it('should generate a remote mf app and automatically find the next port available', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await remote(tree, {
name: 'existing',
port: 4201,
@ -80,7 +80,7 @@ describe('MF Remote App Generator', () => {
it('should generate a remote mf app and automatically find the next port available even when there are no other targets', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await remote(tree, {
@ -94,7 +94,7 @@ describe('MF Remote App Generator', () => {
it('should not set the remote as the default project', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await remote(tree, {
@ -109,7 +109,7 @@ describe('MF Remote App Generator', () => {
it('should generate the a remote setup for standalone components', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await remote(tree, {
@ -140,7 +140,7 @@ describe('MF Remote App Generator', () => {
it('should not generate an e2e project when e2eTestRunner is none', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await remote(tree, {
@ -155,7 +155,7 @@ describe('MF Remote App Generator', () => {
it('should generate a correct app component when inline template is used', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await remote(tree, {
@ -179,7 +179,7 @@ describe('MF Remote App Generator', () => {
it('should update the index.html to use the remote entry component selector for root when standalone', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
// ACT
await remote(tree, {

View File

@ -6,7 +6,7 @@ import { convertDirectiveToScam } from './convert-directive-to-scam';
describe('convertDirectiveToScam', () => {
it('should create the scam directive inline correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -73,7 +73,7 @@ describe('convertDirectiveToScam', () => {
it('should create the scam directive separately correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -132,7 +132,7 @@ describe('convertDirectiveToScam', () => {
it('should create the scam directive inline correctly when --flat', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -199,7 +199,7 @@ describe('convertDirectiveToScam', () => {
it('should create the scam directive separately correctly when --flat', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -258,7 +258,7 @@ describe('convertDirectiveToScam', () => {
it('should place the directive and scam directive in the correct folder when --path is used', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -326,7 +326,7 @@ describe('convertDirectiveToScam', () => {
it('should place the directive and scam directive in the correct folder when --path and --flat is used', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',

View File

@ -5,7 +5,7 @@ import scamDirectiveGenerator from './scam-directive';
describe('SCAM Directive Generator', () => {
it('should create the inline scam directive correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -49,7 +49,7 @@ describe('SCAM Directive Generator', () => {
it('should create the separate scam directive correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -85,7 +85,7 @@ describe('SCAM Directive Generator', () => {
it('should create the scam directive correctly and export it for a secondary entrypoint', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -135,7 +135,7 @@ describe('SCAM Directive Generator', () => {
describe('--path', () => {
it('should not throw when the path does not exist under project', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -180,7 +180,7 @@ describe('SCAM Directive Generator', () => {
it('should not matter if the path starts with a slash', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -225,7 +225,7 @@ describe('SCAM Directive Generator', () => {
it('should throw when the path does not exist under project', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',

View File

@ -6,7 +6,7 @@ import { convertPipeToScam } from './convert-pipe-to-scam';
describe('convertPipeToScam', () => {
it('should create the scam pipe inline correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -75,7 +75,7 @@ describe('convertPipeToScam', () => {
it('should create the scam pipe separately correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -134,7 +134,7 @@ describe('convertPipeToScam', () => {
it('should create the scam pipe inline correctly when --flat', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -200,7 +200,7 @@ describe('convertPipeToScam', () => {
it('should create the scam pipe separately correctly when --flat', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -259,7 +259,7 @@ describe('convertPipeToScam', () => {
it('should place the pipe and scam pipe in the correct folder when --path is used', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -329,7 +329,7 @@ describe('convertPipeToScam', () => {
it('should place the pipe and scam pipe in the correct folder when --path and --flat is used', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',

View File

@ -5,7 +5,7 @@ import scamPipeGenerator from './scam-pipe';
describe('SCAM Pipe Generator', () => {
it('should create the inline scam pipe correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -51,7 +51,7 @@ describe('SCAM Pipe Generator', () => {
it('should create the separate scam pipe correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -87,7 +87,7 @@ describe('SCAM Pipe Generator', () => {
it('should create the scam pipe correctly and export it for a secondary entrypoint', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -137,7 +137,7 @@ describe('SCAM Pipe Generator', () => {
describe('--path', () => {
it('should not throw when the path does not exist under project', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -184,7 +184,7 @@ describe('SCAM Pipe Generator', () => {
it('should not matter if the path starts with a slash', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -231,7 +231,7 @@ describe('SCAM Pipe Generator', () => {
it('should throw when the path does not exist under project', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',

View File

@ -5,7 +5,7 @@ import scamGenerator from '../scam/scam';
describe('scam-to-standalone', () => {
it('should convert an inline scam to standalone', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await applicationGenerator(tree, { name: 'foo' });
await scamGenerator(tree, { name: 'bar', project: 'foo' });

View File

@ -6,7 +6,7 @@ import { convertComponentToScam } from './convert-component-to-scam';
describe('convertComponentToScam', () => {
it('should create the scam inline correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -71,7 +71,7 @@ describe('convertComponentToScam', () => {
it('should create the scam separately correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -128,7 +128,7 @@ describe('convertComponentToScam', () => {
it('should create the scam inline correctly when --flat', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -195,7 +195,7 @@ describe('convertComponentToScam', () => {
it('should create the scam separately correctly when --flat', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -254,7 +254,7 @@ describe('convertComponentToScam', () => {
it('should create the scam inline correctly when --type', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -323,7 +323,7 @@ describe('convertComponentToScam', () => {
it('should create the scam separately correctly when --type', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -384,7 +384,7 @@ describe('convertComponentToScam', () => {
it('should place the component and scam in the correct folder when --path is used', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -452,7 +452,7 @@ describe('convertComponentToScam', () => {
it('should place the component and scam in the correct folder when --path and --flat is used', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',

View File

@ -5,7 +5,7 @@ import { scamGenerator } from './scam';
describe('SCAM Generator', () => {
it('should create the inline scam correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -48,7 +48,7 @@ describe('SCAM Generator', () => {
it('should create the separate scam correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -83,7 +83,7 @@ describe('SCAM Generator', () => {
it('should create the scam correctly and export it for a secondary entrypoint', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -133,7 +133,7 @@ describe('SCAM Generator', () => {
describe('--path', () => {
it('should not throw when the path does not exist under project', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -177,7 +177,7 @@ describe('SCAM Generator', () => {
it('should not matter if the path starts with a slash', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -221,7 +221,7 @@ describe('SCAM Generator', () => {
it('should throw when the path does not exist under project', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',

View File

@ -13,7 +13,7 @@ import setupSsr from './setup-ssr';
describe('setupSSR', () => {
it('should create the files correctly for ssr', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await applicationGenerator(tree, {
name: 'app1',
@ -133,7 +133,7 @@ describe('setupSSR', () => {
it('should use fileReplacements if they already exist', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await applicationGenerator(tree, {
name: 'app1',

View File

@ -18,7 +18,7 @@ describe('setupTailwind generator', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
jest.clearAllMocks();
});

View File

@ -18,7 +18,7 @@ describe('setupTailwind generator', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
jest.clearAllMocks();
});

View File

@ -39,6 +39,7 @@ Array [
".eslintrc.json",
".prettierrc",
".storybook/main.js",
"apps/.gitignore",
"apps/one/two/test-ui-lib-e2e/.eslintrc.json",
"apps/one/two/test-ui-lib-e2e/cypress.config.ts",
"apps/one/two/test-ui-lib-e2e/src/e2e/barrel-button/barrel-button.component.cy.ts",
@ -61,6 +62,7 @@ Array [
"apps/one/two/test-ui-lib-e2e/tsconfig.json",
"jest.config.ts",
"jest.preset.js",
"libs/.gitignore",
"libs/test-ui-lib/.eslintrc.json",
"libs/test-ui-lib/.storybook/main.js",
"libs/test-ui-lib/.storybook/preview.js",
@ -166,6 +168,7 @@ Array [
".eslintrc.json",
".prettierrc",
".storybook/main.js",
"apps/.gitignore",
"apps/test-ui-lib-e2e/.eslintrc.json",
"apps/test-ui-lib-e2e/cypress.config.ts",
"apps/test-ui-lib-e2e/src/e2e/barrel-button/barrel-button.component.cy.ts",
@ -188,6 +191,7 @@ Array [
"apps/test-ui-lib-e2e/tsconfig.json",
"jest.config.ts",
"jest.preset.js",
"libs/.gitignore",
"libs/test-ui-lib/.eslintrc.json",
"libs/test-ui-lib/.storybook/main.js",
"libs/test-ui-lib/.storybook/preview.js",

View File

@ -5,7 +5,7 @@ import { exportScam } from './export-scam';
describe('exportScam', () => {
it('should not throw when project is an application (does not have entry point)', () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
projectType: 'application',
sourceRoot: 'apps/app1/src',
@ -33,7 +33,7 @@ describe('exportScam', () => {
it('should export the component', () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -66,7 +66,7 @@ describe('exportScam', () => {
it('should export the component and the module when "--inline-scam=false"', () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',
@ -100,7 +100,7 @@ describe('exportScam', () => {
it('should export the component from the secondary entrypoint', () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'lib1', {
projectType: 'library',
sourceRoot: 'libs/lib1/src',

View File

@ -26,7 +26,7 @@ describe('Remove ngcc flags from postinstall script', () => {
},
].forEach((testEntry) => {
it(`should adjust ngcc for: "${testEntry.test}"`, async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.delete('workspace.json');
tree.write('angular.json', '{}');
writeJson(tree, 'package.json', {

View File

@ -6,7 +6,7 @@ describe('add-postcss-import migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should not add postcss-import when ng-packagr is not installed', () => {

View File

@ -6,7 +6,7 @@ describe('opt-out-testbed-teardown migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
jest.doMock('@nrwl/devkit', () => ({ workspaceRoot: '' }));
});

View File

@ -8,7 +8,7 @@ import updateAngularConfig from './update-angular-config';
describe('update-angular-config migration', () => {
it('should remove deprecated options from webpack server executor', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'testing', {
root: 'apps/testing',
targets: {
@ -53,7 +53,7 @@ describe('update-angular-config migration', () => {
it('should remove deprecated options from webpack browser executor', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'testing', {
root: 'apps/testing',
targets: {
@ -78,7 +78,7 @@ describe('update-angular-config migration', () => {
it('should not fail for projects with no targets', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'testing', {
root: 'apps/testing',
});

View File

@ -6,7 +6,7 @@ import updateAngularJestConfig from './update-angular-jest-config';
describe('update-angular-jest-config migration', () => {
it('should migrate the jest config', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
targets: {
@ -51,7 +51,7 @@ describe('update-angular-jest-config migration', () => {
});
it("shouldn't error on null targets", async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
});

View File

@ -5,7 +5,7 @@ import updateLibraries from './update-libraries';
describe('update-libraries migration', () => {
it('should remove enableIvy flag from tsconfig and add compilationMode', () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'testing', {
root: 'libs/testing',
targets: {
@ -42,7 +42,7 @@ describe('update-libraries migration', () => {
it('should remove deprecated flags from ng-pacakgr', () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'testing', {
root: 'libs/testing',
targets: {
@ -78,7 +78,7 @@ describe('update-libraries migration', () => {
});
it("shouldn't error on null targets", async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
});

View File

@ -9,7 +9,7 @@ describe('update-mfe-webpack-config', () => {
describe('run the migration', () => {
it('should skip the migration when there is no MFE config', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
targets: {
@ -40,7 +40,7 @@ describe('update-mfe-webpack-config', () => {
it('should skip the migration when using a different executor', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
targets: {
@ -64,7 +64,7 @@ describe('update-mfe-webpack-config', () => {
it('shouldnt run for non mfe configs', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
targets: {
@ -113,7 +113,7 @@ describe('update-mfe-webpack-config', () => {
it('should run the migration successfully for a host config', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
targets: {
@ -274,7 +274,7 @@ describe('update-mfe-webpack-config', () => {
it('should add outputModule to experiments object when something else exists in experiments', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
targets: {
@ -435,7 +435,7 @@ describe('update-mfe-webpack-config', () => {
it('should run the migration successfully for a remote config', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app', {
root: 'apps/testing',
targets: {

View File

@ -12,7 +12,7 @@ describe('remove-library-generator-style-default migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
jest.clearAllMocks();
});

View File

@ -15,7 +15,7 @@ import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
describe('migrateMFEConfigs', () => {
it('should do nothing for correct setups', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'test', {
root: 'apps/test',
targets: {
@ -71,7 +71,7 @@ describe('migrateMFEConfigs', () => {
it('should fix incorrect setups', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'test', {
root: 'apps/test',
sourceRoot: 'apps/test/src',

View File

@ -7,7 +7,7 @@ import addCypressMfWorkaround from './add-cypress-mf-workaround';
describe('Add Cypress MFE Workaround', () => {
it('should add the cypress command to the index.ts for project that has associated e2e', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await applicationGenerator(tree, {
name: 'app1',
routing: true,
@ -28,7 +28,7 @@ describe('Add Cypress MFE Workaround', () => {
it('should not add the cypress command to the index.ts for project that has does not have an associated e2e', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await applicationGenerator(tree, {
name: 'app1',
routing: true,

View File

@ -6,7 +6,7 @@ import migrateKarmaConfig from './migrate-karma-conf';
describe('Migrate Karma Config', () => {
it('should successfully migrate outdate karma setup', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write(
'karma.conf.js',
`// Karma configuration file, see link for more information

View File

@ -11,7 +11,7 @@ describe('set-build-libs-from-source migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should not error when project does not have targets', async () => {

View File

@ -5,7 +5,7 @@ import renameMFConfig from './rename-mf-config';
describe('Module Federation Config Migration', () => {
it('should rename files in projects that have an mfe.config.js', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await host(tree, {
name: 'host1',
@ -32,7 +32,7 @@ describe('Module Federation Config Migration', () => {
it('should fix dynamic hosts', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await host(tree, {
name: 'host1',

View File

@ -10,7 +10,7 @@ describe('remove-show-circular-dependencies-option migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it.each([

View File

@ -6,7 +6,7 @@ describe('update-angular-cli migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update @angular/cli version when defined as a dev dependency', async () => {

View File

@ -17,7 +17,7 @@ describe('update-libraries-secondary-entrypoints migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it.each(libraryExecutors)(

View File

@ -19,7 +19,7 @@ describe('update-router-initial-navigation migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update "initialNavigation" to "enabledBlocking"', async () => {

View File

@ -20,7 +20,7 @@ describe('update-tsconfig-target migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update target in "tsconfig.json" at the project root when it is an Angular project', async () => {

View File

@ -11,7 +11,7 @@ describe('migrate-mfe-to-mf', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should replace any imports from nrwl/angular/mfe', () => {

View File

@ -6,7 +6,7 @@ describe('update-angular-cli migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update @angular/cli version when defined as a dev dependency', async () => {

View File

@ -6,7 +6,7 @@ describe('update-rxjs migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update rxjs version when defined as a dev dependency and greater than 7.0.0', async () => {

View File

@ -6,7 +6,7 @@ describe('update-angular-cli migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update @angular/cli version when defined as a dev dependency', async () => {

View File

@ -6,7 +6,7 @@ import renameWebpackServer from './rename-webpack-server';
describe('renameWebpackServer', () => {
it('should rename webpack-server to webpack-dev-server correctly', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await remote(tree, { name: 'remote' });
updateJson(tree, 'apps/remote/project.json', (json) => {

View File

@ -11,7 +11,7 @@ describe('15.0.0 migration (add-karma-inputs)', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should add inputs configuration for karma targets', async () => {

View File

@ -20,7 +20,7 @@ jest.mock('@nrwl/devkit', () => ({
describe('switchToJasmineMarbles', () => {
it('should correctly migrate a file that is using imports from nrwl/angular/testing that exist in jasmine-marbles', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
projectGraph = {
nodes: {},
@ -75,7 +75,7 @@ describe('switchToJasmineMarbles', () => {
it('should correctly migrate and split imports from nrwl/angular/testing that exist in jasmine-marbles and nrwl/angular/testing', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
projectGraph = {
nodes: {},
dependencies: {
@ -126,7 +126,7 @@ describe('switchToJasmineMarbles', () => {
it('should add jasmine-marbles as a dependency if it does not exist but uses jasmine-marbles symbols in files', async () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
projectGraph = {
nodes: {},
dependencies: {

View File

@ -9,7 +9,7 @@ describe('Migration to delete Browserslist configurations', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await applicationGenerator(tree, {
name: 'test',
});

View File

@ -6,7 +6,7 @@ describe('update-angular-cli migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update @angular/cli version when defined as a dev dependency', async () => {

View File

@ -13,7 +13,7 @@ import { UnitTestRunner } from '@nrwl/angular/src/utils/test-runners';
describe('Migration to update target and add useDefineForClassFields', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await applicationGenerator(tree, {
name: 'test',
});

View File

@ -9,7 +9,7 @@ import { Builders } from '@schematics/angular/utility/workspace-models';
describe(`Migration to remove bundleDependencies`, () => {
it(`should remove 'bundleDependencies'`, async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await applicationGenerator(tree, {
name: 'test',
});

View File

@ -7,7 +7,7 @@ describe.each([
])('standalone component utils - %s', (routes, routeType) => {
it('should add a static route to the routes file', () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write(
'routes-file.ts',
`import { ${routeType} } from '@angular/router';
@ -35,7 +35,7 @@ describe.each([
it('should add a lazy route to the routes file', () => {
// ARRANGE
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write(
'routes-file.ts',
`import { ${routeType} } from '@angular/router';

View File

@ -8,7 +8,7 @@ describe('init', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should add dependencies into `package.json` file', async () => {

View File

@ -27,7 +27,7 @@ describe('convertToCypressTen', () => {
> = installedCypressVersion as never;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
mockedInstalledCypressVersion.mockReturnValue(9);
});

View File

@ -28,7 +28,7 @@ describe('updateComponentTestingConfig', () => {
> = installedCypressVersion as never;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update', async () => {
mockedInstalledCypressVersion.mockReturnValue(10);

View File

@ -7,7 +7,7 @@ describe('Update Cypress if v10 migration', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write(
'package.json',
JSON.stringify({

View File

@ -11,7 +11,7 @@ describe('15.0.0 migration (add-cypress-inputs)', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should add inputs configuration for cypress targets', async () => {

View File

@ -19,7 +19,7 @@ describe('update cy.mount usage', () => {
ReturnType<typeof installedCypressVersion>
> = installedCypressVersion as never;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
mockedInstalledCypressVersion.mockReturnValue(10);
});

View File

@ -12,7 +12,7 @@ describe('Cypress 11 Migration', () => {
ReturnType<typeof installedCypressVersion>
> = installedCypressVersion as never;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
jest.resetAllMocks();
});

View File

@ -100,7 +100,7 @@ describe('update-14-2-0-split-create-empty-tree', () => {
});
function createTreeWithBoilerplate(): { tree: Tree; tsFilePath: string } {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
const project = 'proj';
addProjectConfiguration(tree, project, {
root: `libs/${project}`,

View File

@ -0,0 +1,61 @@
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
import { getWorkspaceLayout } from './get-workspace-layout';
describe('getWorkspaceLayout', () => {
it('should return selected values', () => {
const tree = createTreeWithEmptyWorkspace();
tree.write(
'nx.json',
JSON.stringify({
workspaceLayout: {
appsDir: 'custom-apps',
libsDir: 'custom-libs',
},
})
);
expect(getWorkspaceLayout(tree)).toEqual({
appsDir: 'custom-apps',
libsDir: 'custom-libs',
npmScope: undefined,
standaloneAsDefault: true,
});
});
it('should return apps and libs when present', () => {
const tree = createTreeWithEmptyWorkspace();
tree.write('nx.json', JSON.stringify({}));
tree.write('apps/file', '');
tree.write('libs/file', '');
tree.write('packages/file', '');
expect(getWorkspaceLayout(tree)).toEqual({
appsDir: 'apps',
libsDir: 'libs',
npmScope: undefined,
standaloneAsDefault: true,
});
});
it('should return packages when present', () => {
const tree = createTreeWithEmptyWorkspace();
tree.write('nx.json', JSON.stringify({}));
tree.write('packages/file', '');
tree.write('something/file', '');
expect(getWorkspaceLayout(tree)).toEqual({
appsDir: 'packages',
libsDir: 'packages',
npmScope: undefined,
standaloneAsDefault: true,
});
});
it('should return . in other cases', () => {
const tree = createTreeWithEmptyWorkspace();
tree.write('nx.json', JSON.stringify({}));
tree.write('something/file', '');
expect(getWorkspaceLayout(tree)).toEqual({
appsDir: '.',
libsDir: '.',
npmScope: undefined,
standaloneAsDefault: true,
});
});
});

View File

@ -25,9 +25,24 @@ export function getWorkspaceLayout(tree: Tree): {
} {
const nxJson = readNxJson(tree);
return {
appsDir: nxJson?.workspaceLayout?.appsDir ?? 'apps',
libsDir: nxJson?.workspaceLayout?.libsDir ?? 'libs',
appsDir:
nxJson?.workspaceLayout?.appsDir ??
inOrderOfPreference(tree, ['apps', 'packages'], '.'),
libsDir:
nxJson?.workspaceLayout?.libsDir ??
inOrderOfPreference(tree, ['libs', 'packages'], '.'),
npmScope: nxJson?.npmScope,
standaloneAsDefault: shouldDefaultToUsingStandaloneConfigs(tree),
};
}
function inOrderOfPreference(
tree: Tree,
selectedFolders: string[],
defaultChoice: string
) {
for (let i = 0; i < selectedFolders.length; ++i) {
if (tree.exists(selectedFolders[i])) return selectedFolders[i];
}
return defaultChoice;
}

View File

@ -11,7 +11,7 @@ describe('esbuildProjectGenerator', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'mypkg', {
root: 'libs/mypkg',
});

View File

@ -7,7 +7,7 @@ describe('esbuildInitGenerator', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
writeJson(tree, 'package.json', {});
});

View File

@ -13,7 +13,7 @@ describe('app', () => {
let appTree: Tree;
beforeEach(() => {
appTree = createTreeWithEmptyWorkspace();
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
appTree.write('.gitignore', '');
});

View File

@ -8,7 +8,7 @@ describe('Normalize Options', () => {
let appTree: Tree;
beforeEach(() => {
appTree = createTreeWithEmptyWorkspace();
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should normalize options with name in kebab case', () => {

View File

@ -14,7 +14,7 @@ describe('component', () => {
beforeEach(async () => {
projectName = 'my-lib';
appTree = createTreeWithEmptyWorkspace();
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
appTree.write('.gitignore', '');
defaultSchema = {
name: 'hello',

View File

@ -6,7 +6,7 @@ describe('init', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write('.gitignore', '');
});

View File

@ -25,7 +25,7 @@ describe('lib', () => {
};
beforeEach(() => {
appTree = createTreeWithEmptyWorkspace();
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
appTree.write('.gitignore', '');
});

View File

@ -7,7 +7,7 @@ describe('Add projectRoot option in metro.config.js', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'products', {
root: 'apps/products',
sourceRoot: 'apps/products/src',

View File

@ -6,7 +6,7 @@ describe('add-eject-target-14-1-2', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'product', {
root: 'apps/product',
sourceRoot: 'apps/product/src',

View File

@ -6,7 +6,7 @@ describe('add-eas-build-target', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'product', {
root: 'apps/product',
sourceRoot: 'apps/product/src',

View File

@ -6,7 +6,7 @@ describe('add-eas-update-target', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'product', {
root: 'apps/product',
sourceRoot: 'apps/product/src',

View File

@ -6,7 +6,7 @@ describe('add-eas-update-target', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'product', {
root: 'apps/product',
sourceRoot: 'apps/product/src',

View File

@ -11,7 +11,7 @@ describe('Change expo jest preset', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
updateJson(tree, 'package.json', (packageJson) => {
packageJson.devDependencies['jest-expo'] = '*';
return packageJson;

View File

@ -8,7 +8,7 @@ describe('Add Linting', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await libraryGenerator(tree, {
name: 'my-lib',
linter: Linter.None,

View File

@ -59,7 +59,7 @@ async function libSetUp(tree: Tree, options = setupDefaults) {
describe('Jest Migration (v14.0.0)', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should rename project jest.config.js to jest.config.ts', async () => {

View File

@ -17,7 +17,7 @@ import {
describe('Jest Migration (v14.1.2)', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should update root jest files', () => {

View File

@ -61,7 +61,7 @@ describe('Jest Migration - jest 28 config support', () => {
});
it('should update jest-environment-jsdom if being used', async () => {
let tree = createTreeWithEmptyWorkspace();
let tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write(
`package.json`,
`{
@ -90,7 +90,7 @@ describe('Jest Migration - jest 28 config support', () => {
});
it('should update jest-jasmine2 if being used as a test runner', () => {
let tree = createTreeWithEmptyWorkspace();
let tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write(
`package.json`,
`{
@ -128,7 +128,7 @@ module.exports = {
});
it('should not install deps if they are not used', () => {
let tree = createTreeWithEmptyWorkspace();
let tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write(
`package.json`,
`{
@ -153,7 +153,7 @@ module.exports = {
});
it('should update deps from jest.config.ts', async () => {
let tree = createTreeWithEmptyWorkspace();
let tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await workspaceLib(tree, { name: 'my-lib', unitTestRunner: 'jest' });
tree.write(
'libs/my-lib/jest.config.ts',

View File

@ -13,7 +13,7 @@ import {
describe('Jest Migration - jest 28 test files', () => {
it('should convert test files', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await workspaceLib(tree, {
name: 'blah',
linter: undefined,

View File

@ -11,7 +11,7 @@ describe('15.0.0 migration (add-jest-inputs)', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should add inputs configuration for jest targets', async () => {

View File

@ -22,7 +22,9 @@ describe('convert to swc', () => {
};
beforeAll(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write('/apps/.gitignore', '');
tree.write('/libs/.gitignore', '');
});
it('should convert tsc to swc', async () => {

View File

@ -25,7 +25,9 @@ describe('lib', () => {
};
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
tree.write('/apps/.gitignore', '');
tree.write('/libs/.gitignore', '');
});
describe('configs', () => {

View File

@ -7,7 +7,7 @@ import updateSwcrcPath from './update-swcrc-path';
describe('update-swcrc-path migration', () => {
it('should replace relative `swcrcPath` option with absolute `swcrc`', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'test-package', {
root: 'packages/test-package',
targets: {

View File

@ -7,7 +7,7 @@ describe('@nrwl/linter:init', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
describe('--linter', () => {

View File

@ -6,7 +6,7 @@ describe('@nrwl/linter:workspace-rule', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should generate the required files', async () => {

View File

@ -16,7 +16,7 @@ describe('@nrwl/linter:workspace-rules-project', () => {
let tree: Tree;
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
});
it('should add lint project files to lint inputs', async () => {

View File

@ -13,7 +13,7 @@ describe('15.0.0 migration (add-eslint-inputs)', () => {
describe('production', () => {
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
updateWorkspaceConfiguration(tree, {
version: 2,
@ -76,7 +76,7 @@ describe('15.0.0 migration (add-eslint-inputs)', () => {
describe('development', () => {
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'proj', {
root: 'proj',
@ -134,7 +134,7 @@ describe('15.0.0 migration (add-eslint-inputs)', () => {
describe('lintTargetDefaults.input fallback values', () => {
beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'proj', {
root: 'proj',

View File

@ -7,7 +7,7 @@ import update from './add-default-development-configurations';
describe('React default development configuration', () => {
it('should add development configuration if it does not exist', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(
tree,
'example',
@ -43,7 +43,7 @@ describe('React default development configuration', () => {
});
it('should add development configuration if no configurations at all', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(
tree,
'example',
@ -80,7 +80,7 @@ describe('React default development configuration', () => {
});
it('should work without targets', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(
tree,
'example',

View File

@ -7,7 +7,7 @@ import update from './add-dev-output-path';
describe('React default development configuration', () => {
it('should add output path if it does not alreayd exist', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(
tree,
'example',
@ -37,7 +37,7 @@ describe('React default development configuration', () => {
});
it('should skip update if outputPath already exists for development', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(
tree,
'example',

View File

@ -7,7 +7,7 @@ import update from './update-dev-output-path';
describe('React default development configuration', () => {
it('should add output path if it does not alreayd exist', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(
tree,
'example',
@ -37,7 +37,7 @@ describe('React default development configuration', () => {
});
it('should add output path is default generated pat', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(
tree,
'example',
@ -67,7 +67,7 @@ describe('React default development configuration', () => {
});
it('should skip update if outputPath already exists for development and does not match expected path', async () => {
const tree = createTreeWithEmptyWorkspace();
const tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(
tree,
'example',

View File

@ -6,7 +6,7 @@ describe('Add next eslint 14.5.7', () => {
let tree: Tree;
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
addProjectConfiguration(tree, 'app1', {
root: 'apps/app1',

View File

@ -10,7 +10,7 @@ describe('NxPlugin Executor Generator', () => {
beforeEach(async () => {
projectName = 'my-plugin';
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await pluginGenerator(tree, {
name: projectName,

View File

@ -10,7 +10,7 @@ describe('NxPlugin Generator Generator', () => {
beforeEach(async () => {
projectName = 'my-plugin';
tree = createTreeWithEmptyWorkspace();
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await pluginGenerator(tree, {
name: projectName,
} as any);

View File

@ -20,7 +20,7 @@ describe('lint-checks generator', () => {
let appTree: Tree;
beforeEach(async () => {
appTree = createTreeWithEmptyWorkspace();
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
await pluginGenerator(appTree, {
name: 'plugin',
importPath: '@acme/plugin',

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