@freegamestore/compliance 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checks/audio-mute-respect.d.ts.map +1 -1
- package/dist/checks/audio-mute-respect.js +1 -5
- package/dist/checks/audio-mute-respect.js.map +1 -1
- package/dist/checks/brand-fonts.d.ts.map +1 -1
- package/dist/checks/brand-fonts.js +1 -5
- package/dist/checks/brand-fonts.js.map +1 -1
- package/dist/checks/claude-md-slim.js +1 -1
- package/dist/checks/claude-md-slim.js.map +1 -1
- package/dist/checks/no-any-types.d.ts.map +1 -1
- package/dist/checks/no-any-types.js +1 -5
- package/dist/checks/no-any-types.js.map +1 -1
- package/dist/checks/no-brand-overrides.d.ts.map +1 -1
- package/dist/checks/no-brand-overrides.js +34 -8
- package/dist/checks/no-brand-overrides.js.map +1 -1
- package/dist/checks/no-console-log.d.ts.map +1 -1
- package/dist/checks/no-console-log.js +1 -5
- package/dist/checks/no-console-log.js.map +1 -1
- package/dist/checks/no-cookies.d.ts.map +1 -1
- package/dist/checks/no-cookies.js +1 -5
- package/dist/checks/no-cookies.js.map +1 -1
- package/dist/checks/no-excessive-inline-styles.d.ts.map +1 -1
- package/dist/checks/no-excessive-inline-styles.js +1 -5
- package/dist/checks/no-excessive-inline-styles.js.map +1 -1
- package/dist/checks/no-external-fetch.d.ts.map +1 -1
- package/dist/checks/no-external-fetch.js +1 -5
- package/dist/checks/no-external-fetch.js.map +1 -1
- package/dist/checks/no-external-scripts.d.ts +2 -2
- package/dist/checks/no-external-scripts.d.ts.map +1 -1
- package/dist/checks/no-external-scripts.js +26 -12
- package/dist/checks/no-external-scripts.js.map +1 -1
- package/dist/checks/no-hardcoded-colors.d.ts.map +1 -1
- package/dist/checks/no-hardcoded-colors.js +1 -5
- package/dist/checks/no-hardcoded-colors.js.map +1 -1
- package/dist/checks/no-page-policy.d.ts +17 -0
- package/dist/checks/no-page-policy.d.ts.map +1 -0
- package/dist/checks/no-page-policy.js +45 -0
- package/dist/checks/no-page-policy.js.map +1 -0
- package/dist/checks/no-payment-capabilities.d.ts +4 -0
- package/dist/checks/no-payment-capabilities.d.ts.map +1 -0
- package/dist/checks/no-payment-capabilities.js +129 -0
- package/dist/checks/no-payment-capabilities.js.map +1 -0
- package/dist/checks/no-payment-sdk.d.ts.map +1 -1
- package/dist/checks/no-payment-sdk.js +1 -5
- package/dist/checks/no-payment-sdk.js.map +1 -1
- package/dist/checks/no-placeholders.d.ts.map +1 -1
- package/dist/checks/no-placeholders.js +1 -5
- package/dist/checks/no-placeholders.js.map +1 -1
- package/dist/checks/no-scroll.d.ts.map +1 -1
- package/dist/checks/no-scroll.js +1 -5
- package/dist/checks/no-scroll.js.map +1 -1
- package/dist/checks/no-tracking.d.ts.map +1 -1
- package/dist/checks/no-tracking.js +19 -6
- package/dist/checks/no-tracking.js.map +1 -1
- package/dist/checks/permissions-declared.d.ts +13 -0
- package/dist/checks/permissions-declared.d.ts.map +1 -0
- package/dist/checks/permissions-declared.js +43 -0
- package/dist/checks/permissions-declared.js.map +1 -0
- package/dist/checks/pwa-offline.d.ts.map +1 -1
- package/dist/checks/pwa-offline.js +10 -4
- package/dist/checks/pwa-offline.js.map +1 -1
- package/dist/checks/seo-metadata.d.ts +5 -0
- package/dist/checks/seo-metadata.d.ts.map +1 -0
- package/dist/checks/seo-metadata.js +23 -0
- package/dist/checks/seo-metadata.js.map +1 -0
- package/dist/checks/unsafe-vh.d.ts.map +1 -1
- package/dist/checks/unsafe-vh.js +1 -5
- package/dist/checks/unsafe-vh.js.map +1 -1
- package/dist/checks/uses-game-sdk.d.ts.map +1 -1
- package/dist/checks/uses-game-sdk.js +1 -5
- package/dist/checks/uses-game-sdk.js.map +1 -1
- package/dist/checks/uses-localstorage.d.ts +7 -3
- package/dist/checks/uses-localstorage.d.ts.map +1 -1
- package/dist/checks/uses-localstorage.js +12 -14
- package/dist/checks/uses-localstorage.js.map +1 -1
- package/dist/game-deploy-workflow.d.ts +12 -0
- package/dist/game-deploy-workflow.d.ts.map +1 -0
- package/dist/game-deploy-workflow.js +34 -0
- package/dist/game-deploy-workflow.js.map +1 -0
- package/dist/game-metadata.d.ts +60 -0
- package/dist/game-metadata.d.ts.map +1 -0
- package/dist/game-metadata.js +194 -0
- package/dist/game-metadata.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/inline-manifest.d.ts.map +1 -1
- package/dist/lib/inline-manifest.js +14 -59
- package/dist/lib/inline-manifest.js.map +1 -1
- package/dist/lib/path.d.ts +11 -0
- package/dist/lib/path.d.ts.map +1 -0
- package/dist/lib/path.js +15 -0
- package/dist/lib/path.js.map +1 -0
- package/dist/lib/permissions.d.ts +44 -0
- package/dist/lib/permissions.d.ts.map +1 -0
- package/dist/lib/permissions.js +132 -0
- package/dist/lib/permissions.js.map +1 -0
- package/dist/lib/strip.d.ts.map +1 -1
- package/dist/lib/strip.js +20 -26
- package/dist/lib/strip.js.map +1 -1
- package/dist/live/index.js +1 -1
- package/dist/live/index.js.map +1 -1
- package/dist/run-checks.d.ts.map +1 -1
- package/dist/run-checks.js +8 -0
- package/dist/run-checks.js.map +1 -1
- package/dist/worker.d.ts +6 -0
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +6 -0
- package/dist/worker.js.map +1 -1
- package/package.json +3 -2
|
@@ -2,9 +2,13 @@ import type { FileSource } from '../lib/file-source.js';
|
|
|
2
2
|
import type { CheckResult } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Games should save progress and/or high scores locally so players feel
|
|
5
|
-
* rewarded for returning. This check looks for `localStorage` usage
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* rewarded for returning. This check looks for `localStorage` usage
|
|
6
|
+
* anywhere under `web/src/`.
|
|
7
|
+
*
|
|
8
|
+
* Direct `localStorage` use is the only signal: the games SDK ships no
|
|
9
|
+
* local-persistence hook (its own localStorage keys are just the theme
|
|
10
|
+
* and text-size prefs), and `useLeaderboard` posts to the remote
|
|
11
|
+
* leaderboard Worker rather than storing anything locally.
|
|
8
12
|
*
|
|
9
13
|
* WARN level — not every game needs persistence. Short-session games
|
|
10
14
|
* (Flappy Bird, reaction timers) are perfectly valid without saves. The
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uses-localstorage.d.ts","sourceRoot":"","sources":["../../src/checks/uses-localstorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"uses-localstorage.d.ts","sourceRoot":"","sources":["../../src/checks/uses-localstorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CA4BpF"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Games should save progress and/or high scores locally so players feel
|
|
3
|
-
* rewarded for returning. This check looks for `localStorage` usage
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* rewarded for returning. This check looks for `localStorage` usage
|
|
4
|
+
* anywhere under `web/src/`.
|
|
5
|
+
*
|
|
6
|
+
* Direct `localStorage` use is the only signal: the games SDK ships no
|
|
7
|
+
* local-persistence hook (its own localStorage keys are just the theme
|
|
8
|
+
* and text-size prefs), and `useLeaderboard` posts to the remote
|
|
9
|
+
* leaderboard Worker rather than storing anything locally.
|
|
6
10
|
*
|
|
7
11
|
* WARN level — not every game needs persistence. Short-session games
|
|
8
12
|
* (Flappy Bird, reaction timers) are perfectly valid without saves. The
|
|
@@ -15,7 +19,6 @@ export async function checkUsesLocalStorage(source) {
|
|
|
15
19
|
const content = await source.read(path);
|
|
16
20
|
if (!content)
|
|
17
21
|
continue;
|
|
18
|
-
// Direct localStorage usage
|
|
19
22
|
if (/\blocalStorage\b/.test(content)) {
|
|
20
23
|
return {
|
|
21
24
|
name: 'Local storage for progress/scores',
|
|
@@ -23,22 +26,17 @@ export async function checkUsesLocalStorage(source) {
|
|
|
23
26
|
detail: `localStorage usage found in ${path}`,
|
|
24
27
|
};
|
|
25
28
|
}
|
|
26
|
-
// SDK high-score hook
|
|
27
|
-
if (/\buseHighScore\b/.test(content)) {
|
|
28
|
-
return {
|
|
29
|
-
name: 'Local storage for progress/scores',
|
|
30
|
-
status: 'pass',
|
|
31
|
-
detail: `useHighScore hook found in ${path}`,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
29
|
}
|
|
35
30
|
return {
|
|
36
31
|
name: 'Local storage for progress/scores',
|
|
37
32
|
status: 'warn',
|
|
38
|
-
detail: 'no localStorage usage
|
|
33
|
+
detail: 'no localStorage usage found in web/src/',
|
|
39
34
|
suggestions: [
|
|
40
35
|
'Consider saving high scores or progress with localStorage so returning players feel rewarded.',
|
|
41
|
-
|
|
36
|
+
// Hidden: the global leaderboard is not surfaced to users right now (issue
|
|
37
|
+
// #31), so stop recommending useLeaderboard(). Restore alongside the
|
|
38
|
+
// games-sdk export when the leaderboard is re-enabled.
|
|
39
|
+
// 'To also publish scores to the global leaderboard, use useLeaderboard() from @freegamestore/games — it complements a local save rather than replacing it.',
|
|
42
40
|
],
|
|
43
41
|
};
|
|
44
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uses-localstorage.js","sourceRoot":"","sources":["../../src/checks/uses-localstorage.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"uses-localstorage.js","sourceRoot":"","sources":["../../src/checks/uses-localstorage.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAAkB;IAC5D,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;YAAE,SAAS;QAE3C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO;YAAE,SAAS;QAEvB,IAAI,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACrC,OAAO;gBACL,IAAI,EAAE,mCAAmC;gBACzC,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,+BAA+B,IAAI,EAAE;aAC9C,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,mCAAmC;QACzC,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,yCAAyC;QACjD,WAAW,EAAE;YACX,+FAA+F;YAC/F,2EAA2E;YAC3E,qEAAqE;YACrE,uDAAuD;YACvD,8JAA8J;SAC/J;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The reusable pipeline every game's deploy.yml calls (#123): build, `fgs check`
|
|
2
|
+
* compliance gate, version.json stamp, smoke test, then R2 sync on push to main. */
|
|
3
|
+
export declare const GAME_CI_WORKFLOW = "freegamestore-online/ci-workflows/.github/workflows/game-ci.yml@main";
|
|
4
|
+
/**
|
|
5
|
+
* The `.github/workflows/deploy.yml` a game repo gets when `fgs publish` or the
|
|
6
|
+
* VibeCode agent has to supply one (#111). The single source for both — they
|
|
7
|
+
* used to carry their own inline copies, which drifted. The pipeline itself
|
|
8
|
+
* lives in ci-workflows, so this is only the thin caller the fleet already uses.
|
|
9
|
+
* Node-free: re-exported from `./worker` for the agent.
|
|
10
|
+
*/
|
|
11
|
+
export declare const GAME_DEPLOY_WORKFLOW = "name: CI / Deploy\n\non:\n push:\n branches: [main]\n pull_request:\n branches: [main]\n workflow_dispatch:\n\n# Most-recent push/PR for a ref wins; older runs are cancelled so a deploy\n# never wins a race against a fresh build of the same branch.\nconcurrency:\n group: ${{ github.workflow }}-${{ github.ref }}\n cancel-in-progress: true\n\njobs:\n ci-and-deploy:\n uses: freegamestore-online/ci-workflows/.github/workflows/game-ci.yml@main\n permissions:\n contents: read\n deployments: write\n secrets: inherit\n";
|
|
12
|
+
//# sourceMappingURL=game-deploy-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-deploy-workflow.d.ts","sourceRoot":"","sources":["../src/game-deploy-workflow.ts"],"names":[],"mappings":"AAAA;qFACqF;AACrF,eAAO,MAAM,gBAAgB,yEAC2C,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,wiBAsBhC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The reusable pipeline every game's deploy.yml calls (#123): build, `fgs check`
|
|
2
|
+
* compliance gate, version.json stamp, smoke test, then R2 sync on push to main. */
|
|
3
|
+
export const GAME_CI_WORKFLOW = 'freegamestore-online/ci-workflows/.github/workflows/game-ci.yml@main';
|
|
4
|
+
/**
|
|
5
|
+
* The `.github/workflows/deploy.yml` a game repo gets when `fgs publish` or the
|
|
6
|
+
* VibeCode agent has to supply one (#111). The single source for both — they
|
|
7
|
+
* used to carry their own inline copies, which drifted. The pipeline itself
|
|
8
|
+
* lives in ci-workflows, so this is only the thin caller the fleet already uses.
|
|
9
|
+
* Node-free: re-exported from `./worker` for the agent.
|
|
10
|
+
*/
|
|
11
|
+
export const GAME_DEPLOY_WORKFLOW = `name: CI / Deploy
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
push:
|
|
15
|
+
branches: [main]
|
|
16
|
+
pull_request:
|
|
17
|
+
branches: [main]
|
|
18
|
+
workflow_dispatch:
|
|
19
|
+
|
|
20
|
+
# Most-recent push/PR for a ref wins; older runs are cancelled so a deploy
|
|
21
|
+
# never wins a race against a fresh build of the same branch.
|
|
22
|
+
concurrency:
|
|
23
|
+
group: \${{ github.workflow }}-\${{ github.ref }}
|
|
24
|
+
cancel-in-progress: true
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
ci-and-deploy:
|
|
28
|
+
uses: ${GAME_CI_WORKFLOW}
|
|
29
|
+
permissions:
|
|
30
|
+
contents: read
|
|
31
|
+
deployments: write
|
|
32
|
+
secrets: inherit
|
|
33
|
+
`;
|
|
34
|
+
//# sourceMappingURL=game-deploy-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-deploy-workflow.js","sourceRoot":"","sources":["../src/game-deploy-workflow.ts"],"names":[],"mappings":"AAAA;qFACqF;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAC3B,sEAAsE,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;YAiBxB,gBAAgB;;;;;CAK3B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared game metadata: unified game categories and reference viewports
|
|
3
|
+
* for compliance testing and storefront categorization.
|
|
4
|
+
*
|
|
5
|
+
* This consolidates duplicated category and viewport lists across:
|
|
6
|
+
* - apps/console (CreateGameForm.tsx, GameSettings.tsx)
|
|
7
|
+
* - packages/fgs-cli (publish.ts, screencheck-matrix.ts)
|
|
8
|
+
* - jobs/auditor (audit.ts)
|
|
9
|
+
* - apps/admin (publish.ts)
|
|
10
|
+
*/
|
|
11
|
+
/** Game category with slug and display label. */
|
|
12
|
+
export interface GameCategory {
|
|
13
|
+
slug: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}
|
|
16
|
+
/** Reference viewport for compliance testing. */
|
|
17
|
+
export interface ReferenceViewport {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
orientation: 'portrait' | 'landscape';
|
|
23
|
+
share: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Canonical game categories. The slug is what's stored in the registry and
|
|
27
|
+
* sent to the API; the label is displayed in the UI.
|
|
28
|
+
*/
|
|
29
|
+
export declare const GAME_CATEGORIES: GameCategory[];
|
|
30
|
+
export declare const GAME_CATEGORY_LABELS: readonly ["Strategy", "Brain Training", "Arcade", "Racing", "Sports", "Cards", "Casual", "Puzzle", "Board", "RPG", "Action", "Other (specify in description)"];
|
|
31
|
+
/**
|
|
32
|
+
* Reference viewports for compliance testing. These match the device matrix
|
|
33
|
+
* used for viewport coverage on the storefront. The `share` field represents
|
|
34
|
+
* the cumulative percentage of devices with at least this viewport width.
|
|
35
|
+
*
|
|
36
|
+
* Source: blended StatCounter + caniuse share-of-screens, rounded.
|
|
37
|
+
*/
|
|
38
|
+
export declare const REFERENCE_VIEWPORTS: ReferenceViewport[];
|
|
39
|
+
/**
|
|
40
|
+
* Look up a category by slug.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getCategoryBySlug(slug: string): GameCategory | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Look up a category by label (case-insensitive).
|
|
45
|
+
*/
|
|
46
|
+
export declare function getCategoryByLabel(label: string): GameCategory | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Normalize a category input (slug or label) to its canonical slug.
|
|
49
|
+
* Returns the slug if found, otherwise returns the input as-is (likely invalid).
|
|
50
|
+
*/
|
|
51
|
+
export declare function normalizeCategorySlug(input: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get all category slugs (for validation).
|
|
54
|
+
*/
|
|
55
|
+
export declare function getCategorySlugs(): string[];
|
|
56
|
+
/**
|
|
57
|
+
* Check if a slug is valid.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isValidCategorySlug(slug: string): boolean;
|
|
60
|
+
//# sourceMappingURL=game-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-metadata.d.ts","sourceRoot":"","sources":["../src/game-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,iDAAiD;AACjD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,UAAU,GAAG,WAAW,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,EAazC,CAAC;AAGF,eAAO,MAAM,oBAAoB,gKAavB,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAmGlD,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAExE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAG1E;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa3D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared game metadata: unified game categories and reference viewports
|
|
3
|
+
* for compliance testing and storefront categorization.
|
|
4
|
+
*
|
|
5
|
+
* This consolidates duplicated category and viewport lists across:
|
|
6
|
+
* - apps/console (CreateGameForm.tsx, GameSettings.tsx)
|
|
7
|
+
* - packages/fgs-cli (publish.ts, screencheck-matrix.ts)
|
|
8
|
+
* - jobs/auditor (audit.ts)
|
|
9
|
+
* - apps/admin (publish.ts)
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Canonical game categories. The slug is what's stored in the registry and
|
|
13
|
+
* sent to the API; the label is displayed in the UI.
|
|
14
|
+
*/
|
|
15
|
+
export const GAME_CATEGORIES = [
|
|
16
|
+
{ slug: 'strategy', label: 'Strategy' },
|
|
17
|
+
{ slug: 'brain-training', label: 'Brain Training' },
|
|
18
|
+
{ slug: 'arcade', label: 'Arcade' },
|
|
19
|
+
{ slug: 'racing', label: 'Racing' },
|
|
20
|
+
{ slug: 'sports', label: 'Sports' },
|
|
21
|
+
{ slug: 'cards', label: 'Cards' },
|
|
22
|
+
{ slug: 'casual', label: 'Casual' },
|
|
23
|
+
{ slug: 'puzzle', label: 'Puzzle' },
|
|
24
|
+
{ slug: 'board', label: 'Board' },
|
|
25
|
+
{ slug: 'rpg', label: 'RPG' },
|
|
26
|
+
{ slug: 'action', label: 'Action' },
|
|
27
|
+
{ slug: 'other', label: 'Other (specify in description)' },
|
|
28
|
+
];
|
|
29
|
+
// Literal category labels for type-safe CLI prompts
|
|
30
|
+
export const GAME_CATEGORY_LABELS = [
|
|
31
|
+
'Strategy',
|
|
32
|
+
'Brain Training',
|
|
33
|
+
'Arcade',
|
|
34
|
+
'Racing',
|
|
35
|
+
'Sports',
|
|
36
|
+
'Cards',
|
|
37
|
+
'Casual',
|
|
38
|
+
'Puzzle',
|
|
39
|
+
'Board',
|
|
40
|
+
'RPG',
|
|
41
|
+
'Action',
|
|
42
|
+
'Other (specify in description)',
|
|
43
|
+
];
|
|
44
|
+
/**
|
|
45
|
+
* Reference viewports for compliance testing. These match the device matrix
|
|
46
|
+
* used for viewport coverage on the storefront. The `share` field represents
|
|
47
|
+
* the cumulative percentage of devices with at least this viewport width.
|
|
48
|
+
*
|
|
49
|
+
* Source: blended StatCounter + caniuse share-of-screens, rounded.
|
|
50
|
+
*/
|
|
51
|
+
export const REFERENCE_VIEWPORTS = [
|
|
52
|
+
// Portrait
|
|
53
|
+
{
|
|
54
|
+
id: 'p-320',
|
|
55
|
+
label: '320x568 iPhone SE',
|
|
56
|
+
width: 320,
|
|
57
|
+
height: 568,
|
|
58
|
+
orientation: 'portrait',
|
|
59
|
+
share: 99,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'p-360',
|
|
63
|
+
label: '360x800 Android',
|
|
64
|
+
width: 360,
|
|
65
|
+
height: 800,
|
|
66
|
+
orientation: 'portrait',
|
|
67
|
+
share: 96,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'p-393',
|
|
71
|
+
label: '393x852 iPhone 15',
|
|
72
|
+
width: 393,
|
|
73
|
+
height: 852,
|
|
74
|
+
orientation: 'portrait',
|
|
75
|
+
share: 92,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'p-414',
|
|
79
|
+
label: '414x896 iPhone 11 PM',
|
|
80
|
+
width: 414,
|
|
81
|
+
height: 896,
|
|
82
|
+
orientation: 'portrait',
|
|
83
|
+
share: 88,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'p-600',
|
|
87
|
+
label: '600x800 Tablet',
|
|
88
|
+
width: 600,
|
|
89
|
+
height: 800,
|
|
90
|
+
orientation: 'portrait',
|
|
91
|
+
share: 60,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'p-768',
|
|
95
|
+
label: '768x1024 iPad',
|
|
96
|
+
width: 768,
|
|
97
|
+
height: 1024,
|
|
98
|
+
orientation: 'portrait',
|
|
99
|
+
share: 35,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 'p-1024',
|
|
103
|
+
label: '1024x1366 iPad Pro',
|
|
104
|
+
width: 1024,
|
|
105
|
+
height: 1366,
|
|
106
|
+
orientation: 'portrait',
|
|
107
|
+
share: 20,
|
|
108
|
+
},
|
|
109
|
+
// Landscape
|
|
110
|
+
{
|
|
111
|
+
id: 'l-568',
|
|
112
|
+
label: '568x320 iPhone SE land.',
|
|
113
|
+
width: 568,
|
|
114
|
+
height: 320,
|
|
115
|
+
orientation: 'landscape',
|
|
116
|
+
share: 99,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'l-667',
|
|
120
|
+
label: '667x375 iPhone 8 land.',
|
|
121
|
+
width: 667,
|
|
122
|
+
height: 375,
|
|
123
|
+
orientation: 'landscape',
|
|
124
|
+
share: 96,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'l-736',
|
|
128
|
+
label: '736x414 iPhone+ land.',
|
|
129
|
+
width: 736,
|
|
130
|
+
height: 414,
|
|
131
|
+
orientation: 'landscape',
|
|
132
|
+
share: 88,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 'l-1024',
|
|
136
|
+
label: '1024x768 iPad land.',
|
|
137
|
+
width: 1024,
|
|
138
|
+
height: 768,
|
|
139
|
+
orientation: 'landscape',
|
|
140
|
+
share: 35,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 'l-1366',
|
|
144
|
+
label: '1366x1024 iPad Pro land.',
|
|
145
|
+
width: 1366,
|
|
146
|
+
height: 1024,
|
|
147
|
+
orientation: 'landscape',
|
|
148
|
+
share: 20,
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
/**
|
|
152
|
+
* Look up a category by slug.
|
|
153
|
+
*/
|
|
154
|
+
export function getCategoryBySlug(slug) {
|
|
155
|
+
return GAME_CATEGORIES.find((c) => c.slug === slug);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Look up a category by label (case-insensitive).
|
|
159
|
+
*/
|
|
160
|
+
export function getCategoryByLabel(label) {
|
|
161
|
+
const normalized = label.toLowerCase().trim();
|
|
162
|
+
return GAME_CATEGORIES.find((c) => c.label.toLowerCase() === normalized);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Normalize a category input (slug or label) to its canonical slug.
|
|
166
|
+
* Returns the slug if found, otherwise returns the input as-is (likely invalid).
|
|
167
|
+
*/
|
|
168
|
+
export function normalizeCategorySlug(input) {
|
|
169
|
+
const trimmed = input.trim();
|
|
170
|
+
// Try as a slug first
|
|
171
|
+
if (GAME_CATEGORIES.find((c) => c.slug === trimmed)) {
|
|
172
|
+
return trimmed;
|
|
173
|
+
}
|
|
174
|
+
// Try as a label
|
|
175
|
+
const byLabel = getCategoryByLabel(trimmed);
|
|
176
|
+
if (byLabel) {
|
|
177
|
+
return byLabel.slug;
|
|
178
|
+
}
|
|
179
|
+
// Not found; return as-is
|
|
180
|
+
return trimmed;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Get all category slugs (for validation).
|
|
184
|
+
*/
|
|
185
|
+
export function getCategorySlugs() {
|
|
186
|
+
return GAME_CATEGORIES.map((c) => c.slug);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Check if a slug is valid.
|
|
190
|
+
*/
|
|
191
|
+
export function isValidCategorySlug(slug) {
|
|
192
|
+
return GAME_CATEGORIES.some((c) => c.slug === slug);
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=game-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-metadata.js","sourceRoot":"","sources":["../src/game-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkBH;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACvC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACnD,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACnC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACnC,EAAE,IAAI,EAAE,QAAQ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U,mBAAmB,CAAC,IAAY;IAC9C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,16 +19,20 @@ import { checkNoExcessiveInlineStyles } from './checks/no-excessive-inline-style
|
|
|
19
19
|
import { checkNoExternalFetch } from './checks/no-external-fetch.js';
|
|
20
20
|
import { checkNoExternalScripts } from './checks/no-external-scripts.js';
|
|
21
21
|
import { checkNoHardcodedColors } from './checks/no-hardcoded-colors.js';
|
|
22
|
+
import { checkNoPagePolicy } from './checks/no-page-policy.js';
|
|
23
|
+
import { checkNoPaymentCapabilities } from './checks/no-payment-capabilities.js';
|
|
22
24
|
import { checkNoPaymentSdk } from './checks/no-payment-sdk.js';
|
|
23
25
|
import { checkNoPlaceholders } from './checks/no-placeholders.js';
|
|
24
26
|
import { checkNoScroll } from './checks/no-scroll.js';
|
|
25
27
|
import { checkNoTracking } from './checks/no-tracking.js';
|
|
28
|
+
import { checkPermissionsDeclared } from './checks/permissions-declared.js';
|
|
26
29
|
import { checkPwaIcons } from './checks/pwa-icons.js';
|
|
27
30
|
import { checkMaskableIcon } from './checks/pwa-maskable-icon.js';
|
|
28
31
|
import { checkPwaMeta } from './checks/pwa-meta.js';
|
|
29
32
|
import { checkPwaOffline } from './checks/pwa-offline.js';
|
|
30
33
|
import { checkReactStrictMode } from './checks/react-strict-mode.js';
|
|
31
34
|
import { checkSdkVersion } from './checks/sdk-version.js';
|
|
35
|
+
import { checkSeoMetadata } from './checks/seo-metadata.js';
|
|
32
36
|
import { checkStoreLink } from './checks/store-link.js';
|
|
33
37
|
import { checkTechVersions } from './checks/tech-versions.js';
|
|
34
38
|
import { checkTypescriptStrict } from './checks/typescript-strict.js';
|
|
@@ -41,11 +45,14 @@ import { fsFileSource } from './lib/fs-file-source.js';
|
|
|
41
45
|
import { isGameProject } from './lib/project-type.js';
|
|
42
46
|
import { runChecksFromFiles, runChecksOn } from './run-checks.js';
|
|
43
47
|
import type { CheckResult } from './types.js';
|
|
48
|
+
export { GAME_CI_WORKFLOW, GAME_DEPLOY_WORKFLOW } from './game-deploy-workflow.js';
|
|
49
|
+
export { GAME_CATEGORIES, GAME_CATEGORY_LABELS, type GameCategory, getCategoryByLabel, getCategoryBySlug, getCategorySlugs, isValidCategorySlug, normalizeCategorySlug, REFERENCE_VIEWPORTS, type ReferenceViewport, } from './game-metadata.js';
|
|
44
50
|
export type { FileSource } from './lib/file-source.js';
|
|
51
|
+
export { type DeclaredPermissions, detectPermissions, detectPermissionsInText, PERMISSION_IDS, PERMISSIONS, type PermissionInfo, parseDeclaredPermissions, } from './lib/permissions.js';
|
|
45
52
|
export type { LiveAuditInput, LiveAuditReport } from './live/index.js';
|
|
46
53
|
export { auditLive, checkBrandFontsLive, checkBundleSizeLive, checkManifestLive, checkNoTrackingLive, checkUnsafeVhLive, } from './live/index.js';
|
|
47
54
|
export type { CheckResult, CheckStatus } from './types.js';
|
|
48
|
-
export { checkAudioMuteRespect, checkBrandFonts, checkBrandTokens, checkBundleSize, checkClaudeMdSlim, checkDarkMode, checkDeployWorkflow, checkGameNaming, checkGitignoreComplete, checkHtmlMeta, checkLicenseMit, checkManifest, checkMaskableIcon, checkNoAnyTypes, checkNoBrandOverrides, checkNoConsoleLog, checkNoCookies, checkNoEnvProduction, checkNoExcessiveInlineStyles, checkNoExternalFetch, checkNoExternalScripts, checkNoHardcodedColors, checkNoPaymentSdk, checkNoPlaceholders, checkNoScroll, checkNoTracking, checkPwaIcons, checkPwaMeta, checkPwaOffline, checkReactStrictMode, checkSdkVersion, checkStoreLink, checkTechVersions, checkTypescriptStrict, checkUnsafeVh, checkUsesGameSdk, checkUsesLocalStorage, checkViewportSupport, fsFileSource, isGameProject, mapFileSource, runChecksFromFiles, runChecksOn, };
|
|
55
|
+
export { checkAudioMuteRespect, checkBrandFonts, checkBrandTokens, checkBundleSize, checkClaudeMdSlim, checkDarkMode, checkDeployWorkflow, checkGameNaming, checkGitignoreComplete, checkHtmlMeta, checkLicenseMit, checkManifest, checkMaskableIcon, checkNoAnyTypes, checkNoBrandOverrides, checkNoConsoleLog, checkNoCookies, checkNoEnvProduction, checkNoExcessiveInlineStyles, checkNoExternalFetch, checkNoExternalScripts, checkNoHardcodedColors, checkNoPagePolicy, checkNoPaymentCapabilities, checkNoPaymentSdk, checkNoPlaceholders, checkNoScroll, checkNoTracking, checkPermissionsDeclared, checkPwaIcons, checkPwaMeta, checkPwaOffline, checkReactStrictMode, checkSdkVersion, checkSeoMetadata, checkStoreLink, checkTechVersions, checkTypescriptStrict, checkUnsafeVh, checkUsesGameSdk, checkUsesLocalStorage, checkViewportSupport, fsFileSource, isGameProject, mapFileSource, runChecksFromFiles, runChecksOn, };
|
|
49
56
|
/**
|
|
50
57
|
* On-disk front door — CLI / CI. Reads from a real directory via
|
|
51
58
|
* fsFileSource (node:fs). The Map front door (`runChecksFromFiles`)
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,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Ae,EACf,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,WAAW,GACZ,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAEvE"}
|
package/dist/index.js
CHANGED
|
@@ -19,16 +19,20 @@ import { checkNoExcessiveInlineStyles } from './checks/no-excessive-inline-style
|
|
|
19
19
|
import { checkNoExternalFetch } from './checks/no-external-fetch.js';
|
|
20
20
|
import { checkNoExternalScripts } from './checks/no-external-scripts.js';
|
|
21
21
|
import { checkNoHardcodedColors } from './checks/no-hardcoded-colors.js';
|
|
22
|
+
import { checkNoPagePolicy } from './checks/no-page-policy.js';
|
|
23
|
+
import { checkNoPaymentCapabilities } from './checks/no-payment-capabilities.js';
|
|
22
24
|
import { checkNoPaymentSdk } from './checks/no-payment-sdk.js';
|
|
23
25
|
import { checkNoPlaceholders } from './checks/no-placeholders.js';
|
|
24
26
|
import { checkNoScroll } from './checks/no-scroll.js';
|
|
25
27
|
import { checkNoTracking } from './checks/no-tracking.js';
|
|
28
|
+
import { checkPermissionsDeclared } from './checks/permissions-declared.js';
|
|
26
29
|
import { checkPwaIcons } from './checks/pwa-icons.js';
|
|
27
30
|
import { checkMaskableIcon } from './checks/pwa-maskable-icon.js';
|
|
28
31
|
import { checkPwaMeta } from './checks/pwa-meta.js';
|
|
29
32
|
import { checkPwaOffline } from './checks/pwa-offline.js';
|
|
30
33
|
import { checkReactStrictMode } from './checks/react-strict-mode.js';
|
|
31
34
|
import { checkSdkVersion } from './checks/sdk-version.js';
|
|
35
|
+
import { checkSeoMetadata } from './checks/seo-metadata.js';
|
|
32
36
|
import { checkStoreLink } from './checks/store-link.js';
|
|
33
37
|
import { checkTechVersions } from './checks/tech-versions.js';
|
|
34
38
|
import { checkTypescriptStrict } from './checks/typescript-strict.js';
|
|
@@ -40,6 +44,10 @@ import { mapFileSource } from './lib/file-source.js';
|
|
|
40
44
|
import { fsFileSource } from './lib/fs-file-source.js';
|
|
41
45
|
import { isGameProject } from './lib/project-type.js';
|
|
42
46
|
import { runChecksFromFiles, runChecksOn } from './run-checks.js';
|
|
47
|
+
export { GAME_CI_WORKFLOW, GAME_DEPLOY_WORKFLOW } from './game-deploy-workflow.js';
|
|
48
|
+
// Game metadata: shared categories and viewports across CLI, console, admin, auditor.
|
|
49
|
+
export { GAME_CATEGORIES, GAME_CATEGORY_LABELS, getCategoryByLabel, getCategoryBySlug, getCategorySlugs, isValidCategorySlug, normalizeCategorySlug, REFERENCE_VIEWPORTS, } from './game-metadata.js';
|
|
50
|
+
export { detectPermissions, detectPermissionsInText, PERMISSION_IDS, PERMISSIONS, parseDeclaredPermissions, } from './lib/permissions.js';
|
|
43
51
|
// Live-URL audit (used by the compliance audit Worker; runs in
|
|
44
52
|
// browser/Workers env, no filesystem). Separate export path so callers
|
|
45
53
|
// don't accidentally pull node:fs in via the file-walking checks.
|
|
@@ -47,7 +55,7 @@ export { auditLive, checkBrandFontsLive, checkBundleSizeLive, checkManifestLive,
|
|
|
47
55
|
// Check battery + the Map front door live in run-checks.ts (node-free,
|
|
48
56
|
// also re-exported from ./worker for Workers). Re-exported here so
|
|
49
57
|
// existing CLI/back-end importers keep their single import site.
|
|
50
|
-
export { checkAudioMuteRespect, checkBrandFonts, checkBrandTokens, checkBundleSize, checkClaudeMdSlim, checkDarkMode, checkDeployWorkflow, checkGameNaming, checkGitignoreComplete, checkHtmlMeta, checkLicenseMit, checkManifest, checkMaskableIcon, checkNoAnyTypes, checkNoBrandOverrides, checkNoConsoleLog, checkNoCookies, checkNoEnvProduction, checkNoExcessiveInlineStyles, checkNoExternalFetch, checkNoExternalScripts, checkNoHardcodedColors, checkNoPaymentSdk, checkNoPlaceholders, checkNoScroll, checkNoTracking, checkPwaIcons, checkPwaMeta, checkPwaOffline, checkReactStrictMode, checkSdkVersion, checkStoreLink, checkTechVersions, checkTypescriptStrict, checkUnsafeVh, checkUsesGameSdk, checkUsesLocalStorage, checkViewportSupport, fsFileSource, isGameProject, mapFileSource, runChecksFromFiles, runChecksOn, };
|
|
58
|
+
export { checkAudioMuteRespect, checkBrandFonts, checkBrandTokens, checkBundleSize, checkClaudeMdSlim, checkDarkMode, checkDeployWorkflow, checkGameNaming, checkGitignoreComplete, checkHtmlMeta, checkLicenseMit, checkManifest, checkMaskableIcon, checkNoAnyTypes, checkNoBrandOverrides, checkNoConsoleLog, checkNoCookies, checkNoEnvProduction, checkNoExcessiveInlineStyles, checkNoExternalFetch, checkNoExternalScripts, checkNoHardcodedColors, checkNoPagePolicy, checkNoPaymentCapabilities, checkNoPaymentSdk, checkNoPlaceholders, checkNoScroll, checkNoTracking, checkPermissionsDeclared, checkPwaIcons, checkPwaMeta, checkPwaOffline, checkReactStrictMode, checkSdkVersion, checkSeoMetadata, checkStoreLink, checkTechVersions, checkTypescriptStrict, checkUnsafeVh, checkUsesGameSdk, checkUsesLocalStorage, checkViewportSupport, fsFileSource, isGameProject, mapFileSource, runChecksFromFiles, runChecksOn, };
|
|
51
59
|
/**
|
|
52
60
|
* On-disk front door — CLI / CI. Reads from a real directory via
|
|
53
61
|
* fsFileSource (node:fs). The Map front door (`runChecksFromFiles`)
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],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AmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,uEAAuE;AACvE,mEAAmE;AACnE,iEAAiE;AACjE,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,WAAW,GACZ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,OAAO,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-manifest.d.ts","sourceRoot":"","sources":["../../src/lib/inline-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;oEACgE;IAChE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"inline-manifest.d.ts","sourceRoot":"","sources":["../../src/lib/inline-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;oEACgE;IAChE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAqC/E"}
|
|
@@ -29,59 +29,7 @@ export function extractInlineManifest(viteConfig) {
|
|
|
29
29
|
// Balance braces to find the end of the manifest object literal.
|
|
30
30
|
// Handles nested objects (icons array entries) and quoted strings
|
|
31
31
|
// (so a `}` inside a quoted value isn't counted).
|
|
32
|
-
|
|
33
|
-
let inSingle = false;
|
|
34
|
-
let inDouble = false;
|
|
35
|
-
let inBacktick = false;
|
|
36
|
-
let escaped = false;
|
|
37
|
-
let endIdx = -1;
|
|
38
|
-
for (let i = openIdx; i < viteConfig.length; i++) {
|
|
39
|
-
const ch = viteConfig[i];
|
|
40
|
-
if (escaped) {
|
|
41
|
-
escaped = false;
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (ch === '\\') {
|
|
45
|
-
escaped = true;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
if (inSingle) {
|
|
49
|
-
if (ch === "'")
|
|
50
|
-
inSingle = false;
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (inDouble) {
|
|
54
|
-
if (ch === '"')
|
|
55
|
-
inDouble = false;
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if (inBacktick) {
|
|
59
|
-
if (ch === '`')
|
|
60
|
-
inBacktick = false;
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (ch === "'") {
|
|
64
|
-
inSingle = true;
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
if (ch === '"') {
|
|
68
|
-
inDouble = true;
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
if (ch === '`') {
|
|
72
|
-
inBacktick = true;
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
if (ch === '{')
|
|
76
|
-
depth++;
|
|
77
|
-
else if (ch === '}') {
|
|
78
|
-
depth--;
|
|
79
|
-
if (depth === 0) {
|
|
80
|
-
endIdx = i;
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
32
|
+
const endIdx = findClosing(viteConfig, openIdx, '{', '}');
|
|
85
33
|
if (endIdx < 0)
|
|
86
34
|
return null;
|
|
87
35
|
const block = viteConfig.slice(openIdx + 1, endIdx);
|
|
@@ -118,13 +66,20 @@ function extractIconsArray(block) {
|
|
|
118
66
|
const openIdx = block.indexOf('[', m.index);
|
|
119
67
|
if (openIdx < 0)
|
|
120
68
|
return undefined;
|
|
69
|
+
const closeIdx = findClosing(block, openIdx, '[', ']');
|
|
70
|
+
return closeIdx < 0 ? undefined : block.slice(openIdx, closeIdx + 1);
|
|
71
|
+
}
|
|
72
|
+
/** Index of the bracket that closes the one at `openIdx`, or -1. Skips quoted
|
|
73
|
+
* strings (single, double, backtick) and backslash escapes, so a bracket
|
|
74
|
+
* inside a value isn't counted. */
|
|
75
|
+
function findClosing(src, openIdx, open, close) {
|
|
121
76
|
let depth = 0;
|
|
122
77
|
let inSingle = false;
|
|
123
78
|
let inDouble = false;
|
|
124
79
|
let inBacktick = false;
|
|
125
80
|
let escaped = false;
|
|
126
|
-
for (let i = openIdx; i <
|
|
127
|
-
const ch =
|
|
81
|
+
for (let i = openIdx; i < src.length; i++) {
|
|
82
|
+
const ch = src[i];
|
|
128
83
|
if (escaped) {
|
|
129
84
|
escaped = false;
|
|
130
85
|
continue;
|
|
@@ -160,14 +115,14 @@ function extractIconsArray(block) {
|
|
|
160
115
|
inBacktick = true;
|
|
161
116
|
continue;
|
|
162
117
|
}
|
|
163
|
-
if (ch ===
|
|
118
|
+
if (ch === open)
|
|
164
119
|
depth++;
|
|
165
|
-
else if (ch ===
|
|
120
|
+
else if (ch === close) {
|
|
166
121
|
depth--;
|
|
167
122
|
if (depth === 0)
|
|
168
|
-
return
|
|
123
|
+
return i;
|
|
169
124
|
}
|
|
170
125
|
}
|
|
171
|
-
return
|
|
126
|
+
return -1;
|
|
172
127
|
}
|
|
173
128
|
//# sourceMappingURL=inline-manifest.js.map
|