diff --git a/e2e/schematics/create-nx-workspace.test.ts b/e2e/schematics/create-nx-workspace.test.ts deleted file mode 100644 index 9a08dec560..0000000000 --- a/e2e/schematics/create-nx-workspace.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { checkFilesExist, createNxWorkspace, readJson } from '../utils'; - -/** - * Too slow to run on CI :( - */ -xdescribe('CreateNxWorkspace', () => { - it( - 'should create a new workspace using npm', - () => { - const res = createNxWorkspace('proj --npmScope=myscope'); - expect(res).toContain("Project 'proj' successfully created."); - - const config = readJson('.angular-cli.json'); - expect(config.project.name).toEqual('proj'); - expect(config.project.npmScope).toEqual('myscope'); - - checkFilesExist('package-lock.json'); - }, - 1000000 - ); - - it( - 'should create a new workspace using yarn', - () => { - const res = createNxWorkspace('proj --npmScope=myscope --yarn'); - expect(res).toContain("Project 'proj' successfully created."); - - const config = readJson('.angular-cli.json'); - expect(config.project.name).toEqual('proj'); - expect(config.project.npmScope).toEqual('myscope'); - - checkFilesExist('yarn.lock'); - }, - 1000000 - ); - - it( - 'should create a new workspace with the --directory option', - () => { - const res = createNxWorkspace( - 'myproj --npmScope=myscope --directory=proj' - ); - expect(res).toContain("Project 'myproj' successfully created."); - checkFilesExist('package-lock.json'); - }, - 1000000 - ); - - it( - 'should create a new workspace with the --bazel option', - () => { - const res = createNxWorkspace('mybazelproj --bazel'); - expect(res).toContain("Project 'mybazelproj' successfully created."); - }, - 1000000 - ); - - it( - 'should error when no name is given', - () => { - expect(() => createNxWorkspace('')).toThrowError( - 'Please provide a project name' - ); - }, - 1000000 - ); -}); diff --git a/packages/schematics/bin/create-nx-workspace.ts b/packages/schematics/bin/create-nx-workspace.ts index f54dc02d29..8a906174e2 100644 --- a/packages/schematics/bin/create-nx-workspace.ts +++ b/packages/schematics/bin/create-nx-workspace.ts @@ -85,15 +85,19 @@ if (!projectName) { // creating the sandbox console.log(`Creating a sandbox with the CLI and Nx ${nxTool.name}...`); const tmpDir = dirSync().name; -const nxVersion = readJsonFile( - path.join(path.dirname(__dirname), 'package.json') -).version; + +// we haven't updated bazel to CLI6 yet +const nxVersion = parsedArgs.bazel + ? '1.0.3' + : readJsonFile(path.join(path.dirname(__dirname), 'package.json')).version; + +const cliVersion = parsedArgs.bazel ? '1.7.2' : '6.0.0'; writeFileSync( path.join(tmpDir, 'package.json'), JSON.stringify({ dependencies: { [nxTool.packageName]: nxVersion, - '@angular/cli': '6.0.0' + '@angular/cli': cliVersion }, license: 'MIT' })