Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable changesets #3268

Merged
merged 28 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
83143e5
enable changeset
Feiyang1 May 19, 2020
4a514e2
Create release pull request
Feiyang1 May 19, 2020
ee7c9c6
change env variable name
Feiyang1 May 19, 2020
4b396ff
use the correct secret in GHA
Feiyang1 May 20, 2020
d94b627
make firebase a devDependency in integration test projects
Feiyang1 May 20, 2020
9283298
initial changeset release rewrite
Feiyang1 May 21, 2020
65d6be2
clean up imports in cli.ts
Feiyang1 May 21, 2020
53b1b94
save progress
Feiyang1 May 21, 2020
f3c0ba2
implement canary release
Feiyang1 May 29, 2020
c03cbff
update changesets to the latest
Feiyang1 Jun 20, 2020
ecaa9db
ignore integration test projects
Feiyang1 Jun 20, 2020
efb47b5
Merge branch 'master' into fei-changesets
Feiyang1 Jun 22, 2020
d873223
save updates
Feiyang1 Jun 23, 2020
4221ffa
update ignore list
Feiyang1 Jun 23, 2020
e613277
stream changeset output
Feiyang1 Jun 23, 2020
3164a1c
validate version for staging releases
Feiyang1 Jun 23, 2020
3ab3d59
fix bug
Feiyang1 Jun 23, 2020
23e8e62
add option
Feiyang1 Jun 23, 2020
1ded802
skip private packages
Feiyang1 Jun 24, 2020
059d5c2
remove unused things
Feiyang1 Jun 24, 2020
72c53f7
update release script
Feiyang1 Jun 24, 2020
086b5ed
Merge branch 'master' into fei-changesets
Feiyang1 Jun 24, 2020
b52c3bf
Merge remote-tracking branch 'origin/master' into fei-changesets
Feiyang1 Jun 24, 2020
b167bba
fix type errors
Feiyang1 Jun 24, 2020
74cb4c4
remove commented code
Feiyang1 Jun 24, 2020
f088bf5
fix types
Feiyang1 Jun 25, 2020
96949e5
add Changeset check
Feiyang1 Jun 25, 2020
f4a1c55
compare to master
Feiyang1 Jun 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
26 changes: 26 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "firebase/firebase-js-sdk"}],
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": [
"firebase-browserify-test",
"firebase-package-typings-test",
"firebase-firestore-integration-test",
"firebase-messaging-selenium-test",
"firebase-typescript-test",
"firebase-webpack-test",
"@firebase/app-exp",
"@firebase/app-types-exp",
"@firebase/functions-exp",
"@firebase/functions-types-exp",
"firebase-exp"
],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true,
"useCalculatedVersionForSnapshots": true
}
}
25 changes: 25 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Changeset Check

on:
pull_request:
branches:
- master

jobs:
release:
name: Changeset Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master

- name: Setup Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x

- name: Install Dependencies
run: yarn

