Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@
},
"devDependencies": {
"@ampproject/remapping": "2.2.0",
"@angular/animations": "15.1.0",
"@angular/animations": "15.2.0-next.0",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#5ce0facd1b6958e90d654fc84d68b9899d566a0d",
"@angular/cdk": "15.1.0-rc.0",
"@angular/common": "15.1.0",
"@angular/compiler": "15.1.0",
"@angular/compiler-cli": "15.1.0",
"@angular/core": "15.1.0",
"@angular/forms": "15.1.0",
"@angular/localize": "15.1.0",
"@angular/common": "15.2.0-next.0",
"@angular/compiler": "15.2.0-next.0",
"@angular/compiler-cli": "15.2.0-next.0",
"@angular/core": "15.2.0-next.0",
"@angular/forms": "15.2.0-next.0",
"@angular/localize": "15.2.0-next.0",
"@angular/material": "15.1.0-rc.0",
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#c883714f8061f200f3aa46dbc6bdd0de41ab94d5",
"@angular/platform-browser": "15.1.0",
"@angular/platform-browser-dynamic": "15.1.0",
"@angular/platform-server": "15.1.0",
"@angular/router": "15.1.0",
"@angular/service-worker": "15.1.0",
"@angular/platform-browser": "15.2.0-next.0",
"@angular/platform-browser-dynamic": "15.2.0-next.0",
"@angular/platform-server": "15.2.0-next.0",
"@angular/router": "15.2.0-next.0",
"@angular/service-worker": "15.2.0-next.0",
"@babel/core": "7.20.12",
"@babel/generator": "7.20.7",
"@babel/helper-annotate-as-pure": "7.18.6",
Expand Down Expand Up @@ -173,7 +173,7 @@
"magic-string": "0.27.0",
"mini-css-extract-plugin": "2.7.2",
"minimatch": "5.1.2",
"ng-packagr": "15.1.0-next.0",
"ng-packagr": "15.1.0",
"node-fetch": "^2.2.0",
"npm": "^8.11.0",
"npm-package-arg": "10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"parse5-html-rewriting-stream": "6.0.1"
},
"peerDependencies": {
"@angular/cli": "^15.0.0-next || ^15.1.0-next"
"@angular/cli": "^15.0.0 || ^15.2.0-next"
},
"peerDependenciesMeta": {
"@angular/cli": {
Expand Down
10 changes: 5 additions & 5 deletions packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@
"esbuild": "0.16.16"
},
"peerDependencies": {
"@angular/compiler-cli": "^15.0.0-next || ^15.1.0-next",
"@angular/localize": "^15.0.0-next || ^15.1.0-next",
"@angular/platform-server": "^15.0.0-next || ^15.1.0-next",
"@angular/service-worker": "^15.0.0-next || ^15.1.0-next",
"@angular/compiler-cli": "^15.0.0 || ^15.2.0-next",
"@angular/localize": "^15.0.0 || ^15.2.0-next",
"@angular/platform-server": "^15.0.0 || ^15.2.0-next",
"@angular/service-worker": "^15.0.0 || ^15.2.0-next",
"karma": "^6.3.0",
"ng-packagr": "^15.0.0-next || ^15.1.0-next",
"ng-packagr": "^15.0.0",
"protractor": "^7.0.0",
"tailwindcss": "^2.0.0 || ^3.0.0",
"typescript": ">=4.8.2 <5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"homepage": "https://github.com/angular/angular-cli/tree/main/packages/ngtools/webpack",
"dependencies": {},
"peerDependencies": {
"@angular/compiler-cli": "^15.0.0-next || ^15.1.0-next",
"@angular/compiler-cli": "^15.0.0 || ^15.2.0-next",
"typescript": ">=4.8.2 <5.0",
"webpack": "^5.54.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/utility/latest-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const latestVersions: Record<string, string> & {
...require('./latest-versions/package.json')['dependencies'],

// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
Angular: '^15.1.0-next.0',
Angular: '^15.2.0-next.0',

// Since @angular-devkit/build-angular and @schematics/angular are always
// published together from the same monorepo, and they are both
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"karma-jasmine-html-reporter": "~2.0.0",
"karma-jasmine": "~5.1.0",
"karma": "~6.4.0",
"ng-packagr": "^15.1.0-next.0",
"ng-packagr": "^15.1.0",
"protractor": "~7.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"ts-node": "~10.9.0",
"typescript": "~4.9.3",
"typescript": "~4.9.4",
"zone.js": "~0.12.0"
}
}
65 changes: 40 additions & 25 deletions tests/legacy-cli/e2e/tests/build/material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,51 @@ import { isPrereleaseCli, updateJsonFile } from '../../utils/project';
const snapshots = require('../../ng-snapshot/package.json');

export default async function () {
let tag = (await isPrereleaseCli()) ? '@next' : '';
await ng('add', `@angular/material${tag}`, '--skip-confirmation');
// `@angular/material` pre-release may not support the current version of `@angular/core` pre-release.
// due to the order of releases FW -> CLI -> Material
// In this case peer dependency ranges may not resolve causing npm 7+ to fail during tests.
const original_NPM_CONFIG_legacy_peer_deps = process.env['NPM_CONFIG_legacy_peer_deps'];
const isPrerelease = await isPrereleaseCli();

const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];
if (isSnapshotBuild) {
await updateJsonFile('package.json', (packageJson) => {
const dependencies = packageJson['dependencies'];
// Angular material adds dependencies on other Angular packages
// Iterate over all of the packages to update them to the snapshot version.
for (const [name, version] of Object.entries(snapshots.dependencies)) {
if (name in dependencies) {
dependencies[name] = version;
let tag = isPrerelease ? '@next' : '';

try {
process.env['NPM_CONFIG_legacy_peer_deps'] = isPrerelease
? 'true'
: original_NPM_CONFIG_legacy_peer_deps;

await ng('add', `@angular/material${tag}`, '--skip-confirmation');

const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];
if (isSnapshotBuild) {
await updateJsonFile('package.json', (packageJson) => {
const dependencies = packageJson['dependencies'];
// Angular material adds dependencies on other Angular packages
// Iterate over all of the packages to update them to the snapshot version.
for (const [name, version] of Object.entries(snapshots.dependencies)) {
if (name in dependencies) {
dependencies[name] = version;
}
}
}

dependencies['@angular/material-moment-adapter'] =
snapshots.dependencies['@angular/material-moment-adapter'];
});
await installWorkspacePackages();
} else {
if (!tag) {
const installedMaterialVersion = JSON.parse(await readFile('package.json'))['dependencies'][
'@angular/material'
];
tag = `@${installedMaterialVersion}`;
dependencies['@angular/material-moment-adapter'] =
snapshots.dependencies['@angular/material-moment-adapter'];
});
await installWorkspacePackages();
} else {
if (!tag) {
const installedMaterialVersion = JSON.parse(await readFile('package.json'))['dependencies'][
'@angular/material'
];
tag = `@${installedMaterialVersion}`;
}
await installPackage(`@angular/material-moment-adapter${tag}`);
}
await installPackage(`@angular/material-moment-adapter${tag}`);
}

await installPackage('moment');
await installPackage('moment');
} finally {
process.env['NPM_CONFIG_legacy_peer_deps'] = original_NPM_CONFIG_legacy_peer_deps;
}

await ng('build');

Expand Down
32 changes: 22 additions & 10 deletions tests/legacy-cli/e2e/tests/commands/add/add-material.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
import { assertIsError } from '../../../utils/utils';
import { expectFileToMatch, rimraf } from '../../../utils/fs';
import { uninstallPackage } from '../../../utils/packages';
import { ng } from '../../../utils/process';
import { execWithEnv } from '../../../utils/process';
import { isPrereleaseCli } from '../../../utils/project';

export default async function () {
// forcibly remove in case another test doesn't clean itself up
await rimraf('node_modules/@angular/material');

const tag = (await isPrereleaseCli()) ? '@next' : '';
const isPrerelease = await isPrereleaseCli();
const tag = isPrerelease ? '@next' : '';
const processEnv = {
...process.env,
// `@angular/material` pre-release may not support the current version of `@angular/core` pre-release.
// due to the order of releases FW -> CLI -> Material
// In this case peer dependency ranges may not resolve causing npm 7+ to fail during tests.
'NPM_CONFIG_legacy_peer_deps': isPrerelease
? 'true'
: process.env['NPM_CONFIG_legacy_peer_deps'],
};

try {
await ng('add', `@angular/material${tag}`, '--unknown', '--skip-confirmation');
await execWithEnv(
'ng',
['add', `@angular/material${tag}`, '--skip-confirmation', '--unknown'],
processEnv,
);
} catch (error) {
assertIsError(error);
if (!(error as Error).message.includes(`Unknown option: '--unknown'`)) {
throw error;
}
}

await ng(
'add',
`@angular/material${tag}`,
'--theme',
'custom',
'--verbose',
'--skip-confirmation',
await execWithEnv(
'ng',
['add', `@angular/material${tag}`, '--theme', 'custom', '--verbose', '--skip-confirmation'],
processEnv,
);

await expectFileToMatch('package.json', /@angular\/material/);

// Clean up existing cdk package
Expand Down
21 changes: 18 additions & 3 deletions tests/legacy-cli/e2e/tests/misc/invalid-schematic-dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectFileToMatch } from '../../utils/fs';
import { execWithEnv, extractNpmEnv, ng, silentNpm } from '../../utils/process';
import { execWithEnv, extractNpmEnv, silentNpm } from '../../utils/process';
import { installPackage, uninstallPackage } from '../../utils/packages';
import { isPrereleaseCli } from '../../utils/project';

Expand All @@ -13,8 +13,23 @@ export default async function () {
// Install outdated and incompatible version
await installPackage('@schematics/angular@7');

const tag = (await isPrereleaseCli()) ? '@next' : '';
await ng('add', `@angular/material${tag}`, '--skip-confirmation');
const isPrerelease = await isPrereleaseCli();
const tag = isPrerelease ? '@next' : '';

await execWithEnv(
'ng',
['add', `@angular/material${tag}`, '--skip-confirmation'],
// `@angular/material` pre-release may not support the current version of `@angular/core` pre-release.
// due to the order of releases FW -> CLI -> Material
// In this case peer dependency ranges may not resolve causing npm 7+ to fail during tests.
{
...process.env,
'NPM_CONFIG_legacy_peer_deps': isPrerelease
? 'true'
: process.env['NPM_CONFIG_legacy_peer_deps'],
},
);

await expectFileToMatch('package.json', /@angular\/material/);

// Clean up existing cdk package
Expand Down
Loading