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

fix: too strict peer dependency of angular #9355

Merged
merged 1 commit into from
Jan 12, 2018
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
7 changes: 5 additions & 2 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `/**
Expand Down
73 changes: 39 additions & 34 deletions tools/gulp/tasks/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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);
Expand Down Expand Up @@ -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',
));