Skip to content

Commit fa70d0a

Browse files
authored
Enable changesets (#3268)
* enable changeset * Create release pull request * change env variable name * use the correct secret in GHA * make firebase a devDependency in integration test projects * initial changeset release rewrite * clean up imports in cli.ts * save progress * implement canary release * update changesets to the latest * ignore integration test projects * save updates * update ignore list * stream changeset output * validate version for staging releases * fix bug * add option * skip private packages * remove unused things * update release script * fix type errors * remove commented code * fix types * add Changeset check * compare to master
1 parent 04874c9 commit fa70d0a

File tree

31 files changed

+1217
-771
lines changed

31 files changed

+1217
-771
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)

.changeset/config.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "firebase/firebase-js-sdk"}],
4+
"commit": false,
5+
"linked": [],
6+
"access": "restricted",
7+
"baseBranch": "master",
8+
"updateInternalDependencies": "patch",
9+
"ignore": [
10+
"firebase-browserify-test",
11+
"firebase-package-typings-test",
12+
"firebase-firestore-integration-test",
13+
"firebase-messaging-selenium-test",
14+
"firebase-typescript-test",
15+
"firebase-webpack-test",
16+
"@firebase/app-exp",
17+
"@firebase/app-types-exp",
18+
"@firebase/functions-exp",
19+
"@firebase/functions-types-exp",
20+
"firebase-exp"
21+
],
22+
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
23+
"onlyUpdatePeerDependentsWhenOutOfRange": true,
24+
"useCalculatedVersionForSnapshots": true
25+
}
26+
}

.github/workflows/changesets.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Changeset Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: Changeset Check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@master
15+
16+
- name: Setup Node.js 12.x
17+
uses: actions/setup-node@master
18+
with:
19+
node-version: 12.x
20+
21+
- name: Install Dependencies
22+
run: yarn
23+
24+
- name: Check if any Changeset file exists
25+
run: yarn changeset status --since=master

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@master
15+
with:
16+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js 12.x
20+
uses: actions/setup-node@master
21+
with:
22+
node-version: 12.x
23+
24+
- name: Install Dependencies
25+
run: yarn
26+
27+
- name: Create Release Pull Request
28+
uses: changesets/action@master
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

integration/browserify/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
"test": "karma start --single-run",
88
"test:ci": "node ../../scripts/run_tests_in_ci.js"
99
},
10-
"dependencies": {
11-
"firebase": "7.15.4"
12-
},
1310
"devDependencies": {
11+
"firebase": "7.15.4",
1412
"@babel/core": "7.9.6",
1513
"@babel/preset-env": "7.9.6",
1614
"browserify": "16.5.1",

integration/firebase-typings/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
"test": "tsc",
77
"test:ci": "node ../../scripts/run_tests_in_ci.js"
88
},
9-
"dependencies": {
10-
"firebase": "7.15.4"
11-
},
129
"devDependencies": {
10+
"firebase": "7.15.4",
1311
"typescript": "3.8.3"
1412
}
1513
}

