refactor(nx): extract workspace creation into @nrwl/workspace

This commit is contained in:
Victor Savkin 2019-04-20 11:35:59 -04:00
parent ca57cf29d8
commit b5f1966ca5
259 changed files with 1291 additions and 1712 deletions

View File

@ -3,7 +3,11 @@ tmp
/build
node_modules
/package.json
packages/schematics/src/collection/**/files/**/*.json
packages/workspace/src/schematics/**/files/**/*.json
packages/web/src/schematics/**/files/**/*.json
packages/node/src/schematics/**/files/**/*.json
packages/express/src/schematics/**/files/**/*.json
packages/nest/src/schematics/**/files/**/*.json
packages/react/src/schematics/**/files/**/*.json
packages/jest/src/schematics/**/files/**/*.json
/.vscode

View File

@ -10,7 +10,7 @@ import {
} from '../utils';
describe('Affected', () => {
it('should print, build, and test affected apps', () => {
fit('should print, build, and test affected apps', () => {
ensureProject();
const myapp = uniq('myapp');
const myapp2 = uniq('myapp2');

View File

@ -1,4 +1,10 @@
import { ensureProject, runCLI, uniq, updateFile } from '../utils';
import {
ensureProject,
patchKarmaToWorkOnWSL,
runCLI,
uniq,
updateFile
} from '../utils';
describe('DowngradeModule', () => {
it('should generate a downgradeModule setup', async () => {
@ -6,6 +12,7 @@ describe('DowngradeModule', () => {
const myapp = uniq('myapp');
runCLI(`generate @nrwl/angular:app ${myapp} --unit-test-runner=karma`);
patchKarmaToWorkOnWSL();
updateFile(
`apps/${myapp}/src/legacy.js`,

View File

@ -9,10 +9,10 @@ describe('Jest', () => {
runCLI(`generate @nrwl/angular:lib ${mylib} --unit-test-runner jest`);
await Promise.all([
runCLIAsync(`generate service test --project ${myapp}`),
runCLIAsync(`generate component test --project ${myapp}`),
runCLIAsync(`generate service test --project ${mylib}`),
runCLIAsync(`generate component test --project ${mylib}`)
runCLIAsync(`generate @nrwl/angular:service test --project ${myapp}`),
runCLIAsync(`generate @nrwl/angular:component test --project ${myapp}`),
runCLIAsync(`generate @nrwl/angular:service test --project ${mylib}`),
runCLIAsync(`generate @nrwl/angular:component test --project ${mylib}`)
]);
const appResult = await runCLIAsync(`test ${myapp}`);
expect(appResult.stderr).toContain('Test Suites: 3 passed, 3 total');

View File

@ -1,14 +1,21 @@
import { runCLI, runCLIAsync, ensureProject, uniq } from '../utils';
import {
runCLI,
runCLIAsync,
ensureProject,
uniq,
patchKarmaToWorkOnWSL
} from '../utils';
describe('Karma', () => {
it('should be able to generate a testable library using karma', async done => {
ensureProject();
const mylib = uniq('mylib');
runCLI(`generate @nrwl/angular:lib ${mylib} --unit-test-runner karma`);
patchKarmaToWorkOnWSL();
await Promise.all([
runCLIAsync(`generate service test --project ${mylib}`),
runCLIAsync(`generate component test --project ${mylib}`)
runCLIAsync(`generate @nrwl/angular:service test --project ${mylib}`),
runCLIAsync(`generate @nrwl/angular:component test --project ${mylib}`)
]);
const karmaResult = await runCLIAsync(`test ${mylib}`);
expect(karmaResult.stdout).toContain('3 SUCCESS');
@ -19,10 +26,11 @@ describe('Karma', () => {
ensureProject();
const myapp = uniq('myapp');
runCLI(`generate @nrwl/angular:app ${myapp} --unit-test-runner karma`);
patchKarmaToWorkOnWSL();
await Promise.all([
runCLIAsync(`generate service test --project ${myapp}`),
runCLIAsync(`generate component test --project ${myapp}`)
runCLIAsync(`generate @nrwl/angular:service test --project ${myapp}`),
runCLIAsync(`generate @nrwl/angular:component test --project ${myapp}`)
]);
const karmaResult = await runCLIAsync(`test ${myapp}`);
expect(karmaResult.stdout).toContain('5 SUCCESS');

View File

@ -13,7 +13,7 @@ import {
} from '../utils';
if (!runsInWSL()) {
describe('Nrwl Convert to Nx Workspace', () => {
xdescribe('Nrwl Convert to Nx Workspace', () => {
beforeEach(cleanup);
afterAll(cleanup);
@ -25,7 +25,7 @@ if (!runsInWSL()) {
packageJson.description = 'some description';
updateFile('package.json', JSON.stringify(packageJson, null, 2));
// confirm that @nrwl and @ngrx dependencies do not exist yet
expect(packageJson.devDependencies['@nrwl/schematics']).not.toBeDefined();
expect(packageJson.devDependencies['@nrwl/workspace']).not.toBeDefined();
expect(packageJson.dependencies['@nrwl/nx']).not.toBeDefined();
expect(packageJson.dependencies['@ngrx/store']).not.toBeDefined();
expect(packageJson.dependencies['@ngrx/effects']).not.toBeDefined();
@ -52,7 +52,7 @@ if (!runsInWSL()) {
updateFile('angular.json', JSON.stringify(angularCLIJson, null, 2));
// run the command
runCLI('add @nrwl/schematics --npmScope projscope');
runCLI('add @nrwl/workspace --npmScope projscope');
// check that prettier config exits and that files have been moved!
checkFilesExist(
@ -90,14 +90,14 @@ if (!runsInWSL()) {
format: './node_modules/.bin/nx format:write',
'format:write': './node_modules/.bin/nx format:write',
'format:check': './node_modules/.bin/nx format:check',
update: 'ng update @nrwl/schematics',
update: 'ng update @nrwl/workspace',
'update:check': 'ng update',
'dep-graph': './node_modules/.bin/nx dep-graph',
'workspace-schematic': './node_modules/.bin/nx workspace-schematic',
help: './node_modules/.bin/nx help'
});
expect(
updatedPackageJson.devDependencies['@nrwl/schematics']
updatedPackageJson.devDependencies['@nrwl/workspace']
).toBeDefined();
expect(updatedPackageJson.devDependencies['@angular/cli']).toBeDefined();
@ -258,7 +258,7 @@ if (!runsInWSL()) {
// update package.json
const existingPackageJson = readJson('package.json');
existingPackageJson.devDependencies[
'@nrwl/schematics'
'@nrwl/workspace'
] = schematicsVersion;
existingPackageJson.dependencies['@nrwl/nx'] = nxVersion;
existingPackageJson.dependencies['@ngrx/store'] = ngrxVersion;
@ -274,10 +274,10 @@ if (!runsInWSL()) {
})
);
// run the command
runCLI('add @nrwl/schematics --npmScope projscope --skip-install');
runCLI('add @nrwl/workspace --npmScope projscope --skip-install');
// check that dependencies and devDependencies remained the same
const packageJson = readJson('package.json');
expect(packageJson.devDependencies['@nrwl/schematics']).toEqual(
expect(packageJson.devDependencies['@nrwl/workspace']).toEqual(
schematicsVersion
);
expect(packageJson.dependencies['@nrwl/nx']).toEqual(nxVersion);
@ -306,8 +306,8 @@ if (!runsInWSL()) {
// Add Universal
runCLI('generate universal --client-project proj');
// Add @nrwl/schematics
runCLI('add @nrwl/schematics --npmScope projscope');
// Add @nrwl/workspace
runCLI('add @nrwl/workspace --npmScope projscope');
checkFilesExist('apps/proj/tsconfig.server.json');
@ -366,7 +366,7 @@ if (!runsInWSL()) {
runCLI('add @ngrx/effects');
// Add Nx
runCLI('add @nrwl/schematics');
runCLI('add @nrwl/workspace');
});
it('should handle workspaces with no e2e project', async () => {
@ -379,9 +379,9 @@ if (!runsInWSL()) {
delete existingAngularJson.projects['proj-e2e'];
updateFile('angular.json', JSON.stringify(existingAngularJson, null, 2));
// Add @nrwl/schematics
// Add @nrwl/workspace
const result = await runCLIAsync(
'add @nrwl/schematics --npmScope projscope --skip-install'
'add @nrwl/workspace --npmScope projscope --skip-install'
);
checkFilesExist(
@ -406,8 +406,8 @@ if (!runsInWSL()) {
].architect.lint.options.tsConfig = ['e2e/tsconfig.e2e.json'];
updateFile('angular.json', JSON.stringify(existingAngularJson, null, 2));
// Add @nrwl/schematics
runCLI('add @nrwl/schematics --npmScope projscope --skip-install');
// Add @nrwl/workspace
runCLI('add @nrwl/workspace --npmScope projscope --skip-install');
const updatedAngularCLIJson = readJson('angular.json');
@ -429,7 +429,7 @@ if (!runsInWSL()) {
// Only remove e2e directory
runCommand('mv e2e e2e-bak');
try {
runCLI('add @nrwl/schematics --npmScope projscope --skip-install');
runCLI('add @nrwl/workspace --npmScope projscope --skip-install');
fail('Did not handle not having a e2e directory');
} catch (e) {
expect(e.stderr.toString()).toContain(
@ -443,7 +443,7 @@ if (!runsInWSL()) {
// Remove package.json
runCommand('mv package.json package.json.bak');
try {
runCLI('add @nrwl/schematics --npmScope projscope --skip-install');
runCLI('add @nrwl/workspace --npmScope projscope --skip-install');
fail('Did not handle not having a package.json');
} catch (e) {
expect(e.stderr.toString()).toContain(
@ -457,7 +457,7 @@ if (!runsInWSL()) {
// Remove src
runCommand('mv src src-bak');
try {
runCLI('add @nrwl/schematics --npmScope projscope --skip-install');
runCLI('add @nrwl/workspace --npmScope projscope --skip-install');
fail('Did not handle not having a src directory');
} catch (e) {
expect(e.stderr.toString()).toContain('Path: src does not exist');

View File

@ -9,7 +9,7 @@ import {
uniq,
updateFile
} from '../utils';
import { toClassName } from '@nrwl/schematics/src/utils/name-utils';
import { toClassName } from '@nrwl/workspace';
describe('Nrwl Workspace', () => {
beforeEach(() => {

View File

@ -1,5 +1,4 @@
import {
newApp,
runCLI,
expectTestsPass,
runCLIAsync,

View File

@ -87,7 +87,7 @@ describe('Node Applications', () => {
const config = readJson('angular.json');
config.projects[nodeapp].architect.waitAndPrint = {
builder: '@nrwl/builders:run-commands',
builder: '@nrwl/workspace:run-commands',
options: {
commands: [
{

View File

@ -9,7 +9,7 @@ import {
renameFile,
readJson
} from '../utils';
import { serializeJson } from '@nrwl/schematics/src/utils/fileutils';
import { serializeJson } from '@nrwl/workspace';
describe('React Applications', () => {
it('should be able to generate a react app + lib', async () => {

View File

@ -1,10 +1,7 @@
import {
ensureProject,
expectTestsPass,
newApp,
newProject,
patchKarmaToWorkOnWSL,
runCLI,
runCLIAsync,
uniq,
updateFile
} from '../utils';
@ -14,6 +11,7 @@ describe('Upgrade', () => {
ensureProject();
const myapp = uniq('myapp');
runCLI(`generate @nrwl/angular:app ${myapp} --unit-test-runner=karma`);
patchKarmaToWorkOnWSL();
updateFile(
`apps/${myapp}/src/legacy.js`,

View File

@ -11,7 +11,6 @@ describe('Web Components Applications', () => {
ensureProject();
const appName = uniq('app');
runCLI(`add @nrwl/web`);
runCLI(`generate @nrwl/web:app ${appName} --no-interactive`);
const lintResults = runCLI(`lint ${appName}`);

View File

@ -10,20 +10,39 @@ export function uniq(prefix: string) {
}
export function runNgNew(command?: string, silent?: boolean): string {
const buffer = execSync(
`../node_modules/.bin/ng new proj --no-interactive ${command}`,
const gen = execSync(
`../node_modules/.bin/ng new proj --no-interactive --skip-install ${command}`,
{
cwd: `./tmp`,
...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {})
}
);
return buffer ? buffer.toString() : null;
const p = readFileSync('./tmp/proj/package.json').toString();
const workspacePath = path.join(getCwd(), 'build', 'packages', 'workspace');
const angularPath = path.join(getCwd(), 'build', 'packages', 'angular');
writeFileSync(
'./tmp/proj/package.json',
p
.replace(
'"@nrwl/workspace": "*"',
`"@nrwl/workspace": "file:${workspacePath}"`
)
.replace('"@nrwl/angular": "*"', `"@nrwl/angular": "file:${angularPath}"`)
);
const install = execSync('yarn install', {
cwd: './tmp/proj',
...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {})
});
return silent
? null
: `${gen ? gen.toString() : ''}${install ? install.toString() : ''}`;
}
export function newProject(): void {
cleanup();
if (!directoryExists('./tmp/proj_backup')) {
runNgNew('--collection=@nrwl/schematics --npmScope=proj', true);
runNgNew('--collection=@nrwl/workspace --npmScope=proj', true);
copyMissingPackages();
runCLI('add @nrwl/jest');
runCLI('add @nrwl/cypress');
@ -195,18 +214,6 @@ export function expectTestsPass(v: { stdout: string; stderr: string }) {
expect(v.stderr).not.toContain('fail');
}
export function newApp(name: string): string {
const r = runCLI(`generate app --no-interactive ${name}`);
patchKarmaToWorkOnWSL();
return r;
}
export function newLib(name: string): string {
const r = runCLI(`generate lib --no-interactive ${name}`);
patchKarmaToWorkOnWSL();
return r;
}
export function runCommand(command: string): string {
try {
return execSync(command, {

View File

@ -82,7 +82,7 @@
"jest": "^24.1.0",
"jest-jasmine2": "^24.1.0",
"jest-preset-angular": "7.0.0",
"karma": "~2.0.0",
"karma": "~4.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.1",

View File

@ -28,7 +28,7 @@
"migrations": "./migrations.json"
},
"peerDependencies": {
"@nrwl/schematics": "*"
"@nrwl/workspace": "*"
},
"dependencies": {
"@angular-devkit/core": "~7.3.1",

View File

@ -1,8 +1,8 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { getFileContent } from '@schematics/angular/utility/test';
import * as stripJsonComments from 'strip-json-comments';
import { readJsonInTree, updateJsonInTree, NxJson } from '@nrwl/schematics';
import { readJsonInTree, updateJsonInTree, NxJson } from '@nrwl/workspace';
import { runSchematic, callRule } from '../../utils/testing';
describe('app', () => {
@ -303,7 +303,7 @@ describe('app', () => {
const angularJson = readJsonInTree(result, 'angular.json');
expect(angularJson.projects['my-app'].schematics).toEqual({
'@nrwl/schematics:component': {
'@nrwl/workspace:component': {
style: 'scss'
}
});

View File

@ -15,23 +15,23 @@ import {
import { Schema } from './schema';
import * as ts from 'typescript';
import { insertImport } from '@schematics/angular/utility/ast-utils';
import { updateJsonInTree, readJsonInTree } from '@nrwl/schematics';
import { updateJsonInTree, readJsonInTree } from '@nrwl/workspace';
import {
addImportToModule,
addImportToTestBed,
getDecoratorPropertyValueNode,
insert,
replaceNodeValue
} from '@nrwl/schematics/src/utils/ast-utils';
import { toFileName } from '@nrwl/schematics/src/utils/name-utils';
import { offsetFromRoot } from '@nrwl/schematics/src/utils/common';
} from '@nrwl/workspace';
import { toFileName } from '@nrwl/workspace';
import { offsetFromRoot } from '@nrwl/workspace';
import {
getNpmScope,
getWorkspacePath,
replaceAppNameWithPath,
angularSchematicNames
} from '@nrwl/schematics/src/utils/cli-config-utils';
import { formatFiles } from '@nrwl/schematics/src/utils/rules/format-files';
} from '@nrwl/workspace';
import { formatFiles } from '@nrwl/workspace';
import { join, normalize } from '@angular-devkit/core';
import { addE2eTestRunner, addUnitTestRunner } from '../ng-add/ng-add';
@ -213,7 +213,7 @@ function updateProject(options: NormalizedSchema): Rule {
angularSchematicNames.forEach(type => {
const schematic = `@schematics/angular:${type}`;
if (schematic in fixedProject.schematics) {
fixedProject.schematics[`@nrwl/schematics:${type}`] =
fixedProject.schematics[`@nrwl/workspace:${type}`] =
fixedProject.schematics[schematic];
delete fixedProject.schematics[schematic];
}

View File

@ -1,10 +1,10 @@
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
import * as path from 'path';
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createApp, createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createApp, createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
import { getFileContent } from '@schematics/angular/utility/test';
import { readJsonInTree } from '@nrwl/schematics';
import { readJsonInTree } from '@nrwl/workspace';
describe('downgrade-module', () => {
let appTree: Tree;

View File

@ -5,9 +5,9 @@ import {
insert,
readBootstrapInfo,
removeFromNgModule
} from '@nrwl/schematics/src/utils/ast-utils';
} from '@nrwl/workspace';
import { Schema } from './schema';
import { formatFiles } from '@nrwl/schematics/src/utils/rules/format-files';
import { formatFiles } from '@nrwl/workspace';
import { addUpgradeToPackageJson } from '../../utils/upgrade';
function updateMain(angularJsImport: string, options: Schema): Rule {

View File

@ -1,7 +1,7 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
import { readJsonInTree } from '@nrwl/schematics/src/utils/ast-utils';
import { readJsonInTree } from '@nrwl/workspace';
describe('karmaProject', () => {
let appTree: Tree;

View File

@ -14,9 +14,9 @@ import {
readJsonInTree,
updateJsonInTree,
offsetFromRoot
} from '@nrwl/schematics';
} from '@nrwl/workspace';
import { join, normalize } from '@angular-devkit/core';
import { getProjectConfig } from '@nrwl/schematics/src/utils/ast-utils';
import { getProjectConfig } from '@nrwl/workspace';
export interface KarmaProjectSchema {
project: string;

View File

@ -1,6 +1,6 @@
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { Tree } from '@angular-devkit/schematics';
import { readJsonInTree } from '@nrwl/schematics';
import { readJsonInTree } from '@nrwl/workspace';
import { runSchematic } from '../../utils/testing';
describe('karma', () => {

View File

@ -1,5 +1,5 @@
import { Tree, noop, chain, mergeWith, url } from '@angular-devkit/schematics';
import { readJsonInTree, addDepsToPackageJson } from '@nrwl/schematics';
import { readJsonInTree, addDepsToPackageJson } from '@nrwl/workspace';
import { jasmineMarblesVersion } from '../../utils/versions';
export default function() {
@ -13,15 +13,15 @@ export default function() {
addDepsToPackageJson(
{},
{
karma: '~3.0.0',
karma: '~4.0.0',
'karma-chrome-launcher': '~2.2.0',
'karma-coverage-istanbul-reporter': '~2.0.1',
'karma-jasmine': '~1.1.0',
'karma-jasmine': '~1.1.2',
'karma-jasmine-html-reporter': '^0.2.2',
'jasmine-core': '~2.99.1',
'jasmine-spec-reporter': '~4.2.1',
'jasmine-marbles': jasmineMarblesVersion,
'@types/jasmine': '~2.8.6'
'@types/jasmine': '~2.8.8'
}
)
]);

View File

@ -1,9 +1,9 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createApp, createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createApp, createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
import { getFileContent } from '@schematics/angular/utility/test';
import * as stripJsonComments from 'strip-json-comments';
import { NxJson, readJsonInTree } from '@nrwl/schematics';
import { NxJson, readJsonInTree } from '@nrwl/workspace';
import { UnitTestTree } from '@angular-devkit/schematics/testing';
describe('lib', () => {
@ -721,7 +721,7 @@ describe('lib', () => {
const angularJson = readJsonInTree(result, 'angular.json');
expect(angularJson.projects['my-lib'].schematics).toEqual({
'@nrwl/schematics:component': {
'@nrwl/workspace:component': {
styleext: 'scss'
}
});

View File

@ -24,25 +24,21 @@ import {
updateJsonInTree,
readJsonInTree,
offsetFromRoot
} from '@nrwl/schematics';
} from '@nrwl/workspace';
import {
addGlobal,
addImportToModule,
addIncludeToTsConfig,
addRoute,
insert
} from '@nrwl/schematics/src/utils/ast-utils';
import {
toClassName,
toFileName,
toPropertyName
} from '@nrwl/schematics/src/utils/name-utils';
} from '@nrwl/workspace';
import { toClassName, toFileName, toPropertyName } from '@nrwl/workspace';
import {
getNpmScope,
getWorkspacePath,
replaceAppNameWithPath
} from '@nrwl/schematics/src/utils/cli-config-utils';
import { formatFiles } from '@nrwl/schematics/src/utils/rules/format-files';
} from '@nrwl/workspace';
import { formatFiles } from '@nrwl/workspace';
import { addUnitTestRunner } from '../ng-add/ng-add';
interface NormalizedSchema extends Schema {
@ -329,7 +325,7 @@ function updateProject(options: NormalizedSchema): Rule {
if (options.style !== 'css') {
fixedProject.schematics = {
...fixedProject.schematics,
'@nrwl/schematics:component': {
'@nrwl/workspace:component': {
styleext: options.style
}
};

View File

@ -1,7 +1,7 @@
import { Tree } from '@angular-devkit/schematics';
import { runSchematic } from '../../utils/testing';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { readJsonInTree } from '@nrwl/schematics';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { readJsonInTree } from '@nrwl/workspace';
describe('ng-add', () => {
let appTree: Tree;

View File

@ -10,7 +10,7 @@ import {
readJsonInTree,
addDepsToPackageJson,
updateJsonInTree
} from '@nrwl/schematics';
} from '@nrwl/workspace';
import {
angularVersion,
angularDevkitVersion,

View File

@ -47,7 +47,7 @@
},
"skipInstall": {
"type": "boolean",
"description": "Skip installing after adding @nrwl/schematics",
"description": "Skip installing after adding @nrwl/workspace",
"default": false
}
}

View File

@ -1,20 +1,16 @@
import { UnitTestTree } from '@angular-devkit/schematics/testing';
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { getFileContent } from '@schematics/angular/utility/test';
import { readJsonInTree } from '@nrwl/schematics/src/utils/ast-utils';
import { readJsonInTree } from '@nrwl/workspace';
import { findModuleParent } from '@nrwl/schematics/src/utils/name-utils';
import {
AppConfig,
getLibConfig,
getAppConfig
} from '@nrwl/schematics/src/utils/testing-utils';
import { findModuleParent } from '@nrwl/workspace';
import { AppConfig, getLibConfig, getAppConfig } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
import {
createApp,
createLib,
createEmptyWorkspace
} from '@nrwl/schematics/testing';
} from '@nrwl/workspace/testing';
describe('ngrx', () => {
let appTree: Tree;

View File

@ -15,7 +15,7 @@ import {
import { Schema } from './schema';
import * as path from 'path';
import { names, toFileName } from '@nrwl/schematics/src/utils/name-utils';
import { names, toFileName } from '@nrwl/workspace';
import {
addImportsToModule,
@ -23,7 +23,7 @@ import {
addExportsToBarrel,
RequestContext
} from './rules';
import { formatFiles } from '@nrwl/schematics/src/utils/rules/format-files';
import { formatFiles } from '@nrwl/workspace';
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
/**

View File

@ -2,8 +2,8 @@ import * as ts from 'typescript';
import * as path from 'path';
import { Rule, Tree } from '@angular-devkit/schematics';
import { names } from '@nrwl/schematics/src/utils/name-utils';
import { insert, addGlobal } from '@nrwl/schematics/src/utils/ast-utils';
import { names } from '@nrwl/workspace';
import { insert, addGlobal } from '@nrwl/workspace';
import { Schema } from '../schema';
/**

View File

@ -2,16 +2,12 @@ import { Rule, Tree } from '@angular-devkit/schematics';
import { Change } from '@schematics/angular/utility/change';
import { insertImport } from '@schematics/angular/utility/ast-utils';
import * as ts from 'typescript';
import {
toClassName,
toFileName,
toPropertyName
} from '@nrwl/schematics/src/utils/name-utils';
import { toClassName, toFileName, toPropertyName } from '@nrwl/workspace';
import {
insert,
addImportToModule,
addProviderToModule
} from '@nrwl/schematics/src/utils/ast-utils';
} from '@nrwl/workspace';
import { RequestContext } from './request-context';
export function addImportsToModule(context: RequestContext): Rule {

View File

@ -1,5 +1,5 @@
import { Rule } from '@angular-devkit/schematics';
import { addDepsToPackageJson } from '@nrwl/schematics';
import { addDepsToPackageJson } from '@nrwl/workspace';
import {
ngrxVersion,
ngrxStoreFreezeVersion,

View File

@ -2,7 +2,7 @@ import * as path from 'path';
import { Tree } from '@angular-devkit/schematics';
import { Schema } from '../schema';
import * as stringUtils from '@nrwl/schematics/src/utils/strings';
import { stringUtils } from '@nrwl/workspace';
/**
* Schematic request context

View File

@ -1,8 +1,8 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createApp, createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createApp, createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
import { getFileContent } from '@schematics/angular/utility/test';
import { readJsonInTree } from '@nrwl/schematics';
import { readJsonInTree } from '@nrwl/workspace';
describe('upgrade-module', () => {
let appTree: Tree;

View File

@ -12,11 +12,7 @@ import {
url
} from '@angular-devkit/schematics';
import {
names,
toClassName,
toFileName
} from '@nrwl/schematics/src/utils/name-utils';
import { names, toClassName, toFileName } from '@nrwl/workspace';
import * as path from 'path';
import {
addDeclarationToModule,
@ -28,11 +24,11 @@ import {
insert,
readBootstrapInfo,
removeFromNgModule
} from '@nrwl/schematics/src/utils/ast-utils';
} from '@nrwl/workspace';
import { insertImport } from '@schematics/angular/utility/ast-utils';
import { Schema } from './schema';
import { addUpgradeToPackageJson } from '../../utils/upgrade';
import { formatFiles } from '@nrwl/schematics/src/utils/rules/format-files';
import { formatFiles } from '@nrwl/workspace';
function addImportsToModule(options: Schema): Rule {
return (host: Tree) => {

View File

@ -1,6 +1,6 @@
import { Rule } from '@angular-devkit/schematics';
import { angularJsVersion } from './versions';
import { updateJsonInTree } from '@nrwl/schematics';
import { updateJsonInTree } from '@nrwl/workspace';
export function addUpgradeToPackageJson(): Rule {
return updateJsonInTree('package.json', packageJson => {

View File

@ -1,7 +0,0 @@
export { BuildBuilderOptions, OptimizationOptions } from './src/utils/types';
export { readTsConfig } from './src/utils/typescript';
export {
getBaseWebpackPartial,
OUT_FILENAME
} from './src/utils/webpack/config';
export { normalizeBuildOptions } from './src/utils/normalize';

View File

@ -1,7 +1,7 @@
{
"name": "@nrwl/builders",
"version": "0.0.1",
"description": "Angular CLI power-ups for modern Web development: Builders",
"description": "Deprecated package. Use @nrwl/workspace, @nrwl/web, @nrwl/node, @nrwl/jest, @nrwl/cypress instead.",
"repository": {
"type": "git",
"url": "git+https://github.com/nrwl/nx.git"

View File

@ -29,7 +29,7 @@ if (parsedArgs.help) {
const nxTool = {
name: 'Schematics',
packageName: '@nrwl/schematics'
packageName: '@nrwl/workspace'
};
let useYarn = true;

View File

@ -30,13 +30,9 @@
"migrations": "./migrations.json"
},
"peerDependencies": {
"@nrwl/schematics": "*"
"@nrwl/workspace": "*"
},
"dependencies": {
"@angular-devkit/architect": "~0.13.1",
"@angular-devkit/core": "~7.3.1",
"@angular-devkit/schematics": "~7.3.1",
"tree-kill": "1.2.1",
"rxjs": "6.3.3"
"tree-kill": "1.2.1"
}
}

View File

@ -49,7 +49,7 @@ describe('Cypress builder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:cypress',
builder: 'CYPRESSBUILDER',
options: cypressBuilderOptions
})
.subscribe(() => {
@ -78,7 +78,7 @@ describe('Cypress builder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:cypress',
builder: 'CYPRESSBUILDER',
options: cypressBuilderOptions
})
.subscribe(() => {
@ -107,7 +107,7 @@ describe('Cypress builder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:cypress',
builder: 'CYPRESSBUILDER',
options: Object.assign(cypressBuilderOptions, { headless: false })
})
.subscribe(() => {
@ -135,7 +135,7 @@ describe('Cypress builder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:cypress',
builder: 'CYPRESSBUILDER',
options: Object.assign(cypressBuilderOptions, {
baseUrl: 'http://my-distant-host.com'
})
@ -164,7 +164,7 @@ describe('Cypress builder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:cypress',
builder: 'CYPRESSBUILDER',
options: Object.assign(cypressBuilderOptions, {
browser: 'chrome'
})
@ -193,7 +193,7 @@ describe('Cypress builder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:cypress',
builder: 'CYPRESSBUILDER',
options: {
cypressConfig: 'apps/my-app-e2e/cypress.json',
tsConfig: 'apps/my-app-e2e/tsconfig.json',
@ -236,7 +236,7 @@ describe('Cypress builder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:cypress',
builder: 'CYPRESSBUILDER',
options: {
cypressConfig: 'apps/my-app-e2e/cypress.json',
tsConfig: 'apps/my-app-e2e/tsconfig.e2e.json',
@ -278,7 +278,7 @@ describe('Cypress builder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:cypress',
builder: 'CYPRESSBUILDER',
options: {
cypressConfig: 'apps/my-app-e2e/cypress.json',
tsConfig: 'apps/my-app-e2e/tsconfig.e2e.json',

View File

@ -46,7 +46,7 @@ try {
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/builders:cypress",
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/my-app-e2e/cypress.json",
"tsConfig": "apps/my-app-e2e/tsconfig.json",

View File

@ -1,7 +1,7 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
import { readJsonInTree } from '@nrwl/schematics/src/utils/ast-utils';
import { readJsonInTree } from '@nrwl/workspace';
describe('schematic:cypress-project', () => {
let appTree: Tree;

View File

@ -9,9 +9,9 @@ import {
} from '@angular-devkit/schematics';
import { join, normalize } from '@angular-devkit/core';
// app
import { updateJsonInTree, NxJson } from '@nrwl/schematics';
import { offsetFromRoot } from '@nrwl/schematics/src/utils/common';
import { toFileName } from '@nrwl/schematics/src/utils/name-utils';
import { updateJsonInTree, NxJson } from '@nrwl/workspace';
import { offsetFromRoot } from '@nrwl/workspace';
import { toFileName } from '@nrwl/workspace';
import { Schema } from './schema';
export interface CypressProjectSchema extends Schema {

View File

@ -1,7 +1,7 @@
import { Tree } from '@angular-devkit/schematics';
import { readJsonInTree } from '@nrwl/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { readJsonInTree } from '@nrwl/workspace';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';

View File

@ -2,11 +2,8 @@ import { Rule, Tree, noop, chain } from '@angular-devkit/schematics';
import { Schema } from './schema';
import { cypressVersion, nxVersion } from '../../utils/versions';
import { readJsonInTree } from '@nrwl/schematics';
import {
addDepsToPackageJson,
updateJsonInTree
} from '@nrwl/schematics/src/utils/ast-utils';
import { readJsonInTree } from '@nrwl/workspace';
import { addDepsToPackageJson, updateJsonInTree } from '@nrwl/workspace';
function checkDependenciesInstalled(): Rule {
return (host: Tree): Rule => {

View File

@ -30,12 +30,9 @@
"migrations": "./migrations.json"
},
"peerDependencies": {
"@nrwl/schematics": "*",
"@nrwl/builders": "*"
"@nrwl/workspace": "*"
},
"dependencies": {
"@angular-devkit/core": "~7.3.1",
"@angular-devkit/schematics": "~7.3.1",
"@nrwl/node": "*",
"@nrwl/jest": "*"
}

View File

@ -1,7 +1,7 @@
import { Tree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
import { readJsonInTree } from '@nrwl/schematics';
import { readJsonInTree } from '@nrwl/workspace';
describe('app', () => {
let appTree: Tree;

View File

@ -12,8 +12,8 @@ import {
} from '@angular-devkit/schematics';
import { join, normalize, Path } from '@angular-devkit/core';
import { Schema } from './schema';
import { updateJsonInTree } from '@nrwl/schematics';
import { toFileName } from '@nrwl/schematics/src/utils/name-utils';
import { updateJsonInTree } from '@nrwl/workspace';
import { toFileName } from '@nrwl/workspace';
interface NormalizedSchema extends Schema {
appProjectRoot: Path;

View File

@ -1,8 +1,8 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
import { join } from 'path';
import { readJsonInTree } from '@nrwl/schematics';
import { readJsonInTree } from '@nrwl/workspace';
describe('ng-add', () => {
let tree: Tree;

View File

@ -1,8 +1,5 @@
import { Rule, chain, externalSchematic } from '@angular-devkit/schematics';
import {
addDepsToPackageJson,
updateJsonInTree
} from '@nrwl/schematics/src/utils/ast-utils';
import { addDepsToPackageJson, updateJsonInTree } from '@nrwl/workspace';
import {
expressTypingsVersion,
expressVersion,

View File

@ -30,12 +30,6 @@
"migrations": "./migrations.json"
},
"peerDependencies": {
"@nrwl/schematics": "*"
},
"dependencies": {
"@angular-devkit/architect": "~0.13.1",
"@angular-devkit/core": "~7.3.1",
"@angular-devkit/schematics": "~7.3.1",
"rxjs": "6.3.3"
"@nrwl/workspace": "*"
}
}

View File

@ -170,7 +170,7 @@ describe('Jest Builder', () => {
builder
.run({
root,
builder: '@nrwl/builders:jest',
builder: 'JEST_BUILDER',
projectType: 'application',
options: {
jestConfig: './jest.config.js',

View File

@ -1,6 +1,6 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { readJsonInTree, updateJsonInTree } from '@nrwl/schematics';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { readJsonInTree, updateJsonInTree } from '@nrwl/workspace';
import { runSchematic, callRule } from '../../utils/testing';
describe('jestProject', () => {

View File

@ -11,12 +11,9 @@ import {
noop,
filter
} from '@angular-devkit/schematics';
import { readJsonInTree, updateJsonInTree } from '@nrwl/schematics';
import {
getProjectConfig,
addDepsToPackageJson
} from '@nrwl/schematics/src/utils/ast-utils';
import { offsetFromRoot } from '@nrwl/schematics/src/utils/common';
import { readJsonInTree, updateJsonInTree } from '@nrwl/workspace';
import { getProjectConfig, addDepsToPackageJson } from '@nrwl/workspace';
import { offsetFromRoot } from '@nrwl/workspace';
import { join, normalize } from '@angular-devkit/core';
export interface JestProjectSchema {

View File

@ -1,6 +1,6 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { readJsonInTree } from '@nrwl/schematics/src/utils/ast-utils';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { readJsonInTree } from '@nrwl/workspace';
import { runSchematic } from '../../utils/testing';
describe('jest', () => {

View File

@ -1,8 +1,5 @@
import { mergeWith, chain, url } from '@angular-devkit/schematics';
import {
addDepsToPackageJson,
updateJsonInTree
} from '@nrwl/schematics/src/utils/ast-utils';
import { addDepsToPackageJson, updateJsonInTree } from '@nrwl/workspace';
import {
jestVersion,
jestTypesVersion,

View File

@ -29,12 +29,9 @@
"migrations": "./migrations.json"
},
"peerDependencies": {
"@nrwl/schematics": "*",
"@nrwl/builders": "*"
"@nrwl/workspace": "*"
},
"dependencies": {
"@angular-devkit/core": "~7.3.1",
"@angular-devkit/schematics": "~7.3.1",
"@nrwl/node": "*",
"@nrwl/jest": "*"
}

View File

@ -1,5 +1,5 @@
import { Tree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
describe('app', () => {

View File

@ -12,7 +12,7 @@ import {
} from '@angular-devkit/schematics';
import { join, normalize, Path } from '@angular-devkit/core';
import { Schema } from './schema';
import { toFileName } from '@nrwl/schematics/src/utils/name-utils';
import { toFileName } from '@nrwl/workspace';
interface NormalizedSchema extends Schema {
appProjectRoot: Path;

View File

@ -1,8 +1,8 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
import { join } from 'path';
import { readJsonInTree } from '@nrwl/schematics';
import { readJsonInTree } from '@nrwl/workspace';
describe('ng-add', () => {
let tree: Tree;

View File

@ -1,8 +1,5 @@
import { Rule, chain, externalSchematic } from '@angular-devkit/schematics';
import {
addDepsToPackageJson,
updateJsonInTree
} from '@nrwl/schematics/src/utils/ast-utils';
import { addDepsToPackageJson, updateJsonInTree } from '@nrwl/workspace';
import {
nestJsSchematicsVersion,
nestJsVersion,

View File

@ -29,12 +29,9 @@
"migrations": "./migrations.json"
},
"peerDependencies": {
"@nrwl/schematics": "*",
"@nrwl/builders": "*"
"@nrwl/workspace": "*"
},
"dependencies": {
"@angular-devkit/core": "~7.3.1",
"@angular-devkit/schematics": "~7.3.1",
"@nrwl/jest": "*"
}
}

View File

@ -58,7 +58,7 @@ describe('NodeBuildBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-build',
builder: '@nrwl/node:build',
options: testOptions
});
@ -79,7 +79,7 @@ describe('NodeBuildBuilder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-build',
builder: '@nrwl/node:build',
options: testOptions
})
.toPromise();
@ -110,7 +110,7 @@ describe('NodeBuildBuilder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-build',
builder: '@nrwl/node:build',
options: {
...testOptions,
statsJson: true
@ -156,7 +156,7 @@ describe('NodeBuildBuilder', () => {
root: normalize('/root'),
sourceRoot: join(normalize('/root'), 'apps/nodeapp'),
projectType: 'application',
builder: '@nrwl/builders:node-build',
builder: '@nrwl/node:build',
options: {
...testOptions,
webpackConfig: 'apps/nodeapp/webpack.config.js'

View File

@ -11,12 +11,12 @@ import { Observable } from 'rxjs';
import { writeFileSync } from 'fs';
import { resolve } from 'path';
import { map } from 'rxjs/operators';
import { getNodeWebpackConfig } from '../../../../node/src/utils/node.config';
import { getNodeWebpackConfig } from '../../utils/node.config';
import {
BuildBuilderOptions,
normalizeBuildOptions,
OUT_FILENAME
} from '@nrwl/builders';
} from '@nrwl/workspace';
try {
require('dotenv').config();

View File

@ -88,7 +88,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: testOptions
})
).toBeObservable(
@ -124,7 +124,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: {
...testOptions,
inspect: InspectType.Inspect
@ -154,7 +154,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: {
...testOptions,
inspect: InspectType.InspectBrk
@ -186,7 +186,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: {
...testOptions,
host: '0.0.0.0'
@ -218,7 +218,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: {
...testOptions,
port: 1234
@ -252,7 +252,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: testOptions
})
).toBeObservable(
@ -279,7 +279,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: testOptions
})
).toBeObservable(
@ -302,7 +302,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: {
...testOptions,
inspect: false,
@ -339,7 +339,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: {
...testOptions,
inspect: false,
@ -392,7 +392,7 @@ describe('NodeExecuteBuilder', () => {
builder.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: {
...testOptions,
waitUntilTargets: ['project1:target1', 'project2:target2']
@ -426,7 +426,7 @@ describe('NodeExecuteBuilder', () => {
.run({
root: normalize('/root'),
projectType: 'application',
builder: '@nrwl/builders:node-execute',
builder: '@nrwl/node:execute',
options: {
...testOptions,
waitUntilTargets: ['project1:target1', 'project2:target2']

View File

@ -1,9 +1,9 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { getFileContent } from '@schematics/angular/utility/test';
import * as stripJsonComments from 'strip-json-comments';
import { createApp, createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createApp, createEmptyWorkspace } from '@nrwl/workspace/testing';
import { runSchematic } from '../../utils/testing';
import { NxJson, readJsonInTree } from '@nrwl/schematics';
import { NxJson, readJsonInTree } from '@nrwl/workspace';
describe('app', () => {
let appTree: Tree;

View File

@ -13,10 +13,10 @@ import {
} from '@angular-devkit/schematics';
import { join, normalize, Path } from '@angular-devkit/core';
import { Schema } from './schema';
import { updateJsonInTree } from '@nrwl/schematics';
import { toFileName } from '@nrwl/schematics/src/utils/name-utils';
import { getProjectConfig } from '@nrwl/schematics/src/utils/ast-utils';
import { offsetFromRoot } from '@nrwl/schematics/src/utils/common';
import { updateJsonInTree } from '@nrwl/workspace';
import { toFileName } from '@nrwl/workspace';
import { getProjectConfig } from '@nrwl/workspace';
import { offsetFromRoot } from '@nrwl/workspace';
interface NormalizedSchema extends Schema {
appProjectRoot: Path;

View File

@ -1,8 +1,8 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
import { join } from 'path';
import { readJsonInTree } from '@nrwl/schematics';
import { readJsonInTree } from '@nrwl/workspace';
describe('ng-add', () => {
let tree: Tree;

View File

@ -1,8 +1,5 @@
import { Rule, chain } from '@angular-devkit/schematics';
import {
addDepsToPackageJson,
updateJsonInTree
} from '@nrwl/schematics/src/utils/ast-utils';
import { addDepsToPackageJson, updateJsonInTree } from '@nrwl/workspace';
import { nxVersion } from '../../utils/versions';
function addDependencies(): Rule {

View File

@ -2,7 +2,7 @@ import { Configuration, BannerPlugin } from 'webpack';
import * as mergeWebpack from 'webpack-merge';
import * as nodeExternals from 'webpack-node-externals';
import { getBaseWebpackPartial } from '@nrwl/builders/src/utils/webpack/config';
import { getBaseWebpackPartial } from '@nrwl/workspace';
import { BuildNodeBuilderOptions } from '../builders/build/build.builder';
function getNodePartial(options: BuildNodeBuilderOptions) {

View File

@ -7,7 +7,7 @@
"module": "esm5/nrwl-nx.js",
"es2015": "esm2015/nrwl-nx.js",
"peerDependencies": {
"jasmine-marbles": "0.4.0"
"jasmine-marbles": "*"
},
"author": "Victor Savkin",
"license": "MIT"

View File

@ -28,11 +28,9 @@
"migrations": "./migrations.json"
},
"peerDependencies": {
"@nrwl/schematics": "*"
"@nrwl/workspace": "*"
},
"dependencies": {
"@angular-devkit/core": "~7.3.1",
"@angular-devkit/schematics": "~7.3.1",
"@nrwl/cypress": "*",
"@nrwl/jest": "*",
"@nrwl/web": "*"

View File

@ -1,7 +1,7 @@
import { Tree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import * as stripJsonComments from 'strip-json-comments';
import { readJsonInTree, NxJson } from '@nrwl/schematics';
import { readJsonInTree, NxJson } from '@nrwl/workspace';
import { runSchematic } from '../../utils/testing';
describe('app', () => {

View File

@ -14,11 +14,11 @@ import {
filter
} from '@angular-devkit/schematics';
import { Schema } from './schema';
import { updateJsonInTree, NxJson } from '@nrwl/schematics';
import { toFileName, names } from '@nrwl/schematics/src/utils/name-utils';
import { offsetFromRoot } from '@nrwl/schematics/src/utils/common';
import { getNpmScope } from '@nrwl/schematics/src/utils/cli-config-utils';
import { formatFiles } from '@nrwl/schematics/src/utils/rules/format-files';
import { updateJsonInTree, NxJson } from '@nrwl/workspace';
import { toFileName, names } from '@nrwl/workspace';
import { offsetFromRoot } from '@nrwl/workspace';
import { getNpmScope } from '@nrwl/workspace';
import { formatFiles } from '@nrwl/workspace';
interface NormalizedSchema extends Schema {
projectName: string;

View File

@ -1,7 +1,7 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { readJsonInTree } from '@nrwl/schematics/src/utils/ast-utils';
import { NxJson } from '@nrwl/schematics/src/command-line/shared';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { readJsonInTree } from '@nrwl/workspace';
import { NxJson } from '@nrwl/workspace';
import { runSchematic } from '../../utils/testing';
describe('lib', () => {

View File

@ -13,15 +13,12 @@ import {
} from '@angular-devkit/schematics';
import { Schema } from './schema';
import { NxJson } from '@nrwl/schematics';
import {
updateJsonInTree,
readJsonInTree
} from '@nrwl/schematics/src/utils/ast-utils';
import { toFileName, names } from '@nrwl/schematics/src/utils/name-utils';
import { formatFiles } from '@nrwl/schematics/src/utils/rules/format-files';
import { NxJson } from '@nrwl/workspace';
import { updateJsonInTree, readJsonInTree } from '@nrwl/workspace';
import { toFileName, names } from '@nrwl/workspace';
import { formatFiles } from '@nrwl/workspace';
import { join, normalize } from 'path';
import { offsetFromRoot } from '@nrwl/schematics/src/utils/common';
import { offsetFromRoot } from '@nrwl/workspace';
export interface NormalizedSchema extends Schema {
name: string;

View File

@ -1,8 +1,8 @@
import { Tree, VirtualTree } from '@angular-devkit/schematics';
import { createEmptyWorkspace } from '@nrwl/schematics/testing';
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
import { join } from 'path';
import { readJsonInTree } from '@nrwl/schematics';
import { readJsonInTree } from '@nrwl/workspace';
describe('ng-add', () => {
let tree: Tree;

View File

@ -9,7 +9,7 @@ import {
addDepsToPackageJson,
updateJsonInTree,
readJsonInTree
} from '@nrwl/schematics/src/utils/ast-utils';
} from '@nrwl/workspace';
import {
frameworkVersion,
typesVersion,

View File

@ -1,7 +0,0 @@
export { NxJson } from './src/command-line/shared';
export {
readJsonInTree,
updateJsonInTree,
addDepsToPackageJson
} from './src/utils/ast-utils';
export { offsetFromRoot } from './src/utils/common';

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Update the schema file to point to the nrwl schema.',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description:

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Remove npmScope from tslint.json',

View File

@ -1,6 +1,6 @@
import { readCliConfigFile, updateJsonFile } from '../../src/utils/fileutils';
import { readCliConfigFile, updateJsonFile } from '@nrwl/workspace';
import { writeFileSync, unlinkSync } from 'fs';
import { offsetFromRoot } from '../../src/utils/common';
import { offsetFromRoot } from '@nrwl/workspace';
import * as path from 'path';
export default {

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Update tsconfig.spec.json to exclude e2e specs',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description:

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Add format:write and format:check to npm scripts',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Update npm scripts to use the nx command',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Update the version of prettier',

View File

@ -1,4 +1,4 @@
import { copyFile, updateJsonFile } from '../../src/utils/fileutils';
import { copyFile, updateJsonFile } from '@nrwl/workspace';
import * as path from 'path';
export default {

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Add @angular-devkit/core as a dev dependency',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Add nx-migrate:check and nx-migrate:skip to npm scripts',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Add postinstall script to run nx-migrate:check',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Add @angular-devkit/schematics as a dev dependency',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
import { unlinkSync } from 'fs';
export default {

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Add update, update:skip, update:check scripts',

View File

@ -1,11 +1,11 @@
import { writeFileSync, unlinkSync } from 'fs';
import { join } from 'path';
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
import {
ExistingPrettierConfig,
resolveUserExistingPrettierConfig
} from '../../src/utils/common';
} from '@nrwl/workspace';
export default {
description: 'Create or update prettier configuration',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Add tags to all app and libs',

View File

@ -1,4 +1,4 @@
import { updateJsonFile } from '../../src/utils/fileutils';
import { updateJsonFile } from '@nrwl/workspace';
export default {
description: 'Run lint checks ensuring the integrity of the workspace',

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