feat(core): remove angular devkit deps
This commit is contained in:
parent
7dd44c1e92
commit
a25e081a84
@ -3,7 +3,7 @@ tmp
|
|||||||
/build
|
/build
|
||||||
node_modules
|
node_modules
|
||||||
/package.json
|
/package.json
|
||||||
packages/workspace/src/schematics/**/files/**/*.json
|
packages/workspace/src/generators/**/files/**/*.json
|
||||||
packages/workspace/src/core/dep-graph/vendor.js
|
packages/workspace/src/core/dep-graph/vendor.js
|
||||||
packages/angular/src/schematics/**/files/**/*.json
|
packages/angular/src/schematics/**/files/**/*.json
|
||||||
packages/angular/src/migrations/**/files/**/*.json
|
packages/angular/src/migrations/**/files/**/*.json
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nrwl/nx-source",
|
"name": "@nrwl/nx-source",
|
||||||
"version": "11.99.0",
|
"version": "11.1.5",
|
||||||
"description": "Extensible Dev Tools for Monorepos",
|
"description": "Extensible Dev Tools for Monorepos",
|
||||||
"homepage": "https://nx.dev",
|
"homepage": "https://nx.dev",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { classify } from '@angular-devkit/core/src/utils/strings';
|
import { classify } from '@angular-devkit/core/src/utils/strings';
|
||||||
import { SchematicContext, Tree } from '@angular-devkit/schematics';
|
import { SchematicContext, Tree } from '@angular-devkit/schematics';
|
||||||
import { getWorkspace } from '@nrwl/workspace';
|
import { getWorkspace } from '@nrwl/workspace';
|
||||||
import { getNewProjectName } from '@nrwl/workspace/src/schematics/move/lib/utils';
|
import { getNewProjectName } from '@nrwl/workspace/src/generators/move/lib/utils';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { Schema } from '../schema';
|
import { Schema } from '../schema';
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { parseRunOneOptions } from './parse-run-one-options';
|
|||||||
process.env.NX_CLI_SET = 'true';
|
process.env.NX_CLI_SET = 'true';
|
||||||
|
|
||||||
export function initLocal(workspace: Workspace) {
|
export function initLocal(workspace: Workspace) {
|
||||||
require('@nrwl/workspace/' + 'src/utils/perf-logging');
|
require('@nrwl/workspace/' + 'src/utilities/perf-logging');
|
||||||
require('@nrwl/tao/src/compat/compat.js');
|
require('@nrwl/tao/src/compat/compat.js');
|
||||||
|
|
||||||
const supportedNxCommands = require('@nrwl/workspace/' +
|
const supportedNxCommands = require('@nrwl/workspace/' +
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
// we can't import from '@nrwl/workspace' because it will require typescript
|
// we can't import from '@nrwl/workspace' because it will require typescript
|
||||||
import { output } from '@nrwl/workspace/src/utils/output';
|
import { output } from '@nrwl/workspace/src/utilities/output';
|
||||||
import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager';
|
import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager';
|
||||||
import { dirSync } from 'tmp';
|
import { dirSync } from 'tmp';
|
||||||
import { writeFileSync, readFileSync, removeSync } from 'fs-extra';
|
import { writeFileSync, readFileSync, removeSync } from 'fs-extra';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
import { output } from '@nrwl/workspace/src/utils/output';
|
import { output } from '@nrwl/workspace/src/utilities/output';
|
||||||
|
|
||||||
export function showNxWarning(workspaceName: string) {
|
export function showNxWarning(workspaceName: string) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
import { output, unparse } from '@nrwl/workspace';
|
import { output } from '@nrwl/workspace/src/utilities/output';
|
||||||
import { Schema, Preset } from '@nrwl/workspace/src/schematics/new/new';
|
import { unparse } from '@nrwl/workspace/src/tasks-runner/utils';
|
||||||
|
import { Schema, Preset } from '@nrwl/workspace/src/generators/new/new';
|
||||||
import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager';
|
import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
import { writeFileSync } from 'fs';
|
import { writeFileSync } from 'fs';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
import { output } from '@nrwl/workspace/src/utils/output';
|
import { output } from '@nrwl/workspace/src/utilities/output';
|
||||||
|
|
||||||
export function showNxWarning(workspaceName: string) {
|
export function showNxWarning(workspaceName: string) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -49,3 +49,4 @@ export { offsetFromRoot } from './src/utils/offset-from-root';
|
|||||||
export { convertNxGenerator } from './src/utils/invoke-nx-generator';
|
export { convertNxGenerator } from './src/utils/invoke-nx-generator';
|
||||||
export { convertNxExecutor } from './src/utils/convert-nx-executor';
|
export { convertNxExecutor } from './src/utils/convert-nx-executor';
|
||||||
export { stripIndents } from './src/utils/strip-indents';
|
export { stripIndents } from './src/utils/strip-indents';
|
||||||
|
export { joinPathFragments, normalizePath } from './src/utils/path';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as path from 'path';
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import { Tree } from '@nrwl/tao/src/shared/tree';
|
import { Tree } from '@nrwl/tao/src/shared/tree';
|
||||||
|
import { joinPathFragments } from '../utils/path';
|
||||||
|
|
||||||
const ejs = require('ejs');
|
const ejs = require('ejs');
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ export function generateFiles(
|
|||||||
substitutions
|
substitutions
|
||||||
);
|
);
|
||||||
const newContent = ejs.render(fs.readFileSync(f).toString(), substitutions);
|
const newContent = ejs.render(fs.readFileSync(f).toString(), substitutions);
|
||||||
host.write(path.join(target, relativeToTarget), newContent);
|
host.write(joinPathFragments(target, relativeToTarget), newContent);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ function allFilesInDir(parent: string) {
|
|||||||
let res = [];
|
let res = [];
|
||||||
try {
|
try {
|
||||||
fs.readdirSync(parent).forEach((c) => {
|
fs.readdirSync(parent).forEach((c) => {
|
||||||
const child = path.join(parent, c);
|
const child = joinPathFragments(parent, c);
|
||||||
try {
|
try {
|
||||||
const s = fs.statSync(child);
|
const s = fs.statSync(child);
|
||||||
if (!s.isDirectory()) {
|
if (!s.isDirectory()) {
|
||||||
|
|||||||
28
packages/devkit/src/utils/path.ts
Normal file
28
packages/devkit/src/utils/path.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
function removeWindowsDriveLetter(osSpecificPath: string): string {
|
||||||
|
return osSpecificPath.replace(/^[A-Z]:/, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Coverts an os specific path to a unix style path
|
||||||
|
*/
|
||||||
|
export function normalizePath(osSpecificPath: string): string {
|
||||||
|
return removeWindowsDriveLetter(osSpecificPath).split(path.sep).join('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Normalized path fragments and joins them
|
||||||
|
*/
|
||||||
|
export function joinPathFragments(...fragments: string[]): string {
|
||||||
|
const normalizedFragments = [];
|
||||||
|
for (let i = 0; i < fragments.length; ++i) {
|
||||||
|
if (i === 0) {
|
||||||
|
normalizedFragments.push(normalizePath(fragments[i]));
|
||||||
|
} else {
|
||||||
|
const n = normalizePath(fragments[i]);
|
||||||
|
normalizedFragments.push(n.startsWith('/') ? n.substring(1) : n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return normalizedFragments.join('/');
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { appRootPath } from '@nrwl/workspace/src/utils/app-root';
|
import { appRootPath } from '@nrwl/workspace/src/utilities/app-root';
|
||||||
import {
|
import {
|
||||||
DepConstraint,
|
DepConstraint,
|
||||||
findConstraintsFor,
|
findConstraintsFor,
|
||||||
|
|||||||
@ -33,9 +33,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nrwl/devkit": "*",
|
"@nrwl/devkit": "*",
|
||||||
"@angular-devkit/architect": "~0.1100.1",
|
|
||||||
"@angular-devkit/core": "~11.0.1",
|
|
||||||
"@angular-devkit/schematics": "~11.0.1",
|
|
||||||
"jest-resolve": "^26.6.2",
|
"jest-resolve": "^26.6.2",
|
||||||
"rxjs": "^6.5.4",
|
"rxjs": "^6.5.4",
|
||||||
"strip-json-comments": "2.0.1",
|
"strip-json-comments": "2.0.1",
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
|
||||||
import {
|
import {
|
||||||
babelCoreVersion,
|
babelCoreVersion,
|
||||||
babelJestVersion,
|
babelJestVersion,
|
||||||
@ -16,6 +15,7 @@ import {
|
|||||||
updateJson,
|
updateJson,
|
||||||
addDependenciesToPackageJson,
|
addDependenciesToPackageJson,
|
||||||
convertNxGenerator,
|
convertNxGenerator,
|
||||||
|
stripIndents,
|
||||||
} from '@nrwl/devkit';
|
} from '@nrwl/devkit';
|
||||||
|
|
||||||
interface NormalizedSchema extends ReturnType<typeof normalizeOptions> {}
|
interface NormalizedSchema extends ReturnType<typeof normalizeOptions> {}
|
||||||
|
|||||||
@ -1,18 +1,27 @@
|
|||||||
import { join, normalize } from '@angular-devkit/core';
|
|
||||||
import { JestProjectSchema } from '../schema';
|
import { JestProjectSchema } from '../schema';
|
||||||
import {
|
import {
|
||||||
readProjectConfiguration,
|
readProjectConfiguration,
|
||||||
Tree,
|
Tree,
|
||||||
updateProjectConfiguration,
|
updateProjectConfiguration,
|
||||||
|
joinPathFragments,
|
||||||
|
normalizePath,
|
||||||
} from '@nrwl/devkit';
|
} from '@nrwl/devkit';
|
||||||
|
|
||||||
export function updateWorkspace(tree: Tree, options: JestProjectSchema) {
|
export function updateWorkspace(tree: Tree, options: JestProjectSchema) {
|
||||||
const projectConfig = readProjectConfiguration(tree, options.project);
|
const projectConfig = readProjectConfiguration(tree, options.project);
|
||||||
projectConfig.targets.test = {
|
projectConfig.targets.test = {
|
||||||
executor: '@nrwl/jest:jest',
|
executor: '@nrwl/jest:jest',
|
||||||
outputs: [join(normalize('coverage'), normalize(projectConfig.root))],
|
outputs: [
|
||||||
|
joinPathFragments(
|
||||||
|
normalizePath('coverage'),
|
||||||
|
normalizePath(projectConfig.root)
|
||||||
|
),
|
||||||
|
],
|
||||||
options: {
|
options: {
|
||||||
jestConfig: join(normalize(projectConfig.root), 'jest.config.js'),
|
jestConfig: joinPathFragments(
|
||||||
|
normalizePath(projectConfig.root),
|
||||||
|
'jest.config.js'
|
||||||
|
),
|
||||||
passWithNoTests: true,
|
passWithNoTests: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -24,7 +33,10 @@ export function updateWorkspace(tree: Tree, options: JestProjectSchema) {
|
|||||||
if (isUsingTSLint) {
|
if (isUsingTSLint) {
|
||||||
projectConfig.targets.lint.options.tsConfig = [
|
projectConfig.targets.lint.options.tsConfig = [
|
||||||
...(projectConfig.targets.lint.options.tsConfig || []),
|
...(projectConfig.targets.lint.options.tsConfig || []),
|
||||||
join(normalize(projectConfig.root), 'tsconfig.spec.json'),
|
joinPathFragments(
|
||||||
|
normalizePath(projectConfig.root),
|
||||||
|
'tsconfig.spec.json'
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
updateProjectConfiguration(tree, options.project, projectConfig);
|
updateProjectConfiguration(tree, options.project, projectConfig);
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import {
|
|||||||
} from '@nrwl/workspace';
|
} from '@nrwl/workspace';
|
||||||
import { addPropertyToJestConfig } from '../utils/config/legacy/update-config';
|
import { addPropertyToJestConfig } from '../utils/config/legacy/update-config';
|
||||||
import { getJestObject } from './require-jest-config';
|
import { getJestObject } from './require-jest-config';
|
||||||
import { appRootPath } from '@nrwl/workspace/src/utils/app-root';
|
import { appRootPath } from '@nrwl/workspace/src/utilities/app-root';
|
||||||
|
|
||||||
function checkJestPropertyObject(object: unknown): object is object {
|
function checkJestPropertyObject(object: unknown): object is object {
|
||||||
return object !== null && object !== undefined;
|
return object !== null && object !== undefined;
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import {
|
|||||||
} from '../utils/config/legacy/update-config';
|
} from '../utils/config/legacy/update-config';
|
||||||
import { getJestObject } from '../update-10-0-0/require-jest-config';
|
import { getJestObject } from '../update-10-0-0/require-jest-config';
|
||||||
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
||||||
import { appRootPath } from '@nrwl/workspace/src/utils/app-root';
|
import { appRootPath } from '@nrwl/workspace/src/utilities/app-root';
|
||||||
|
|
||||||
function updateAstTransformers(): Rule {
|
function updateAstTransformers(): Rule {
|
||||||
return async (host: Tree, context: SchematicContext) => {
|
return async (host: Tree, context: SchematicContext) => {
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
},
|
},
|
||||||
"builders": "./builders.json",
|
"builders": "./builders.json",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular-devkit/architect": "~0.1100.1",
|
|
||||||
"@nrwl/devkit": "*",
|
"@nrwl/devkit": "*",
|
||||||
"glob": "7.1.4",
|
"glob": "7.1.4",
|
||||||
"minimatch": "3.0.4",
|
"minimatch": "3.0.4",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
const { join } = require('path');
|
const { join } = require('path');
|
||||||
const { appRootPath } = require('@nrwl/workspace/src/utils/app-root');
|
const { appRootPath } = require('@nrwl/workspace/src/utilities/app-root');
|
||||||
const { workspaceLayout } = require('@nrwl/workspace/src/core/file-utils');
|
const { workspaceLayout } = require('@nrwl/workspace/src/core/file-utils');
|
||||||
|
|
||||||
function regexEqual(x, y) {
|
function regexEqual(x, y) {
|
||||||
|
|||||||
@ -16,9 +16,9 @@ jest.mock('glob');
|
|||||||
import * as glob from 'glob';
|
import * as glob from 'glob';
|
||||||
jest.mock('fs-extra');
|
jest.mock('fs-extra');
|
||||||
import * as fs from 'fs-extra';
|
import * as fs from 'fs-extra';
|
||||||
jest.mock('@nrwl/workspace/src/utils/fileutils');
|
jest.mock('@nrwl/workspace/src/utilities/fileutils');
|
||||||
import * as fsUtility from '@nrwl/workspace/src/utils/fileutils';
|
import * as fsUtility from '@nrwl/workspace/src/utilities/fileutils';
|
||||||
import * as tsUtils from '@nrwl/workspace/src/utils/typescript';
|
import * as tsUtils from '@nrwl/workspace/src/utilities/typescript';
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
|
|
||||||
describe('NodePackageBuilder', () => {
|
describe('NodePackageBuilder', () => {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { BuilderContext } from '@angular-devkit/architect';
|
import { BuilderContext } from '@angular-devkit/architect';
|
||||||
import { normalize } from '@angular-devkit/core';
|
import { normalize } from '@angular-devkit/core';
|
||||||
import { readJsonFile } from '@nrwl/workspace';
|
import { readJsonFile } from '@nrwl/workspace';
|
||||||
import { writeJsonFile } from '@nrwl/workspace/src/utils/fileutils';
|
import { writeJsonFile } from '@nrwl/workspace/src/utilities/fileutils';
|
||||||
import { basename, join } from 'path';
|
import { basename, join } from 'path';
|
||||||
import { NormalizedBuilderOptions } from './models';
|
import { NormalizedBuilderOptions } from './models';
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { ProjectGraph, readJsonFile } from '@nrwl/workspace';
|
import { ProjectGraph, readJsonFile } from '@nrwl/workspace';
|
||||||
import { BuildNodeBuilderOptions } from './types';
|
import { BuildNodeBuilderOptions } from './types';
|
||||||
import { writeJsonFile } from '@nrwl/workspace/src/utils/fileutils';
|
import { writeJsonFile } from '@nrwl/workspace/src/utilities/fileutils';
|
||||||
import { OUT_FILENAME } from './config';
|
import { OUT_FILENAME } from './config';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { appRootPath } from '@nrwl/workspace/src/utils/app-root';
|
import { appRootPath } from '@nrwl/workspace/src/utilities/app-root';
|
||||||
import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager';
|
import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
import { readFileSync, writeFileSync } from 'fs';
|
import { readFileSync, writeFileSync } from 'fs';
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { appRootPath } from '@nrwl/workspace/src/utils/app-root';
|
import { appRootPath } from '@nrwl/workspace/src/utilities/app-root';
|
||||||
import { readJsonFile } from '@nrwl/workspace';
|
import { readJsonFile } from '@nrwl/workspace';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|
||||||
|
|||||||
@ -29,9 +29,6 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://nx.dev",
|
"homepage": "https://nx.dev",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular-devkit/schematics": "~11.0.1",
|
|
||||||
"@angular-devkit/core": "~11.0.1",
|
|
||||||
"@angular-devkit/architect": "~0.1100.1",
|
|
||||||
"chalk": "4.1.0",
|
"chalk": "4.1.0",
|
||||||
"inquirer": "^6.3.1",
|
"inquirer": "^6.3.1",
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { BuildResult } from '@angular-devkit/build-webpack';
|
|||||||
import {
|
import {
|
||||||
readJsonFile,
|
readJsonFile,
|
||||||
writeJsonFile,
|
writeJsonFile,
|
||||||
} from '@nrwl/workspace/src/utils/fileutils';
|
} from '@nrwl/workspace/src/utilities/fileutils';
|
||||||
import { createProjectGraph } from '@nrwl/workspace/src/core/project-graph';
|
import { createProjectGraph } from '@nrwl/workspace/src/core/project-graph';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|||||||
@ -3,128 +3,128 @@
|
|||||||
"version": "0.1",
|
"version": "0.1",
|
||||||
"schematics": {
|
"schematics": {
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"factory": "./src/schematics/workspace/workspace#workspaceSchematic",
|
"factory": "./src/generators/workspace/workspace#workspaceSchematic",
|
||||||
"schema": "./src/schematics/workspace/schema.json",
|
"schema": "./src/generators/workspace/schema.json",
|
||||||
"description": "Create an empty workspace",
|
"description": "Create an empty workspace",
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"ng-add": {
|
"ng-add": {
|
||||||
"factory": "./src/schematics/init/init#initSchematic",
|
"factory": "./src/generators/init/init#initSchematic",
|
||||||
"schema": "./src/schematics/init/schema.json",
|
"schema": "./src/generators/init/schema.json",
|
||||||
"description": "Convert an existing CLI project into an Nx Workspace",
|
"description": "Convert an existing CLI project into an Nx Workspace",
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"preset": {
|
"preset": {
|
||||||
"factory": "./src/schematics/preset/preset#presetSchematic",
|
"factory": "./src/generators/preset/preset#presetSchematic",
|
||||||
"schema": "./src/schematics/preset/schema.json",
|
"schema": "./src/generators/preset/schema.json",
|
||||||
"description": "Create application in an empty workspace",
|
"description": "Create application in an empty workspace",
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"move": {
|
"move": {
|
||||||
"factory": "./src/schematics/move/move#moveSchematic",
|
"factory": "./src/generators/move/move#moveSchematic",
|
||||||
"schema": "./src/schematics/move/schema.json",
|
"schema": "./src/generators/move/schema.json",
|
||||||
"aliases": ["mv"],
|
"aliases": ["mv"],
|
||||||
"description": "Move an application or library to another folder"
|
"description": "Move an application or library to another folder"
|
||||||
},
|
},
|
||||||
|
|
||||||
"remove": {
|
"remove": {
|
||||||
"factory": "./src/schematics/remove/remove#moveSchematic",
|
"factory": "./src/generators/remove/remove#moveSchematic",
|
||||||
"schema": "./src/schematics/remove/schema.json",
|
"schema": "./src/generators/remove/schema.json",
|
||||||
"aliases": ["rm"],
|
"aliases": ["rm"],
|
||||||
"description": "Remove an application or library"
|
"description": "Remove an application or library"
|
||||||
},
|
},
|
||||||
|
|
||||||
"new": {
|
"new": {
|
||||||
"factory": "./src/schematics/new/new#newSchematic",
|
"factory": "./src/generators/new/new#newSchematic",
|
||||||
"schema": "./src/schematics/new/schema.json",
|
"schema": "./src/generators/new/schema.json",
|
||||||
"description": "Create a workspace",
|
"description": "Create a workspace",
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"library": {
|
"library": {
|
||||||
"factory": "./src/schematics/library/library#librarySchematic",
|
"factory": "./src/generators/library/library#librarySchematic",
|
||||||
"schema": "./src/schematics/library/schema.json",
|
"schema": "./src/generators/library/schema.json",
|
||||||
"aliases": ["lib"],
|
"aliases": ["lib"],
|
||||||
"description": "Create a library"
|
"description": "Create a library"
|
||||||
},
|
},
|
||||||
|
|
||||||
"workspace-generator": {
|
"workspace-generator": {
|
||||||
"factory": "./src/schematics/workspace-generator/workspace-generator",
|
"factory": "./src/generators/workspace-generator/workspace-generator",
|
||||||
"schema": "./src/schematics/workspace-generator/schema.json",
|
"schema": "./src/generators/workspace-generator/schema.json",
|
||||||
"aliases": ["workspace-schematic"],
|
"aliases": ["workspace-schematic"],
|
||||||
"description": "Generates a workspace generator"
|
"description": "Generates a workspace generator"
|
||||||
},
|
},
|
||||||
|
|
||||||
"run-commands": {
|
"run-commands": {
|
||||||
"factory": "./src/schematics/run-commands/run-commands#runCommandsSchematic",
|
"factory": "./src/generators/run-commands/run-commands#runCommandsSchematic",
|
||||||
"schema": "./src/schematics/run-commands/schema.json",
|
"schema": "./src/generators/run-commands/schema.json",
|
||||||
"aliases": ["run-command", "target"],
|
"aliases": ["run-command", "target"],
|
||||||
"description": "Generates a target to run any command in the terminal"
|
"description": "Generates a target to run any command in the terminal"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"generators": {
|
"generators": {
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"factory": "./src/schematics/workspace/workspace#workspaceGenerator",
|
"factory": "./src/generators/workspace/workspace#workspaceGenerator",
|
||||||
"schema": "./src/schematics/workspace/schema.json",
|
"schema": "./src/generators/workspace/schema.json",
|
||||||
"description": "Create an empty workspace",
|
"description": "Create an empty workspace",
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"ng-add": {
|
"ng-add": {
|
||||||
"factory": "./src/schematics/init/init#initGenerator",
|
"factory": "./src/generators/init/init#initGenerator",
|
||||||
"schema": "./src/schematics/init/schema.json",
|
"schema": "./src/generators/init/schema.json",
|
||||||
"description": "Convert an existing CLI project into an Nx Workspace",
|
"description": "Convert an existing CLI project into an Nx Workspace",
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"preset": {
|
"preset": {
|
||||||
"factory": "./src/schematics/preset/preset#presetGenerator",
|
"factory": "./src/generators/preset/preset#presetGenerator",
|
||||||
"schema": "./src/schematics/preset/schema.json",
|
"schema": "./src/generators/preset/schema.json",
|
||||||
"description": "Create application in an empty workspace",
|
"description": "Create application in an empty workspace",
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"move": {
|
"move": {
|
||||||
"factory": "./src/schematics/move/move#moveGenerator",
|
"factory": "./src/generators/move/move#moveGenerator",
|
||||||
"schema": "./src/schematics/move/schema.json",
|
"schema": "./src/generators/move/schema.json",
|
||||||
"aliases": ["mv"],
|
"aliases": ["mv"],
|
||||||
"description": "Move an application or library to another folder"
|
"description": "Move an application or library to another folder"
|
||||||
},
|
},
|
||||||
|
|
||||||
"remove": {
|
"remove": {
|
||||||
"factory": "./src/schematics/remove/remove#removeGenerator",
|
"factory": "./src/generators/remove/remove#removeGenerator",
|
||||||
"schema": "./src/schematics/remove/schema.json",
|
"schema": "./src/generators/remove/schema.json",
|
||||||
"aliases": ["rm"],
|
"aliases": ["rm"],
|
||||||
"description": "Remove an application or library"
|
"description": "Remove an application or library"
|
||||||
},
|
},
|
||||||
|
|
||||||
"new": {
|
"new": {
|
||||||
"factory": "./src/schematics/new/new#newGenerator",
|
"factory": "./src/generators/new/new#newGenerator",
|
||||||
"schema": "./src/schematics/new/schema.json",
|
"schema": "./src/generators/new/schema.json",
|
||||||
"description": "Create a workspace",
|
"description": "Create a workspace",
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"library": {
|
"library": {
|
||||||
"factory": "./src/schematics/library/library#libraryGenerator",
|
"factory": "./src/generators/library/library#libraryGenerator",
|
||||||
"schema": "./src/schematics/library/schema.json",
|
"schema": "./src/generators/library/schema.json",
|
||||||
"aliases": ["lib"],
|
"aliases": ["lib"],
|
||||||
"description": "Create a library"
|
"description": "Create a library"
|
||||||
},
|
},
|
||||||
|
|
||||||
"workspace-generator": {
|
"workspace-generator": {
|
||||||
"factory": "./src/schematics/workspace-generator/workspace-generator",
|
"factory": "./src/generators/workspace-generator/workspace-generator",
|
||||||
"schema": "./src/schematics/workspace-generator/schema.json",
|
"schema": "./src/generators/workspace-generator/schema.json",
|
||||||
"aliases": ["workspace-schematic"],
|
"aliases": ["workspace-schematic"],
|
||||||
"description": "Generates a workspace generator"
|
"description": "Generates a workspace generator"
|
||||||
},
|
},
|
||||||
|
|
||||||
"run-commands": {
|
"run-commands": {
|
||||||
"factory": "./src/schematics/run-commands/run-commands#runCommandsGenerator",
|
"factory": "./src/generators/run-commands/run-commands#runCommandsGenerator",
|
||||||
"schema": "./src/schematics/run-commands/schema.json",
|
"schema": "./src/generators/run-commands/schema.json",
|
||||||
"aliases": ["run-command", "target"],
|
"aliases": ["run-command", "target"],
|
||||||
"description": "Generates a target to run any command in the terminal"
|
"description": "Generates a target to run any command in the terminal"
|
||||||
}
|
}
|
||||||
|
|||||||
4
packages/workspace/generators.ts
Normal file
4
packages/workspace/generators.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export { libraryGenerator } from './src/generators/library/library';
|
||||||
|
export { moveGenerator } from './src/generators/move/move';
|
||||||
|
export { removeGenerator } from './src/generators/remove/remove';
|
||||||
|
export { runCommandsGenerator } from './src/generators/run-commands/run-commands';
|
||||||
@ -1,4 +1,4 @@
|
|||||||
export { readTsConfig } from './src/utils/typescript';
|
export { readTsConfig } from './src/utilities/typescript';
|
||||||
export { ProjectType, projectRootDir } from './src/utils/project-type';
|
export { ProjectType, projectRootDir } from './src/utils/project-type';
|
||||||
export {
|
export {
|
||||||
serializeJson,
|
serializeJson,
|
||||||
@ -7,7 +7,7 @@ export {
|
|||||||
readJsonFile,
|
readJsonFile,
|
||||||
copyFile,
|
copyFile,
|
||||||
createDirectory,
|
createDirectory,
|
||||||
} from './src/utils/fileutils';
|
} from './src/utilities/fileutils';
|
||||||
|
|
||||||
// TODO: vsavkin delete after Nx 12
|
// TODO: vsavkin delete after Nx 12
|
||||||
export * from './src/devkit-reexport';
|
export * from './src/devkit-reexport';
|
||||||
@ -15,9 +15,9 @@ export * from './src/devkit-reexport';
|
|||||||
export {
|
export {
|
||||||
ExistingPrettierConfig,
|
ExistingPrettierConfig,
|
||||||
resolveUserExistingPrettierConfig,
|
resolveUserExistingPrettierConfig,
|
||||||
} from './src/utils/common';
|
} from './src/utilities/prettier';
|
||||||
|
|
||||||
export { output } from './src/utils/output';
|
export { output } from './src/utilities/output';
|
||||||
export { commandsObject } from './src/command-line/nx-commands';
|
export { commandsObject } from './src/command-line/nx-commands';
|
||||||
export { supportedNxCommands } from './src/command-line/supported-nx-commands';
|
export { supportedNxCommands } from './src/command-line/supported-nx-commands';
|
||||||
export {
|
export {
|
||||||
@ -91,9 +91,9 @@ import * as strings from './src/utils/strings';
|
|||||||
export { checkAndCleanWithSemver } from './src/utils/version-utils';
|
export { checkAndCleanWithSemver } from './src/utils/version-utils';
|
||||||
export { updatePackagesInPackageJson } from './src/utils/update-packages-in-package-json';
|
export { updatePackagesInPackageJson } from './src/utils/update-packages-in-package-json';
|
||||||
|
|
||||||
export { libraryGenerator } from './src/schematics/library/library';
|
export { libraryGenerator } from './src/generators/library/library';
|
||||||
export { moveGenerator } from './src/schematics/move/move';
|
export { moveGenerator } from './src/generators/move/move';
|
||||||
export { removeGenerator } from './src/schematics/remove/remove';
|
export { removeGenerator } from './src/generators/remove/remove';
|
||||||
export { runCommandsGenerator } from './src/schematics/run-commands/run-commands';
|
export { runCommandsGenerator } from './src/generators/run-commands/run-commands';
|
||||||
|
|
||||||
export const stringUtils = strings;
|
export const stringUtils = strings;
|
||||||
|
|||||||
@ -53,9 +53,6 @@
|
|||||||
"prettier": "^2.0.4"
|
"prettier": "^2.0.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular-devkit/architect": "~0.1100.1",
|
|
||||||
"@angular-devkit/core": "~11.0.1",
|
|
||||||
"@angular-devkit/schematics": "~11.0.1",
|
|
||||||
"@nrwl/cli": "*",
|
"@nrwl/cli": "*",
|
||||||
"@nrwl/devkit": "*",
|
"@nrwl/devkit": "*",
|
||||||
"@nrwl/jest": "*",
|
"@nrwl/jest": "*",
|
||||||
|
|||||||
@ -10,8 +10,8 @@ import {
|
|||||||
} from '../core/project-graph';
|
} from '../core/project-graph';
|
||||||
import { DefaultReporter } from '../tasks-runner/default-reporter';
|
import { DefaultReporter } from '../tasks-runner/default-reporter';
|
||||||
import { runCommand } from '../tasks-runner/run-command';
|
import { runCommand } from '../tasks-runner/run-command';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
import { projectHasTarget } from '../utils/project-graph-utils';
|
import { projectHasTarget } from '../utilities/project-graph-utils';
|
||||||
import { generateGraph } from './dep-graph';
|
import { generateGraph } from './dep-graph';
|
||||||
import { printAffected } from './print-affected';
|
import { printAffected } from './print-affected';
|
||||||
import { promptForNxCloud } from './prompt-for-nx-cloud';
|
import { promptForNxCloud } from './prompt-for-nx-cloud';
|
||||||
|
|||||||
@ -10,8 +10,8 @@ import {
|
|||||||
ProjectGraph,
|
ProjectGraph,
|
||||||
ProjectGraphNode,
|
ProjectGraphNode,
|
||||||
} from '../core/project-graph';
|
} from '../core/project-graph';
|
||||||
import { appRootPath } from '../utils/app-root';
|
import { appRootPath } from '../utilities/app-root';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
|
|
||||||
// maps file extention to MIME types
|
// maps file extention to MIME types
|
||||||
const mimeType = {
|
const mimeType = {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { execSync } from 'child_process';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as resolve from 'resolve';
|
import * as resolve from 'resolve';
|
||||||
import { getProjectRoots, parseFiles } from './shared';
|
import { getProjectRoots, parseFiles } from './shared';
|
||||||
import { fileExists } from '../utils/fileutils';
|
import { fileExists } from '../utilities/fileutils';
|
||||||
import {
|
import {
|
||||||
createProjectGraph,
|
createProjectGraph,
|
||||||
onlyWorkspaceProjects,
|
onlyWorkspaceProjects,
|
||||||
@ -15,7 +15,7 @@ import {
|
|||||||
reformattedWorkspaceJsonOrNull,
|
reformattedWorkspaceJsonOrNull,
|
||||||
workspaceConfigName,
|
workspaceConfigName,
|
||||||
} from '@nrwl/tao/src/shared/workspace';
|
} from '@nrwl/tao/src/shared/workspace';
|
||||||
import { appRootPath } from '@nrwl/workspace/src/utils/app-root';
|
import { appRootPath } from '@nrwl/workspace/src/utilities/app-root';
|
||||||
import { readFileSync, writeFileSync } from 'fs-extra';
|
import { readFileSync, writeFileSync } from 'fs-extra';
|
||||||
import * as stripJsonComments from 'strip-json-comments';
|
import * as stripJsonComments from 'strip-json-comments';
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import {
|
|||||||
} from '../core/project-graph';
|
} from '../core/project-graph';
|
||||||
import { WorkspaceIntegrityChecks } from './workspace-integrity-checks';
|
import { WorkspaceIntegrityChecks } from './workspace-integrity-checks';
|
||||||
import { readWorkspaceFiles, workspaceLayout } from '../core/file-utils';
|
import { readWorkspaceFiles, workspaceLayout } from '../core/file-utils';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
export function workspaceLint() {
|
export function workspaceLint() {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as yargs from 'yargs';
|
import * as yargs from 'yargs';
|
||||||
import { appRootPath } from '../utils/app-root';
|
import { appRootPath } from '../utilities/app-root';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
import {
|
import {
|
||||||
fetchCommunityPlugins,
|
fetchCommunityPlugins,
|
||||||
fetchCorePlugins,
|
fetchCorePlugins,
|
||||||
@ -9,7 +9,7 @@ import {
|
|||||||
listCorePlugins,
|
listCorePlugins,
|
||||||
listInstalledPlugins,
|
listInstalledPlugins,
|
||||||
listPluginCapabilities,
|
listPluginCapabilities,
|
||||||
} from '../utils/plugins';
|
} from '../utilities/plugins';
|
||||||
|
|
||||||
export interface YargsListArgs extends yargs.Arguments, ListArgs {}
|
export interface YargsListArgs extends yargs.Arguments, ListArgs {}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as inquirer from 'inquirer';
|
import * as inquirer from 'inquirer';
|
||||||
import { readNxJson } from '../core/file-utils';
|
import { readNxJson } from '../core/file-utils';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager';
|
import { getPackageManagerCommand } from '@nrwl/tao/src/shared/package-manager';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import * as chalk from 'chalk';
|
import * as chalk from 'chalk';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { appRootPath } from '../utils/app-root';
|
import { appRootPath } from '../utilities/app-root';
|
||||||
import { detectPackageManager } from '@nrwl/tao/src/shared/package-manager';
|
import { detectPackageManager } from '@nrwl/tao/src/shared/package-manager';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
|
|
||||||
export const packagesWeCareAbout = [
|
export const packagesWeCareAbout = [
|
||||||
'nx',
|
'nx',
|
||||||
|
|||||||
@ -11,8 +11,8 @@ import {
|
|||||||
} from '../core/project-graph';
|
} from '../core/project-graph';
|
||||||
import { readEnvironment } from '../core/file-utils';
|
import { readEnvironment } from '../core/file-utils';
|
||||||
import { DefaultReporter } from '../tasks-runner/default-reporter';
|
import { DefaultReporter } from '../tasks-runner/default-reporter';
|
||||||
import { projectHasTarget } from '../utils/project-graph-utils';
|
import { projectHasTarget } from '../utilities/project-graph-utils';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
import { promptForNxCloud } from './prompt-for-nx-cloud';
|
import { promptForNxCloud } from './prompt-for-nx-cloud';
|
||||||
|
|
||||||
export async function runMany(parsedArgs: yargs.Arguments) {
|
export async function runMany(parsedArgs: yargs.Arguments) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { createProjectGraph, ProjectGraph } from '../core/project-graph';
|
|||||||
import { readEnvironment } from '../core/file-utils';
|
import { readEnvironment } from '../core/file-utils';
|
||||||
import { EmptyReporter } from '../tasks-runner/empty-reporter';
|
import { EmptyReporter } from '../tasks-runner/empty-reporter';
|
||||||
import { splitArgsIntoNxArgsAndOverrides } from './utils';
|
import { splitArgsIntoNxArgsAndOverrides } from './utils';
|
||||||
import { projectHasTarget } from '../utils/project-graph-utils';
|
import { projectHasTarget } from '../utilities/project-graph-utils';
|
||||||
import { promptForNxCloud } from './prompt-for-nx-cloud';
|
import { promptForNxCloud } from './prompt-for-nx-cloud';
|
||||||
|
|
||||||
export async function runOne(opts: {
|
export async function runOne(opts: {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import * as yargsParser from 'yargs-parser';
|
|||||||
import * as yargs from 'yargs';
|
import * as yargs from 'yargs';
|
||||||
import * as fileUtils from '../core/file-utils';
|
import * as fileUtils from '../core/file-utils';
|
||||||
import { NxAffectedConfig } from '../core/shared-interfaces';
|
import { NxAffectedConfig } from '../core/shared-interfaces';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
import { names } from '@nrwl/devkit';
|
import { names } from '@nrwl/devkit';
|
||||||
|
|
||||||
const runOne = [
|
const runOne = [
|
||||||
|
|||||||
@ -1,23 +1,4 @@
|
|||||||
import {
|
|
||||||
JsonObject,
|
|
||||||
logging,
|
|
||||||
normalize,
|
|
||||||
schema,
|
|
||||||
tags,
|
|
||||||
virtualFs,
|
|
||||||
} from '@angular-devkit/core';
|
|
||||||
import * as chalk from 'chalk';
|
import * as chalk from 'chalk';
|
||||||
import { createConsoleLogger, NodeJsSyncHost } from '@angular-devkit/core/node';
|
|
||||||
import {
|
|
||||||
formats,
|
|
||||||
SchematicEngine,
|
|
||||||
UnsuccessfulWorkflowExecution,
|
|
||||||
} from '@angular-devkit/schematics';
|
|
||||||
import {
|
|
||||||
NodeModulesEngineHost,
|
|
||||||
NodeWorkflow,
|
|
||||||
validateOptionsWithSchema,
|
|
||||||
} from '@angular-devkit/schematics/tools';
|
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import { writeFileSync } from 'fs';
|
import { writeFileSync } from 'fs';
|
||||||
@ -25,15 +6,20 @@ import { copySync, removeSync } from 'fs-extra';
|
|||||||
import * as inquirer from 'inquirer';
|
import * as inquirer from 'inquirer';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as yargsParser from 'yargs-parser';
|
import * as yargsParser from 'yargs-parser';
|
||||||
import { appRootPath } from '../utils/app-root';
|
import { appRootPath } from '../utilities/app-root';
|
||||||
import {
|
import {
|
||||||
detectPackageManager,
|
detectPackageManager,
|
||||||
getPackageManagerCommand,
|
getPackageManagerCommand,
|
||||||
} from '@nrwl/tao/src/shared/package-manager';
|
} from '@nrwl/tao/src/shared/package-manager';
|
||||||
import { fileExists, readJsonFile, writeJsonFile } from '../utils/fileutils';
|
import {
|
||||||
import { output } from '../utils/output';
|
fileExists,
|
||||||
|
readJsonFile,
|
||||||
|
writeJsonFile,
|
||||||
|
} from '../utilities/fileutils';
|
||||||
|
import { output } from '../utilities/output';
|
||||||
import { CompilerOptions } from 'typescript';
|
import { CompilerOptions } from 'typescript';
|
||||||
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
|
import { Workspaces } from '@nrwl/tao/src/shared/workspace';
|
||||||
|
import { logger, normalizePath } from '@nrwl/devkit';
|
||||||
|
|
||||||
const rootDirectory = appRootPath;
|
const rootDirectory = appRootPath;
|
||||||
|
|
||||||
@ -49,14 +35,10 @@ type TsConfig = {
|
|||||||
export async function workspaceGenerators(args: string[]) {
|
export async function workspaceGenerators(args: string[]) {
|
||||||
const outDir = compileTools();
|
const outDir = compileTools();
|
||||||
const parsedArgs = parseOptions(args, outDir);
|
const parsedArgs = parseOptions(args, outDir);
|
||||||
const logger = createConsoleLogger(
|
|
||||||
parsedArgs.verbose,
|
|
||||||
process.stdout,
|
|
||||||
process.stderr
|
|
||||||
);
|
|
||||||
const collectionFile = path.join(outDir, 'workspace-generators.json');
|
const collectionFile = path.join(outDir, 'workspace-generators.json');
|
||||||
if (parsedArgs.listGenerators) {
|
if (parsedArgs.listGenerators) {
|
||||||
return listGenerators(collectionFile, logger);
|
return listGenerators(collectionFile);
|
||||||
}
|
}
|
||||||
const generatorName = args[0];
|
const generatorName = args[0];
|
||||||
const ws = new Workspaces(rootDirectory);
|
const ws = new Workspaces(rootDirectory);
|
||||||
@ -72,6 +54,11 @@ export async function workspaceGenerators(args: string[]) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
const logger = require('@angular-devkit/core/node').createConsoleLogger(
|
||||||
|
parsedArgs.verbose,
|
||||||
|
process.stdout,
|
||||||
|
process.stderr
|
||||||
|
);
|
||||||
try {
|
try {
|
||||||
const workflow = createWorkflow(parsedArgs.dryRun);
|
const workflow = createWorkflow(parsedArgs.dryRun);
|
||||||
await executeAngularDevkitSchematic(
|
await executeAngularDevkitSchematic(
|
||||||
@ -129,7 +116,7 @@ function constructCollection() {
|
|||||||
if (exists(path.join(childDir, 'schema.json'))) {
|
if (exists(path.join(childDir, 'schema.json'))) {
|
||||||
generators[c] = {
|
generators[c] = {
|
||||||
factory: `./${c}`,
|
factory: `./${c}`,
|
||||||
schema: `./${normalize(path.join(c, 'schema.json'))}`,
|
schema: `./${normalizePath(path.join(c, 'schema.json'))}`,
|
||||||
description: `Schematic ${c}`,
|
description: `Schematic ${c}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -137,7 +124,7 @@ function constructCollection() {
|
|||||||
return {
|
return {
|
||||||
name: 'workspace-generators',
|
name: 'workspace-generators',
|
||||||
version: '1.0',
|
version: '1.0',
|
||||||
schematics: generators, // TODO vsavkin: remove this
|
generators: generators,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,29 +152,31 @@ function toolsTsConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createWorkflow(dryRun: boolean) {
|
function createWorkflow(dryRun: boolean) {
|
||||||
const root = normalize(rootDirectory);
|
const { virtualFs, schema } = require('@angular-devkit/core');
|
||||||
|
const { NodeJsSyncHost } = require('@angular-devkit/core/node');
|
||||||
|
const { formats } = require('@angular-devkit/schematics');
|
||||||
|
const { NodeWorkflow } = require('@angular-devkit/schematics/tools');
|
||||||
|
const root = normalizePath(rootDirectory);
|
||||||
const host = new virtualFs.ScopedHost(new NodeJsSyncHost(), root);
|
const host = new virtualFs.ScopedHost(new NodeJsSyncHost(), root);
|
||||||
return new NodeWorkflow(host, {
|
return new NodeWorkflow(host, {
|
||||||
packageManager: detectPackageManager(),
|
packageManager: detectPackageManager(),
|
||||||
root,
|
|
||||||
dryRun,
|
dryRun,
|
||||||
registry: new schema.CoreSchemaRegistry(formats.standardFormats),
|
registry: new schema.CoreSchemaRegistry(formats.standardFormats),
|
||||||
resolvePaths: [process.cwd(), rootDirectory],
|
resolvePaths: [process.cwd(), rootDirectory],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function listGenerators(collectionName: string, logger: logging.Logger) {
|
function listGenerators(collectionFile: string) {
|
||||||
try {
|
try {
|
||||||
const engineHost = new NodeModulesEngineHost();
|
|
||||||
const engine = new SchematicEngine(engineHost);
|
|
||||||
const collection = engine.createCollection(collectionName);
|
|
||||||
const bodyLines: string[] = [];
|
const bodyLines: string[] = [];
|
||||||
|
|
||||||
|
const collection = JSON.parse(fs.readFileSync(collectionFile).toString());
|
||||||
|
|
||||||
bodyLines.push(chalk.bold(chalk.green('WORKSPACE GENERATORS')));
|
bodyLines.push(chalk.bold(chalk.green('WORKSPACE GENERATORS')));
|
||||||
bodyLines.push('');
|
bodyLines.push('');
|
||||||
bodyLines.push(
|
bodyLines.push(
|
||||||
...Object.entries(collection.description.schematics).map(
|
...Object.entries(collection.generators).map(
|
||||||
([schematicName, schematicMeta]) => {
|
([schematicName, schematicMeta]: [string, any]) => {
|
||||||
return `${chalk.bold(schematicName)} : ${schematicMeta.description}`;
|
return `${chalk.bold(schematicName)} : ${schematicMeta.description}`;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -205,8 +194,8 @@ function listGenerators(collectionName: string, logger: logging.Logger) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createPromptProvider(): schema.PromptProvider {
|
function createPromptProvider(): any {
|
||||||
return (definitions: Array<schema.PromptDefinition>) => {
|
return (definitions: Array<any>) => {
|
||||||
const questions: inquirer.Questions = definitions.map((definition) => {
|
const questions: inquirer.Questions = definitions.map((definition) => {
|
||||||
const question: inquirer.Question = {
|
const question: inquirer.Question = {
|
||||||
name: definition.id,
|
name: definition.id,
|
||||||
@ -252,10 +241,18 @@ function createPromptProvider(): schema.PromptProvider {
|
|||||||
async function executeAngularDevkitSchematic(
|
async function executeAngularDevkitSchematic(
|
||||||
schematicName: string,
|
schematicName: string,
|
||||||
options: { [p: string]: any },
|
options: { [p: string]: any },
|
||||||
workflow: NodeWorkflow,
|
workflow: any,
|
||||||
outDir: string,
|
outDir: string,
|
||||||
logger: logging.Logger
|
logger: any
|
||||||
) {
|
) {
|
||||||
|
const { schema } = require('@angular-devkit/core');
|
||||||
|
const {
|
||||||
|
validateOptionsWithSchema,
|
||||||
|
} = require('@angular-devkit/schematics/tools');
|
||||||
|
const {
|
||||||
|
UnsuccessfulWorkflowExecution,
|
||||||
|
} = require('@angular-devkit/schematics');
|
||||||
|
|
||||||
output.logSingleLine(
|
output.logSingleLine(
|
||||||
`${output.colors.gray(`Executing your local schematic`)}: ${schematicName}`
|
`${output.colors.gray(`Executing your local schematic`)}: ${schematicName}`
|
||||||
);
|
);
|
||||||
@ -281,27 +278,27 @@ async function executeAngularDevkitSchematic(
|
|||||||
break;
|
break;
|
||||||
case 'update':
|
case 'update':
|
||||||
loggingQueue.push(
|
loggingQueue.push(
|
||||||
tags.oneLine`${chalk.white('UPDATE')} ${eventPath} (${
|
`${chalk.white('UPDATE')} ${eventPath} (${
|
||||||
event.content.length
|
event.content.length
|
||||||
} bytes)`
|
} bytes)`
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'create':
|
case 'create':
|
||||||
loggingQueue.push(
|
loggingQueue.push(
|
||||||
tags.oneLine`${chalk.green('CREATE')} ${eventPath} (${
|
`${chalk.green('CREATE')} ${eventPath} (${
|
||||||
event.content.length
|
event.content.length
|
||||||
} bytes)`
|
} bytes)`
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
loggingQueue.push(tags.oneLine`${chalk.yellow('DELETE')} ${eventPath}`);
|
loggingQueue.push(`${chalk.yellow('DELETE')} ${eventPath}`);
|
||||||
break;
|
break;
|
||||||
case 'rename':
|
case 'rename':
|
||||||
const eventToPath = event.to.startsWith('/')
|
const eventToPath = event.to.startsWith('/')
|
||||||
? event.to.substr(1)
|
? event.to.substr(1)
|
||||||
: event.to;
|
: event.to;
|
||||||
loggingQueue.push(
|
loggingQueue.push(
|
||||||
tags.oneLine`${chalk.blue('RENAME')} ${eventPath} => ${eventToPath}`
|
`${chalk.blue('RENAME')} ${eventPath} => ${eventToPath}`
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -319,7 +316,7 @@ async function executeAngularDevkitSchematic(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const args = options._.slice(1);
|
const args = options._.slice(1);
|
||||||
workflow.registry.addSmartDefaultProvider('argv', (schema: JsonObject) => {
|
workflow.registry.addSmartDefaultProvider('argv', (schema: any) => {
|
||||||
if ('index' in schema) {
|
if ('index' in schema) {
|
||||||
return args[+schema.index];
|
return args[+schema.index];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { output, CLIErrorMessageConfig } from '../utils/output';
|
import { output, CLIErrorMessageConfig } from '../utilities/output';
|
||||||
import { ProjectGraph } from '../core/project-graph';
|
import { ProjectGraph } from '../core/project-graph';
|
||||||
import { workspaceFileName } from '../core/file-utils';
|
import { workspaceFileName } from '../core/file-utils';
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
|
||||||
import { WorkspaceResults } from './workspace-results';
|
import { WorkspaceResults } from './workspace-results';
|
||||||
import { serializeJson } from '../utils/fileutils';
|
import { serializeJson } from '../utilities/fileutils';
|
||||||
import { ProjectType } from '../core/project-graph';
|
import { ProjectType } from '../core/project-graph';
|
||||||
|
|
||||||
describe('WorkspacesResults', () => {
|
describe('WorkspacesResults', () => {
|
||||||
|
|||||||
@ -3,16 +3,16 @@ import {
|
|||||||
directoryExists,
|
directoryExists,
|
||||||
readJsonFile,
|
readJsonFile,
|
||||||
writeJsonFile,
|
writeJsonFile,
|
||||||
} from '../utils/fileutils';
|
} from '../utilities/fileutils';
|
||||||
import { existsSync, unlinkSync } from 'fs';
|
import { existsSync, unlinkSync } from 'fs';
|
||||||
import { ProjectGraphNode } from '../core/project-graph';
|
import { ProjectGraphNode } from '../core/project-graph';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { appRootPath } from '@nrwl/workspace/src/utils/app-root';
|
import { appRootPath } from '@nrwl/workspace/src/utilities/app-root';
|
||||||
import * as fsExtra from 'fs-extra';
|
import * as fsExtra from 'fs-extra';
|
||||||
import {
|
import {
|
||||||
cacheDirectory,
|
cacheDirectory,
|
||||||
readCacheDirectoryProperty,
|
readCacheDirectoryProperty,
|
||||||
} from '../utils/cache-directory';
|
} from '../utilities/cache-directory';
|
||||||
|
|
||||||
const resultsDir = cacheDirectory(
|
const resultsDir = cacheDirectory(
|
||||||
appRootPath,
|
appRootPath,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { extname } from 'path';
|
import { extname } from 'path';
|
||||||
import { jsonDiff } from '../../utils/json-diff';
|
import { jsonDiff } from '../../utilities/json-diff';
|
||||||
import { vol } from 'memfs';
|
import { vol } from 'memfs';
|
||||||
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
||||||
import { createProjectGraph } from '../project-graph';
|
import { createProjectGraph } from '../project-graph';
|
||||||
@ -8,7 +8,7 @@ import { FileData, WholeFileChange } from '../file-utils';
|
|||||||
import { NxJson } from '../shared-interfaces';
|
import { NxJson } from '../shared-interfaces';
|
||||||
|
|
||||||
jest.mock('fs', () => require('memfs').fs);
|
jest.mock('fs', () => require('memfs').fs);
|
||||||
jest.mock('../../utils/app-root', () => ({ appRootPath: '/root' }));
|
jest.mock('../../utilities/app-root', () => ({ appRootPath: '/root' }));
|
||||||
|
|
||||||
describe('project graph', () => {
|
describe('project graph', () => {
|
||||||
let packageJson: any;
|
let packageJson: any;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { getImplicitlyTouchedProjectsByJsonChanges } from './implicit-json-changes';
|
import { getImplicitlyTouchedProjectsByJsonChanges } from './implicit-json-changes';
|
||||||
import { NxJson } from '../../shared-interfaces';
|
import { NxJson } from '../../shared-interfaces';
|
||||||
import { WholeFileChange } from '../../file-utils';
|
import { WholeFileChange } from '../../file-utils';
|
||||||
import { DiffType } from '../../../utils/json-diff';
|
import { DiffType } from '../../../utilities/json-diff';
|
||||||
|
|
||||||
function getModifiedChange(path: string[]) {
|
function getModifiedChange(path: string[]) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
isJsonChange,
|
isJsonChange,
|
||||||
JsonChange,
|
JsonChange,
|
||||||
walkJsonTree,
|
walkJsonTree,
|
||||||
} from '../../../utils/json-diff';
|
} from '../../../utilities/json-diff';
|
||||||
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
||||||
import { ImplicitDependencyEntry } from '../../shared-interfaces';
|
import { ImplicitDependencyEntry } from '../../shared-interfaces';
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { getTouchedNpmPackages } from './npm-packages';
|
import { getTouchedNpmPackages } from './npm-packages';
|
||||||
import { NxJson } from '../../shared-interfaces';
|
import { NxJson } from '../../shared-interfaces';
|
||||||
import { WholeFileChange } from '../../file-utils';
|
import { WholeFileChange } from '../../file-utils';
|
||||||
import { DiffType } from '../../../utils/json-diff';
|
import { DiffType } from '../../../utilities/json-diff';
|
||||||
import { ProjectGraph } from '../../project-graph';
|
import { ProjectGraph } from '../../project-graph';
|
||||||
|
|
||||||
describe('getTouchedNpmPackages', () => {
|
describe('getTouchedNpmPackages', () => {
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
import { isWholeFileChange, WholeFileChange } from '../../file-utils';
|
import { isWholeFileChange, WholeFileChange } from '../../file-utils';
|
||||||
import { DiffType, isJsonChange, JsonChange } from '../../../utils/json-diff';
|
import {
|
||||||
|
DiffType,
|
||||||
|
isJsonChange,
|
||||||
|
JsonChange,
|
||||||
|
} from '../../../utilities/json-diff';
|
||||||
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
||||||
|
|
||||||
export const getTouchedNpmPackages: TouchedProjectLocator<
|
export const getTouchedNpmPackages: TouchedProjectLocator<
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { getTouchedProjectsInNxJson } from './nx-json-changes';
|
import { getTouchedProjectsInNxJson } from './nx-json-changes';
|
||||||
import { WholeFileChange } from '../../file-utils';
|
import { WholeFileChange } from '../../file-utils';
|
||||||
import { DiffType } from '../../../utils/json-diff';
|
import { DiffType } from '../../../utilities/json-diff';
|
||||||
|
|
||||||
describe('getTouchedProjectsInNxJson', () => {
|
describe('getTouchedProjectsInNxJson', () => {
|
||||||
it('should not return changes when nx.json is not touched', () => {
|
it('should not return changes when nx.json is not touched', () => {
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
import { isWholeFileChange, WholeFileChange } from '../../file-utils';
|
import { isWholeFileChange, WholeFileChange } from '../../file-utils';
|
||||||
import { DiffType, isJsonChange, JsonChange } from '../../../utils/json-diff';
|
import {
|
||||||
|
DiffType,
|
||||||
|
isJsonChange,
|
||||||
|
JsonChange,
|
||||||
|
} from '../../../utilities/json-diff';
|
||||||
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
||||||
|
|
||||||
export const getTouchedProjectsInNxJson: TouchedProjectLocator<
|
export const getTouchedProjectsInNxJson: TouchedProjectLocator<
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { WholeFileChange } from '../../file-utils';
|
import { WholeFileChange } from '../../file-utils';
|
||||||
import { jsonDiff } from '../../../utils/json-diff';
|
import { jsonDiff } from '../../../utilities/json-diff';
|
||||||
import { getTouchedProjectsFromTsConfig } from './tsconfig-json-changes';
|
import { getTouchedProjectsFromTsConfig } from './tsconfig-json-changes';
|
||||||
import { DependencyType, ProjectGraph } from '../../project-graph';
|
import { DependencyType, ProjectGraph } from '../../project-graph';
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|
||||||
import { WholeFileChange } from '../../file-utils';
|
import { WholeFileChange } from '../../file-utils';
|
||||||
import { DiffType, isJsonChange, JsonChange } from '../../../utils/json-diff';
|
import {
|
||||||
|
DiffType,
|
||||||
|
isJsonChange,
|
||||||
|
JsonChange,
|
||||||
|
} from '../../../utilities/json-diff';
|
||||||
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
||||||
import {
|
import {
|
||||||
getSortedProjectNodes,
|
getSortedProjectNodes,
|
||||||
onlyWorkspaceProjects,
|
onlyWorkspaceProjects,
|
||||||
ProjectGraphNode,
|
ProjectGraphNode,
|
||||||
} from '../../project-graph';
|
} from '../../project-graph';
|
||||||
import { appRootPath } from '../../../utils/app-root';
|
import { appRootPath } from '../../../utilities/app-root';
|
||||||
|
|
||||||
export const getTouchedProjectsFromTsConfig: TouchedProjectLocator<
|
export const getTouchedProjectsFromTsConfig: TouchedProjectLocator<
|
||||||
WholeFileChange | JsonChange
|
WholeFileChange | JsonChange
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { getTouchedProjectsInWorkspaceJson } from './workspace-json-changes';
|
import { getTouchedProjectsInWorkspaceJson } from './workspace-json-changes';
|
||||||
import { WholeFileChange } from '../../file-utils';
|
import { WholeFileChange } from '../../file-utils';
|
||||||
import { DiffType } from '../../../utils/json-diff';
|
import { DiffType } from '../../../utilities/json-diff';
|
||||||
|
|
||||||
describe('getTouchedProjectsInWorkspaceJson', () => {
|
describe('getTouchedProjectsInWorkspaceJson', () => {
|
||||||
it('should not return changes when workspace.json is not touched', () => {
|
it('should not return changes when workspace.json is not touched', () => {
|
||||||
|
|||||||
@ -3,7 +3,11 @@ import {
|
|||||||
WholeFileChange,
|
WholeFileChange,
|
||||||
workspaceFileName,
|
workspaceFileName,
|
||||||
} from '../../file-utils';
|
} from '../../file-utils';
|
||||||
import { DiffType, isJsonChange, JsonChange } from '../../../utils/json-diff';
|
import {
|
||||||
|
DiffType,
|
||||||
|
isJsonChange,
|
||||||
|
JsonChange,
|
||||||
|
} from '../../../utilities/json-diff';
|
||||||
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
import { TouchedProjectLocator } from '../affected-project-graph-models';
|
||||||
|
|
||||||
export const getTouchedProjectsInWorkspaceJson: TouchedProjectLocator<
|
export const getTouchedProjectsInWorkspaceJson: TouchedProjectLocator<
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { assertWorkspaceValidity } from './assert-workspace-validity';
|
import { assertWorkspaceValidity } from './assert-workspace-validity';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
|
|
||||||
describe('assertWorkspaceValidity', () => {
|
describe('assertWorkspaceValidity', () => {
|
||||||
let mockNxJson: any;
|
let mockNxJson: any;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import {
|
|||||||
ImplicitJsonSubsetDependency,
|
ImplicitJsonSubsetDependency,
|
||||||
NxJson,
|
NxJson,
|
||||||
} from '@nrwl/workspace/src/core/shared-interfaces';
|
} from '@nrwl/workspace/src/core/shared-interfaces';
|
||||||
import { output } from '../utils/output';
|
import { output } from '../utilities/output';
|
||||||
|
|
||||||
export function assertWorkspaceValidity(workspaceJson, nxJson: NxJson) {
|
export function assertWorkspaceValidity(workspaceJson, nxJson: NxJson) {
|
||||||
const workspaceJsonProjects = Object.keys(workspaceJson.projects);
|
const workspaceJsonProjects = Object.keys(workspaceJson.projects);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { calculateFileChanges, WholeFileChange } from './file-utils';
|
import { calculateFileChanges, WholeFileChange } from './file-utils';
|
||||||
import { DiffType, JsonChange, jsonDiff } from '../utils/json-diff';
|
import { DiffType, JsonChange, jsonDiff } from '../utilities/json-diff';
|
||||||
|
|
||||||
const ignore = require('ignore');
|
const ignore = require('ignore');
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,9 @@ import * as path from 'path';
|
|||||||
import { extname, join } from 'path';
|
import { extname, join } from 'path';
|
||||||
import { NxArgs } from '../command-line/utils';
|
import { NxArgs } from '../command-line/utils';
|
||||||
import { WorkspaceResults } from '../command-line/workspace-results';
|
import { WorkspaceResults } from '../command-line/workspace-results';
|
||||||
import { appRootPath } from '../utils/app-root';
|
import { appRootPath } from '../utilities/app-root';
|
||||||
import { fileExists, readJsonFile } from '../utils/fileutils';
|
import { fileExists, readJsonFile } from '../utilities/fileutils';
|
||||||
import { jsonDiff } from '../utils/json-diff';
|
import { jsonDiff } from '../utilities/json-diff';
|
||||||
import { ProjectGraphNode } from './project-graph';
|
import { ProjectGraphNode } from './project-graph';
|
||||||
import { Environment, NxJson } from './shared-interfaces';
|
import { Environment, NxJson } from './shared-interfaces';
|
||||||
import { defaultFileHasher } from './hasher/file-hasher';
|
import { defaultFileHasher } from './hasher/file-hasher';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { getFileHashes } from './git-hasher';
|
import { getFileHashes } from './git-hasher';
|
||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { defaultHashing, HashingImp } from './hashing-impl';
|
import { defaultHashing, HashingImp } from './hashing-impl';
|
||||||
import { appRootPath } from '../../utils/app-root';
|
import { appRootPath } from '../../utilities/app-root';
|
||||||
import { performance } from 'perf_hooks';
|
import { performance } from 'perf_hooks';
|
||||||
|
|
||||||
type PathAndTransformer = {
|
type PathAndTransformer = {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
ProjectGraphNode,
|
ProjectGraphNode,
|
||||||
} from '../project-graph';
|
} from '../project-graph';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { appRootPath } from '../../utils/app-root';
|
import { appRootPath } from '../../utilities/app-root';
|
||||||
import { existsSync } from 'fs';
|
import { existsSync } from 'fs';
|
||||||
import * as fsExtra from 'fs-extra';
|
import * as fsExtra from 'fs-extra';
|
||||||
import {
|
import {
|
||||||
@ -13,13 +13,13 @@ import {
|
|||||||
fileExists,
|
fileExists,
|
||||||
readJsonFile,
|
readJsonFile,
|
||||||
writeJsonFile,
|
writeJsonFile,
|
||||||
} from '../../utils/fileutils';
|
} from '../../utilities/fileutils';
|
||||||
import { FileMap } from '@nrwl/workspace/src/core/file-graph';
|
import { FileMap } from '@nrwl/workspace/src/core/file-graph';
|
||||||
import { performance } from 'perf_hooks';
|
import { performance } from 'perf_hooks';
|
||||||
import {
|
import {
|
||||||
cacheDirectory,
|
cacheDirectory,
|
||||||
readCacheDirectoryProperty,
|
readCacheDirectoryProperty,
|
||||||
} from '../../utils/cache-directory';
|
} from '../../utilities/cache-directory';
|
||||||
|
|
||||||
export interface ProjectGraphCache {
|
export interface ProjectGraphCache {
|
||||||
version: string;
|
version: string;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
jest.mock('../../../utils/app-root', () => ({
|
jest.mock('../../../utilities/app-root', () => ({
|
||||||
appRootPath: '/root',
|
appRootPath: '/root',
|
||||||
}));
|
}));
|
||||||
jest.mock('fs', () => require('memfs').fs);
|
jest.mock('fs', () => require('memfs').fs);
|
||||||
@ -13,7 +13,7 @@ import {
|
|||||||
import { buildExplicitTypeScriptDependencies } from './explicit-project-dependencies';
|
import { buildExplicitTypeScriptDependencies } from './explicit-project-dependencies';
|
||||||
import { createFileMap } from '../../file-graph';
|
import { createFileMap } from '../../file-graph';
|
||||||
import { readWorkspaceFiles } from '../../file-utils';
|
import { readWorkspaceFiles } from '../../file-utils';
|
||||||
import { appRootPath } from '../../../utils/app-root';
|
import { appRootPath } from '../../../utilities/app-root';
|
||||||
import { string } from 'prop-types';
|
import { string } from 'prop-types';
|
||||||
|
|
||||||
describe('explicit project dependencies', () => {
|
describe('explicit project dependencies', () => {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { DependencyType } from '../project-graph-models';
|
import { DependencyType } from '../project-graph-models';
|
||||||
import { stripSourceCode } from '../../../utils/strip-source-code';
|
import { stripSourceCode } from '../../../utilities/strip-source-code';
|
||||||
import { FileRead } from '../../file-utils';
|
import { FileRead } from '../../file-utils';
|
||||||
|
|
||||||
export class TypeScriptImportLocator {
|
export class TypeScriptImportLocator {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { vol, fs } from 'memfs';
|
import { vol, fs } from 'memfs';
|
||||||
jest.mock('fs', () => require('memfs').fs);
|
jest.mock('fs', () => require('memfs').fs);
|
||||||
jest.mock('../../utils/app-root', () => ({ appRootPath: '/root' }));
|
jest.mock('../../utilities/app-root', () => ({ appRootPath: '/root' }));
|
||||||
|
|
||||||
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
import { stripIndents } from '@angular-devkit/core/src/utils/literals';
|
||||||
import { createProjectGraph } from './project-graph';
|
import { createProjectGraph } from './project-graph';
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
} from './project-graph/project-graph-models';
|
} from './project-graph/project-graph-models';
|
||||||
import { TargetProjectLocator } from './target-project-locator';
|
import { TargetProjectLocator } from './target-project-locator';
|
||||||
|
|
||||||
jest.mock('../utils/app-root', () => ({
|
jest.mock('../utilities/app-root', () => ({
|
||||||
appRootPath: '/root',
|
appRootPath: '/root',
|
||||||
}));
|
}));
|
||||||
jest.mock('fs', () => require('memfs').fs);
|
jest.mock('fs', () => require('memfs').fs);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { resolveModuleByImport } from '../utils/typescript';
|
import { resolveModuleByImport } from '../utilities/typescript';
|
||||||
import { defaultFileRead, FileRead, normalizedProjectRoot } from './file-utils';
|
import { defaultFileRead, FileRead, normalizedProjectRoot } from './file-utils';
|
||||||
import {
|
import {
|
||||||
ProjectGraphNode,
|
ProjectGraphNode,
|
||||||
@ -9,9 +9,9 @@ import {
|
|||||||
isNpmProject,
|
isNpmProject,
|
||||||
isWorkspaceProject,
|
isWorkspaceProject,
|
||||||
} from './project-graph';
|
} from './project-graph';
|
||||||
import { isRelativePath, parseJsonWithComments } from '../utils/fileutils';
|
import { isRelativePath, parseJsonWithComments } from '../utilities/fileutils';
|
||||||
import { dirname, join } from 'path';
|
import { dirname, join } from 'path';
|
||||||
import { appRootPath } from '@nrwl/workspace/src/utils/app-root';
|
import { appRootPath } from '@nrwl/workspace/src/utilities/app-root';
|
||||||
|
|
||||||
export class TargetProjectLocator {
|
export class TargetProjectLocator {
|
||||||
private sortedProjects = getSortedProjectNodes(this.nodes);
|
private sortedProjects = getSortedProjectNodes(this.nodes);
|
||||||
|
|||||||
@ -293,6 +293,7 @@ describe('workspace', () => {
|
|||||||
|
|
||||||
expect(tree.exists('/apps/myApp/tsconfig.app.json')).toBe(true);
|
expect(tree.exists('/apps/myApp/tsconfig.app.json')).toBe(true);
|
||||||
expect(tree.exists('/apps/myApp/karma.conf.js')).toBe(true);
|
expect(tree.exists('/apps/myApp/karma.conf.js')).toBe(true);
|
||||||
|
|
||||||
expect(tree.exists('/karma.conf.js')).toBe(true);
|
expect(tree.exists('/karma.conf.js')).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -17,9 +17,10 @@ import {
|
|||||||
updateWorkspaceConfiguration,
|
updateWorkspaceConfiguration,
|
||||||
visitNotIgnoredFiles,
|
visitNotIgnoredFiles,
|
||||||
writeJson,
|
writeJson,
|
||||||
|
normalizePath,
|
||||||
|
joinPathFragments,
|
||||||
} from '@nrwl/devkit';
|
} from '@nrwl/devkit';
|
||||||
import { basename, join } from 'path';
|
import { basename } from 'path';
|
||||||
import { JsonArray, normalize } from '@angular-devkit/core';
|
|
||||||
import { Schema } from './schema';
|
import { Schema } from './schema';
|
||||||
import {
|
import {
|
||||||
angularCliVersion,
|
angularCliVersion,
|
||||||
@ -28,8 +29,8 @@ import {
|
|||||||
} from '../../utils/versions';
|
} from '../../utils/versions';
|
||||||
import { DEFAULT_NRWL_PRETTIER_CONFIG } from '../workspace/workspace';
|
import { DEFAULT_NRWL_PRETTIER_CONFIG } from '../workspace/workspace';
|
||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { serializeJson } from '../../utils/fileutils';
|
import { serializeJson } from '../../utilities/fileutils';
|
||||||
import { resolveUserExistingPrettierConfig } from '../../utils/common';
|
import { resolveUserExistingPrettierConfig } from '../../utilities/prettier';
|
||||||
|
|
||||||
function updatePackageJson(tree) {
|
function updatePackageJson(tree) {
|
||||||
updateJson(tree, 'package.json', (packageJson) => {
|
updateJson(tree, 'package.json', (packageJson) => {
|
||||||
@ -90,19 +91,20 @@ function updateAngularCLIJson(host: Tree, options: Schema) {
|
|||||||
const workspaceConfig = readWorkspaceConfiguration(host);
|
const workspaceConfig = readWorkspaceConfiguration(host);
|
||||||
const appName = workspaceConfig.defaultProject;
|
const appName = workspaceConfig.defaultProject;
|
||||||
const e2eName = appName + '-e2e';
|
const e2eName = appName + '-e2e';
|
||||||
const e2eRoot = join('apps', e2eName);
|
const e2eRoot = joinPathFragments('apps', e2eName);
|
||||||
delete (workspaceConfig as any).newProjectRoot;
|
delete (workspaceConfig as any).newProjectRoot;
|
||||||
|
|
||||||
const defaultProject = readProjectConfiguration(host, appName);
|
const defaultProject = readProjectConfiguration(host, appName);
|
||||||
|
|
||||||
const oldSourceRoot = defaultProject.sourceRoot;
|
const oldSourceRoot = defaultProject.sourceRoot;
|
||||||
const newRoot = join('apps', appName);
|
const newRoot = joinPathFragments('apps', appName);
|
||||||
defaultProject.root = newRoot;
|
defaultProject.root = newRoot;
|
||||||
defaultProject.sourceRoot = join(newRoot, 'src');
|
defaultProject.sourceRoot = joinPathFragments(newRoot, 'src');
|
||||||
|
|
||||||
function convertBuildOptions(buildOptions) {
|
function convertBuildOptions(buildOptions) {
|
||||||
buildOptions.outputPath =
|
buildOptions.outputPath =
|
||||||
buildOptions.outputPath && join(normalize('dist'), 'apps', appName);
|
buildOptions.outputPath &&
|
||||||
|
joinPathFragments(normalizePath('dist'), 'apps', appName);
|
||||||
buildOptions.index =
|
buildOptions.index =
|
||||||
buildOptions.index && convertAsset(buildOptions.index as string);
|
buildOptions.index && convertAsset(buildOptions.index as string);
|
||||||
buildOptions.main =
|
buildOptions.main =
|
||||||
@ -110,16 +112,13 @@ function updateAngularCLIJson(host: Tree, options: Schema) {
|
|||||||
buildOptions.polyfills =
|
buildOptions.polyfills =
|
||||||
buildOptions.polyfills && convertAsset(buildOptions.polyfills as string);
|
buildOptions.polyfills && convertAsset(buildOptions.polyfills as string);
|
||||||
buildOptions.tsConfig =
|
buildOptions.tsConfig =
|
||||||
buildOptions.tsConfig && join(newRoot, 'tsconfig.app.json');
|
buildOptions.tsConfig && joinPathFragments(newRoot, 'tsconfig.app.json');
|
||||||
buildOptions.assets =
|
buildOptions.assets =
|
||||||
buildOptions.assets &&
|
buildOptions.assets && (buildOptions.assets as any).map(convertAsset);
|
||||||
(buildOptions.assets as JsonArray).map(convertAsset);
|
|
||||||
buildOptions.styles =
|
buildOptions.styles =
|
||||||
buildOptions.styles &&
|
buildOptions.styles && (buildOptions.styles as any).map(convertAsset);
|
||||||
(buildOptions.styles as JsonArray).map(convertAsset);
|
|
||||||
buildOptions.scripts =
|
buildOptions.scripts =
|
||||||
buildOptions.scripts &&
|
buildOptions.scripts && (buildOptions.scripts as any).map(convertAsset);
|
||||||
(buildOptions.scripts as JsonArray).map(convertAsset);
|
|
||||||
buildOptions.fileReplacements =
|
buildOptions.fileReplacements =
|
||||||
buildOptions.fileReplacements &&
|
buildOptions.fileReplacements &&
|
||||||
buildOptions.fileReplacements.map((replacement) => ({
|
buildOptions.fileReplacements.map((replacement) => ({
|
||||||
@ -137,34 +136,37 @@ function updateAngularCLIJson(host: Tree, options: Schema) {
|
|||||||
testOptions.main = testOptions.main && convertAsset(testOptions.main);
|
testOptions.main = testOptions.main && convertAsset(testOptions.main);
|
||||||
testOptions.polyfills =
|
testOptions.polyfills =
|
||||||
testOptions.polyfills && convertAsset(testOptions.polyfills);
|
testOptions.polyfills && convertAsset(testOptions.polyfills);
|
||||||
testOptions.tsConfig = join(newRoot, 'tsconfig.spec.json');
|
testOptions.tsConfig = joinPathFragments(newRoot, 'tsconfig.spec.json');
|
||||||
testOptions.karmaConfig = join(newRoot, 'karma.conf.js');
|
testOptions.karmaConfig = joinPathFragments(newRoot, 'karma.conf.js');
|
||||||
testOptions.assets =
|
testOptions.assets =
|
||||||
testOptions.assets && (testOptions.assets as JsonArray).map(convertAsset);
|
testOptions.assets && (testOptions.assets as any).map(convertAsset);
|
||||||
testOptions.styles =
|
testOptions.styles =
|
||||||
testOptions.styles && (testOptions.styles as JsonArray).map(convertAsset);
|
testOptions.styles && (testOptions.styles as any).map(convertAsset);
|
||||||
testOptions.scripts =
|
testOptions.scripts =
|
||||||
testOptions.scripts &&
|
testOptions.scripts && (testOptions.scripts as any).map(convertAsset);
|
||||||
(testOptions.scripts as JsonArray).map(convertAsset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const lintTarget = defaultProject.targets.lint;
|
const lintTarget = defaultProject.targets.lint;
|
||||||
|
|
||||||
if (lintTarget) {
|
if (lintTarget) {
|
||||||
lintTarget.options.tsConfig = [
|
lintTarget.options.tsConfig = [
|
||||||
join(newRoot, 'tsconfig.app.json'),
|
joinPathFragments(newRoot, 'tsconfig.app.json'),
|
||||||
join(newRoot, 'tsconfig.spec.json'),
|
joinPathFragments(newRoot, 'tsconfig.spec.json'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertServerOptions(serverOptions) {
|
function convertServerOptions(serverOptions) {
|
||||||
serverOptions.outputPath =
|
serverOptions.outputPath =
|
||||||
serverOptions.outputPath &&
|
serverOptions.outputPath &&
|
||||||
join(normalize('dist'), 'apps', options.name + '-server');
|
joinPathFragments(
|
||||||
|
normalizePath('dist'),
|
||||||
|
'apps',
|
||||||
|
options.name + '-server'
|
||||||
|
);
|
||||||
serverOptions.main = serverOptions.main && convertAsset(serverOptions.main);
|
serverOptions.main = serverOptions.main && convertAsset(serverOptions.main);
|
||||||
serverOptions.tsConfig =
|
serverOptions.tsConfig =
|
||||||
serverOptions.tsConfig &&
|
serverOptions.tsConfig &&
|
||||||
join(normalize('apps'), appName, 'tsconfig.server.json');
|
joinPathFragments(normalizePath('apps'), appName, 'tsconfig.server.json');
|
||||||
serverOptions.fileReplacements =
|
serverOptions.fileReplacements =
|
||||||
serverOptions.fileReplacements &&
|
serverOptions.fileReplacements &&
|
||||||
serverOptions.fileReplacements.map((replacement) => ({
|
serverOptions.fileReplacements.map((replacement) => ({
|
||||||
@ -191,14 +193,14 @@ function updateAngularCLIJson(host: Tree, options: Schema) {
|
|||||||
...defaultProject.targets.e2e,
|
...defaultProject.targets.e2e,
|
||||||
options: {
|
options: {
|
||||||
...defaultProject.targets.e2e.options,
|
...defaultProject.targets.e2e.options,
|
||||||
protractorConfig: join(e2eRoot, 'protractor.conf.js'),
|
protractorConfig: joinPathFragments(e2eRoot, 'protractor.conf.js'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lint: {
|
lint: {
|
||||||
executor: '@angular-devkit/build-angular:tslint',
|
executor: '@angular-devkit/build-angular:tslint',
|
||||||
options: {
|
options: {
|
||||||
...lintTargetOptions,
|
...lintTargetOptions,
|
||||||
tsConfig: join(e2eRoot, 'tsconfig.json'),
|
tsConfig: joinPathFragments(e2eRoot, 'tsconfig.json'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -349,7 +351,9 @@ function moveOutOfSrc(
|
|||||||
}
|
}
|
||||||
const filename = !!filePath ? basename(filePath) : '';
|
const filename = !!filePath ? basename(filePath) : '';
|
||||||
const from = filePath;
|
const from = filePath;
|
||||||
const to = filename ? join('apps', appName, filename) : join('apps', appName);
|
const to = filename
|
||||||
|
? joinPathFragments('apps', appName, filename)
|
||||||
|
: joinPathFragments('apps', appName);
|
||||||
renameSyncInTree(tree, from, to, required);
|
renameSyncInTree(tree, from, to, required);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,11 +399,14 @@ function moveExistingFiles(host: Tree, options: Schema) {
|
|||||||
moveOutOfSrc(host, options.name, app.architect.server.options.tsConfig);
|
moveOutOfSrc(host, options.name, app.architect.server.options.tsConfig);
|
||||||
}
|
}
|
||||||
const oldAppSourceRoot = app.sourceRoot;
|
const oldAppSourceRoot = app.sourceRoot;
|
||||||
const newAppSourceRoot = join('apps', options.name, 'src');
|
const newAppSourceRoot = joinPathFragments('apps', options.name, 'src');
|
||||||
renameDirSyncInTree(host, oldAppSourceRoot, newAppSourceRoot);
|
renameDirSyncInTree(host, oldAppSourceRoot, newAppSourceRoot);
|
||||||
if (e2eApp) {
|
if (e2eApp) {
|
||||||
const oldE2eRoot = join(app.root || '', 'e2e');
|
const oldE2eRoot = joinPathFragments(app.root || '', 'e2e');
|
||||||
const newE2eRoot = join('apps', getE2eKey(workspaceJson) + '-e2e');
|
const newE2eRoot = joinPathFragments(
|
||||||
|
'apps',
|
||||||
|
getE2eKey(workspaceJson) + '-e2e'
|
||||||
|
);
|
||||||
renameDirSyncInTree(host, oldE2eRoot, newE2eRoot);
|
renameDirSyncInTree(host, oldE2eRoot, newE2eRoot);
|
||||||
} else {
|
} else {
|
||||||
console.warn(
|
console.warn(
|
||||||
@ -562,7 +569,12 @@ function createNxJson(host: Tree) {
|
|||||||
|
|
||||||
function decorateAngularClI(host: Tree) {
|
function decorateAngularClI(host: Tree) {
|
||||||
const decorateCli = readFileSync(
|
const decorateCli = readFileSync(
|
||||||
join(__dirname as any, '..', 'utils', 'decorate-angular-cli.js__tmpl__')
|
joinPathFragments(
|
||||||
|
__dirname as any,
|
||||||
|
'..',
|
||||||
|
'utils',
|
||||||
|
'decorate-angular-cli.js__tmpl__'
|
||||||
|
)
|
||||||
).toString();
|
).toString();
|
||||||
host.write('decorate-angular-cli.js', decorateCli);
|
host.write('decorate-angular-cli.js', decorateCli);
|
||||||
updateJson(host, 'package.json', (json) => {
|
updateJson(host, 'package.json', (json) => {
|
||||||
@ -586,12 +598,12 @@ function decorateAngularClI(host: Tree) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addFiles(host: Tree) {
|
function addFiles(host: Tree) {
|
||||||
generateFiles(host, join(__dirname, './files/root'), '.', {
|
generateFiles(host, joinPathFragments(__dirname, './files/root'), '.', {
|
||||||
tmpl: '',
|
tmpl: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!host.exists('.prettierignore')) {
|
if (!host.exists('.prettierignore')) {
|
||||||
generateFiles(host, join(__dirname, './files/prettier'), '.', {
|
generateFiles(host, joinPathFragments(__dirname, './files/prettier'), '.', {
|
||||||
tmpl: '',
|
tmpl: '',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -8,7 +8,7 @@ import {
|
|||||||
import { NxJson } from '@nrwl/workspace';
|
import { NxJson } from '@nrwl/workspace';
|
||||||
import { Schema } from '../schema';
|
import { Schema } from '../schema';
|
||||||
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
||||||
import { moveProjectConfiguration } from '@nrwl/workspace/src/schematics/move/lib/move-project-configuration';
|
import { moveProjectConfiguration } from '@nrwl/workspace/src/generators/move/lib/move-project-configuration';
|
||||||
|
|
||||||
describe('moveProjectConfiguration', () => {
|
describe('moveProjectConfiguration', () => {
|
||||||
let tree: Tree;
|
let tree: Tree;
|
||||||
@ -6,7 +6,7 @@ import {
|
|||||||
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
||||||
import { Schema } from '../schema';
|
import { Schema } from '../schema';
|
||||||
import { libraryGenerator } from '../../library/library';
|
import { libraryGenerator } from '../../library/library';
|
||||||
import { moveProject } from '@nrwl/workspace/src/schematics/move/lib/move-project';
|
import { moveProject } from '@nrwl/workspace/src/generators/move/lib/move-project';
|
||||||
|
|
||||||
describe('moveProject', () => {
|
describe('moveProject', () => {
|
||||||
let tree: Tree;
|
let tree: Tree;
|
||||||
@ -1,8 +1,4 @@
|
|||||||
import { SchematicContext } from '@angular-devkit/schematics';
|
|
||||||
import { ProjectConfiguration, Tree, visitNotIgnoredFiles } from '@nrwl/devkit';
|
import { ProjectConfiguration, Tree, visitNotIgnoredFiles } from '@nrwl/devkit';
|
||||||
import { getWorkspace } from '@nrwl/workspace';
|
|
||||||
import { from, Observable } from 'rxjs';
|
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
import { Schema } from '../schema';
|
import { Schema } from '../schema';
|
||||||
import { getDestination } from './utils';
|
import { getDestination } from './utils';
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { Schema } from '@nrwl/workspace/src/schematics/move/schema';
|
import { Schema } from '@nrwl/workspace/src/generators/move/schema';
|
||||||
import {
|
import {
|
||||||
addProjectConfiguration,
|
addProjectConfiguration,
|
||||||
readWorkspaceConfiguration,
|
readWorkspaceConfiguration,
|
||||||
@ -6,7 +6,7 @@ import {
|
|||||||
updateWorkspaceConfiguration,
|
updateWorkspaceConfiguration,
|
||||||
} from '@nrwl/devkit';
|
} from '@nrwl/devkit';
|
||||||
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
||||||
import { updateDefaultProject } from '@nrwl/workspace/src/schematics/move/lib/update-default-project';
|
import { updateDefaultProject } from '@nrwl/workspace/src/generators/move/lib/update-default-project';
|
||||||
|
|
||||||
describe('updateDefaultProject', () => {
|
describe('updateDefaultProject', () => {
|
||||||
let tree: Tree;
|
let tree: Tree;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user