Skip to content

Fix health metrics #5509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/messaging/sw/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@firebase/messaging",
"name": "@firebase/messaging-sw",
"description": "",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"module": "../dist/index.sw.esm2017.js",
Expand Down
369 changes: 53 additions & 316 deletions repo-scripts/size-analysis/analysis-helper.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions repo-scripts/size-analysis/bundle-analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { bundleWithRollup } from './bundle/rollup';
import { bundleWithWebpack } from './bundle/webpack';
import { calculateContentSize } from './util';
import { minify } from './bundle/minify';
import { extractDeclarations, MemberList } from './analysis-helper';
import { extractAllTopLevelSymbols, MemberList } from './analysis-helper';

interface BundleAnalysisArgs {
input: string;
Expand Down Expand Up @@ -392,7 +392,7 @@ async function analyzeBundleWithBundler(
analysisResult.debugInfo = {
pathToBundle: bundleFilePath,
pathToMinifiedBundle: minifiedBundleFilePath,
dependencies: extractDeclarations(bundleFilePath)
dependencies: extractAllTopLevelSymbols(bundleFilePath)
};
}

Expand Down
3 changes: 2 additions & 1 deletion repo-scripts/size-analysis/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

import * as yargs from 'yargs';
import { extractAllTopLevelSymbols, extractExports } from './analysis-helper';
import { run as runBundleAnalysis } from './bundle-analysis';
import { analyzePackageSize } from './package-analysis';

Expand All @@ -29,7 +30,7 @@ yargs
type: 'array',
alias: 'im',
desc:
'The name of the module(s) to be analyzed. example: --inputModule "@firebase/functions-exp" "firebase/auth-exp"'
'The name of the module(s) to be analyzed. example: --inputModule "@firebase/functions" "firebase/auth"'
},
inputDtsFile: {
type: 'string',
Expand Down
5 changes: 5 additions & 0 deletions repo-scripts/size-analysis/package-analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ export async function analyzePackageSize(
`${projectRoot}/packages/*`
]);
allModulesLocation = allModulesLocation.filter(path => {
const pkgJsonPath = `${path}/package.json`;
if (!fs.existsSync(pkgJsonPath)){
return false;
}

const json = JSON.parse(
fs.readFileSync(`${path}/package.json`, { encoding: 'utf-8' })
);
Expand Down
Loading