Skip to content

Commit

Permalink
Merge branch 'master' into fei-idempotentapp
Browse files Browse the repository at this point in the history
  • Loading branch information
Feiyang1 committed Jul 28, 2021
2 parents 597b79c + 4bc015c commit c3b828d
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 7 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/update-api-reports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update API reports

on: pull_request

jobs:
update_api_reports:
name: Update API reports
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# checkout HEAD commit instead of merge commit
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.OSS_BOT_GITHUB_TOKEN }}
- name: Set up Node (14)
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Yarn install
run: yarn
- name: Update API reports
run: yarn ts-node-script scripts/exp/update-api-reports.ts
id: update-api-reports
- name: Commit & Push changes
uses: EndBug/add-and-commit@v7
with:
add: 'common/api-review/*'
message: 'Update API reports'
default_author: github_actor
2 changes: 0 additions & 2 deletions common/api-review/app-check-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,4 @@ export function setTokenAutoRefreshEnabled(appCheckInstance: AppCheck, isTokenAu
export { Unsubscribe }


// (No @packageDocumentation comment for this package)

```
10 changes: 5 additions & 5 deletions common/api-review/database.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import { FirebaseApp } from '@firebase/app';
// @public
export function child(parent: DatabaseReference, path: string): DatabaseReference;

// @public
export function connectDatabaseEmulator(db: Database, host: string, port: number, options?: {
mockUserToken?: EmulatorMockTokenOptions;
}): void;

// @public
export class Database {
readonly app: FirebaseApp;
Expand All @@ -23,11 +28,6 @@ export interface DatabaseReference extends Query {
readonly root: DatabaseReference;
}

// @public
export function connectDatabaseEmulator(db: FirebaseDatabase, host: string, port: number, options?: {
mockUserToken?: EmulatorMockTokenOptions;
}): void;

// @public
export class DataSnapshot {
child(path: string): DataSnapshot;
Expand Down
60 changes: 60 additions & 0 deletions scripts/exp/update-api-reports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { spawn } from 'child-process-promise';
import simpleGit from 'simple-git/promise';
import { projectRoot } from '../utils';

const git = simpleGit(projectRoot);

async function updateApiReports() {
/** API reports are generated as part of the builds */
// TODO: change yarn command once exp packages become official
await spawn('yarn', ['lerna', 'run', '--scope', '@firebase/*-exp', 'build'], {
stdio: 'inherit'
});

// build storage-exp
await spawn(
'yarn',
['lerna', 'run', '--scope', '@firebase/storage', 'build:exp'],
{
stdio: 'inherit'
}
);

// build database-exp
await spawn(
'yarn',
['lerna', 'run', '--scope', '@firebase/database', 'build:exp'],
{
stdio: 'inherit'
}
);

// generate public typings for firestore
await spawn(
'yarn',
['lerna', 'run', '--scope', '@firebase/firestore', 'prebuild'],
{
stdio: 'inherit'
}
);

// Committing and Pushing to the remote branch is done in the GHA workflow, see .github/workflows/update-api-reports.yml
}

updateApiReports();

0 comments on commit c3b828d

Please sign in to comment.