Skip to content

Commit

Permalink
Revert "Revert "feat(core): update to next version of angular deps"" (#…
Browse files Browse the repository at this point in the history
…2264)

This reverts commit f816fc4.
  • Loading branch information
FrozenPandaz committed Jan 31, 2020
1 parent 1c40789 commit b6e6b3f
Show file tree
Hide file tree
Showing 61 changed files with 1,723 additions and 1,832 deletions.
4 changes: 2 additions & 2 deletions docs/angular/api-angular/schematics/application.md
Expand Up @@ -52,11 +52,11 @@ Test runner to use for end to end (e2e) tests

### enableIvy

Default: `false`
Default: `true`

Type: `boolean`

**EXPERIMENTAL** True to create a new app that uses the Ivy rendering engine.
Create a new app that uses the Ivy rendering engine.

### inlineStyle

Expand Down
4 changes: 2 additions & 2 deletions docs/react/api-angular/schematics/application.md
Expand Up @@ -52,11 +52,11 @@ Test runner to use for end to end (e2e) tests

### enableIvy

Default: `false`
Default: `true`

Type: `boolean`

**EXPERIMENTAL** True to create a new app that uses the Ivy rendering engine.
Create a new app that uses the Ivy rendering engine.

### inlineStyle

Expand Down
4 changes: 2 additions & 2 deletions docs/web/api-angular/schematics/application.md
Expand Up @@ -52,11 +52,11 @@ Test runner to use for end to end (e2e) tests

### enableIvy

Default: `false`
Default: `true`

Type: `boolean`

**EXPERIMENTAL** True to create a new app that uses the Ivy rendering engine.
Create a new app that uses the Ivy rendering engine.

### inlineStyle

Expand Down
4 changes: 2 additions & 2 deletions e2e/new.test.ts
Expand Up @@ -63,13 +63,13 @@ forEachCli(() => {
console.log(
`The current es2015 bundle size is ${es2015BundleSize / 1000} KB`
);
expect(es2015BundleSize).toBeLessThanOrEqual(160000);
expect(es2015BundleSize).toBeLessThanOrEqual(125000);

const es5BundleSize = getSize(
tmpProjPath(`dist/apps/my-dir/${myapp}/main-es5.js`)
);
console.log(`The current es5 bundle size is ${es5BundleSize / 1000} KB`);
expect(es5BundleSize).toBeLessThanOrEqual(175000);
expect(es5BundleSize).toBeLessThanOrEqual(150000);

// running tests for the app
expectTestsPass(await runCLIAsync(`test my-dir-${myapp} --no-watch`));
Expand Down
6 changes: 4 additions & 2 deletions e2e/next.test.ts
@@ -1,5 +1,5 @@
import { capitalize } from '@nrwl/workspace/src/utils/strings';
import { fork } from 'child_process';
import { stringUtils } from '@nrwl/workspace';
import * as http from 'http';
import {
checkFilesExist,
Expand Down Expand Up @@ -63,7 +63,9 @@ module.exports = {
`
import dynamic from 'next/dynamic';
const DynamicComponent = dynamic(
() => import('@proj/${libName}').then(d => d.${capitalize(libName)})
() => import('@proj/${libName}').then(d => d.${stringUtils.capitalize(
libName
)})
);
` + readFile(mainPath)
);
Expand Down
3 changes: 1 addition & 2 deletions e2e/ng-add.test.ts
Expand Up @@ -132,7 +132,7 @@ forEachCli('angular', () => {
expect(updatedAngularCLIJson.projects.proj.architect.build).toEqual({
builder: '@angular-devkit/build-angular:browser',
options: {
aot: false,
aot: true,
outputPath: 'dist/apps/proj',
index: 'apps/proj/src/index.html',
main: 'apps/proj/src/main.ts',
Expand Down Expand Up @@ -167,7 +167,6 @@ forEachCli('angular', () => {
sourceMap: false,
extractCss: true,
namedChunks: false,
aot: true,
extractLicenses: true,
vendorChunk: false,
buildOptimizer: true
Expand Down
7 changes: 4 additions & 3 deletions e2e/node.test.ts
Expand Up @@ -129,7 +129,7 @@ forEachCli(currentCLIName => {
done();
});
});
}, 60000);
}, 120000);

it('should have correct ts options for nest application', async () => {
if (currentCLIName === 'angular') {
Expand Down Expand Up @@ -158,7 +158,8 @@ forEachCli(currentCLIName => {
); // respects "extends" inside tsconfigs

expect(config.options.emitDecoratorMetadata).toEqual(true); // required by nest to function properly
}, 60000);
cleanup();
}, 120000);

it('should be able to generate a nest application', async done => {
ensureProject();
Expand Down Expand Up @@ -222,7 +223,7 @@ forEachCli(currentCLIName => {
done();
});
});
}, 60000);
}, 120000);

