Skip to content

Commit

Permalink
feat(angular): add initial angular v14 prerelease version support
Browse files Browse the repository at this point in the history
  • Loading branch information
leosvelperez committed Feb 7, 2022
1 parent b9f6c73 commit aac46a2
Show file tree
Hide file tree
Showing 10 changed files with 776 additions and 504 deletions.
12 changes: 1 addition & 11 deletions docs/generated/api-angular/executors/webpack-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Default: `true`

Type: `boolean`

Enables '@angular-devkit/build-optimizer' optimizations when using the 'aot' option.
Enables advanced build optimizations when using the 'aot' option.

### commonChunk

Expand Down Expand Up @@ -239,16 +239,6 @@ Type: `boolean`

Generates a service worker config for production builds.

### ~~showCircularDependencies~~

Default: `false`

Type: `boolean`

**Deprecated:** The recommended method to detect circular dependencies in project code is to use either a lint rule or other external tooling.

Show circular dependency warnings on builds.

### sourceMap

Default: `false`
Expand Down
37 changes: 18 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,25 @@
"prepare": "is-ci || husky install"
},
"devDependencies": {
"@angular-devkit/architect": "~0.1302.0",
"@angular-devkit/build-angular": "~13.2.0",
"@angular-devkit/build-optimizer": "~0.1302.0",
"@angular-devkit/build-webpack": "~0.1302.0",
"@angular-devkit/core": "~13.2.0",
"@angular-devkit/schematics": "~13.2.0",
"@angular-devkit/architect": "~0.1400.0-next.0",
"@angular-devkit/build-angular": "~14.0.0-next.0",
"@angular-devkit/build-webpack": "~0.1400.0-next.0",
"@angular-devkit/core": "~14.0.0-next.0",
"@angular-devkit/schematics": "~14.0.0-next.0",
"@angular-eslint/eslint-plugin": "~13.0.1",
"@angular-eslint/eslint-plugin-template": "~13.0.1",
"@angular-eslint/template-parser": "~13.0.1",
"@angular/cli": "~13.2.0",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/compiler-cli": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/forms": "~13.2.0",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"@angular/service-worker": "~13.2.0",
"@angular/upgrade": "~13.2.0",
"@angular/cli": "~14.0.0-next.0",
"@angular/common": "~14.0.0-next.1",
"@angular/compiler": "~14.0.0-next.1",
"@angular/compiler-cli": "~14.0.0-next.1",
"@angular/core": "~14.0.0-next.1",
"@angular/forms": "~14.0.0-next.1",
"@angular/platform-browser": "~14.0.0-next.1",
"@angular/platform-browser-dynamic": "~14.0.0-next.1",
"@angular/router": "~14.0.0-next.1",
"@angular/service-worker": "~14.0.0-next.1",
"@angular/upgrade": "~14.0.0-next.1",
"@babel/helper-create-regexp-features-plugin": "^7.14.5",
"@cypress/webpack-preprocessor": "^5.9.1",
"@nestjs/common": "^8.0.0",
Expand Down Expand Up @@ -83,7 +82,7 @@
"@rollup/plugin-image": "^2.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@schematics/angular": "~13.2.0",
"@schematics/angular": "~14.0.0-next.0",
"@storybook/addon-essentials": "~6.4.12",
"@storybook/addon-knobs": "~6.3.0",
"@storybook/angular": "~6.4.12",
Expand Down Expand Up @@ -189,7 +188,7 @@
"minimatch": "3.0.4",
"next": "12.0.7",
"next-sitemap": "^1.6.108",
"ng-packagr": "~13.2.0",
"ng-packagr": "~14.0.0-next.1",
"ngrx-store-freeze": "0.2.4",
"node-fetch": "^2.6.7",
"open": "^8.4.0",
Expand Down
85 changes: 85 additions & 0 deletions packages/angular/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,91 @@
"alwaysAddToPackageJson": false
}
}
},
"14.0.0": {
"version": "14.0.0-beta.0",
"packages": {
"@angular/cli": {
"version": "~14.0.0-next.0",
"alwaysAddToPackageJson": false
},
"@angular-devkit/build-angular": {
"version": "~14.0.0-next.0",
"alwaysAddToPackageJson": false
},
"@angular/core": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": true
},
"@angular/common": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/forms": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/elements": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/compiler": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/compiler-cli": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/localize": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/platform-browser": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/platform-browser-dynamic": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/platform-server": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/router": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/upgrade": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/language-service": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/animations": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/service-worker": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/material": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"@angular/cdk": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
},
"ng-packagr": {
"version": "~14.0.0-next.1",
"alwaysAddToPackageJson": false
}
}
}
}
}
4 changes: 2 additions & 2 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"migrations": "./migrations.json"
},
"dependencies": {
"@angular-devkit/schematics": "~13.2.0",
"@angular-devkit/schematics": "~14.0.0-next.0",
"@nrwl/cypress": "*",
"@nrwl/devkit": "*",
"@nrwl/jest": "*",
"@nrwl/linter": "*",
"@nrwl/storybook": "*",
"@schematics/angular": "~13.2.0",
"@schematics/angular": "~14.0.0-next.0",
"@phenomnomnominal/tsquery": "4.1.1",
"ignore": "^5.0.4",
"jasmine-marbles": "~0.8.4",
Expand Down
97 changes: 59 additions & 38 deletions packages/angular/src/builders/webpack-browser/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,71 @@
"type": "array",
"default": [],
"items": {
"$ref": "#/definitions/extraEntryPoint"
"oneOf": [
{
"type": "object",
"properties": {
"input": {
"type": "string",
"description": "The file to include.",
"pattern": "\\.[cm]?jsx?$"
},
"bundleName": {
"type": "string",
"pattern": "^[\\w\\-.]*$",
"description": "The bundle name for this extra entry point."
},
"inject": {
"type": "boolean",
"description": "If the bundle will be referenced in the HTML file.",
"default": true
}
},
"additionalProperties": false,
"required": ["input"]
},
{
"type": "string",
"description": "The file to include.",
"pattern": "\\.[cm]?jsx?$"
}
]
}
},
"styles": {
"description": "Global styles to be included in the build.",
"type": "array",
"default": [],
"items": {
"$ref": "#/definitions/extraEntryPoint"
"oneOf": [
{
"type": "object",
"properties": {
"input": {
"type": "string",
"description": "The file to include.",
"pattern": "\\.(?:css|scss|sass|less|styl)$"
},
"bundleName": {
"type": "string",
"pattern": "^[\\w\\-.]*$",
"description": "The bundle name for this extra entry point."
},
"inject": {
"type": "boolean",
"description": "If the bundle will be referenced in the HTML file.",
"default": true
}
},
"additionalProperties": false,
"required": ["input"]
},
{
"type": "string",
"description": "The file to include.",
"pattern": "\\.(?:css|scss|sass|less|styl)$"
}
]
}
},
"inlineStyleLanguage": {
Expand Down Expand Up @@ -273,15 +329,9 @@
"description": "Extract all licenses in a separate file.",
"default": true
},
"showCircularDependencies": {
"type": "boolean",
"description": "Show circular dependency warnings on builds.",
"default": false,
"x-deprecated": "The recommended method to detect circular dependencies in project code is to use either a lint rule or other external tooling."
},
"buildOptimizer": {
"type": "boolean",
"description": "Enables '@angular-devkit/build-optimizer' optimizations when using the 'aot' option.",
"description": "Enables advanced build optimizations when using the 'aot' option.",
"default": true
},
"namedChunks": {
Expand Down Expand Up @@ -448,35 +498,6 @@
}
]
},
"extraEntryPoint": {
"oneOf": [
{
"type": "object",
"properties": {
"input": {
"type": "string",
"description": "The file to include."
},
"bundleName": {
"type": "string",
"pattern": "^[\\w\\-.]*$",
"description": "The bundle name for this extra entry point."
},
"inject": {
"type": "boolean",
"description": "If the bundle will be referenced in the HTML file.",
"default": true
}
},
"additionalProperties": false,
"required": ["input"]
},
{
"type": "string",
"description": "The file to include."
}
]
},
"budget": {
"type": "object",
"properties": {
Expand Down
5 changes: 4 additions & 1 deletion packages/angular/src/generators/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import {
formatFiles,
installPackagesTask,
moveFilesToNewDirectory,
removeDependenciesFromPackageJson,
Tree,
} from '@nrwl/devkit';
import { wrapAngularDevkitSchematic } from '@nrwl/devkit/ngcli-adapter';
import { jestProjectGenerator } from '@nrwl/jest';
import { Linter } from '@nrwl/linter';
import { convertToNxProjectGenerator } from '@nrwl/workspace';
import init from '../../generators/init/init';
import { postcssVersion } from '../../utils/versions';
import { ngPackagrVersion, postcssVersion } from '../../utils/versions';
import addLintingGenerator from '../add-linting/add-linting';
import karmaProjectGenerator from '../karma-project/karma-project';
import setupTailwindGenerator from '../setup-tailwind/setup-tailwind';
Expand Down Expand Up @@ -80,10 +81,12 @@ export async function libraryGenerator(host: Tree, schema: Partial<Schema>) {
}

if (options.buildable || options.publishable) {
removeDependenciesFromPackageJson(host, [], ['ng-packagr']);
addDependenciesToPackageJson(
host,
{},
{
'ng-packagr': ngPackagrVersion,
postcss: postcssVersion,
'postcss-import': '^14.0.2',
'postcss-preset-env': '^6.7.0',
Expand Down
5 changes: 3 additions & 2 deletions packages/angular/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const nxVersion = '*';
export const angularVersion = '~13.2.0';
export const angularDevkitVersion = '~13.2.0';
export const angularVersion = '~14.0.0-next.1';
export const angularDevkitVersion = '~14.0.0-next.0';
export const ngPackagrVersion = '~14.0.0-next.1';
export const angularJsVersion = '1.7.9';
export const ngrxVersion = '~13.0.0';
export const rxjsVersion = '~7.4.0';
Expand Down
2 changes: 1 addition & 1 deletion packages/linter/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const nxVersion = '*';

export const tslintVersion = '~6.1.0';
export const tslintToEslintConfigVersion = '^2.4.0';
export const buildAngularVersion = '~13.2.0';
export const buildAngularVersion = '~14.0.0-next.0';

export const typescriptESLintVersion = '~5.10.0';
export const eslintVersion = '~8.7.0';
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const nxVersion = '*';

export const angularCliVersion = '~13.2.0';
export const angularCliVersion = '~14.0.0-next.0';
export const typescriptVersion = '~4.5.2';
export const prettierVersion = '^2.5.1';
export const tslintVersion = '~6.1.0';
Expand Down

0 comments on commit aac46a2

Please sign in to comment.