@hominis/fireforge 0.16.0 → 0.16.1
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/CHANGELOG.md +69 -0
- package/README.md +4 -2
- package/dist/src/commands/config.js +16 -5
- package/dist/src/commands/download.js +22 -4
- package/dist/src/commands/export-all.js +50 -9
- package/dist/src/commands/furnace/chrome-doc-templates.d.ts +11 -1
- package/dist/src/commands/furnace/chrome-doc-templates.js +12 -2
- package/dist/src/commands/furnace/create.js +21 -3
- package/dist/src/commands/furnace/index.js +1 -0
- package/dist/src/commands/furnace/init.js +76 -2
- package/dist/src/commands/furnace/preview.js +15 -2
- package/dist/src/commands/lint.js +16 -1
- package/dist/src/commands/rebase/patch-loop.js +19 -0
- package/dist/src/commands/status.js +17 -5
- package/dist/src/commands/wire.js +35 -9
- package/dist/src/core/build-baseline.d.ts +14 -0
- package/dist/src/core/build-baseline.js +61 -1
- package/dist/src/core/config-mutate.d.ts +1 -1
- package/dist/src/core/config.d.ts +17 -0
- package/dist/src/core/config.js +35 -0
- package/dist/src/core/firefox.d.ts +16 -2
- package/dist/src/core/firefox.js +7 -2
- package/dist/src/core/furnace-config.d.ts +23 -0
- package/dist/src/core/furnace-config.js +38 -0
- package/dist/src/core/mach-error-hints.js +23 -0
- package/dist/src/core/patch-lint.js +43 -20
- package/dist/src/core/test-stale-check.js +46 -1
- package/dist/src/core/token-manager.js +57 -4
- package/dist/src/core/token-scaffold.d.ts +36 -0
- package/dist/src/core/token-scaffold.js +74 -0
- package/dist/src/types/commands/options.d.ts +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scaffolds the default tokens CSS file consumed by `fireforge token add`.
|
|
3
|
+
*
|
|
4
|
+
* Before 0.16.0 `fireforge furnace init` wrote `furnace.json` but not the
|
|
5
|
+
* tokens CSS — every project's first `fireforge token add` hit
|
|
6
|
+
* `Token CSS file not found: browser/themes/shared/<binaryName>-tokens.css`.
|
|
7
|
+
* The 0.16.0 init now calls into this module to write a canonical
|
|
8
|
+
* `:root { … }` shell with a seed set of category headers that
|
|
9
|
+
* `assertTokenCategoryExists` recognises, and registers the tokens CSS
|
|
10
|
+
* path in `patchLint.rawColorAllowlist` so the first token that's an
|
|
11
|
+
* actual color value does not instantly fail `fireforge lint`.
|
|
12
|
+
*/
|
|
13
|
+
import type { ProjectLicense } from '../types/config.js';
|
|
14
|
+
/**
|
|
15
|
+
* The set of categories seeded by the default scaffold. `token add
|
|
16
|
+
* --category <name>` accepts any of these without further setup; an
|
|
17
|
+
* operator who needs another category only has to add a matching
|
|
18
|
+
* `/* = My Category = *\/` header inside the `:root` block by hand.
|
|
19
|
+
*
|
|
20
|
+
* The names intentionally mirror the vocabulary used in Firefox's own
|
|
21
|
+
* token files (Colors — Canvas, Spacing, …) so operators coming from
|
|
22
|
+
* upstream don't have to relearn a fork-specific taxonomy.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DEFAULT_TOKEN_CATEGORIES: readonly string[];
|
|
25
|
+
/**
|
|
26
|
+
* Generates the default tokens CSS body. Extracted from the init
|
|
27
|
+
* command so tests can assert on the generated shape without running
|
|
28
|
+
* the interactive scaffold flow.
|
|
29
|
+
*
|
|
30
|
+
* @param binaryName - `fireforge.json` `binaryName` used in the
|
|
31
|
+
* rendered file banner so operators can identify the fork on-sight.
|
|
32
|
+
* @param license - Project license; piped through `getLicenseHeader`
|
|
33
|
+
* so the scaffold is SPDX-marked and survives `fireforge lint`'s
|
|
34
|
+
* license-header checks without operator intervention.
|
|
35
|
+
*/
|
|
36
|
+
export declare function generateDefaultTokensCss(binaryName: string, license: ProjectLicense): string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// SPDX-License-Identifier: EUPL-1.2
|
|
2
|
+
/**
|
|
3
|
+
* Scaffolds the default tokens CSS file consumed by `fireforge token add`.
|
|
4
|
+
*
|
|
5
|
+
* Before 0.16.0 `fireforge furnace init` wrote `furnace.json` but not the
|
|
6
|
+
* tokens CSS — every project's first `fireforge token add` hit
|
|
7
|
+
* `Token CSS file not found: browser/themes/shared/<binaryName>-tokens.css`.
|
|
8
|
+
* The 0.16.0 init now calls into this module to write a canonical
|
|
9
|
+
* `:root { … }` shell with a seed set of category headers that
|
|
10
|
+
* `assertTokenCategoryExists` recognises, and registers the tokens CSS
|
|
11
|
+
* path in `patchLint.rawColorAllowlist` so the first token that's an
|
|
12
|
+
* actual color value does not instantly fail `fireforge lint`.
|
|
13
|
+
*/
|
|
14
|
+
import { getLicenseHeader } from './license-headers.js';
|
|
15
|
+
/**
|
|
16
|
+
* The set of categories seeded by the default scaffold. `token add
|
|
17
|
+
* --category <name>` accepts any of these without further setup; an
|
|
18
|
+
* operator who needs another category only has to add a matching
|
|
19
|
+
* `/* = My Category = *\/` header inside the `:root` block by hand.
|
|
20
|
+
*
|
|
21
|
+
* The names intentionally mirror the vocabulary used in Firefox's own
|
|
22
|
+
* token files (Colors — Canvas, Spacing, …) so operators coming from
|
|
23
|
+
* upstream don't have to relearn a fork-specific taxonomy.
|
|
24
|
+
*/
|
|
25
|
+
export const DEFAULT_TOKEN_CATEGORIES = [
|
|
26
|
+
'Colors — General',
|
|
27
|
+
'Colors — Canvas',
|
|
28
|
+
'Colors — Experiment',
|
|
29
|
+
'Spacing',
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Generates the default tokens CSS body. Extracted from the init
|
|
33
|
+
* command so tests can assert on the generated shape without running
|
|
34
|
+
* the interactive scaffold flow.
|
|
35
|
+
*
|
|
36
|
+
* @param binaryName - `fireforge.json` `binaryName` used in the
|
|
37
|
+
* rendered file banner so operators can identify the fork on-sight.
|
|
38
|
+
* @param license - Project license; piped through `getLicenseHeader`
|
|
39
|
+
* so the scaffold is SPDX-marked and survives `fireforge lint`'s
|
|
40
|
+
* license-header checks without operator intervention.
|
|
41
|
+
*/
|
|
42
|
+
export function generateDefaultTokensCss(binaryName, license) {
|
|
43
|
+
const header = getLicenseHeader(license, 'css');
|
|
44
|
+
const categoryBlocks = DEFAULT_TOKEN_CATEGORIES.map((category) => ` /* = ${category} = */\n /* (add design tokens for "${category}" here; use \`fireforge token add --category "${category}" …\`) */`).join('\n\n');
|
|
45
|
+
return `${header}
|
|
46
|
+
|
|
47
|
+
/*
|
|
48
|
+
* Design tokens for ${binaryName}.
|
|
49
|
+
*
|
|
50
|
+
* Scaffolded by \`fireforge furnace init\`. Add new tokens with
|
|
51
|
+
* \`fireforge token add --category '<name>' -- <token-name> <value>\`
|
|
52
|
+
* — the command appends into the matching \`/* = <name> = *\\/\` block
|
|
53
|
+
* below and keeps the per-category ordering stable.
|
|
54
|
+
*
|
|
55
|
+
* Raw color literals inside this file are expected — the whole point
|
|
56
|
+
* of the tokens layer is that every other CSS file consumes \`var(…)\`
|
|
57
|
+
* instead of literal colors. \`fireforge furnace init\` adds this
|
|
58
|
+
* file's path to \`patchLint.rawColorAllowlist\` in fireforge.json so
|
|
59
|
+
* \`fireforge lint\` stops flagging the literals here.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
:root {
|
|
63
|
+
${categoryBlocks}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@media (prefers-color-scheme: dark) {
|
|
67
|
+
:root {
|
|
68
|
+
/* Dark-mode overrides land here. Use \`fireforge token add --mode override --dark-value <v>\`
|
|
69
|
+
to have a token's dark value placed inside this block. */
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=token-scaffold.js.map
|
|
@@ -372,6 +372,16 @@ export interface FurnaceCreateOptions {
|
|
|
372
372
|
* dry-run faithfully previews the real command's outcome.
|
|
373
373
|
*/
|
|
374
374
|
dryRun?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Bypass the configured `componentPrefix` check for the supplied name.
|
|
377
|
+
* Without this flag, a name that does not start with the prefix is
|
|
378
|
+
* rejected before any files are written, so a prefix-mismatched
|
|
379
|
+
* component cannot leave behind a half-scaffolded state. Pass this
|
|
380
|
+
* flag only when you know the prefix mismatch is intentional — e.g.
|
|
381
|
+
* creating an experimental component whose name intentionally breaks
|
|
382
|
+
* the fork's convention.
|
|
383
|
+
*/
|
|
384
|
+
allowPrefixMismatch?: boolean;
|
|
375
385
|
}
|
|
376
386
|
/**
|
|
377
387
|
* Options for the wire command.
|