it('should be able to generate an empty application', async () => {
ensureProject();
Expand Down
2 changes: 1 addition & 1 deletion e2e/report.test.ts
@@ -1,4 +1,4 @@
import { packagesWeCareAbout } from '@nrwl/workspace/src/command-line/report';
import { packagesWeCareAbout } from '../packages/workspace/src/command-line/report';
import { ensureProject, forEachCli, runCommand } from './utils';

const testTimeout = 120000;
Expand Down
14 changes: 14 additions & 0 deletions e2e/utils.ts
Expand Up @@ -84,6 +84,17 @@ export function runYarnInstall(silent: boolean = true) {
return install ? install.toString() : '';
}

export function runNgcc(silent: boolean = true) {
const install = execSync(
'node ./node_modules/@angular/compiler-cli/ngcc/main-ngcc.js',
{
cwd: tmpProjPath(),
...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {})
}
);
return install ? install.toString() : '';
}

/**
* Run the `new` command for the currently selected CLI
*
Expand Down Expand Up @@ -150,6 +161,8 @@ function default_1(factoryOptions = {}) {
exports.default = default_1;`
);

runNgcc();

execSync(`mv ${tmpProjPath()} ${tmpBackupProjPath()}`);
}
execSync(`cp -a ${tmpBackupProjPath()} ${tmpProjPath()}`);
Expand Down Expand Up @@ -241,6 +254,7 @@ export function copyMissingPackages(): void {
'document-register-element',

'@angular/forms',
'@storybook',

'fork-ts-checker-webpack-plugin',

Expand Down
66 changes: 33 additions & 33 deletions package.json
Expand Up @@ -26,32 +26,32 @@
"documentation": "./scripts/documentation/documentation.sh && ./scripts/documentation/check-documentation.sh"
},
"devDependencies": {
"@angular-devkit/architect": "0.803.23",
"@angular-devkit/build-angular": "0.803.23",
"@angular-devkit/build-ng-packagr": "0.803.23",
"@angular-devkit/build-optimizer": "0.803.23",
"@angular-devkit/build-webpack": "0.803.23",
"@angular-devkit/core": "8.3.23",
"@angular-devkit/schematics": "8.3.23",
"@angular-devkit/architect": "0.900.0-rc.12",
"@angular-devkit/build-angular": "0.900.0-rc.12",
"@angular-devkit/build-ng-packagr": "0.900.0-rc.12",
"@angular-devkit/build-optimizer": "0.900.0-rc.12",
"@angular-devkit/build-webpack": "0.900.0-rc.12",
"@angular-devkit/core": "9.0.0-rc.12",
"@angular-devkit/schematics": "9.0.0-rc.12",
"@angular-eslint/builder": "0.0.1-alpha.18",
"@angular/cli": "8.3.23",
"@angular/common": "^8.2.12",
"@angular/compiler": "^8.2.12",
"@angular/compiler-cli": "^8.2.12",
"@angular/core": "^8.2.12",
"@angular/forms": "^8.2.12",
"@angular/platform-browser": "^8.2.12",
"@angular/platform-browser-dynamic": "^8.2.12",
"@angular/router": "^8.2.12",
"@angular/service-worker": "^8.2.12",
"@angular/upgrade": "^8.2.12",
"@babel/core": "7.8.3",
"@babel/preset-env": "7.8.3",
"@babel/preset-react": "7.8.3",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-decorators": "7.8.3",
"@babel/plugin-transform-regenerator": "7.8.3",
"@babel/preset-typescript": "7.8.3",
"@angular/cli": "9.0.0-rc.12",
"@angular/common": "9.0.0-rc.12",
"@angular/compiler": "9.0.0-rc.12",
"@angular/compiler-cli": "9.0.0-rc.12",
"@angular/core": "9.0.0-rc.12",
"@angular/forms": "9.0.0-rc.12",
"@angular/platform-browser": "9.0.0-rc.12",
"@angular/platform-browser-dynamic": "9.0.0-rc.12",
"@angular/router": "9.0.0-rc.12",
"@angular/service-worker": "9.0.0-rc.12",
"@angular/upgrade": "9.0.0-rc.12",
"@babel/core": "7.5.5",
"@babel/plugin-proposal-class-properties": "7.5.5",
"@babel/plugin-proposal-decorators": "7.4.4",
"@babel/plugin-transform-regenerator": "7.4.5",
"@babel/preset-env": "7.5.5",
"@babel/preset-react": "7.0.0",
"@babel/preset-typescript": "7.3.3",
"@bazel/bazel": "^1.2.0",
"@bazel/ibazel": "^0.10.3",
"@cypress/webpack-preprocessor": "^4.1.0",
Expand All @@ -66,12 +66,12 @@
"@ngrx/schematics": "8.5.0",
"@ngrx/store": "8.5.0",
"@ngrx/store-devtools": "8.5.0",
"@ngtools/webpack": "8.3.23",
"@schematics/angular": "8.3.23",
"@storybook/addon-knobs": "^5.2.5",
"@storybook/angular": "^5.2.5",
"@storybook/core": "^5.2.5",
"@storybook/react": "^5.2.5",
"@ngtools/webpack": "9.0.0-rc.12",
"@schematics/angular": "9.0.0-rc.12",
"@storybook/addon-knobs": "5.3.9",
"@storybook/angular": "5.3.9",
"@storybook/core": "5.3.9",
"@storybook/react": "5.3.9",
"@svgr/webpack": "^4.3.3",
"@testing-library/react": "9.4.0",
"@types/express": "4.17.0",
Expand Down Expand Up @@ -191,7 +191,7 @@
"rollup-plugin-peer-deps-external": "2.2.0",
"rollup-plugin-postcss": "2.0.3",
"rollup-plugin-typescript2": "0.24.3",
"rxjs": "~6.4.0",
"rxjs": "6.5.3",
"sass": "1.22.9",
"sass-loader": "7.2.0",
"semver": "6.3.0",
Expand All @@ -216,7 +216,7 @@
"tsickle": "^0.37.0",
"tslib": "^1.9.3",
"tslint": "5.11.0",
"typescript": "~3.5.3",
"typescript": "~3.7.4",
"url-loader": "^2.2.0",
"webpack": "4.41.2",
"webpack-dev-middleware": "3.7.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/angular/migrations.json
@@ -1,5 +1,11 @@
{
"schematics": {
"add-postinstall": {
"version": "0.0.0",
"description": "Adds postinstall to run ngcc",
"factory": "./src/migrations/update-9-0-0/add-postinstall",
"hidden": true
},
"upgrade-ngrx-8-0": {
"version": "8.3.0-beta.1",
"description": "Upgrades NgRx dependencies to version 8, and runs migrations for breaking changes",
Expand All @@ -14,6 +20,11 @@
"version": "8.12.0-beta.1",
"description": "Changes Angular library builder to @nrwl/angular:package",
"factory": "./src/migrations/update-8-12-0/change-angular-lib-builder"
},
"update-9-0-0": {
"version": "9.0.0-beta.1",
"description": "Upgrades Angular and Angular CLI to 9.0.0",
"factory": "./src/migrations/update-9-0-0/update-9-0-0"
}
}
}
4 changes: 2 additions & 2 deletions packages/angular/package.json
Expand Up @@ -38,8 +38,8 @@
"dependencies": {
"@nrwl/cypress": "*",
"@nrwl/jest": "*",
"@angular-devkit/schematics": "8.3.23",
"@schematics/angular": "8.3.23",
"@angular-devkit/schematics": "9.0.0-rc.12",
"@schematics/angular": "9.0.0-rc.12",
"jasmine-marbles": "~0.6.0"
}
}
23 changes: 5 additions & 18 deletions packages/angular/src/migrations/update-8-5-0/update-8-5-0.spec.ts
Expand Up @@ -5,19 +5,14 @@ import {
UnitTestTree
} from '@angular-devkit/schematics/testing';
import { serializeJson } from '@nrwl/workspace';
import { join } from 'path';
import { runMigration } from '../../utils/testing';

describe('Update 8.5.0', () => {
let tree: Tree;
let schematicRunner: SchematicTestRunner;

beforeEach(() => {
tree = new UnitTestTree(Tree.empty());

schematicRunner = new SchematicTestRunner(
'@nrwl/workspace',
join(__dirname, '../../../migrations.json')
);
});

describe('Update Angular CLI', () => {
Expand All @@ -31,9 +26,7 @@ describe('Update 8.5.0', () => {
})
);

const result = await schematicRunner
.runSchematicAsync('upgrade-cli-8-3', {}, tree)
.toPromise();
const result = await runMigration('upgrade-cli-8-3', {}, tree);

expect(
readJsonInTree(result, 'package.json').devDependencies['@angular/cli']
Expand All @@ -50,9 +43,7 @@ describe('Update 8.5.0', () => {
})
);

const result = await schematicRunner
.runSchematicAsync('upgrade-cli-8-3', {}, tree)
.toPromise();
const result = await runMigration('upgrade-cli-8-3', {}, tree);

expect(
readJsonInTree(result, 'package.json').devDependencies['@angular/cli']
Expand All @@ -69,9 +60,7 @@ describe('Update 8.5.0', () => {
})
);

const result = await schematicRunner
.runSchematicAsync('upgrade-cli-8-3', {}, tree)
.toPromise();
const result = await runMigration('upgrade-cli-8-3', {}, tree);

expect(
readJsonInTree(result, 'package.json').devDependencies['@angular/cli']
Expand All @@ -91,9 +80,7 @@ describe('Update 8.5.0', () => {
);

try {
await schematicRunner
.runSchematicAsync('upgrade-cli-8-3', {}, tree)
.toPromise();
await runMigration('upgrade-cli-8-3', {}, tree);
} catch (e) {
error = e;
}
Expand Down
@@ -0,0 +1,37 @@
import { Tree } from '@angular-devkit/schematics';
import { readJsonInTree, updateJsonInTree } from '@nrwl/workspace';
import { callRule, runMigration } from '../../utils/testing';

describe('add-postinstall', () => {
let tree: Tree;
beforeEach(async () => {
tree = Tree.empty();
tree = await callRule(updateJsonInTree('package.json', () => ({})), tree);
});
it('should add a postinstall for "ngcc"', async () => {
const result = await runMigration('add-postinstall', {}, tree);

const packageJson = readJsonInTree(result, 'package.json');

expect(packageJson.scripts.postinstall).toEqual(
'ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points'
);
});

it('should not add a postinstall if one exists', async () => {
tree = await callRule(
updateJsonInTree('package.json', json => {
json.scripts = {
postinstall: './postinstall.sh'
};
return json;
}),
tree
);
const result = await runMigration('add-postinstall', {}, tree);

const packageJson = readJsonInTree(result, 'package.json');

expect(packageJson.scripts.postinstall).toEqual('./postinstall.sh');
});
});

0 comments on commit b6e6b3f

Please sign in to comment.