Skip to content

Commit

Permalink
build(): publish to prod but not dev builds (#24232)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi authored Nov 17, 2021
1 parent 0566ec0 commit 2d70427
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function copyPackageToDist(tasks, packages) {
});
}

function publishPackages(tasks, packages, version, npmTag = 'latest') {
function verifyPackages(tasks, packages, version, npmTag = 'latest') {
// verify version
packages.forEach(package => {
if (package === 'core') {
Expand All @@ -338,6 +338,26 @@ function publishPackages(tasks, packages, version, npmTag = 'latest') {
});
}

function publishPackages(tasks, packages, version, npmTag = 'latest') {
verifyPackages(tasks, packages, version, npmTag);

// Publish
packages.forEach(package => {
let projectRoot = projectPath(package);

if (package === 'packages/angular-server' || package === 'angular') {
projectRoot = path.join(projectRoot, 'dist')
}

tasks.push({
title: `${package}: publish to ${npmTag} tag`,
task: async () => {
await execa('npm', ['publish', '--tag', npmTag], { cwd: projectRoot });
}
});
});
}

function updateDependency(pkg, dependency, version) {
if (pkg.dependencies && pkg.dependencies[dependency]) {
pkg.dependencies[dependency] = version;
Expand Down Expand Up @@ -379,6 +399,7 @@ module.exports = {
preparePackage,
projectPath,
publishPackages,
verifyPackages,
readPkg,
rootDir,
updateDependency,
Expand Down

0 comments on commit 2d70427

Please sign in to comment.