mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix: too strict peer dependency of angular (#9355)
* Right now the `peerDependency` of Angular will be the one from the `package.json`. This means that upcoming minor versions of Angular cause peer dependency warnings within Yarn or NPM. Fixes #9328
This commit is contained in:
committed by
Andrew Seguin
parent
cdbabf7366
commit
7187670d14
+5
-2
@@ -9,8 +9,11 @@ const package = require('./package.json');
|
||||
/** Current version of the project*/
|
||||
const buildVersion = package.version;
|
||||
|
||||
/** Required Angular version for the project. */
|
||||
const angularVersion = package.dependencies['@angular/core'];
|
||||
/**
|
||||
* Required Angular version for all Angular Material packages. This version will be used
|
||||
* as the peer dependency version for Angular in all release packages.
|
||||
*/
|
||||
const angularVersion = '^5.0.0';
|
||||
|
||||
/** License that will be placed inside of all created bundles. */
|
||||
const buildLicense = `/**
|
||||
|
||||
+39
-34
@@ -19,6 +19,14 @@ export const releasePackages = [
|
||||
/** Parse command-line arguments for release task. */
|
||||
const argv = minimist(process.argv.slice(3));
|
||||
|
||||
task('publish', sequenceTask(
|
||||
':publish:whoami',
|
||||
':publish:build-releases',
|
||||
'validate-release:check-bundles',
|
||||
':publish',
|
||||
':publish:logout',
|
||||
));
|
||||
|
||||
/** Task that builds all releases that will be published. */
|
||||
task(':publish:build-releases', sequenceTask(
|
||||
'clean',
|
||||
@@ -33,6 +41,37 @@ task(':publish:whoami', execTask('npm', ['whoami'], {
|
||||
|
||||
task(':publish:logout', execTask('npm', ['logout']));
|
||||
|
||||
task(':publish', async () => {
|
||||
const label = argv['tag'];
|
||||
const version = buildConfig.projectVersion;
|
||||
const currentDir = process.cwd();
|
||||
|
||||
console.log('');
|
||||
if (!label) {
|
||||
console.log(grey('> You can use a label with --tag=labelName.\n'));
|
||||
console.log(green(`Publishing version "${version}" using the latest tag...`));
|
||||
} else {
|
||||
console.log(yellow(`Publishing version "${version}" using the ${label} tag...`));
|
||||
}
|
||||
console.log('');
|
||||
|
||||
if (releasePackages.length > 1) {
|
||||
console.warn(red('Warning: Multiple packages will be released if proceeding.'));
|
||||
console.warn(red('Warning: Packages to be released: ', releasePackages.join(', ')));
|
||||
console.log();
|
||||
}
|
||||
|
||||
console.log(yellow('> Make sure to check the "angularVersion" in the build config.'));
|
||||
console.log(yellow('> The version in the config defines the peer dependency of Angular.'));
|
||||
console.log();
|
||||
|
||||
// Iterate over every declared release package and publish it on NPM.
|
||||
for (const packageName of releasePackages) {
|
||||
await _execNpmPublish(label, packageName);
|
||||
}
|
||||
|
||||
process.chdir(currentDir);
|
||||
});
|
||||
|
||||
function _execNpmPublish(label: string, packageName: string): Promise<{}> | undefined {
|
||||
const packageDir = join(buildConfig.outputDir, 'releases', packageName);
|
||||
@@ -83,37 +122,3 @@ function _execNpmPublish(label: string, packageName: string): Promise<{}> | unde
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
task(':publish', async () => {
|
||||
const label = argv['tag'];
|
||||
const currentDir = process.cwd();
|
||||
|
||||
console.log('');
|
||||
if (!label) {
|
||||
console.log(yellow('You can use a label with --tag=labelName.'));
|
||||
console.log(yellow('Publishing using the latest tag.'));
|
||||
} else {
|
||||
console.log(yellow(`Publishing using the ${label} tag.`));
|
||||
}
|
||||
console.log('');
|
||||
|
||||
if (releasePackages.length > 1) {
|
||||
console.warn(red('Warning: Multiple packages will be released if proceeding.'));
|
||||
console.warn(red('Warning: Packages to be released: ', releasePackages.join(', ')));
|
||||
}
|
||||
|
||||
// Iterate over every declared release package and publish it on NPM.
|
||||
for (const packageName of releasePackages) {
|
||||
await _execNpmPublish(label, packageName);
|
||||
}
|
||||
|
||||
process.chdir(currentDir);
|
||||
});
|
||||
|
||||
task('publish', sequenceTask(
|
||||
':publish:whoami',
|
||||
':publish:build-releases',
|
||||
'validate-release:check-bundles',
|
||||
':publish',
|
||||
':publish:logout',
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user