diff --git a/packages/app-check/package.json b/packages/app-check/package.json index aec31e9cb4b..c9d61bf00a6 100644 --- a/packages/app-check/package.json +++ b/packages/app-check/package.json @@ -2,7 +2,7 @@ "name": "@firebase/app-check", "version": "0.1.0", "private": true, - "description": "A template package for new firebase packages", + "description": "The App Check component of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", "browser": "dist/index.cjs.js", diff --git a/packages/firebase/rollup.config.js b/packages/firebase/rollup.config.js index e0ecef11cf9..55acf8f6c7d 100644 --- a/packages/firebase/rollup.config.js +++ b/packages/firebase/rollup.config.js @@ -76,16 +76,7 @@ const plugins = [ commonjs() ]; -// bundle app-check and app-check enabled libraries in firebase -const deps = Object.keys(pkg.dependencies || {}).filter( - dep => - ![ - '@firebase/app-check', - '@firebase/storage', - '@firebase/functions', - '@firebase/database' - ].includes(dep) -); +const deps = Object.keys(pkg.dependencies || {}); const external = id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)); /** diff --git a/scripts/pack-appcheck.ts b/scripts/pack-appcheck.ts deleted file mode 100644 index db9da65ec9f..00000000000 --- a/scripts/pack-appcheck.ts +++ /dev/null @@ -1,98 +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. - */ - -import { spawn } from 'child-process-promise'; -import { resolve } from 'path'; -import { projectRoot, readPackageJson } from './utils'; -import fs from 'fs'; - -const outputDir = `${projectRoot}/appcheck`; -async function packAppCheck() { - if (!fs.existsSync(outputDir)) { - fs.mkdirSync(outputDir); - } - - const appCheckPkgPath = resolve(projectRoot, 'packages/app-check'); - // make @firebase/app-check tarball - await spawn('yarn', ['build:deps'], { - cwd: appCheckPkgPath, - stdio: 'inherit' - }); - - // Remove app-check-types and app-check-interop-types from the dependencies. - // Otherwise an error will occur when installing the tarball because these packages have not been published to npm yet. - const packageJson = await readPackageJson(appCheckPkgPath); - - delete packageJson.dependencies['@firebase/app-check-types']; - delete packageJson.dependencies['@firebase/app-check-interop-types']; - - fs.writeFileSync( - `${appCheckPkgPath}/package.json`, - `${JSON.stringify(packageJson, null, 2)}\n`, - { encoding: 'utf-8' } - ); - - // make a firebase tarball that bundles @firebase/app-check and with typings. Also creates firebase-app-check.js - - // build app-exp first because firestore needs it - await spawn('yarn', ['build'], { - cwd: resolve(projectRoot, 'packages-exp/app-exp'), - stdio: 'inherit' - }); - - const firebasePkgPath = resolve(projectRoot, 'packages/firebase'); - await spawn('yarn', ['build:deps'], { - cwd: firebasePkgPath, - stdio: 'inherit' - }); - - // Remove @firebase/app-check from the dependencies. - // Otherwise an error will occur when installing the tarball because @firebase/app-check has not been published to npm yet. - const firebasePackageJson = await readPackageJson(firebasePkgPath); - delete firebasePackageJson.dependencies['@firebase/app-check']; - fs.writeFileSync( - `${firebasePkgPath}/package.json`, - `${JSON.stringify(firebasePackageJson, null, 2)}\n`, - { encoding: 'utf-8' } - ); - - await spawn('npm', ['pack', firebasePkgPath], { - cwd: outputDir, - stdio: 'inherit' - }); - - // copy CDN scripts to the output folder - const filesToCopy = [ - 'firebase.js', - 'firebase-app-check.js', - 'firebase-database.js', - 'firebase-storage.js', - 'firebase-functions.js', - 'firebase-app-check.js.map', - 'firebase-database.js.map', - 'firebase-storage.js.map', - 'firebase-functions.js.map' - ]; - for (const fileName of filesToCopy) { - fs.copyFileSync( - `${firebasePkgPath}/${fileName}`, - `${outputDir}/${fileName}` - ); - } -} - -packAppCheck();