- name: Check if any Changeset file exists
run: yarn changeset status --since=master
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
push:
branches:
- release

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request
uses: changesets/action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 1 addition & 3 deletions integration/browserify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"test": "karma start --single-run",
"test:ci": "node ../../scripts/run_tests_in_ci.js"
},
"dependencies": {
"firebase": "7.15.4"
},
"devDependencies": {
"firebase": "7.15.4",
"@babel/core": "7.9.6",
"@babel/preset-env": "7.9.6",
"browserify": "16.5.1",
Expand Down
4 changes: 1 addition & 3 deletions integration/firebase-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
"test": "tsc",
"test:ci": "node ../../scripts/run_tests_in_ci.js"
},
"dependencies": {
"firebase": "7.15.4"
},
"devDependencies": {
"firebase": "7.15.4",
"typescript": "3.8.3"
}
}
4 changes: 1 addition & 3 deletions integration/messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"test": "mocha --exit",
"test:manual": "mocha --exit"
},
"dependencies": {
"firebase": "7.15.4"
},
"devDependencies": {
"firebase": "7.15.4",
"chai": "4.2.0",
"chromedriver": "^83.0.0",
"express": "4.17.1",
Expand Down
4 changes: 1 addition & 3 deletions integration/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
"test": "karma start --single-run",
"test:ci": "node ../../scripts/run_tests_in_ci.js"
},
"dependencies": {
"firebase": "7.15.4"
},
"devDependencies": {
"firebase": "7.15.4",
"@babel/core": "7.9.6",
"@babel/preset-env": "7.9.6",
"@types/chai": "4.2.11",
Expand Down
4 changes: 1 addition & 3 deletions integration/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"test": "karma start --single-run",
"test:ci": "node ../../scripts/run_tests_in_ci.js"
},
"dependencies": {
"firebase": "7.15.4"
},
"devDependencies": {
"firebase": "7.15.4",
"@babel/core": "7.9.6",
"@babel/preset-env": "7.9.6",
"chai": "4.2.0",
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"link:packages": "lerna exec --scope @firebase/* --scope firebase --scope rxfire -- yarn link",
"stage:packages": "./scripts/prepublish.sh",
"repl": "node tools/repl.js",
"release": "node scripts/release/cli.js",
"release": "ts-node-script scripts/release/cli.ts",
"pretest": "node tools/pretest.js",
"test": "lerna run --concurrency 4 --stream test",
"test:ci": "lerna run --concurrency 4 --stream test:ci",
Expand Down Expand Up @@ -60,17 +60,23 @@
"integration/*"
],
"devDependencies": {
"@changesets/changelog-github": "0.2.5",
"@changesets/cli": "2.9.1",
"@microsoft/api-documenter": "7.7.20",
"@microsoft/api-extractor": "7.7.13",
"@types/chai": "4.2.11",
"@types/chai-as-promised": "7.1.2",
"@types/child-process-promise": "2.2.1",
"@types/clone": "0.1.30",
"@types/inquirer": "6.5.0",
"@types/long": "4.0.1",
"@types/mocha": "7.0.2",
"@types/node": "12.12.37",
"@types/sinon": "9.0.0",
"@types/sinon-chai": "3.2.4",
"@types/tmp": "0.2.0",
"@types/yargs": "15.0.4",
"@types/listr": "0.14.2",
"@typescript-eslint/eslint-plugin": "2.30.0",
"@typescript-eslint/eslint-plugin-tslint": "2.30.0",
"@typescript-eslint/parser": "2.30.0",
Expand Down
5 changes: 2 additions & 3 deletions scripts/emulator-testing/database-test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ import { spawn } from 'child-process-promise';
import * as path from 'path';

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

function runTest(port: number, namespace: string): ChildProcessPromise {
function runTest(port: number, namespace: string) {
const options = {
cwd: path.resolve(__dirname, '../../packages/database'),
env: Object.assign({}, process.env, {
RTDB_EMULATOR_PORT: port,
RTDB_EMULATOR_NAMESPACE: namespace
}),
stdio: 'inherit'
stdio: 'inherit' as const
};
return spawn('yarn', ['test:all'], options);
}
Expand Down
13 changes: 7 additions & 6 deletions scripts/emulator-testing/emulators/emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ import * as request from 'request';
// @ts-ignore
import * as tmp from 'tmp';

export interface ChildProcessPromise extends Promise<void> {
childProcess: ChildProcess;
}

export abstract class Emulator {
binaryPath: string | null = null;
emulator: ChildProcess | null = null;
Expand Down Expand Up @@ -72,9 +68,14 @@ export abstract class Emulator {
if (!this.binaryPath) {
throw new Error('You must call download() before setUp()');
}
const promise: ChildProcessPromise = spawn(
const promise = spawn(
'java',
['-jar', path.basename(this.binaryPath), '--port', this.port],
[
'-jar',
path.basename(this.binaryPath),
'--port',
this.port.toString()
],
{
cwd: path.dirname(this.binaryPath),
stdio: 'inherit'
Expand Down
9 changes: 2 additions & 7 deletions scripts/emulator-testing/firestore-test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,16 @@ import * as path from 'path';
// @ts-ignore
import * as freePortFinder from 'find-free-port';

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

function runTest(
port: number,
projectId: string,
withPersistence: boolean
): ChildProcessPromise {
function runTest(port: number, projectId: string, withPersistence: boolean) {
const options = {
cwd: path.resolve(__dirname, '../../packages/firestore'),
env: Object.assign({}, process.env, {
FIRESTORE_EMULATOR_PORT: port,
FIRESTORE_EMULATOR_PROJECT_ID: projectId
}),
stdio: 'inherit'
stdio: 'inherit' as const
};
// TODO(b/113267261): Include browser test once WebChannel support is
// ready in Firestore emulator.
Expand Down
Loading