Skip to content

Commit

Permalink
tool: remove hardcoded beta from publish
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-statsig committed Nov 8, 2024
1 parent 064dd90 commit fcbdb23
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions tools/scripts/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,33 @@ if (!existsSync(configPath)) {
throw new Error(`Failed to find package.json at ${configPath}`);
}

const isBeta = true;
const isBeta = false;

const parts = [
const publish = [
`npm publish`,
`--registry=https://registry.npmjs.org/`,
`--userconfig=${root}/.npmrc`,
`--access public`,
isBeta ? `--tag beta` : '',
];

const command = parts.join(' ');
if (
command !==
`npm publish --registry=https://registry.npmjs.org/ --userconfig=${root}/.npmrc --access public --tag beta`
) {
throw new Error(`Invalid command: ${command}`);
}
// If you need to promote a version to latest
// const promote = [
// 'npm dist-tag add',
// `@statsig/${packageName}@${VERSION} latest`,
// `--registry=https://registry.npmjs.org/`,
// `--userconfig=${root}/.npmrc`,
// ];

// If you need to remove the beta tag from a version
// const rmBeta = [
// 'npm dist-tag rm',
// `@statsig/${packageName}@${VERSION} beta`,
// `--registry=https://registry.npmjs.org/`,
// `--userconfig=${root}/.npmrc`,
// ];

const command = publish.join(' ');

try {
execSync(command, { cwd: dir });
Expand Down

0 comments on commit fcbdb23

Please sign in to comment.