@freeappstore/compliance 0.7.8 → 0.7.10
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/brand-tokens.d.ts +4 -7
- package/dist/checks/brand-tokens.d.ts.map +1 -1
- package/dist/checks/brand-tokens.js +6 -11
- package/dist/checks/brand-tokens.js.map +1 -1
- package/dist/lib/project-type.d.ts +6 -2
- package/dist/lib/project-type.d.ts.map +1 -1
- package/dist/lib/project-type.js +10 -2
- package/dist/lib/project-type.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,13 +6,10 @@ import type { CheckResult } from '../types.js';
|
|
|
6
6
|
* one ensures the tokens haven't been redefined elsewhere, the other
|
|
7
7
|
* ensures they exist in the first place.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* neutral; games live on a bg-toned canvas (often dark). The shared
|
|
14
|
-
* `--ink` and `--accent` keep typography + interactive states
|
|
15
|
-
* consistent across both stores.
|
|
9
|
+
* Apps and games alike must define `--paper`, `--ink`, `--accent`. Games
|
|
10
|
+
* used to require `--bg` instead, but DESIGN-SYSTEM.md bans `--bg` as an
|
|
11
|
+
* alias of `--paper` in every store, so no game could satisfy both (#64).
|
|
12
|
+
* A game's canvas is still dark — only the token name is shared.
|
|
16
13
|
*
|
|
17
14
|
* We scan all CSS / SCSS files (not just the canonical theme path) so
|
|
18
15
|
* the check passes whether the creator's tokens live in `index.css`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-tokens.d.ts","sourceRoot":"","sources":["../../src/checks/brand-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"brand-tokens.d.ts","sourceRoot":"","sources":["../../src/checks/brand-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CA6B/E"}
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { isGameProject } from '../lib/project-type.js';
|
|
2
1
|
/**
|
|
3
2
|
* Verifies the canonical CSS custom properties are *defined* in the
|
|
4
3
|
* project's theme CSS. This is the inverse of `no-brand-overrides`:
|
|
5
4
|
* one ensures the tokens haven't been redefined elsewhere, the other
|
|
6
5
|
* ensures they exist in the first place.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* neutral; games live on a bg-toned canvas (often dark). The shared
|
|
13
|
-
* `--ink` and `--accent` keep typography + interactive states
|
|
14
|
-
* consistent across both stores.
|
|
7
|
+
* Apps and games alike must define `--paper`, `--ink`, `--accent`. Games
|
|
8
|
+
* used to require `--bg` instead, but DESIGN-SYSTEM.md bans `--bg` as an
|
|
9
|
+
* alias of `--paper` in every store, so no game could satisfy both (#64).
|
|
10
|
+
* A game's canvas is still dark — only the token name is shared.
|
|
15
11
|
*
|
|
16
12
|
* We scan all CSS / SCSS files (not just the canonical theme path) so
|
|
17
13
|
* the check passes whether the creator's tokens live in `index.css`,
|
|
18
14
|
* `main.css`, or some other theme file.
|
|
19
15
|
*/
|
|
20
16
|
export async function checkBrandTokens(source) {
|
|
21
|
-
const
|
|
22
|
-
const required = isGame ? ['--bg', '--ink', '--accent'] : ['--paper', '--ink', '--accent'];
|
|
17
|
+
const required = ['--paper', '--ink', '--accent'];
|
|
23
18
|
const found = new Set();
|
|
24
19
|
for await (const path of source.list()) {
|
|
25
20
|
if (!path.endsWith('.css') && !path.endsWith('.scss'))
|
|
@@ -46,7 +41,7 @@ export async function checkBrandTokens(source) {
|
|
|
46
41
|
detail: `missing CSS tokens: ${missing.join(', ')}`,
|
|
47
42
|
suggestions: [
|
|
48
43
|
`Define ${missing.join(', ')} in your theme CSS (typically web/src/index.css).`,
|
|
49
|
-
`Apps use --paper / --ink / --accent
|
|
44
|
+
`Apps and games both use --paper / --ink / --accent (--bg is a banned alias of --paper).`,
|
|
50
45
|
],
|
|
51
46
|
};
|
|
52
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-tokens.js","sourceRoot":"","sources":["../../src/checks/brand-tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brand-tokens.js","sourceRoot":"","sources":["../../src/checks/brand-tokens.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAkB;IACvD,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAEhC,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,SAAS;QAChE,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,8DAA8D;YAC9D,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,iBAAiB,KAAK,OAAO,EAAE,GAAG,CAAC,CAAC;YAC1D,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,MAAM;YAAE,MAAM;IAC5C,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACxF,CAAC;IACD,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,uBAAuB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACnD,WAAW,EAAE;YACX,UAAU,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,mDAAmD;YAC/E,yFAAyF;SAC1F;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -9,9 +9,13 @@ import type { FileSource } from './file-source.js';
|
|
|
9
9
|
* Detection signals (any one is sufficient):
|
|
10
10
|
* - `@freeappstore/games` listed in any package.json
|
|
11
11
|
* - A TS/JS source file imports from `@freeappstore/games`
|
|
12
|
+
* - A TS/JS source file imports `GameShell` from anywhere — FAS-generated
|
|
13
|
+
* games (workers/agent/src/template.ts) ship their own local GameShell
|
|
14
|
+
* and depend only on `@freeappstore/sdk`, so neither signal above
|
|
15
|
+
* fires for them (#64)
|
|
12
16
|
*
|
|
13
|
-
*
|
|
14
|
-
* root package.json (where a per-app scan would miss it) and template
|
|
17
|
+
* The package signals exist because workspace hoisting can put the dep in
|
|
18
|
+
* the root package.json (where a per-app scan would miss it) and template
|
|
15
19
|
* scaffolds put the import in app source.
|
|
16
20
|
*/
|
|
17
21
|
export declare function isGameProject(source: FileSource): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-type.d.ts","sourceRoot":"","sources":["../../src/lib/project-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"project-type.d.ts","sourceRoot":"","sources":["../../src/lib/project-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAMnD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAcxE"}
|
package/dist/lib/project-type.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** `import { GameShell } from "<anything>"`, including `type` and aliased forms. */
|
|
2
|
+
const GAME_SHELL_IMPORT = /import\s*(?:type\s*)?\{[^}]*\bGameShell\b[^}]*\}\s*from\s*['"][^'"]+['"]/;
|
|
1
3
|
/**
|
|
2
4
|
* "Is this a game project?" — used by checks that diverge between apps
|
|
3
5
|
* (FreeAppStore) and games (FreeGameStore). Apps run inside a sidebar+
|
|
@@ -8,9 +10,13 @@
|
|
|
8
10
|
* Detection signals (any one is sufficient):
|
|
9
11
|
* - `@freeappstore/games` listed in any package.json
|
|
10
12
|
* - A TS/JS source file imports from `@freeappstore/games`
|
|
13
|
+
* - A TS/JS source file imports `GameShell` from anywhere — FAS-generated
|
|
14
|
+
* games (workers/agent/src/template.ts) ship their own local GameShell
|
|
15
|
+
* and depend only on `@freeappstore/sdk`, so neither signal above
|
|
16
|
+
* fires for them (#64)
|
|
11
17
|
*
|
|
12
|
-
*
|
|
13
|
-
* root package.json (where a per-app scan would miss it) and template
|
|
18
|
+
* The package signals exist because workspace hoisting can put the dep in
|
|
19
|
+
* the root package.json (where a per-app scan would miss it) and template
|
|
14
20
|
* scaffolds put the import in app source.
|
|
15
21
|
*/
|
|
16
22
|
export async function isGameProject(source) {
|
|
@@ -28,6 +34,8 @@ export async function isGameProject(source) {
|
|
|
28
34
|
const content = await source.read(path);
|
|
29
35
|
if (content && /from\s+['"]@freeappstore\/games['"]/.test(content))
|
|
30
36
|
return true;
|
|
37
|
+
if (content && GAME_SHELL_IMPORT.test(content))
|
|
38
|
+
return true;
|
|
31
39
|
}
|
|
32
40
|
return false;
|
|
33
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-type.js","sourceRoot":"","sources":["../../src/lib/project-type.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"project-type.js","sourceRoot":"","sources":["../../src/lib/project-type.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,MAAM,iBAAiB,GACrB,0EAA0E,CAAC;AAE7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAkB;IACpD,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;QACzC,IAAI,IAAI,KAAK,cAAc;YAAE,SAAS;QACtC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,OAAO,IAAI,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;IACnE,CAAC;IACD,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,SAAS;QAC9D,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,OAAO,IAAI,qCAAqC,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;QAChF,IAAI,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;IAC9D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED