Combine link and link-spec scripts
This commit is contained in:
parent
4184bb2d13
commit
6a21906fdd
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@ node_modules
|
|||||||
.vscode
|
.vscode
|
||||||
dist
|
dist
|
||||||
build
|
build
|
||||||
|
test
|
||||||
.DS_Store
|
.DS_Store
|
||||||
tmp
|
tmp
|
||||||
yarn-error
|
yarn-error
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
module.exports = function(config) {
|
module.exports = function(config) {
|
||||||
const webpackConfig = {
|
const webpackConfig = {
|
||||||
"node": {
|
node: {
|
||||||
"fs": "empty",
|
fs: 'empty',
|
||||||
"global": true,
|
global: true,
|
||||||
"crypto": "empty",
|
crypto: 'empty',
|
||||||
"tls": "empty",
|
tls: 'empty',
|
||||||
"net": "empty",
|
net: 'empty',
|
||||||
"process": true,
|
process: true,
|
||||||
"module": false,
|
module: false,
|
||||||
"clearImmediate": false,
|
clearImmediate: false,
|
||||||
"setImmediate": false
|
setImmediate: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
config.set({
|
config.set({
|
||||||
@ -20,9 +20,7 @@ module.exports = function(config) {
|
|||||||
frameworks: ['jasmine'],
|
frameworks: ['jasmine'],
|
||||||
|
|
||||||
// list of files / patterns to load in the browser
|
// list of files / patterns to load in the browser
|
||||||
files: [
|
files: [{ pattern: 'test/test.js', watched: false }],
|
||||||
{ pattern: 'build/test.js', watched: false}
|
|
||||||
],
|
|
||||||
|
|
||||||
// list of files to exclude
|
// list of files to exclude
|
||||||
exclude: [],
|
exclude: [],
|
||||||
@ -30,7 +28,7 @@ module.exports = function(config) {
|
|||||||
// preprocess matching files before serving them to the browser
|
// preprocess matching files before serving them to the browser
|
||||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
'build/test.js': ['webpack']
|
'test/test.js': ['webpack']
|
||||||
},
|
},
|
||||||
|
|
||||||
reporters: ['dots'],
|
reporters: ['dots'],
|
||||||
@ -54,7 +52,7 @@ module.exports = function(config) {
|
|||||||
colors: true,
|
colors: true,
|
||||||
|
|
||||||
// level of logging
|
// level of logging
|
||||||
logLevel:config.LOG_INFO,
|
logLevel: config.LOG_INFO,
|
||||||
|
|
||||||
// enable / disable watching file and executing tests whenever any file changes
|
// enable / disable watching file and executing tests whenever any file changes
|
||||||
autoWatch: true,
|
autoWatch: true,
|
||||||
|
|||||||
@ -13,9 +13,9 @@
|
|||||||
"release": "./scripts/release.sh",
|
"release": "./scripts/release.sh",
|
||||||
"copy": "./scripts/copy.sh",
|
"copy": "./scripts/copy.sh",
|
||||||
"test:schematics": "yarn linknpm && ./scripts/test_schematics.sh",
|
"test:schematics": "yarn linknpm && ./scripts/test_schematics.sh",
|
||||||
"test:nx": "./scripts/link-spec.sh && ./scripts/test_nx.sh",
|
"test:nx": "yarn linknpm && ./scripts/test_nx.sh",
|
||||||
"test":
|
"test":
|
||||||
"./scripts/link-spec.sh && ./scripts/test_nx.sh && ./scripts/test_schematics.sh",
|
"yarn linknpm && ./scripts/test_nx.sh && ./scripts/test_schematics.sh",
|
||||||
"checkformat": "echo 1",
|
"checkformat": "echo 1",
|
||||||
"publish_npm": "./scripts/publish.sh",
|
"publish_npm": "./scripts/publish.sh",
|
||||||
"precommit": "yarn checkformat"
|
"precommit": "yarn checkformat"
|
||||||
|
|||||||
@ -44,7 +44,6 @@ function addBootstrap(path: string): Rule {
|
|||||||
const modulePath = `${path}/app/app.module.ts`;
|
const modulePath = `${path}/app/app.module.ts`;
|
||||||
const moduleSource = host.read(modulePath)!.toString('utf-8');
|
const moduleSource = host.read(modulePath)!.toString('utf-8');
|
||||||
const sourceFile = ts.createSourceFile(
|
const sourceFile = ts.createSourceFile(
|
||||||
<<<<<<< HEAD
|
|
||||||
modulePath,
|
modulePath,
|
||||||
moduleSource,
|
moduleSource,
|
||||||
ts.ScriptTarget.Latest,
|
ts.ScriptTarget.Latest,
|
||||||
@ -64,15 +63,6 @@ function addBootstrap(path: string): Rule {
|
|||||||
'AppComponent',
|
'AppComponent',
|
||||||
'./app.component'
|
'./app.component'
|
||||||
)
|
)
|
||||||
=======
|
|
||||||
modulePath, moduleSource, ts.ScriptTarget.Latest, true);
|
|
||||||
insert(host, modulePath, [
|
|
||||||
insertImport(
|
|
||||||
sourceFile, modulePath, 'BrowserModule', '@angular/platform-browser'),
|
|
||||||
...addImportToModule(sourceFile, modulePath, 'BrowserModule'),
|
|
||||||
...addBootstrapToModule(
|
|
||||||
sourceFile, modulePath, 'AppComponent', './app.component')
|
|
||||||
>>>>>>> Rebasing issues resolved
|
|
||||||
]);
|
]);
|
||||||
return host;
|
return host;
|
||||||
};
|
};
|
||||||
@ -83,15 +73,11 @@ function addNxModule(path: string): Rule {
|
|||||||
const modulePath = `${path}/app/app.module.ts`;
|
const modulePath = `${path}/app/app.module.ts`;
|
||||||
const moduleSource = host.read(modulePath)!.toString('utf-8');
|
const moduleSource = host.read(modulePath)!.toString('utf-8');
|
||||||
const sourceFile = ts.createSourceFile(
|
const sourceFile = ts.createSourceFile(
|
||||||
<<<<<<< HEAD
|
|
||||||
modulePath,
|
modulePath,
|
||||||
moduleSource,
|
moduleSource,
|
||||||
ts.ScriptTarget.Latest,
|
ts.ScriptTarget.Latest,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
=======
|
|
||||||
modulePath, moduleSource, ts.ScriptTarget.Latest, true);
|
|
||||||
>>>>>>> Rebasing issues resolved
|
|
||||||
insert(host, modulePath, [
|
insert(host, modulePath, [
|
||||||
insertImport(sourceFile, modulePath, 'NxModule', '@nrwl/nx'),
|
insertImport(sourceFile, modulePath, 'NxModule', '@nrwl/nx'),
|
||||||
...addImportToModule(sourceFile, modulePath, 'NxModule.forRoot()')
|
...addImportToModule(sourceFile, modulePath, 'NxModule.forRoot()')
|
||||||
@ -151,7 +137,6 @@ function addRouterRootConfiguration(path: string): Rule {
|
|||||||
const modulePath = `${path}/app/app.module.ts`;
|
const modulePath = `${path}/app/app.module.ts`;
|
||||||
const moduleSource = host.read(modulePath)!.toString('utf-8');
|
const moduleSource = host.read(modulePath)!.toString('utf-8');
|
||||||
const sourceFile = ts.createSourceFile(
|
const sourceFile = ts.createSourceFile(
|
||||||
<<<<<<< HEAD
|
|
||||||
modulePath,
|
modulePath,
|
||||||
moduleSource,
|
moduleSource,
|
||||||
ts.ScriptTarget.Latest,
|
ts.ScriptTarget.Latest,
|
||||||
@ -164,14 +149,6 @@ function addRouterRootConfiguration(path: string): Rule {
|
|||||||
modulePath,
|
modulePath,
|
||||||
`RouterModule.forRoot([], {initialNavigation: 'enabled'})`
|
`RouterModule.forRoot([], {initialNavigation: 'enabled'})`
|
||||||
)
|
)
|
||||||
=======
|
|
||||||
modulePath, moduleSource, ts.ScriptTarget.Latest, true);
|
|
||||||
insert(host, modulePath, [
|
|
||||||
insertImport(sourceFile, modulePath, 'RouterModule', '@angular/router'),
|
|
||||||
...addImportToModule(
|
|
||||||
sourceFile, modulePath,
|
|
||||||
`RouterModule.forRoot([], {initialNavigation: 'enabled'})`)
|
|
||||||
>>>>>>> Rebasing issues resolved
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const componentSpecPath = `${path}/app/app.component.spec.ts`;
|
const componentSpecPath = `${path}/app/app.component.spec.ts`;
|
||||||
@ -180,7 +157,6 @@ function addRouterRootConfiguration(path: string): Rule {
|
|||||||
componentSpecPath, componentSpecSource, ts.ScriptTarget.Latest, true);
|
componentSpecPath, componentSpecSource, ts.ScriptTarget.Latest, true);
|
||||||
insert(host, componentSpecPath, [
|
insert(host, componentSpecPath, [
|
||||||
insertImport(
|
insertImport(
|
||||||
<<<<<<< HEAD
|
|
||||||
componentSpecSourceFile,
|
componentSpecSourceFile,
|
||||||
componentSpecPath,
|
componentSpecPath,
|
||||||
'RouterTestingModule',
|
'RouterTestingModule',
|
||||||
@ -191,12 +167,6 @@ function addRouterRootConfiguration(path: string): Rule {
|
|||||||
componentSpecPath,
|
componentSpecPath,
|
||||||
`RouterTestingModule`
|
`RouterTestingModule`
|
||||||
)
|
)
|
||||||
=======
|
|
||||||
componentSpecSourceFile, componentSpecPath, 'RouterTestingModule',
|
|
||||||
'@angular/router/testing'),
|
|
||||||
...addImportToTestBed(
|
|
||||||
componentSpecSourceFile, componentSpecPath, `RouterTestingModule`)
|
|
||||||
>>>>>>> Rebasing issues resolved
|
|
||||||
]);
|
]);
|
||||||
return host;
|
return host;
|
||||||
};
|
};
|
||||||
@ -280,14 +250,9 @@ export default function(schema: Schema): Rule {
|
|||||||
|
|
||||||
function normalizeOptions(options: Schema): NormalizedSchema {
|
function normalizeOptions(options: Schema): NormalizedSchema {
|
||||||
const name = toFileName(options.name);
|
const name = toFileName(options.name);
|
||||||
<<<<<<< HEAD
|
|
||||||
const fullName = options.directory
|
const fullName = options.directory
|
||||||
? `${toFileName(options.directory)}/${name}`
|
? `${toFileName(options.directory)}/${name}`
|
||||||
: name;
|
: name;
|
||||||
=======
|
|
||||||
const fullName =
|
|
||||||
options.directory ? `${toFileName(options.directory)}/${name}` : name;
|
|
||||||
>>>>>>> Rebasing issues resolved
|
|
||||||
const fullPath = `apps/${fullName}/src`;
|
const fullPath = `apps/${fullName}/src`;
|
||||||
return {...options, sourceDir: 'src', name, fullName, fullPath};
|
return {...options, sourceDir: 'src', name, fullName, fullPath};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,8 @@ import {
|
|||||||
Rule,
|
Rule,
|
||||||
template,
|
template,
|
||||||
Tree,
|
Tree,
|
||||||
url
|
url,
|
||||||
|
Source
|
||||||
} from '@angular-devkit/schematics';
|
} from '@angular-devkit/schematics';
|
||||||
import { Schema } from './schema';
|
import { Schema } from './schema';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
./scripts/link.sh
|
|
||||||
rm -rf tmp
|
|
||||||
jest --maxWorkers=1 ./build/e2e/bazel
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
rm -rf build/
|
|
||||||
|
|
||||||
tsc
|
|
||||||
|
|
||||||
rsync -a --exclude=*.ts packages/ build/packages
|
|
||||||
|
|
||||||
rm -rf node_modules/@nrwl
|
|
||||||
cp -r build/packages node_modules/@nrwl
|
|
||||||
@ -4,3 +4,12 @@
|
|||||||
|
|
||||||
rm -rf node_modules/@nrwl
|
rm -rf node_modules/@nrwl
|
||||||
cp -r build/packages node_modules/@nrwl
|
cp -r build/packages node_modules/@nrwl
|
||||||
|
|
||||||
|
rm -rf test/
|
||||||
|
|
||||||
|
tsc -p tsconfig.spec.json
|
||||||
|
|
||||||
|
rsync -a --exclude=*.ts packages/ test/packages
|
||||||
|
|
||||||
|
rm -rf node_modules/@nrwl
|
||||||
|
cp -r build/packages node_modules/@nrwl
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
jest --maxWorkers=1 ./build/packages/$1.spec.js
|
jest --maxWorkers=1 ./test/packages/$1.spec.js
|
||||||
else
|
else
|
||||||
jest --maxWorkers=1 ./build/packages/{schematics,bazel}
|
jest --maxWorkers=1 ./test/packages/{schematics,bazel}
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -8,15 +8,25 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"lib": ["es2017"],
|
"lib": [
|
||||||
|
"es2017"
|
||||||
|
],
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@nrwl/schematics": ["./packages/schematics"],
|
"@nrwl/schematics": [
|
||||||
"@nrwl/schematics/*": ["./packages/schematics/*"]
|
"./packages/schematics"
|
||||||
|
],
|
||||||
|
"@nrwl/schematics/*": [
|
||||||
|
"./packages/schematics/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"exclude": ["tmp", "node_modules"],
|
"exclude": [
|
||||||
|
"tmp",
|
||||||
|
"node_modules",
|
||||||
|
"packages/schematics/src/*/files/**/*"
|
||||||
|
],
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"strictMetadataEmit": true,
|
"strictMetadataEmit": true,
|
||||||
"skipTemplateCodegen": true,
|
"skipTemplateCodegen": true,
|
||||||
|
|||||||
21
tsconfig.spec.json
Normal file
21
tsconfig.spec.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"outDir": "test",
|
||||||
|
"typeRoots": ["node_modules/@types"],
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"lib": ["es2017"],
|
||||||
|
"declaration": true,
|
||||||
|
"baseUrl": "."
|
||||||
|
},
|
||||||
|
"exclude": ["tmp", "node_modules"],
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"strictMetadataEmit": true,
|
||||||
|
"skipTemplateCodegen": true,
|
||||||
|
"annotationsAs": "decorators"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user