Skip to content

Commit 989cb75

Browse files
authored
publish packages publicly (#3368)
* publish packages publicly * Create perfect-terms-press.md
1 parent f8d1b3d commit 989cb75

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"changelog": ["@changesets/changelog-github", { "repo": "firebase/firebase-js-sdk"}],
44
"commit": false,
55
"linked": [],
6-
"access": "restricted",
6+
"access": "public",
77
"baseBranch": "master",
88
"updateInternalDependencies": "patch",
99
"ignore": [

.changeset/perfect-terms-press.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
---

scripts/release/cli.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const prompt = createPromptModule();
6161
/**
6262
* Determine if the current release is a staging or production release
6363
*/
64-
const releaseType = await (async () => {
64+
const releaseType: string = await (async () => {
6565
if (argv.canary) return ReleaseType.Canary;
6666
/**
6767
* Capture the release type if it was passed to the CLI via args
@@ -77,7 +77,9 @@ const prompt = createPromptModule();
7777
/**
7878
* Prompt for the release type (i.e. staging/prod)
7979
*/
80-
const responses = await prompt([releaseTypePrompt]);
80+
const responses = await prompt<{ [key: string]: string }>([
81+
releaseTypePrompt
82+
]);
8183
return responses.releaseType;
8284
})();
8385

@@ -133,7 +135,7 @@ const prompt = createPromptModule();
133135
* Release new versions to NPM using changeset
134136
* It will also create tags
135137
*/
136-
await publish();
138+
await publish(releaseType);
137139

138140
/**
139141
* Changeset creats tags for staging releases as well,

scripts/release/utils/publish.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@
1717

1818
import { spawn } from 'child-process-promise';
1919
import { projectRoot as root } from '../../utils';
20+
import { ReleaseType } from './enums';
2021

21-
export async function publish() {
22-
await spawn('yarn', ['changeset', 'publish'], {
22+
export async function publish(releaseType: string) {
23+
let tag: string[] = [];
24+
if (releaseType === ReleaseType.Staging) {
25+
tag = ['--tag', 'next'];
26+
}
27+
28+
await spawn('yarn', ['changeset', 'publish', ...tag], {
2329
cwd: root,
2430
stdio: 'inherit'
2531
});

0 commit comments

Comments
 (0)