Skip to content

Commit 43c5c6d

Browse files
authored
Add app-check-compat (#5073)
1 parent 04a0560 commit 43c5c6d

12 files changed

+609
-1
lines changed

.changeset/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"firebase-messaging-integration-test",
1616
"firebase-compat-interop-test",
1717
"firebase-compat-typings-test",
18+
"@firebase/app-compat",
1819
"@firebase/app-exp",
20+
"@firebase/app-check-compat",
1921
"@firebase/app-check-exp",
2022
"@firebase/analytics-compat",
2123
"@firebase/analytics-exp",
@@ -32,7 +34,6 @@
3234
"@firebase/remote-config-exp",
3335
"@firebase/remote-config-compat",
3436
"firebase-exp",
35-
"@firebase/app-compat",
3637
"@firebase/changelog-generator",
3738
"firebase-size-analysis"
3839
],
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @license
3+
* Copyright 2021 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
const path = require('path');
18+
19+
module.exports = {
20+
'extends': '../../config/.eslintrc.js',
21+
'parserOptions': {
22+
'project': 'tsconfig.json',
23+
'tsconfigRootDir': __dirname
24+
},
25+
rules: {
26+
'import/no-extraneous-dependencies': [
27+
'error',
28+
{
29+
'packageDir': [path.resolve(__dirname, '../../'), __dirname]
30+
}
31+
]
32+
}
33+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @firebase/app-check-compat
2+
3+
This is the Firebase App Check component (compat version) of the Firebase JS SDK.
4+
5+
**This package is not intended for direct usage, and should only be used via the officially supported [`firebase`](https://www.npmjs.com/package/firebase) package.**
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* @license
3+
* Copyright 2021 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
// eslint-disable-next-line @typescript-eslint/no-require-imports
19+
const karmaBase = require('../../config/karma.base');
20+
21+
const files = [`**/*.test.ts`];
22+
23+
module.exports = function (config) {
24+
config.set({
25+
...karmaBase,
26+
files,
27+
preprocessors: { '**/*.ts': ['webpack', 'sourcemap'] },
28+
frameworks: ['mocha']
29+
});
30+
};
31+
32+
module.exports.files = files;
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "@firebase/app-check-compat",
3+
"version": "0.0.900",
4+
"private": true,
5+
"description": "A compat App Check package for new firebase packages",
6+
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
7+
"main": "dist/index.cjs.js",
8+
"browser": "dist/index.esm2017.js",
9+
"module": "dist/index.esm2017.js",
10+
"files": [
11+
"dist"
12+
],
13+
"scripts": {
14+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
15+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
16+
"build": "rollup -c",
17+
"build:release": "rollup -c rollup.config.release.js",
18+
"build:deps": "lerna run --scope @firebase/app-check-compat --include-dependencies build",
19+
"dev": "rollup -c -w",
20+
"test": "run-p lint test:browser",
21+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
22+
"test:browser": "karma start --single-run --nocache"
23+
},
24+
"peerDependencies": {
25+
"@firebase/app-compat": "0.x"
26+
},
27+
"dependencies": {
28+
"@firebase/app-check-exp": "0.0.900",
29+
"@firebase/logger": "0.2.6",
30+
"@firebase/util": "1.1.0",
31+
"@firebase/component": "0.5.3",
32+
"tslib": "^2.1.0"
33+
},
34+
"license": "Apache-2.0",
35+
"devDependencies": {
36+
"@firebase/app-compat": "0.0.900",
37+
"rollup": "2.33.2",
38+
"@rollup/plugin-commonjs": "17.1.0",
39+
"@rollup/plugin-json": "4.1.0",
40+
"@rollup/plugin-node-resolve": "11.2.0",
41+
"rollup-plugin-typescript2": "0.29.0",
42+
"typescript": "4.2.2"
43+
},
44+
"repository": {
45+
"directory": "packages/app-check",
46+
"type": "git",
47+
"url": "https://github.com/firebase/firebase-js-sdk.git"
48+
},
49+
"bugs": {
50+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
51+
},
52+
"typings": "dist/src/index.d.ts",
53+
"nyc": {
54+
"extension": [
55+
".ts"
56+
],
57+
"reportDir": "./coverage/node"
58+
},
59+
"esm5": "dist/index.esm.js"
60+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* @license
3+
* Copyright 2021 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import json from '@rollup/plugin-json';
19+
import typescriptPlugin from 'rollup-plugin-typescript2';
20+
import typescript from 'typescript';
21+
import { es2017BuildsNoPlugin, es5BuildsNoPlugin } from './rollup.shared';
22+
23+
/**
24+
* ES5 Builds
25+
*/
26+
const es5BuildPlugins = [
27+
typescriptPlugin({
28+
typescript
29+
}),
30+
json()
31+
];
32+
33+
const es5Builds = es5BuildsNoPlugin.map(build => ({
34+
...build,
35+
plugins: es5BuildPlugins
36+
}));
37+
38+
/**
39+
* ES2017 Builds
40+
*/
41+
const es2017BuildPlugins = [
42+
typescriptPlugin({
43+
typescript,
44+
tsconfigOverride: {
45+
compilerOptions: {
46+
target: 'es2017'
47+
}
48+
}
49+
}),
50+
json({ preferConst: true })
51+
];
52+
53+
const es2017Builds = es2017BuildsNoPlugin.map(build => ({
54+
...build,
55+
plugins: es2017BuildPlugins
56+
}));
57+
58+
export default [...es5Builds, ...es2017Builds];
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* @license
3+
* Copyright 2021 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import typescriptPlugin from 'rollup-plugin-typescript2';
19+
import typescript from 'typescript';
20+
import json from '@rollup/plugin-json';
21+
import { importPathTransformer } from '../../scripts/exp/ts-transform-import-path';
22+
import { es2017BuildsNoPlugin, es5BuildsNoPlugin } from './rollup.shared';
23+
24+
/**
25+
* ES5 Builds
26+
*/
27+
const es5BuildPlugins = [
28+
typescriptPlugin({
29+
typescript,
30+
clean: true,
31+
abortOnError: false,
32+
transformers: [importPathTransformer]
33+
}),
34+
json()
35+
];
36+
37+
const es5Builds = es5BuildsNoPlugin.map(build => ({
38+
...build,
39+
plugins: es5BuildPlugins
40+
}));
41+
42+
/**
43+
* ES2017 Builds
44+
*/
45+
const es2017BuildPlugins = [
46+
typescriptPlugin({
47+
typescript,
48+
tsconfigOverride: {
49+
compilerOptions: {
50+
target: 'es2017'
51+
}
52+
},
53+
abortOnError: false,
54+
clean: true,
55+
transformers: [importPathTransformer]
56+
}),
57+
json({
58+
preferConst: true
59+
})
60+
];
61+
62+
const es2017Builds = es2017BuildsNoPlugin.map(build => ({
63+
...build,
64+
plugins: es2017BuildPlugins
65+
}));
66+
67+
export default [...es5Builds, ...es2017Builds];
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* @license
3+
* Copyright 2021 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
import pkg from './package.json';
18+
19+
const deps = [
20+
...Object.keys(Object.assign({}, pkg.peerDependencies, pkg.dependencies)),
21+
'@firebase/app'
22+
];
23+
24+
export const es5BuildsNoPlugin = [
25+
/**
26+
* Browser Builds
27+
*/
28+
{
29+
input: 'src/index.ts',
30+
output: [
31+
{ file: pkg.main, format: 'cjs', sourcemap: true },
32+
{ file: pkg.esm5, format: 'es', sourcemap: true }
33+
],
34+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
35+
}
36+
];
37+
38+
/**
39+
* ES2017 Builds
40+
*/
41+
export const es2017BuildsNoPlugin = [
42+
{
43+
/**
44+
* Browser Build
45+
*/
46+
input: 'src/index.ts',
47+
output: {
48+
file: pkg.browser,
49+
format: 'es',
50+
sourcemap: true
51+
},
52+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
53+
}
54+
];

0 commit comments

Comments
 (0)