aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/publish.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-07-25 03:39:31 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-07-25 03:57:47 +0800
commitc40b3dea6cefc9a192136d66311839bd7c5d5169 (patch)
treef2bca973ab6e03afa9870ff6bdb9e0ef18c9efe8 /packages/monorepo-scripts/src/publish.ts
parentdbc798596b052d3e28cf5772c94789d37ee5a4c7 (diff)
downloaddexon-0x-contracts-c40b3dea6cefc9a192136d66311839bd7c5d5169.tar.gz
dexon-0x-contracts-c40b3dea6cefc9a192136d66311839bd7c5d5169.tar.zst
dexon-0x-contracts-c40b3dea6cefc9a192136d66311839bd7c5d5169.zip
Specify registry url only if local publish attempted
Diffstat (limited to 'packages/monorepo-scripts/src/publish.ts')
-rw-r--r--packages/monorepo-scripts/src/publish.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 71eb16a98..d5238ab52 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -12,11 +12,11 @@ import semverSort = require('semver-sort');
import { constants } from './constants';
import { Package, PackageToNextVersion, VersionChangelog } from './types';
import { changelogUtils } from './utils/changelog_utils';
+import { configs } from './utils/configs';
import { utils } from './utils/utils';
const DOC_GEN_COMMAND = 'docs:json';
const NPM_NAMESPACE = '@0xproject/';
-const IS_LOCAL_PUBLISH = process.env.IS_LOCAL_PUBLISH === 'true';
const TODAYS_TIMESTAMP = moment().unix();
const packageNameToWebsitePath: { [name: string]: string } = {
'0x.js': '0xjs',
@@ -36,7 +36,7 @@ const packageNameToWebsitePath: { [name: string]: string } = {
const shouldIncludePrivate = true;
const allUpdatedPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
- if (!IS_LOCAL_PUBLISH) {
+ if (!configs.IS_LOCAL_PUBLISH) {
await confirmDocPagesRenderAsync(allUpdatedPackages);
}
@@ -59,7 +59,7 @@ const packageNameToWebsitePath: { [name: string]: string } = {
});
// Push changelog changes to Github
- if (!IS_LOCAL_PUBLISH) {
+ if (!configs.IS_LOCAL_PUBLISH) {
await pushChangelogsToGithubAsync();
}
@@ -182,9 +182,11 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string
const packageVersionString = _.map(packageToNextVersion, (nextVersion: string, packageName: string) => {
return `${packageName}@${nextVersion}`;
}).join(',');
- let lernaPublishCmd = `node ${constants.lernaExecutable} publish --cdVersions=${packageVersionString}`;
- if (IS_LOCAL_PUBLISH) {
- lernaPublishCmd += ' --skip-git --yes --force-publish *';
+ let lernaPublishCmd = `node ${constants.lernaExecutable} publish --cdVersions=${packageVersionString} --registry=${
+ configs.NPM_REGISTRY_URL
+ }`;
+ if (configs.IS_LOCAL_PUBLISH) {
+ lernaPublishCmd += ` --skip-git --yes --force-publish *`;
}
utils.log('Lerna is publishing...');
await execAsync(lernaPublishCmd, { cwd: constants.monorepoRootPath });