Skip to content

Commit 5889d76

Browse files
committed
Update priority param strings
1 parent 2ae759b commit 5889d76

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

repo-scripts/api-documenter/src/documenters/MarkdownDocumenter.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -960,9 +960,6 @@ page_type: reference
960960
}
961961
const sortedFunctionsFirstParamKeys = Object.keys(functionsRowGroup).sort(
962962
(a, b) => {
963-
if (!a || !b) {
964-
console.log(`Missing one. a:${a}, b:${b}`);
965-
}
966963
if (priorityParams.includes(a) && priorityParams.includes(b)) {
967964
return priorityParams.indexOf(a) - priorityParams.indexOf(b);
968965
} else if (priorityParams.includes(a)) {

scripts/docgen/docgen.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ https://github.com/firebase/firebase-js-sdk
3939
const tmpDir = `${projectRoot}/temp`;
4040
const EXCLUDED_PACKAGES = ['app-compat', 'util', 'rules-unit-testing'];
4141

42+
/**
43+
* When ordering functions, will prioritize these first params at
44+
* the top, in order.
45+
*/
46+
const PREFERRED_PARAMS = [
47+
'app',
48+
'analyticsInstance',
49+
'appCheckInstance',
50+
'db',
51+
'firestore',
52+
'functionsInstance',
53+
'installations',
54+
'messaging',
55+
'performance',
56+
'remoteConfig',
57+
'storage'
58+
];
59+
4260
yargs
4361
.command(
4462
'$0',
@@ -183,7 +201,7 @@ async function generateDocs(
183201
'--project',
184202
'js',
185203
'--sort-functions',
186-
'app,appCheck,auth,analytics,database,firestore,functions,storage,installations,messaging,performance,remoteConfig'
204+
PREFERRED_PARAMS.join(',')
187205
],
188206
{ stdio: 'inherit' }
189207
);

0 commit comments

Comments
 (0)