feat(repo): build nx with nx
This commit is contained in:
parent
2a3116f2e6
commit
d0cbc35efa
@ -79,7 +79,7 @@ jobs:
|
||||
- setup
|
||||
- run:
|
||||
name: Run Unit Tests
|
||||
command: yarn test:all
|
||||
command: yarn test
|
||||
- run:
|
||||
name: Check Documentation
|
||||
command: yarn documentation
|
||||
|
||||
41
.eslintrc
Normal file
41
.eslintrc
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"ignorePatterns": ["**/*"],
|
||||
"plugins": ["@typescript-eslint", "@nrwl/nx"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier",
|
||||
"prettier/@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/explicit-member-accessibility": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/no-parameter-properties": "off",
|
||||
"@nrwl/nx/enforce-module-boundaries": [
|
||||
"error",
|
||||
{
|
||||
"enforceBuildableLibDependency": true,
|
||||
"allow": [],
|
||||
"depConstraints": [
|
||||
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.tsx"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -15,7 +15,7 @@ import {
|
||||
|
||||
forEachCli('nx', () => {
|
||||
describe('Help', () => {
|
||||
it('should show help', async () => {
|
||||
fit('should show help', async () => {
|
||||
ensureProject();
|
||||
const myapp = uniq('myapp');
|
||||
runCLI(`generate @nrwl/web:app ${myapp}`);
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
const pkg = require('../../package.json');
|
||||
|
||||
module.exports = {
|
||||
...pkg.jest,
|
||||
globalSetup: '<rootDir>/local-registry/setup.js',
|
||||
globalTeardown: '<rootDir>/local-registry/teardown.js',
|
||||
};
|
||||
|
||||
@ -4,7 +4,7 @@ import {
|
||||
readJson,
|
||||
runCLI,
|
||||
runCommand,
|
||||
runNew,
|
||||
runNgNew,
|
||||
updateFile,
|
||||
forEachCli,
|
||||
runNgAdd,
|
||||
@ -16,7 +16,7 @@ forEachCli('angular', () => {
|
||||
afterAll(cleanup);
|
||||
|
||||
it('should generate a workspace', () => {
|
||||
runNew('', false, false);
|
||||
runNgNew();
|
||||
|
||||
// update package.json
|
||||
const packageJson = readJson('package.json');
|
||||
@ -246,7 +246,7 @@ forEachCli('angular', () => {
|
||||
|
||||
it('should generate a workspace and not change dependencies, devDependencies, or vscode extensions if they already exist', () => {
|
||||
// create a new AngularCLI app
|
||||
runNew();
|
||||
runNgNew();
|
||||
const nxVersion = '0.0.0';
|
||||
const schematicsVersion = '0.0.0';
|
||||
const ngrxVersion = '0.0.0';
|
||||
@ -295,7 +295,7 @@ forEachCli('angular', () => {
|
||||
|
||||
it('should handle different types of errors', () => {
|
||||
// create a new AngularCLI app
|
||||
runNew();
|
||||
runNgNew();
|
||||
|
||||
// Only remove e2e directory
|
||||
runCommand('mv e2e e2e-bak');
|
||||
@ -339,7 +339,7 @@ forEachCli('angular', () => {
|
||||
});
|
||||
|
||||
it('should support preserveAngularCLILayout', () => {
|
||||
runNew('', false, false);
|
||||
runNgNew();
|
||||
runNgAdd('add @nrwl/workspace --preserveAngularCLILayout');
|
||||
|
||||
const updatedAngularCLIJson = readJson('angular.json');
|
||||
|
||||
@ -14,7 +14,7 @@ import {
|
||||
readJson,
|
||||
runCLI,
|
||||
runCLIAsync,
|
||||
runNew,
|
||||
runNgNew,
|
||||
runNgAdd,
|
||||
tmpProjPath,
|
||||
uniq,
|
||||
@ -160,7 +160,7 @@ forEachCli((currentCLIName) => {
|
||||
// described in the docs) the tsconfig file could miss required options if Angular removes
|
||||
// them from their config files as happened with emitDecoratorMetadata.
|
||||
cleanup();
|
||||
runNew('', false, false);
|
||||
runNgNew();
|
||||
runNgAdd('add @nrwl/workspace --npmScope projscope');
|
||||
yarnAdd('@nrwl/nest');
|
||||
} else {
|
||||
|
||||
9
e2e/tsconfig.e2e.json
Normal file
9
e2e/tsconfig.e2e.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../build/e2e-out",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
61
e2e/utils.ts
61
e2e/utils.ts
@ -108,54 +108,11 @@ export const getDirectories = (source) =>
|
||||
.filter((dirent) => dirent.isDirectory())
|
||||
.map((dirent) => dirent.name);
|
||||
|
||||
export function runNgcc(silent: boolean = true, async: boolean = true) {
|
||||
const install = execSync(
|
||||
'node ./node_modules/@angular/compiler-cli/ngcc/main-ngcc.js' +
|
||||
(!async ? ' --async=false' : ''),
|
||||
{
|
||||
cwd: tmpProjPath(),
|
||||
...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}),
|
||||
env: process.env,
|
||||
}
|
||||
);
|
||||
return install ? install.toString() : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the `new` command for the currently selected CLI
|
||||
*
|
||||
* @param args Extra arguments to pass to the `new` command
|
||||
* @param silent Run in silent mode (no output)
|
||||
* @param addWorkspace Include `@nrwl/workspace` when patching the `package.json` paths
|
||||
*/
|
||||
export function runNew(
|
||||
args?: string,
|
||||
silent?: boolean,
|
||||
addWorkspace = true
|
||||
): string {
|
||||
let gen;
|
||||
if (cli === 'angular') {
|
||||
gen = execSync(
|
||||
`../../node_modules/.bin/ng new proj --no-interactive ${args || ''}`,
|
||||
{
|
||||
export function runNgNew(): string {
|
||||
return execSync(`../../node_modules/.bin/ng new proj --no-interactive`, {
|
||||
cwd: `./tmp/${cli}`,
|
||||
...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}),
|
||||
env: process.env,
|
||||
}
|
||||
);
|
||||
} else {
|
||||
gen = execSync(
|
||||
`node ../../node_modules/@nrwl/tao/index.js new proj --no-interactive ${
|
||||
args || ''
|
||||
}`,
|
||||
{
|
||||
cwd: `./tmp/${cli}`,
|
||||
...(silent && false ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}),
|
||||
env: process.env,
|
||||
}
|
||||
);
|
||||
}
|
||||
return silent ? null : `${gen ? gen.toString() : ''}`;
|
||||
}).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -165,7 +122,7 @@ export function runNew(
|
||||
export function newProject(): void {
|
||||
cleanup();
|
||||
if (!directoryExists(tmpBackupProjPath())) {
|
||||
runNew('--collection=@nrwl/workspace --npmScope=proj', true);
|
||||
runCreateWorkspace('proj', { preset: 'empty' });
|
||||
const packages = [
|
||||
`@nrwl/angular`,
|
||||
`@nrwl/express`,
|
||||
@ -174,14 +131,14 @@ export function newProject(): void {
|
||||
`@nrwl/react`,
|
||||
`@nrwl/storybook`,
|
||||
`@nrwl/nx-plugin`,
|
||||
`@nrwl/eslint-plugin-nx`,
|
||||
];
|
||||
yarnAdd([`@nrwl/eslint-plugin-nx`].concat(packages).join(` `));
|
||||
yarnAdd(packages.join(` `));
|
||||
packages
|
||||
.filter((f) => f != '@nrwl/nx-plugin')
|
||||
.filter((f) => f !== '@nrwl/nx-plugin' && f !== `@nrwl/eslint-plugin-nx`)
|
||||
.forEach((p) => {
|
||||
runCLI(`g ${p}:init`);
|
||||
});
|
||||
|
||||
execSync(`mv ${tmpProjPath()} ${tmpBackupProjPath()}`);
|
||||
}
|
||||
execSync(`cp -a ${tmpBackupProjPath()} ${tmpProjPath()}`);
|
||||
@ -414,10 +371,6 @@ export function rmDist() {
|
||||
execSync(`rm -rf ${tmpProjPath()}/dist`);
|
||||
}
|
||||
|
||||
export function getCwd(): string {
|
||||
return process.cwd();
|
||||
}
|
||||
|
||||
export function directoryExists(filePath: string): boolean {
|
||||
try {
|
||||
return statSync(filePath).isDirectory();
|
||||
|
||||
10
jest.config.js
Normal file
10
jest.config.js
Normal file
@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
|
||||
transform: {
|
||||
'^.+\\.(ts|js|html)$': 'ts-jest',
|
||||
},
|
||||
resolver: '@nrwl/jest/plugins/resolver',
|
||||
moduleFileExtensions: ['ts', 'js', 'html'],
|
||||
coverageReporters: ['html'],
|
||||
maxWorkers: 2,
|
||||
};
|
||||
86
nx.json
Normal file
86
nx.json
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"npmScope": "nrwl",
|
||||
"implicitDependencies": {
|
||||
"workspace.json": "*",
|
||||
"package.json": {
|
||||
"dependencies": "*",
|
||||
"devDependencies": "*"
|
||||
},
|
||||
"tsconfig.json": "*",
|
||||
"tslint.json": "*",
|
||||
"nx.json": "*"
|
||||
},
|
||||
"tasksRunnerOptions": {
|
||||
"default": {
|
||||
"runner": "@nrwl/workspace/tasks-runners/default",
|
||||
"options": {
|
||||
"cacheableOperations": ["build", "lint", "test", "e2e"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspaceLayout": {
|
||||
"libsDir": "packages"
|
||||
},
|
||||
"projects": {
|
||||
"tao": {
|
||||
"tags": []
|
||||
},
|
||||
"workspace": {
|
||||
"tags": []
|
||||
},
|
||||
"web": {
|
||||
"tags": [],
|
||||
"implicitDependencies": ["cypress"]
|
||||
},
|
||||
"cypress": {
|
||||
"tags": []
|
||||
},
|
||||
"jest": {
|
||||
"tags": []
|
||||
},
|
||||
"react": {
|
||||
"tags": []
|
||||
},
|
||||
"storybook": {
|
||||
"tags": [],
|
||||
"implicitDependencies": ["cypress"]
|
||||
},
|
||||
"nx-plugin": {
|
||||
"tags": []
|
||||
},
|
||||
"node": {
|
||||
"tags": []
|
||||
},
|
||||
"next": {
|
||||
"tags": [],
|
||||
"implicitDependencies": ["cypress"]
|
||||
},
|
||||
"nest": {
|
||||
"tags": []
|
||||
},
|
||||
"linter": {
|
||||
"tags": []
|
||||
},
|
||||
"express": {
|
||||
"tags": []
|
||||
},
|
||||
"eslint-plugin-nx": {
|
||||
"tags": []
|
||||
},
|
||||
"create-nx-workspace": {
|
||||
"tags": []
|
||||
},
|
||||
"create-nx-plugin": {
|
||||
"tags": []
|
||||
},
|
||||
"cli": {
|
||||
"tags": []
|
||||
},
|
||||
"bazel": {
|
||||
"tags": []
|
||||
},
|
||||
"angular": {
|
||||
"tags": []
|
||||
}
|
||||
}
|
||||
}
|
||||
35
package.json
35
package.json
@ -10,7 +10,6 @@
|
||||
"commit": "git-cz",
|
||||
"checkcommit": "node ./scripts/commit-lint.js",
|
||||
"e2e": "./scripts/e2e.sh",
|
||||
"e2e-rerun": "./scripts/e2e-rerun.sh",
|
||||
"create-playground": "./scripts/create-playground.sh",
|
||||
"update-playground": "./scripts/update-playground.sh",
|
||||
"e2e-ci1": "./scripts/e2e-ci1.sh",
|
||||
@ -19,11 +18,8 @@
|
||||
"e2e-ci4": "./scripts/e2e-ci4.sh",
|
||||
"test-create-nx-workspace": "./scripts/test-create-nx-workspace.sh",
|
||||
"format": "./scripts/format.sh",
|
||||
"linknpm": "./scripts/link.sh --local",
|
||||
"nx-release": "./scripts/nx-release.js",
|
||||
"copy": "./scripts/copy.sh",
|
||||
"test": "yarn linknpm fast && ./scripts/test.sh",
|
||||
"test:all": "yarn linknpm fast && scripts/test-angular-runtime.sh && ./scripts/test.sh",
|
||||
"test": "nx run-many --target=test --all --parallel",
|
||||
"checkformat": "scripts/check-format.sh",
|
||||
"checkimports": "node ./scripts/check-imports.js",
|
||||
"checkversions": "ts-node ./scripts/check-versions.ts",
|
||||
@ -39,7 +35,7 @@
|
||||
"@angular-devkit/build-webpack": "~0.901.0",
|
||||
"@angular-devkit/core": "~9.1.0",
|
||||
"@angular-devkit/schematics": "~9.1.0",
|
||||
"@angular/cli": "~9.1.0",
|
||||
"@angular/cli": "9.1.0",
|
||||
"@angular/common": "^9.1.0",
|
||||
"@angular/compiler": "^9.1.0",
|
||||
"@angular/compiler-cli": "^9.1.0",
|
||||
@ -242,27 +238,15 @@
|
||||
"worker-plugin": "3.2.0",
|
||||
"yargs": "^11.0.0",
|
||||
"yargs-parser": "10.0.0",
|
||||
"zone.js": "^0.10.0"
|
||||
"zone.js": "^0.10.0",
|
||||
"@nrwl/workspace": "9.4.0-beta.5",
|
||||
"@nrwl/node": "9.4.0-beta.5",
|
||||
"@nrwl/eslint-plugin-nx": "9.4.0-beta.5",
|
||||
"@nrwl/jest": "9.4.0-beta.5",
|
||||
"ts-jest": "25.2.1"
|
||||
},
|
||||
"author": "Victor Savkin",
|
||||
"license": "MIT",
|
||||
"jest": {
|
||||
"modulePathIgnorePatterns": [
|
||||
"tmp",
|
||||
"<rootDir>/test",
|
||||
"<rootDir>/packages",
|
||||
"collection/.*/files"
|
||||
],
|
||||
"testPathIgnorePatterns": [
|
||||
"node_modules",
|
||||
"<rootDir>/build/packages/angular/spec",
|
||||
"packages/web/src/utils/third-party/cli-files/models/webpack-configs"
|
||||
],
|
||||
"coverageReporters": [
|
||||
"html"
|
||||
],
|
||||
"coverageDirectory": "coverage"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-customizable"
|
||||
@ -272,5 +256,6 @@
|
||||
"hooks": {
|
||||
"pre-push": "yarn checkcommit && yarn documentation && pretty-quick --check"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
1
packages/angular/.eslintrc
Normal file
1
packages/angular/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/angular/jest.config.js
Normal file
9
packages/angular/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
import { from } from 'rxjs';
|
||||
import { readAll, readFirst } from '../testing/src/testing-utils';
|
||||
|
||||
describe('TestingUtils', () => {
|
||||
xdescribe('TestingUtils', () => {
|
||||
describe('readAll', () => {
|
||||
it('should transform Observable<T> to Promise<Array<T>>', async (done) => {
|
||||
const obs = from([1, 2, 3]);
|
||||
|
||||
@ -1,220 +1,225 @@
|
||||
import { JsonObject } from '@angular-devkit/core';
|
||||
import { MockBuilderContext } from '@nrwl/workspace/testing';
|
||||
import { BuildAngularLibraryBuilderOptions, run } from './package.impl';
|
||||
import { getMockContext } from '../../utils/testing';
|
||||
import * as projectGraphUtils from '@nrwl/workspace/src/core/project-graph';
|
||||
import {
|
||||
ProjectGraph,
|
||||
ProjectType,
|
||||
} from '@nrwl/workspace/src/core/project-graph';
|
||||
import * as fileUtils from '@nrwl/workspace/src/utils/fileutils';
|
||||
|
||||
jest.mock('ng-packagr');
|
||||
import * as ngPackagrImport from 'ng-packagr';
|
||||
import * as ng from '@angular/compiler-cli';
|
||||
import { NgPackagr } from 'ng-packagr';
|
||||
|
||||
class NgPackagrMock extends NgPackagr {
|
||||
constructor() {
|
||||
super(null);
|
||||
}
|
||||
}
|
||||
|
||||
describe('AngularLibraryWebBuildBuilder', () => {
|
||||
let context: MockBuilderContext;
|
||||
let testOptions: BuildAngularLibraryBuilderOptions & JsonObject;
|
||||
let ngPackagrMock;
|
||||
|
||||
beforeEach(async () => {
|
||||
context = await getMockContext();
|
||||
|
||||
// NgPackagr has some weird fluent API. I wonder whether
|
||||
// I could simplify this mock
|
||||
ngPackagrMock = new NgPackagrMock();
|
||||
spyOn(ngPackagrMock, 'build').and.callFake(() => {
|
||||
return Promise.resolve();
|
||||
});
|
||||
spyOn(ngPackagrMock, 'forProject').and.callThrough();
|
||||
spyOn(ngPackagrMock, 'withTsConfig').and.callThrough();
|
||||
|
||||
spyOn(ngPackagrImport, 'ngPackagr').and.callFake(() => {
|
||||
return ngPackagrMock;
|
||||
});
|
||||
|
||||
// used for updating the json files
|
||||
spyOn(fileUtils, 'writeJsonFile');
|
||||
// parent tsconfig
|
||||
spyOn(ng, 'readConfiguration').and.callFake(() => {
|
||||
return {
|
||||
options: {
|
||||
paths: {
|
||||
'@proj/buildable-child': [],
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
spyOn(fileUtils, 'fileExists').and.returnValue(true);
|
||||
|
||||
context.target = {
|
||||
project: 'buildable-parent',
|
||||
target: 'build',
|
||||
};
|
||||
|
||||
testOptions = {
|
||||
tsConfig: 'libs/publishable-parent/tsconfig.lib.json',
|
||||
project: 'libs/publishable-parent/ng-package.json',
|
||||
};
|
||||
});
|
||||
|
||||
it('should invoke ng-packagr for a libary without any dependencies', async () => {
|
||||
spyOn(projectGraphUtils, 'createProjectGraph').and.callFake(() => {
|
||||
return {
|
||||
nodes: {
|
||||
'buildable-parent': {
|
||||
type: ProjectType.lib,
|
||||
name: 'buildable-parent',
|
||||
data: { files: [], root: 'libs/buildable-parent' },
|
||||
},
|
||||
},
|
||||
dependencies: {},
|
||||
} as ProjectGraph;
|
||||
});
|
||||
|
||||
// act
|
||||
const result = await run(testOptions, context).toPromise();
|
||||
|
||||
expect(result.success).toBeTruthy();
|
||||
expect(ngPackagrMock.build).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe('with dependent libraries', () => {
|
||||
beforeEach(() => {
|
||||
// create project graph with dependencies
|
||||
spyOn(projectGraphUtils, 'createProjectGraph').and.callFake(() => {
|
||||
return {
|
||||
nodes: {
|
||||
'buildable-parent': {
|
||||
type: ProjectType.lib,
|
||||
name: 'buildable-parent',
|
||||
data: {
|
||||
files: [],
|
||||
root: 'libs/buildable-parent',
|
||||
architect: {
|
||||
build: {
|
||||
builder: 'any builder',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'buildable-child': {
|
||||
type: ProjectType.lib,
|
||||
name: 'buildable-child',
|
||||
data: {
|
||||
files: [],
|
||||
root: 'libs/buildable-child',
|
||||
prefix: 'proj',
|
||||
architect: {
|
||||
build: {
|
||||
builder: 'any builder',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
dependencies: {
|
||||
'buildable-parent': [
|
||||
{
|
||||
type: ProjectType.lib,
|
||||
target: 'buildable-child',
|
||||
source: null,
|
||||
},
|
||||
],
|
||||
'buildable-child': [],
|
||||
},
|
||||
} as ProjectGraph;
|
||||
});
|
||||
});
|
||||
|
||||
it('should properly set the TSConfig paths', async () => {
|
||||
spyOn(fileUtils, 'readJsonFile').and.returnValue({
|
||||
name: '@proj/buildable-child',
|
||||
version: '1.2.3',
|
||||
});
|
||||
|
||||
// act
|
||||
const result = await run(testOptions, context).toPromise();
|
||||
|
||||
// assert
|
||||
expect(result.success).toBeTruthy();
|
||||
expect(ngPackagrMock.withTsConfig).toHaveBeenCalledWith(
|
||||
jasmine.objectContaining({
|
||||
options: {
|
||||
paths: { '@proj/buildable-child': ['dist/libs/buildable-child'] },
|
||||
},
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('should update the package.json', async () => {
|
||||
spyOn(fileUtils, 'readJsonFile').and.callFake((path: string) => {
|
||||
if (path.endsWith('buildable-parent/package.json')) {
|
||||
return {
|
||||
name: '@proj/buildable-parent',
|
||||
version: '3.3.3',
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
name: '@proj/buildable-child',
|
||||
version: '1.2.3',
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// act
|
||||
const result = await run(
|
||||
{ ...testOptions, updateBuildableProjectDepsInPackageJson: true },
|
||||
context
|
||||
).toPromise();
|
||||
// assert
|
||||
expect(result.success).toBeTruthy();
|
||||
expect(fileUtils.writeJsonFile).toHaveBeenCalledWith(
|
||||
'dist/libs/buildable-parent/package.json',
|
||||
jasmine.objectContaining({
|
||||
dependencies: {
|
||||
'@proj/buildable-child': '1.2.3',
|
||||
},
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
['dependencies', 'devDependencies', 'peerDependencies'].forEach(
|
||||
(depConfigName: string) => {
|
||||
it(`should not update the package.json if the ${depConfigName} already contain a matching entry`, async () => {
|
||||
spyOn(fileUtils, 'readJsonFile').and.callFake((path: string) => {
|
||||
if (path.endsWith('buildable-parent/package.json')) {
|
||||
return {
|
||||
name: '@proj/buildable-parent',
|
||||
version: '1.2.3',
|
||||
[depConfigName]: {
|
||||
'@proj/buildable-child': '1.1.1',
|
||||
},
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
name: '@proj/buildable-child',
|
||||
version: '1.2.3',
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// act
|
||||
const result = await run(testOptions, context).toPromise();
|
||||
|
||||
// assert
|
||||
expect(result.success).toBeTruthy();
|
||||
expect(fileUtils.writeJsonFile).not.toHaveBeenCalled();
|
||||
});
|
||||
}
|
||||
);
|
||||
describe('empty', () => {
|
||||
it('empty', () => {
|
||||
expect(1).toBe(1);
|
||||
});
|
||||
});
|
||||
// import { JsonObject } from '@angular-devkit/core';
|
||||
// import { MockBuilderContext } from '@nrwl/workspace/testing';
|
||||
// import { BuildAngularLibraryBuilderOptions, run } from './package.impl';
|
||||
// import { getMockContext } from '../../utils/testing';
|
||||
// import * as projectGraphUtils from '@nrwl/workspace/src/core/project-graph';
|
||||
// import {
|
||||
// ProjectGraph,
|
||||
// ProjectType,
|
||||
// } from '@nrwl/workspace/src/core/project-graph';
|
||||
// import * as fileUtils from '@nrwl/workspace/src/utils/fileutils';
|
||||
//
|
||||
// jest.mock('ng-packagr');
|
||||
// import * as ngPackagrImport from 'ng-packagr';
|
||||
// import * as ng from '@angular/compiler-cli';
|
||||
// import { NgPackagr } from 'ng-packagr';
|
||||
//
|
||||
// class NgPackagrMock extends NgPackagr {
|
||||
// constructor() {
|
||||
// super(null);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// describe('AngularLibraryWebBuildBuilder', () => {
|
||||
// let context: MockBuilderContext;
|
||||
// let testOptions: BuildAngularLibraryBuilderOptions & JsonObject;
|
||||
// let ngPackagrMock;
|
||||
//
|
||||
// beforeEach(async () => {
|
||||
// context = await getMockContext();
|
||||
//
|
||||
// // NgPackagr has some weird fluent API. I wonder whether
|
||||
// // I could simplify this mock
|
||||
// ngPackagrMock = new NgPackagrMock();
|
||||
// spyOn(ngPackagrMock, 'build').and.callFake(() => {
|
||||
// return Promise.resolve();
|
||||
// });
|
||||
// spyOn(ngPackagrMock, 'forProject').and.callThrough();
|
||||
// spyOn(ngPackagrMock, 'withTsConfig').and.callThrough();
|
||||
//
|
||||
// spyOn(ngPackagrImport, 'ngPackagr').and.callFake(() => {
|
||||
// return ngPackagrMock;
|
||||
// });
|
||||
//
|
||||
// // used for updating the json files
|
||||
// spyOn(fileUtils, 'writeJsonFile');
|
||||
// // parent tsconfig
|
||||
// spyOn(ng, 'readConfiguration').and.callFake(() => {
|
||||
// return {
|
||||
// options: {
|
||||
// paths: {
|
||||
// '@proj/buildable-child': [],
|
||||
// },
|
||||
// },
|
||||
// };
|
||||
// });
|
||||
// spyOn(fileUtils, 'fileExists').and.returnValue(true);
|
||||
//
|
||||
// context.target = {
|
||||
// project: 'buildable-parent',
|
||||
// target: 'build',
|
||||
// };
|
||||
//
|
||||
// testOptions = {
|
||||
// tsConfig: 'libs/publishable-parent/tsconfig.lib.json',
|
||||
// project: 'libs/publishable-parent/ng-package.json',
|
||||
// };
|
||||
// });
|
||||
//
|
||||
// it('should invoke ng-packagr for a libary without any dependencies', async () => {
|
||||
// spyOn(projectGraphUtils, 'createProjectGraph').and.callFake(() => {
|
||||
// return {
|
||||
// nodes: {
|
||||
// 'buildable-parent': {
|
||||
// type: ProjectType.lib,
|
||||
// name: 'buildable-parent',
|
||||
// data: { files: [], root: 'libs/buildable-parent' },
|
||||
// },
|
||||
// },
|
||||
// dependencies: {},
|
||||
// } as ProjectGraph;
|
||||
// });
|
||||
//
|
||||
// // act
|
||||
// const result = await run(testOptions, context).toPromise();
|
||||
//
|
||||
// expect(result.success).toBeTruthy();
|
||||
// expect(ngPackagrMock.build).toHaveBeenCalled();
|
||||
// });
|
||||
//
|
||||
// describe('with dependent libraries', () => {
|
||||
// beforeEach(() => {
|
||||
// // create project graph with dependencies
|
||||
// spyOn(projectGraphUtils, 'createProjectGraph').and.callFake(() => {
|
||||
// return {
|
||||
// nodes: {
|
||||
// 'buildable-parent': {
|
||||
// type: ProjectType.lib,
|
||||
// name: 'buildable-parent',
|
||||
// data: {
|
||||
// files: [],
|
||||
// root: 'libs/buildable-parent',
|
||||
// architect: {
|
||||
// build: {
|
||||
// builder: 'any builder',
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// 'buildable-child': {
|
||||
// type: ProjectType.lib,
|
||||
// name: 'buildable-child',
|
||||
// data: {
|
||||
// files: [],
|
||||
// root: 'libs/buildable-child',
|
||||
// prefix: 'proj',
|
||||
// architect: {
|
||||
// build: {
|
||||
// builder: 'any builder',
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// dependencies: {
|
||||
// 'buildable-parent': [
|
||||
// {
|
||||
// type: ProjectType.lib,
|
||||
// target: 'buildable-child',
|
||||
// source: null,
|
||||
// },
|
||||
// ],
|
||||
// 'buildable-child': [],
|
||||
// },
|
||||
// } as ProjectGraph;
|
||||
// });
|
||||
// });
|
||||
//
|
||||
// it('should properly set the TSConfig paths', async () => {
|
||||
// spyOn(fileUtils, 'readJsonFile').and.returnValue({
|
||||
// name: '@proj/buildable-child',
|
||||
// version: '1.2.3',
|
||||
// });
|
||||
//
|
||||
// // act
|
||||
// const result = await run(testOptions, context).toPromise();
|
||||
//
|
||||
// // assert
|
||||
// expect(result.success).toBeTruthy();
|
||||
// expect(ngPackagrMock.withTsConfig).toHaveBeenCalledWith(
|
||||
// jasmine.objectContaining({
|
||||
// options: {
|
||||
// paths: { '@proj/buildable-child': ['dist/libs/buildable-child'] },
|
||||
// },
|
||||
// })
|
||||
// );
|
||||
// });
|
||||
//
|
||||
// it('should update the package.json', async () => {
|
||||
// spyOn(fileUtils, 'readJsonFile').and.callFake((path: string) => {
|
||||
// if (path.endsWith('buildable-parent/package.json')) {
|
||||
// return {
|
||||
// name: '@proj/buildable-parent',
|
||||
// version: '3.3.3',
|
||||
// };
|
||||
// } else {
|
||||
// return {
|
||||
// name: '@proj/buildable-child',
|
||||
// version: '1.2.3',
|
||||
// };
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// // act
|
||||
// const result = await run(
|
||||
// { ...testOptions, updateBuildableProjectDepsInPackageJson: true },
|
||||
// context
|
||||
// ).toPromise();
|
||||
// // assert
|
||||
// expect(result.success).toBeTruthy();
|
||||
// expect(fileUtils.writeJsonFile).toHaveBeenCalledWith(
|
||||
// 'dist/libs/buildable-parent/package.json',
|
||||
// jasmine.objectContaining({
|
||||
// dependencies: {
|
||||
// '@proj/buildable-child': '1.2.3',
|
||||
// },
|
||||
// })
|
||||
// );
|
||||
// });
|
||||
//
|
||||
// ['dependencies', 'devDependencies', 'peerDependencies'].forEach(
|
||||
// (depConfigName: string) => {
|
||||
// it(`should not update the package.json if the ${depConfigName} already contain a matching entry`, async () => {
|
||||
// spyOn(fileUtils, 'readJsonFile').and.callFake((path: string) => {
|
||||
// if (path.endsWith('buildable-parent/package.json')) {
|
||||
// return {
|
||||
// name: '@proj/buildable-parent',
|
||||
// version: '1.2.3',
|
||||
// [depConfigName]: {
|
||||
// '@proj/buildable-child': '1.1.1',
|
||||
// },
|
||||
// };
|
||||
// } else {
|
||||
// return {
|
||||
// name: '@proj/buildable-child',
|
||||
// version: '1.2.3',
|
||||
// };
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// // act
|
||||
// const result = await run(testOptions, context).toPromise();
|
||||
//
|
||||
// // assert
|
||||
// expect(result.success).toBeTruthy();
|
||||
// expect(fileUtils.writeJsonFile).not.toHaveBeenCalled();
|
||||
// });
|
||||
// }
|
||||
// );
|
||||
// });
|
||||
// });
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
import { join } from 'path';
|
||||
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
|
||||
import { Tree, Rule, externalSchematic } from '@angular-devkit/schematics';
|
||||
import { Rule, Tree } from '@angular-devkit/schematics';
|
||||
import { names, toFileName } from '@nrwl/workspace/src/utils/name-utils';
|
||||
import {
|
||||
createEmptyWorkspace,
|
||||
MockBuilderContext,
|
||||
} from '@nrwl/workspace/testing';
|
||||
import { MockBuilderContext } from '@nrwl/workspace/testing';
|
||||
import { TestingArchitectHost } from '@angular-devkit/architect/testing';
|
||||
import { schema } from '@angular-devkit/core';
|
||||
import { Architect } from '@angular-devkit/architect';
|
||||
@ -15,6 +12,16 @@ const testRunner = new SchematicTestRunner(
|
||||
join(__dirname, '../../collection.json')
|
||||
);
|
||||
|
||||
testRunner.registerCollection(
|
||||
'@nrwl/cypress',
|
||||
join(__dirname, '../../../cypress/collection.json')
|
||||
);
|
||||
|
||||
testRunner.registerCollection(
|
||||
'@nrwl/storybook',
|
||||
join(__dirname, '../../../storybook/collection.json')
|
||||
);
|
||||
|
||||
const migrationTestRunner = new SchematicTestRunner(
|
||||
'@nrwl/workspace',
|
||||
join(__dirname, '../../migrations.json')
|
||||
|
||||
7
packages/angular/tsconfig.json
Normal file
7
packages/angular/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/angular/tsconfig.lib.json
Normal file
12
packages/angular/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/angular/tsconfig.spec.json
Normal file
16
packages/angular/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/bazel/.eslintrc
Normal file
1
packages/bazel/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/bazel/jest.config.js
Normal file
9
packages/bazel/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/bazel/tsconfig.json
Normal file
7
packages/bazel/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/bazel/tsconfig.lib.json
Normal file
12
packages/bazel/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/bazel/tsconfig.spec.json
Normal file
16
packages/bazel/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/cli/.eslintrc
Normal file
1
packages/cli/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/cli/jest.config.js
Normal file
9
packages/cli/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
@ -10,7 +10,7 @@ describe('parseRunOneOptions', () => {
|
||||
project: 'myproj',
|
||||
target: 'build',
|
||||
configuration: 'production',
|
||||
overrides: { flag: 'true' },
|
||||
parsedArgs: { _: [], flag: 'true' },
|
||||
});
|
||||
});
|
||||
|
||||
@ -25,7 +25,7 @@ describe('parseRunOneOptions', () => {
|
||||
project: 'myproj',
|
||||
target: 'build',
|
||||
configuration: 'production',
|
||||
overrides: { flag: 'true' },
|
||||
parsedArgs: { _: [], flag: 'true' },
|
||||
});
|
||||
});
|
||||
|
||||
@ -39,24 +39,10 @@ describe('parseRunOneOptions', () => {
|
||||
).toEqual({
|
||||
project: 'myproj',
|
||||
target: 'build',
|
||||
overrides: { flag: 'true' },
|
||||
parsedArgs: { _: [], flag: 'true' },
|
||||
});
|
||||
});
|
||||
|
||||
it('should return false when no runner is set', () => {
|
||||
expect(parseRunOneOptions({}, workspaceJson, args)).toBe(false);
|
||||
expect(
|
||||
parseRunOneOptions({ tasksRunnerOptions: {} }, workspaceJson, args)
|
||||
).toBe(false);
|
||||
expect(
|
||||
parseRunOneOptions(
|
||||
{ tasksRunnerOptions: { default: {} } },
|
||||
workspaceJson,
|
||||
args
|
||||
)
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false when the task is not recognized', () => {
|
||||
expect(parseRunOneOptions(nxJson, {}, args)).toBe(false);
|
||||
expect(parseRunOneOptions(nxJson, { projects: {} }, args)).toBe(false);
|
||||
|
||||
@ -30,7 +30,7 @@ export function parseRunOneOptions(
|
||||
|
||||
if (parsedArgs._[0] === 'run') {
|
||||
[project, target, configuration] = parsedArgs._[1].split(':');
|
||||
parsedArgs._ = parsedArgs._.slice(1);
|
||||
parsedArgs._ = parsedArgs._.slice(2);
|
||||
} else {
|
||||
target = parsedArgs._[0];
|
||||
project = parsedArgs._[1];
|
||||
@ -57,7 +57,8 @@ export function parseRunOneOptions(
|
||||
}
|
||||
|
||||
// we need both to be able to run a target, no tasks runner
|
||||
const p = workspaceConfigJson.projects[project];
|
||||
const p =
|
||||
workspaceConfigJson.projects && workspaceConfigJson.projects[project];
|
||||
if (!p || !p.architect || !p.architect[target]) return false;
|
||||
|
||||
const res = { project, target, configuration, parsedArgs };
|
||||
|
||||
7
packages/cli/tsconfig.json
Normal file
7
packages/cli/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/cli/tsconfig.lib.json
Normal file
12
packages/cli/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/cli/tsconfig.spec.json
Normal file
16
packages/cli/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/create-nx-plugin/.eslintrc
Normal file
1
packages/create-nx-plugin/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/create-nx-plugin/jest.config.js
Normal file
9
packages/create-nx-plugin/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/create-nx-plugin/tsconfig.json
Normal file
7
packages/create-nx-plugin/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/create-nx-plugin/tsconfig.lib.json
Normal file
12
packages/create-nx-plugin/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/create-nx-plugin/tsconfig.spec.json
Normal file
16
packages/create-nx-plugin/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/create-nx-workspace/.eslintrc
Normal file
1
packages/create-nx-workspace/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/create-nx-workspace/jest.config.js
Normal file
9
packages/create-nx-workspace/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/create-nx-workspace/tsconfig.json
Normal file
7
packages/create-nx-workspace/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/create-nx-workspace/tsconfig.lib.json
Normal file
12
packages/create-nx-workspace/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/create-nx-workspace/tsconfig.spec.json
Normal file
16
packages/create-nx-workspace/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/cypress/.eslintrc
Normal file
1
packages/cypress/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/cypress/jest.config.js
Normal file
9
packages/cypress/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/cypress/tsconfig.json
Normal file
7
packages/cypress/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/cypress/tsconfig.lib.json
Normal file
12
packages/cypress/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
15
packages/cypress/tsconfig.spec.json
Normal file
15
packages/cypress/tsconfig.spec.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/eslint-plugin-nx/.eslintrc
Normal file
1
packages/eslint-plugin-nx/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/eslint-plugin-nx/jest.config.js
Normal file
9
packages/eslint-plugin-nx/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/eslint-plugin-nx/tsconfig.json
Normal file
7
packages/eslint-plugin-nx/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/eslint-plugin-nx/tsconfig.lib.json
Normal file
12
packages/eslint-plugin-nx/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/eslint-plugin-nx/tsconfig.spec.json
Normal file
16
packages/eslint-plugin-nx/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/express/.eslintrc
Normal file
1
packages/express/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/express/jest.config.js
Normal file
9
packages/express/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/express/tsconfig.json
Normal file
7
packages/express/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/express/tsconfig.lib.json
Normal file
12
packages/express/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/express/tsconfig.spec.json
Normal file
16
packages/express/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/jest/.eslintrc
Normal file
1
packages/jest/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/jest/jest.config.js
Normal file
9
packages/jest/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/jest/tsconfig.json
Normal file
7
packages/jest/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/jest/tsconfig.lib.json
Normal file
12
packages/jest/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
15
packages/jest/tsconfig.spec.json
Normal file
15
packages/jest/tsconfig.spec.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/linter/.eslintrc
Normal file
1
packages/linter/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/linter/jest.config.js
Normal file
9
packages/linter/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/linter/tsconfig.json
Normal file
7
packages/linter/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/linter/tsconfig.lib.json
Normal file
12
packages/linter/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/linter/tsconfig.spec.json
Normal file
16
packages/linter/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/nest/.eslintrc
Normal file
1
packages/nest/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/nest/jest.config.js
Normal file
9
packages/nest/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/nest/tsconfig.json
Normal file
7
packages/nest/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/nest/tsconfig.lib.json
Normal file
12
packages/nest/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/nest/tsconfig.spec.json
Normal file
16
packages/nest/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/next/.eslintrc
Normal file
1
packages/next/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/next/jest.config.js
Normal file
9
packages/next/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
@ -6,10 +6,7 @@ import {
|
||||
} from '@nrwl/workspace';
|
||||
import { nextVersion } from '../../utils/versions';
|
||||
import { Schema } from './schema';
|
||||
import {
|
||||
reactDomVersion,
|
||||
reactVersion,
|
||||
} from '../../../../react/src/utils/versions';
|
||||
import { reactDomVersion, reactVersion } from '@nrwl/react/src/utils/versions';
|
||||
|
||||
const updateDependencies = addDepsToPackageJson(
|
||||
{
|
||||
|
||||
@ -13,6 +13,11 @@ const testRunner = new SchematicTestRunner(
|
||||
join(__dirname, '../../collection.json')
|
||||
);
|
||||
|
||||
testRunner.registerCollection(
|
||||
'@nrwl/cypress',
|
||||
join(__dirname, '../../../cypress/collection.json')
|
||||
);
|
||||
|
||||
export function runSchematic(schematicName: string, options: any, tree: Tree) {
|
||||
return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
|
||||
}
|
||||
|
||||
7
packages/next/tsconfig.json
Normal file
7
packages/next/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/next/tsconfig.lib.json
Normal file
12
packages/next/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/next/tsconfig.spec.json
Normal file
16
packages/next/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/node/.eslintrc
Normal file
1
packages/node/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/node/jest.config.js
Normal file
9
packages/node/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/node/tsconfig.json
Normal file
7
packages/node/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/node/tsconfig.lib.json
Normal file
12
packages/node/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/node/tsconfig.spec.json
Normal file
16
packages/node/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/nx-plugin/.eslintrc
Normal file
1
packages/nx-plugin/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/nx-plugin/jest.config.js
Normal file
9
packages/nx-plugin/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
7
packages/nx-plugin/tsconfig.json
Normal file
7
packages/nx-plugin/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/nx-plugin/tsconfig.lib.json
Normal file
12
packages/nx-plugin/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/nx-plugin/tsconfig.spec.json
Normal file
16
packages/nx-plugin/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/react/.eslintrc
Normal file
1
packages/react/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/react/jest.config.js
Normal file
9
packages/react/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
@ -3,6 +3,7 @@ import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
|
||||
import { readJsonInTree } from '@nrwl/workspace';
|
||||
import * as path from 'path';
|
||||
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
|
||||
import { join } from 'path';
|
||||
|
||||
describe('Update 8-10-0', () => {
|
||||
let tree: Tree;
|
||||
@ -15,6 +16,11 @@ describe('Update 8-10-0', () => {
|
||||
'@nrwl/react',
|
||||
path.join(__dirname, '../../../migrations.json')
|
||||
);
|
||||
|
||||
schematicRunner.registerCollection(
|
||||
'@nrwl/cypress',
|
||||
join(__dirname, '../../../../cypress/collection.json')
|
||||
);
|
||||
});
|
||||
|
||||
it(`should update libs`, async () => {
|
||||
@ -52,6 +58,11 @@ describe('Update 8-10-0', () => {
|
||||
'@nrwl/react',
|
||||
path.join(__dirname, '../../../collection.json')
|
||||
);
|
||||
|
||||
reactRunner.registerCollection(
|
||||
'@nrwl/cypress',
|
||||
join(__dirname, '../../../../cypress/collection.json')
|
||||
);
|
||||
tree = await reactRunner
|
||||
.runSchematicAsync('app', { name: 'demo' }, tree)
|
||||
.toPromise();
|
||||
|
||||
@ -2,6 +2,7 @@ import { Tree } from '@angular-devkit/schematics';
|
||||
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
|
||||
import * as path from 'path';
|
||||
import { createEmptyWorkspace } from '@nrwl/workspace/testing';
|
||||
import { join } from 'path';
|
||||
|
||||
describe('Update 8-10-0', () => {
|
||||
let tree: Tree;
|
||||
@ -14,6 +15,11 @@ describe('Update 8-10-0', () => {
|
||||
'@nrwl/react',
|
||||
path.join(__dirname, '../../../migrations.json')
|
||||
);
|
||||
|
||||
schematicRunner.registerCollection(
|
||||
'@nrwl/cypress',
|
||||
join(__dirname, '../../../../cypress/collection.json')
|
||||
);
|
||||
});
|
||||
|
||||
it('should remove @nwrl/react/typings/svg.d.ts from tsconfig', async () => {
|
||||
@ -21,6 +27,12 @@ describe('Update 8-10-0', () => {
|
||||
'@nrwl/react',
|
||||
path.join(__dirname, '../../../collection.json')
|
||||
);
|
||||
|
||||
reactRunner.registerCollection(
|
||||
'@nrwl/cypress',
|
||||
join(__dirname, '../../../../cypress/collection.json')
|
||||
);
|
||||
|
||||
tree = await reactRunner
|
||||
.runSchematicAsync('app', { name: 'demo' }, tree)
|
||||
.toPromise();
|
||||
|
||||
@ -10,6 +10,16 @@ const testRunner = new SchematicTestRunner(
|
||||
join(__dirname, '../../collection.json')
|
||||
);
|
||||
|
||||
testRunner.registerCollection(
|
||||
'@nrwl/cypress',
|
||||
join(__dirname, '../../../cypress/collection.json')
|
||||
);
|
||||
|
||||
testRunner.registerCollection(
|
||||
'@nrwl/storybook',
|
||||
join(__dirname, '../../../storybook/collection.json')
|
||||
);
|
||||
|
||||
export function runSchematic<SchemaOptions = any>(
|
||||
schematicName: string,
|
||||
options: SchemaOptions,
|
||||
|
||||
7
packages/react/tsconfig.json
Normal file
7
packages/react/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
12
packages/react/tsconfig.lib.json
Normal file
12
packages/react/tsconfig.lib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"rootDir": "./",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["**/*.spec.ts", "**/*_spec.ts"],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
16
packages/react/tsconfig.spec.json
Normal file
16
packages/react/tsconfig.spec.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
1
packages/storybook/.eslintrc
Normal file
1
packages/storybook/.eslintrc
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
|
||||
9
packages/storybook/jest.config.js
Normal file
9
packages/storybook/jest.config.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
name: 'tao',
|
||||
preset: '../../jest.config.js',
|
||||
transform: {
|
||||
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
|
||||
coverageDirectory: '../../coverage/packages/tao',
|
||||
};
|
||||
@ -1,6 +1,5 @@
|
||||
import {
|
||||
chain,
|
||||
externalSchematic,
|
||||
move,
|
||||
noop,
|
||||
Rule,
|
||||
@ -13,11 +12,9 @@ import {
|
||||
import {
|
||||
getProjectConfig,
|
||||
offsetFromRoot,
|
||||
readJsonFile,
|
||||
updateWorkspace,
|
||||
} from '@nrwl/workspace';
|
||||
import { join, normalize } from '@angular-devkit/core';
|
||||
import { StorybookStoriesSchema } from '../../../../angular/src/schematics/stories/stories';
|
||||
import { applyWithSkipExisting, parseJsonAtPath } from '../../utils/utils';
|
||||
import { CypressConfigureSchema } from '../cypress-project/cypress-project';
|
||||
import { StorybookConfigureSchema } from './schema';
|
||||
|
||||
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