integration/messaging/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
"test": "mocha --exit",
88
"test:manual": "mocha --exit"
99
},
10-
"dependencies": {
11-
"firebase": "7.15.4"
12-
},
1310
"devDependencies": {
11+
"firebase": "7.15.4",
1412
"chai": "4.2.0",
1513
"chromedriver": "^83.0.0",
1614
"express": "4.17.1",

integration/typescript/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
"test": "karma start --single-run",
77
"test:ci": "node ../../scripts/run_tests_in_ci.js"
88
},
9-
"dependencies": {
10-
"firebase": "7.15.4"
11-
},
129
"devDependencies": {
10+
"firebase": "7.15.4",
1311
"@babel/core": "7.9.6",
1412
"@babel/preset-env": "7.9.6",
1513
"@types/chai": "4.2.11",

integration/webpack/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
"test": "karma start --single-run",
88
"test:ci": "node ../../scripts/run_tests_in_ci.js"
99
},
10-
"dependencies": {
11-
"firebase": "7.15.4"
12-
},
1310
"devDependencies": {
11+
"firebase": "7.15.4",
1412
"@babel/core": "7.9.6",
1513
"@babel/preset-env": "7.9.6",
1614
"chai": "4.2.0",

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"link:packages": "lerna exec --scope @firebase/* --scope firebase --scope rxfire -- yarn link",
3030
"stage:packages": "./scripts/prepublish.sh",
3131
"repl": "node tools/repl.js",
32-
"release": "node scripts/release/cli.js",
32+
"release": "ts-node-script scripts/release/cli.ts",
3333
"pretest": "node tools/pretest.js",
3434
"test": "lerna run --concurrency 4 --stream test",
3535
"test:ci": "lerna run --concurrency 4 --stream test:ci",
@@ -60,17 +60,23 @@
6060
"integration/*"
6161
],
6262
"devDependencies": {
63+
"@changesets/changelog-github": "0.2.5",
64+
"@changesets/cli": "2.9.1",
6365
"@microsoft/api-documenter": "7.7.20",
6466
"@microsoft/api-extractor": "7.7.13",
6567
"@types/chai": "4.2.11",
6668
"@types/chai-as-promised": "7.1.2",
69+
"@types/child-process-promise": "2.2.1",
70+
"@types/clone": "0.1.30",
71+
"@types/inquirer": "6.5.0",
6772
"@types/long": "4.0.1",
6873
"@types/mocha": "7.0.2",
6974
"@types/node": "12.12.37",
7075
"@types/sinon": "9.0.0",
7176
"@types/sinon-chai": "3.2.4",
7277
"@types/tmp": "0.2.0",
7378
"@types/yargs": "15.0.4",
79+
"@types/listr": "0.14.2",
7480
"@typescript-eslint/eslint-plugin": "2.30.0",
7581
"@typescript-eslint/eslint-plugin-tslint": "2.30.0",
7682
"@typescript-eslint/parser": "2.30.0",

scripts/emulator-testing/database-test-runner.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ import { spawn } from 'child-process-promise';
1919
import * as path from 'path';
2020

2121
import { DatabaseEmulator } from './emulators/database-emulator';
22-
import { ChildProcessPromise } from './emulators/emulator';
2322

24-
function runTest(port: number, namespace: string): ChildProcessPromise {
23+
function runTest(port: number, namespace: string) {
2524
const options = {
2625
cwd: path.resolve(__dirname, '../../packages/database'),
2726
env: Object.assign({}, process.env, {
2827
RTDB_EMULATOR_PORT: port,
2928
RTDB_EMULATOR_NAMESPACE: namespace
3029
}),
31-
stdio: 'inherit'
30+
stdio: 'inherit' as const
3231
};
3332
return spawn('yarn', ['test:all'], options);
3433
}

scripts/emulator-testing/emulators/emulator.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ import * as request from 'request';
2424
// @ts-ignore
2525
import * as tmp from 'tmp';
2626

27-
export interface ChildProcessPromise extends Promise<void> {
28-
childProcess: ChildProcess;
29-
}
30-
3127
export abstract class Emulator {
3228
binaryPath: string | null = null;
3329
emulator: ChildProcess | null = null;
@@ -72,9 +68,14 @@ export abstract class Emulator {
7268
if (!this.binaryPath) {
7369
throw new Error('You must call download() before setUp()');
7470
}
75-
const promise: ChildProcessPromise = spawn(
71+
const promise = spawn(
7672
'java',
77-
['-jar', path.basename(this.binaryPath), '--port', this.port],
73+
[
74+
'-jar',
75+
path.basename(this.binaryPath),
76+
'--port',
77+
this.port.toString()
78+
],
7879
{
7980
cwd: path.dirname(this.binaryPath),
8081
stdio: 'inherit'

scripts/emulator-testing/firestore-test-runner.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,16 @@ import * as path from 'path';
2121
// @ts-ignore
2222
import * as freePortFinder from 'find-free-port';
2323

24-
import { ChildProcessPromise } from './emulators/emulator';
2524
import { FirestoreEmulator } from './emulators/firestore-emulator';
2625

27-
function runTest(
28-
port: number,
29-
projectId: string,
30-
withPersistence: boolean
31-
): ChildProcessPromise {
26+
function runTest(port: number, projectId: string, withPersistence: boolean) {
3227
const options = {
3328
cwd: path.resolve(__dirname, '../../packages/firestore'),
3429
env: Object.assign({}, process.env, {
3530
FIRESTORE_EMULATOR_PORT: port,
3631
FIRESTORE_EMULATOR_PROJECT_ID: projectId
3732
}),
38-
stdio: 'inherit'
33+
stdio: 'inherit' as const
3934
};
4035
// TODO(b/113267261): Include browser test once WebChannel support is
4136
// ready in Firestore emulator.

0 commit comments

Comments
 (0)