Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(angular): support angular v14.0.0-rc.2 #8883

Merged
merged 1 commit into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
57 changes: 20 additions & 37 deletions docs/generated/packages/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@
"default": false,
"alias": "t"
},
"standalone": {
"description": "Whether the generated component is standalone.",
"type": "boolean",
"default": false
},
"viewEncapsulation": {
"description": "The view encapsulation strategy to use in the new component.",
"enum": ["Emulated", "None", "ShadowDom"],
Expand Down Expand Up @@ -2304,7 +2309,8 @@
"properties": {
"input": {
"type": "string",
"description": "The file to include."
"description": "The file to include.",
"pattern": "\\.[cm]?jsx?$"
},
"bundleName": {
"type": "string",
Expand All @@ -2320,7 +2326,11 @@
"additionalProperties": false,
"required": ["input"]
},
{ "type": "string", "description": "The file to include." }
{
"type": "string",
"description": "The file to include.",
"pattern": "\\.[cm]?jsx?$"
}
]
}
},
Expand All @@ -2335,7 +2345,8 @@
"properties": {
"input": {
"type": "string",
"description": "The file to include."
"description": "The file to include.",
"pattern": "\\.(?:css|scss|sass|less|styl)$"
},
"bundleName": {
"type": "string",
Expand All @@ -2351,7 +2362,11 @@
"additionalProperties": false,
"required": ["input"]
},
{ "type": "string", "description": "The file to include." }
{
"type": "string",
"description": "The file to include.",
"pattern": "\\.(?:css|scss|sass|less|styl)$"
}
]
}
},
Expand Down Expand Up @@ -2606,15 +2621,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 @@ -2829,32 +2838,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
11 changes: 5 additions & 6 deletions e2e/angular-core/src/ng-add.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
updateFile('tsconfig.json', JSON.stringify(tsConfig, null, 2));

// add an extra script file
updateFile('src/scripts.ts', 'const x = 1;');
updateFile('src/scripts.js', 'const x = 1;');

// update angular.json
const angularJson = readJson('angular.json');
angularJson.projects[project].architect.build.options.scripts =
angularJson.projects[project].architect.test.options.scripts = [
'src/scripts.ts',
'src/scripts.js',
];
angularJson.projects[project].architect.test.options.styles = [
'src/styles.css',
Expand Down Expand Up @@ -144,7 +144,6 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
defaultCollection: '@nrwl/angular',
packageManager: packageManager,
},
defaultProject: project,
implicitDependencies: {
'.eslintrc.json': '*',
'package.json': {
Expand Down Expand Up @@ -196,7 +195,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
`apps/${project}/src/assets`,
],
styles: [`apps/${project}/src/styles.css`],
scripts: [`apps/${project}/src/scripts.ts`],
scripts: [`apps/${project}/src/scripts.js`],
},
configurations: {
production: {
Expand Down Expand Up @@ -251,7 +250,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
`apps/${project}/src/assets`,
],
styles: [`apps/${project}/src/styles.css`],
scripts: [`apps/${project}/src/scripts.ts`],
scripts: [`apps/${project}/src/scripts.js`],
},
});
expect(projectConfig.targets.e2e).toBeUndefined();
Expand All @@ -271,7 +270,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
},
});

runCLI('build --configuration production --outputHashing none');
runCLI(`build ${project} --configuration production --outputHashing none`);
checkFilesExist(`dist/apps/${project}/main.js`);
});

Expand Down
39 changes: 2 additions & 37 deletions e2e/angular-core/src/projects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,45 +193,10 @@ describe('Angular Projects', () => {
runCLI(
`generate @nrwl/angular:library ${childLib} --publishable=true --importPath=@${proj}/${childLib} --no-interactive`
);

// create secondary entrypoint
updateFile(
`libs/${childLib}/sub/package.json`,
`
{
"ngPackage": {}
}
`
);
updateFile(
`libs/${childLib}/sub/src/lib/sub.module.ts`,
`
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
@NgModule({ imports: [CommonModule] })
export class SubModule {}
`
);

updateFile(
`libs/${childLib}/sub/src/public_api.ts`,
`export * from './lib/sub.module';`
);

updateFile(
`libs/${childLib}/sub/src/index.ts`,
`export * from './public_api';`
runCLI(
`generate @nrwl/angular:secondary-entry-point --name=sub --library=${childLib} --no-interactive`
);

updateFile(`tsconfig.base.json`, (s) => {
return s.replace(
`"@${proj}/${childLib}": ["libs/${childLib}/src/index.ts"],`,
`"@${proj}/${childLib}": ["libs/${childLib}/src/index.ts"],
"@${proj}/${childLib}/sub": ["libs/${childLib}/sub/src/index.ts"],
`
);
});

const moduleContent = `
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
Expand Down
6 changes: 1 addition & 5 deletions e2e/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,10 @@ export function runNgNew(
): string {
projName = projectName;

// Use the latest version of the currently supported @angular/cli major version
// to cover existing usage out there while avoiding the tests to fail when a new
// major comes out and is still not supported
const ngCliMajorVersion = coerce(angularCliVersion).major;
const npmMajorVersion = getNpmMajorVersion();
const command = `npx ${
+npmMajorVersion >= 7 ? '--yes' : ''
} @angular/cli@${ngCliMajorVersion} new ${projectName} --package-manager=${packageManager}`;
} @angular/cli@${angularCliVersion} new ${projectName} --package-manager=${packageManager}`;

return execSync(command, {
cwd: e2eCwd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ describe('Move Angular Project', () => {
expect(moveOutput).toContain(
`CREATE apps/${newPath}/src/environments/environment.ts`
);
expect(moveOutput).toContain(`UPDATE nx.json`);
expect(moveOutput).toContain(`UPDATE workspace.json`);
});

Expand Down
65 changes: 32 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@
"prepare": "is-ci || husky install"
},
"devDependencies": {
"@angular-devkit/architect": "~0.1303.0",
"@angular-devkit/build-angular": "~13.3.0",
"@angular-devkit/core": "~13.3.0",
"@angular-devkit/schematics": "~13.3.0",
"@angular-eslint/eslint-plugin": "~13.1.0",
"@angular-eslint/eslint-plugin-template": "~13.1.0",
"@angular-eslint/template-parser": "~13.1.0",
"@angular/cli": "~13.3.0",
"@angular/common": "~13.3.0",
"@angular/compiler": "~13.3.0",
"@angular/compiler-cli": "~13.3.0",
"@angular/core": "~13.3.0",
"@angular/forms": "~13.3.0",
"@angular/platform-browser": "~13.3.0",
"@angular/platform-browser-dynamic": "~13.3.0",
"@angular/router": "~13.3.0",
"@angular/service-worker": "~13.3.0",
"@angular/upgrade": "~13.3.0",
"@angular-devkit/architect": "~0.1400.0-rc.2",
"@angular-devkit/build-angular": "~14.0.0-rc.2",
"@angular-devkit/core": "~14.0.0-rc.2",
"@angular-devkit/schematics": "~14.0.0-rc.2",
"@angular-eslint/eslint-plugin": "~13.2.1",
"@angular-eslint/eslint-plugin-template": "~13.2.1",
"@angular-eslint/template-parser": "~13.2.1",
"@angular/cli": "~14.0.0-rc.2",
"@angular/common": "~14.0.0-rc.2",
"@angular/compiler": "~14.0.0-rc.2",
"@angular/compiler-cli": "~14.0.0-rc.2",
"@angular/core": "~14.0.0-rc.2",
"@angular/forms": "~14.0.0-rc.2",
"@angular/platform-browser": "~14.0.0-rc.2",
"@angular/platform-browser-dynamic": "~14.0.0-rc.2",
"@angular/router": "~14.0.0-rc.2",
"@angular/service-worker": "~14.0.0-rc.2",
"@angular/upgrade": "~14.0.0-rc.2",
"@babel/helper-create-regexp-features-plugin": "^7.14.5",
"@cypress/webpack-preprocessor": "^5.9.1",
"@nestjs/common": "^8.0.0",
Expand All @@ -51,13 +51,13 @@
"@nestjs/schematics": "^8.0.0",
"@nestjs/swagger": "^5.0.9",
"@nestjs/testing": "^8.0.0",
"@ngrx/component-store": "~13.0.0",
"@ngrx/effects": "~13.0.0",
"@ngrx/entity": "~13.0.0",
"@ngrx/router-store": "~13.0.0",
"@ngrx/schematics": "~13.0.0",
"@ngrx/store": "~13.0.0",
"@ngrx/store-devtools": "~13.0.0",
"@ngrx/component-store": "~13.2.0",
"@ngrx/effects": "~13.2.0",
"@ngrx/entity": "~13.2.0",
"@ngrx/router-store": "~13.2.0",
"@ngrx/schematics": "~13.2.0",
"@ngrx/store": "~13.2.0",
"@ngrx/store-devtools": "~13.2.0",
"@nrwl/eslint-plugin-nx": "14.1.9-beta.1",
"@nrwl/jest": "14.1.9-beta.1",
"@nrwl/next": "14.1.9-beta.1",
Expand All @@ -74,7 +74,7 @@
"@rollup/plugin-image": "^2.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@schematics/angular": "~13.3.0",
"@schematics/angular": "~14.0.0-rc.2",
"@storybook/addon-essentials": "~6.5.4",
"@storybook/addon-knobs": "~6.3.0",
"@storybook/angular": "~6.5.4",
Expand Down Expand Up @@ -107,9 +107,9 @@
"@types/tar-stream": "^2.2.2",
"@types/tmp": "^0.2.0",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "5.18.0",
"@typescript-eslint/experimental-utils": "5.18.0",
"@typescript-eslint/parser": "5.18.0",
"@typescript-eslint/eslint-plugin": "~5.24.0",
"@typescript-eslint/experimental-utils": "~5.24.0",
"@typescript-eslint/parser": "~5.24.0",
"@xstate/immer": "^0.2.0",
"@xstate/inspect": "^0.5.1",
"@xstate/react": "^1.6.3",
Expand All @@ -135,7 +135,7 @@
"dotenv": "~10.0.0",
"ejs": "^3.1.7",
"enhanced-resolve": "^5.8.3",
"eslint": "8.12.0",
"eslint": "8.15.0",
"eslint-config-next": "12.1.5",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-cypress": "^2.10.3",
Expand Down Expand Up @@ -164,7 +164,7 @@
"jasmine-spec-reporter": "~4.2.1",
"jest": "27.5.1",
"jest-circus": "27.2.3",
"jest-preset-angular": "11.1.1",
"jest-preset-angular": "~11.1.2",
"jsonc-eslint-parser": "^2.1.0",
"jsonc-parser": "3.0.0",
"karma": "~4.0.0",
Expand All @@ -185,7 +185,7 @@
"mini-css-extract-plugin": "~2.4.7",
"minimatch": "3.0.5",
"next-sitemap": "^1.6.108",
"ng-packagr": "~13.3.0",
"ng-packagr": "~14.0.0-rc.0",
"ngrx-store-freeze": "0.2.4",
"node-fetch": "^2.6.7",
"nx": "14.1.9-beta.1",
Expand Down Expand Up @@ -301,7 +301,6 @@
"weak-napi": "^2.0.2"
},
"resolutions": {
"ng-packagr/rxjs": "6.6.7",
"**/xmlhttprequest-ssl": "~1.6.2",
"minimist": "^1.2.6"
}
Expand Down