@fragments-sdk/cli 0.3.3 → 0.4.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/dist/bin.js +18 -13
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-PMGI7ATF.js → chunk-5CKYLCJH.js} +58 -2
- package/dist/chunk-5CKYLCJH.js.map +1 -0
- package/dist/{chunk-MUZ6CM66.js → chunk-5ZYEOHYK.js} +13 -11
- package/dist/chunk-5ZYEOHYK.js.map +1 -0
- package/dist/{chunk-XHNKNI6J.js → chunk-AW7MWOUH.js} +9 -1
- package/dist/chunk-AW7MWOUH.js.map +1 -0
- package/dist/{chunk-LY2CFFPY.js → chunk-G3M3MPQ6.js} +14 -3
- package/dist/chunk-G3M3MPQ6.js.map +1 -0
- package/dist/{chunk-3OTEW66K.js → chunk-J4SI5RIH.js} +4 -4
- package/dist/{chunk-BSCG3IP7.js → chunk-NOTYONHY.js} +2 -2
- package/dist/{chunk-D6VXWI45.js → chunk-ZFKGX3QK.js} +8 -6
- package/dist/chunk-ZFKGX3QK.js.map +1 -0
- package/dist/{core-DWKLGY4N.js → core-LNXDLXDP.js} +5 -3
- package/dist/{generate-3LBZANQ3.js → generate-OIXXHOWR.js} +4 -4
- package/dist/index.d.ts +16 -0
- package/dist/index.js +6 -6
- package/dist/{init-NKIUCYTG.js → init-EVPXIDW4.js} +4 -4
- package/dist/mcp-bin.js +3 -3
- package/dist/mcp-bin.js.map +1 -1
- package/dist/scan-YVYD64GD.js +12 -0
- package/dist/{service-QSZMZJBJ.js → service-K52ORLCJ.js} +4 -4
- package/dist/{static-viewer-MIPGZ4Z7.js → static-viewer-JNQIHA4B.js} +4 -4
- package/dist/{test-ZCTR4LBB.js → test-USARUEFW.js} +9 -5
- package/dist/test-USARUEFW.js.map +1 -0
- package/dist/{tokens-5JQ5IOR2.js → tokens-C6YHBOQE.js} +5 -5
- package/dist/{viewer-D7QC4GM2.js → viewer-H7TVFT4E.js} +15 -15
- package/dist/{viewer-D7QC4GM2.js.map → viewer-H7TVFT4E.js.map} +1 -1
- package/package.json +2 -1
- package/src/bin.ts +7 -1
- package/src/build.ts +2 -0
- package/src/core/index.ts +4 -0
- package/src/core/parser.ts +102 -1
- package/src/core/schema.ts +11 -0
- package/src/core/storyAdapter.ts +1 -1
- package/src/core/storybook-csf.ts +11 -0
- package/src/core/types.ts +25 -1
- package/src/mcp/server.ts +1 -1
- package/src/migrate/bin.ts +7 -1
- package/src/migrate/report.ts +1 -1
- package/src/service/enhance/doc-extractor.ts +2 -2
- package/src/service/enhance/props-extractor.ts +1 -1
- package/src/service/enhance/storybook-parser.ts +1 -1
- package/src/service/figma.ts +2 -2
- package/src/service/metrics-store.ts +2 -1
- package/src/service/patch-generator.ts +2 -1
- package/src/service/report.ts +1 -1
- package/src/test/reporters/junit.ts +7 -3
- package/src/test/runner.ts +4 -4
- package/src/test/watch.ts +2 -2
- package/src/theme/__tests__/generator.test.ts +412 -0
- package/src/theme/__tests__/presets.test.ts +169 -0
- package/src/theme/__tests__/schema.test.ts +463 -0
- package/src/theme/__tests__/serializer.test.ts +326 -0
- package/src/theme/generator.ts +355 -0
- package/src/theme/index.ts +61 -0
- package/src/theme/presets.ts +189 -0
- package/src/theme/schema.ts +193 -0
- package/src/theme/serializer.ts +123 -0
- package/src/theme/types.ts +210 -0
- package/src/viewer/components/CodePanel.tsx +1 -1
- package/src/viewer/components/FigmaEmbed.tsx +1 -1
- package/src/viewer/jsx-parser.ts +2 -1
- package/src/viewer/styles/globals.css +1 -1
- package/src/viewer/utils/colorSchemes.ts +3 -3
- package/dist/chunk-D6VXWI45.js.map +0 -1
- package/dist/chunk-LY2CFFPY.js.map +0 -1
- package/dist/chunk-MUZ6CM66.js.map +0 -1
- package/dist/chunk-PMGI7ATF.js.map +0 -1
- package/dist/chunk-XHNKNI6J.js.map +0 -1
- package/dist/scan-3ZAOVO4U.js +0 -12
- package/dist/test-ZCTR4LBB.js.map +0 -1
- /package/dist/{chunk-3OTEW66K.js.map → chunk-J4SI5RIH.js.map} +0 -0
- /package/dist/{chunk-BSCG3IP7.js.map → chunk-NOTYONHY.js.map} +0 -0
- /package/dist/{core-DWKLGY4N.js.map → core-LNXDLXDP.js.map} +0 -0
- /package/dist/{generate-3LBZANQ3.js.map → generate-OIXXHOWR.js.map} +0 -0
- /package/dist/{init-NKIUCYTG.js.map → init-EVPXIDW4.js.map} +0 -0
- /package/dist/{scan-3ZAOVO4U.js.map → scan-YVYD64GD.js.map} +0 -0
- /package/dist/{service-QSZMZJBJ.js.map → service-K52ORLCJ.js.map} +0 -0
- /package/dist/{static-viewer-MIPGZ4Z7.js.map → static-viewer-JNQIHA4B.js.map} +0 -0
- /package/dist/{tokens-5JQ5IOR2.js.map → tokens-C6YHBOQE.js.map} +0 -0
package/dist/bin.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
validateAll,
|
|
10
10
|
validateCoverage,
|
|
11
11
|
validateSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZFKGX3QK.js";
|
|
13
13
|
import {
|
|
14
14
|
scan
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-J4SI5RIH.js";
|
|
16
16
|
import {
|
|
17
17
|
FigmaClient,
|
|
18
18
|
StorageManager,
|
|
@@ -28,22 +28,25 @@ import {
|
|
|
28
28
|
renderAllComponentVariants,
|
|
29
29
|
scanCodebase,
|
|
30
30
|
shutdownSharedPool
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-5ZYEOHYK.js";
|
|
32
32
|
import {
|
|
33
33
|
discoverSegmentFiles,
|
|
34
34
|
loadConfig,
|
|
35
35
|
loadSegmentFile
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-5CKYLCJH.js";
|
|
37
37
|
import {
|
|
38
38
|
generateContext
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-G3M3MPQ6.js";
|
|
40
40
|
import {
|
|
41
41
|
BRAND
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-AW7MWOUH.js";
|
|
43
43
|
|
|
44
44
|
// src/bin.ts
|
|
45
45
|
import { Command } from "commander";
|
|
46
46
|
import pc20 from "picocolors";
|
|
47
|
+
import { readFileSync } from "fs";
|
|
48
|
+
import { fileURLToPath } from "url";
|
|
49
|
+
import { dirname as dirname4, join as join10 } from "path";
|
|
47
50
|
|
|
48
51
|
// src/commands/validate.ts
|
|
49
52
|
import pc from "picocolors";
|
|
@@ -1768,7 +1771,7 @@ ${BRAND.name} Dev Server
|
|
|
1768
1771
|
}
|
|
1769
1772
|
}
|
|
1770
1773
|
}
|
|
1771
|
-
const { createDevServer } = await import("./viewer-
|
|
1774
|
+
const { createDevServer } = await import("./viewer-H7TVFT4E.js");
|
|
1772
1775
|
console.log(pc7.dim("\nStarting dev server..."));
|
|
1773
1776
|
const parsedPort = typeof port === "string" ? parseInt(port, 10) : port;
|
|
1774
1777
|
try {
|
|
@@ -4273,8 +4276,10 @@ ${whenNotItems}
|
|
|
4273
4276
|
}
|
|
4274
4277
|
|
|
4275
4278
|
// src/bin.ts
|
|
4279
|
+
var __dirname = dirname4(fileURLToPath(import.meta.url));
|
|
4280
|
+
var pkg = JSON.parse(readFileSync(join10(__dirname, "../package.json"), "utf-8"));
|
|
4276
4281
|
var program = new Command();
|
|
4277
|
-
program.name(BRAND.cliCommand).description(`${BRAND.name} - Design system documentation and compliance tool`).version(
|
|
4282
|
+
program.name(BRAND.cliCommand).description(`${BRAND.name} - Design system documentation and compliance tool`).version(pkg.version);
|
|
4278
4283
|
program.command("validate").description("Validate fragment files").option("-c, --config <path>", "Path to config file").option("--schema", "Validate fragment schema only").option("--coverage", "Validate coverage only").action(async (options) => {
|
|
4279
4284
|
try {
|
|
4280
4285
|
const result = await validate(options);
|
|
@@ -4636,7 +4641,7 @@ Make sure the dev server is running: ${BRAND.cliCommand} dev`));
|
|
|
4636
4641
|
});
|
|
4637
4642
|
program.command("view").description(`Generate a static HTML viewer for ${BRAND.outFile}`).option("-i, --input <path>", `Path to ${BRAND.outFile}`, BRAND.outFile).option("-o, --output <path>", "Output HTML file path", BRAND.viewerHtmlFile).option("--open", "Open in browser after generation").action(async (options) => {
|
|
4638
4643
|
try {
|
|
4639
|
-
const { generateViewerFromJson } = await import("./static-viewer-
|
|
4644
|
+
const { generateViewerFromJson } = await import("./static-viewer-JNQIHA4B.js");
|
|
4640
4645
|
const fs = await import("fs/promises");
|
|
4641
4646
|
const path = await import("path");
|
|
4642
4647
|
const inputPath = path.resolve(process.cwd(), options.input);
|
|
@@ -4684,7 +4689,7 @@ program.command("add").argument("[name]", 'Component name (e.g., "Button", "Text
|
|
|
4684
4689
|
});
|
|
4685
4690
|
program.command("init").description("Initialize fragments in a project (interactive by default)").option("--force", "Overwrite existing config").option("-y, --yes", "Non-interactive mode - auto-detect and use defaults").action(async (options) => {
|
|
4686
4691
|
try {
|
|
4687
|
-
const { init } = await import("./init-
|
|
4692
|
+
const { init } = await import("./init-EVPXIDW4.js");
|
|
4688
4693
|
const result = await init({
|
|
4689
4694
|
projectRoot: process.cwd(),
|
|
4690
4695
|
force: options.force,
|
|
@@ -4704,7 +4709,7 @@ program.command("init").description("Initialize fragments in a project (interact
|
|
|
4704
4709
|
});
|
|
4705
4710
|
program.command("tokens").description("Discover and list design tokens from CSS/SCSS files").option("-c, --config <path>", "Path to config file").option("--json", "Output as JSON").option("--categories", "Group tokens by category").option("--theme <theme>", "Filter by theme name").option("--category <category>", "Filter by category (color, spacing, typography, etc.)").option("--verbose", "Show all tokens (no truncation)").action(async (options) => {
|
|
4706
4711
|
try {
|
|
4707
|
-
const { tokens } = await import("./tokens-
|
|
4712
|
+
const { tokens } = await import("./tokens-C6YHBOQE.js");
|
|
4708
4713
|
const result = await tokens({
|
|
4709
4714
|
config: options.config,
|
|
4710
4715
|
json: options.json,
|
|
@@ -4723,7 +4728,7 @@ program.command("tokens").description("Discover and list design tokens from CSS/
|
|
|
4723
4728
|
});
|
|
4724
4729
|
program.command("generate").description("Generate fragment files from component source code").argument("[component]", "Specific component name to generate (optional)").option("--force", "Overwrite existing fragment files").option("--pattern <glob>", "Pattern for component files", "src/components/**/*.tsx").action(async (component, options) => {
|
|
4725
4730
|
try {
|
|
4726
|
-
const { generate } = await import("./generate-
|
|
4731
|
+
const { generate } = await import("./generate-OIXXHOWR.js");
|
|
4727
4732
|
const result = await generate({
|
|
4728
4733
|
projectRoot: process.cwd(),
|
|
4729
4734
|
component,
|
|
@@ -4742,7 +4747,7 @@ program.command("generate").description("Generate fragment files from component
|
|
|
4742
4747
|
program.command("test").description("Run interaction tests for fragments with play functions").option("-c, --config <path>", "Path to config file").option("--component <name>", "Filter by component name").option("--tags <tags>", "Filter by tags (comma-separated)").option("--grep <pattern>", "Filter by variant name pattern").option("--exclude <pattern>", "Exclude tests matching pattern").option("--parallel <count>", "Number of parallel browser contexts", parseInt, 4).option("--timeout <ms>", "Timeout per test in milliseconds", parseInt, 3e4).option("--retries <count>", "Number of retries for failed tests", parseInt, 0).option("--bail", "Stop on first failure").option("--browser <name>", "Browser to use (chromium, firefox, webkit)", "chromium").option("--headed", "Run in headed mode (show browser)").option("--a11y", "Run accessibility checks with axe-core").option("--visual", "Capture screenshots for visual regression").option("--update-snapshots", "Update visual snapshots").option("--watch", "Watch mode - re-run on file changes").option("--reporters <names>", "Reporters to use (console, junit, json)", "console").option("-o, --output <dir>", "Output directory for results", "./test-results").option("--server-url <url>", "URL of running dev server (skips starting server)").option("-p, --port <port>", "Port for dev server", parseInt, 6006).option("--ci", "CI mode - non-interactive, exit with code 1 on failure").option("--list", "List available tests without running them").action(async (options) => {
|
|
4743
4748
|
try {
|
|
4744
4749
|
const { config, configDir } = await loadConfig(options.config);
|
|
4745
|
-
const { runTestCommand, listTests } = await import("./test-
|
|
4750
|
+
const { runTestCommand, listTests } = await import("./test-USARUEFW.js");
|
|
4746
4751
|
if (options.list) {
|
|
4747
4752
|
await listTests(config, configDir, {
|
|
4748
4753
|
component: options.component,
|