From 8143c836f01c08d77fb602f1c00f9642231fcef3 Mon Sep 17 00:00:00 2001 From: Feiyang Date: Wed, 6 May 2020 16:15:56 -0700 Subject: [PATCH] Point to the internal typing file in app-exp's package.json (#3030) * point to the internal typing file * Remove api report from prepush * remove stale code --- packages-exp/app-exp/package.json | 2 +- tools/gitHooks/api-report.js | 68 ------------------------------- tools/gitHooks/prepush.js | 4 -- 3 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 tools/gitHooks/api-report.js diff --git a/packages-exp/app-exp/package.json b/packages-exp/app-exp/package.json index 380e156ec62..b5d2583648c 100644 --- a/packages-exp/app-exp/package.json +++ b/packages-exp/app-exp/package.json @@ -52,7 +52,7 @@ "bugs": { "url": "https://github.com/firebase/firebase-js-sdk/issues" }, - "typings": "./dist/app-exp-public.d.ts", + "typings": "./dist/app-exp.d.ts", "nyc": { "extension": [ ".ts" diff --git a/tools/gitHooks/api-report.js b/tools/gitHooks/api-report.js deleted file mode 100644 index f5f598fd5c4..00000000000 --- a/tools/gitHooks/api-report.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @license - * Copyright 2020 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. - */ - -/** - * generate API reports in changed packages - */ - -const { - getChangedPackages, - getPackageInfo, - projectRoot -} = require('../../scripts/utils'); -const { execSync } = require('child_process'); -const ora = require('ora'); -const simpleGit = require('simple-git/promise'); - -const git = simpleGit(projectRoot); - -async function doApiReportsCommit() { - const changedPackages = await getChangedPackages(); - const packageInfo = await getPackageInfo(); - const packageLocations = []; - for (const packageName of changedPackages) { - const packageDesc = packageInfo.find(info => info.name === packageName); - if (packageDesc) { - const packageJson = require(`${packageDesc.location}/package.json`); - - if (packageJson && packageJson.scripts['api-report']) { - const apiReportSpinner = ora( - ` Creating API report for ${packageName}` - ).start(); - packageLocations.push(packageDesc.location); - execSync(`yarn api-report`, { cwd: packageDesc.location }); - apiReportSpinner.stopAndPersist({ - symbol: '✅' - }); - } - } - } - - const hasDiff = await git.diff(); - - if (!hasDiff) return; - - const gitSpinner = ora(' Creating automated API reports commit').start(); - await git.add('.'); - - await git.commit('[AUTOMATED]: API Reports'); - gitSpinner.stopAndPersist({ - symbol: '✅' - }); -} - -exports.doApiReportsCommit = doApiReportsCommit; diff --git a/tools/gitHooks/prepush.js b/tools/gitHooks/prepush.js index 8ff853564e3..b52a41cf9cb 100644 --- a/tools/gitHooks/prepush.js +++ b/tools/gitHooks/prepush.js @@ -17,7 +17,6 @@ const { doPrettierCommit } = require('./prettier'); const { doLicenseCommit } = require('./license'); -const { doApiReportsCommit } = require('./api-report'); const { resolve } = require('path'); const simpleGit = require('simple-git/promise'); const chalk = require('chalk'); @@ -58,9 +57,6 @@ $ git stash pop // Validate License headers exist await doLicenseCommit(changedFiles); - // Generate API reports - await doApiReportsCommit(); - console.log(chalk` Pre-Push Validation Succeeded