Skip to content

Commit 032b860

Browse files
Add exp configuration
1 parent c7c4779 commit 032b860

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../../config/api-extractor.json",
3+
"mainEntryPointFilePath": "../dist/exp/firestore/exp/index.d.ts",
4+
"dtsRollup": {
5+
"enabled": true,
6+
"publicTrimmedFilePath": "../dist/exp/index.d.ts"
7+
}
8+
}

packages/firestore/exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@firebase/firestore/exp",
2+
"name": "@firebase/firestore-exp",
33
"description": "A tree-shakeable version of the Firestore SDK",
44
"main": "../dist/exp/index.node.umd.js",
55
"main-esm": "../dist/exp/index.node.esm2017.js",

packages/firestore/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
"description": "The Cloud Firestore component of the Firebase JS SDK.",
88
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
99
"scripts": {
10+
"api-report:exp": "(cd exp; api-extractor run --local --verbose)",
1011
"api-report:lite": "(cd lite; api-extractor run --local --verbose)",
1112
"bundle": "rollup -c",
1213
"build": "run-p 'bundle rollup.config.browser.js' 'bundle rollup.config.browser.memory.js' 'bundle rollup.config.node.js' 'bundle rollup.config.node.memory.js' 'bundle rollup.config.rn.js' 'bundle rollup.config.rn.memory.js' build:lite build:exp",
1314
"build:scripts": "tsc -moduleResolution node --module commonjs scripts/*.ts && ls scripts/*.js | xargs -I % sh -c 'terser % -o %'",
1415
"build:release": "rollup -c rollup.config.es2017.js && rollup -c rollup.config.es5.js",
1516
"build:deps": "lerna run --scope @firebase/'{app,firestore}' --include-dependencies build",
1617
"build:console": "node tools/console.build.js",
17-
"build:exp": "rollup -c rollup.config.exp.js",
18+
"build:exp": "rollup -c rollup.config.exp.js && yarn api-report:exp",
1819
"build:lite": "rollup -c rollup.config.lite.js && yarn api-report:lite",
1920
"build:exp:release": "yarn build:exp && yarn build:lite",
2021
"predev": "yarn prebuild",

packages/firestore/rollup.config.exp.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import typescriptPlugin from 'rollup-plugin-typescript2';
2222
import typescript from 'typescript';
2323
import path from 'path';
2424
import sourcemaps from 'rollup-plugin-sourcemaps';
25+
import copy from 'rollup-plugin-copy';
26+
import replace from 'rollup-plugin-replace';
2527
import { terser } from 'rollup-plugin-terser';
2628
import { importPathTransformer } from '../../scripts/exp/ts-transform-import-path';
2729

@@ -41,7 +43,23 @@ const nodePlugins = [
4143
abortOnError: false,
4244
transformers: [util.removeAssertTransformer, importPathTransformer]
4345
}),
44-
json({ preferConst: true })
46+
json({ preferConst: true }),
47+
copy({
48+
targets: [
49+
{
50+
src: 'src/protos',
51+
dest: 'dist/exp/src'
52+
},
53+
{
54+
// Copy into generated source files to support API Extractor
55+
src: 'src/protos/firestore_proto_api.d.ts',
56+
dest: 'dist/exp/firestore/src/protos'
57+
}
58+
]
59+
}),
60+
replace({
61+
'process.env.FIRESTORE_PROTO_ROOT': JSON.stringify('src/protos')
62+
})
4563
];
4664

4765
const browserPlugins = [

0 commit comments

Comments
 (0)