@fragments-sdk/cli 0.7.2 → 0.7.4
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/README.md +2 -0
- package/dist/bin.js +25 -17
- package/dist/bin.js.map +1 -1
- package/dist/chunk-AWYCDRPG.js +272 -0
- package/dist/chunk-AWYCDRPG.js.map +1 -0
- package/dist/chunk-EKLMXTWU.js +80 -0
- package/dist/chunk-EKLMXTWU.js.map +1 -0
- package/dist/{chunk-DH4ETVSM.js → chunk-NEJ2FBTN.js} +9 -7
- package/dist/{chunk-DH4ETVSM.js.map → chunk-NEJ2FBTN.js.map} +1 -1
- package/dist/{chunk-GHYYFAQN.js → chunk-P33AKQJW.js} +1 -76
- package/dist/chunk-P33AKQJW.js.map +1 -0
- package/dist/{chunk-3T6QL7IY.js → chunk-R6IZZSE7.js} +23 -275
- package/dist/chunk-R6IZZSE7.js.map +1 -0
- package/dist/{chunk-7KUSBMI4.js → chunk-S56I5FST.js} +174 -45
- package/dist/chunk-S56I5FST.js.map +1 -0
- package/dist/{chunk-DQHWLAUV.js → chunk-TOIE7VXF.js} +2 -2
- package/dist/{chunk-OOGTG5FM.js → chunk-UXLGIGSX.js} +56 -2
- package/dist/chunk-UXLGIGSX.js.map +1 -0
- package/dist/{chunk-GKX2HPZ6.js → chunk-YMPGYEWK.js} +9 -3
- package/dist/chunk-YMPGYEWK.js.map +1 -0
- package/dist/chunk-Z7EY4VHE.js +50 -0
- package/dist/{core-UQXZTBFZ.js → core-3NMNCLFW.js} +8 -5
- package/dist/discovery-Z4RDDFVR.js +28 -0
- package/dist/{generate-GP6ZLAQB.js → generate-23VLX7QN.js} +7 -4
- package/dist/{generate-GP6ZLAQB.js.map → generate-23VLX7QN.js.map} +1 -1
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/{init-W72WBSU2.js → init-VYVYMVHH.js} +10 -6
- package/dist/{init-W72WBSU2.js.map → init-VYVYMVHH.js.map} +1 -1
- package/dist/mcp-bin.js +5 -3
- package/dist/mcp-bin.js.map +1 -1
- package/dist/sass.node-4XJK6YBF.js +130708 -0
- package/dist/sass.node-4XJK6YBF.js.map +1 -0
- package/dist/scan-FZR6YVI5.js +15 -0
- package/dist/{service-PVGTYUKX.js → service-CFFBHW4X.js} +6 -4
- package/dist/service-CFFBHW4X.js.map +1 -0
- package/dist/{static-viewer-KILKIVN7.js → static-viewer-VA2JXSCX.js} +6 -4
- package/dist/static-viewer-VA2JXSCX.js.map +1 -0
- package/dist/{test-3YRYQRGV.js → test-VTD7R6G2.js} +8 -4
- package/dist/{test-3YRYQRGV.js.map → test-VTD7R6G2.js.map} +1 -1
- package/dist/{tokens-IXSQHPQK.js → tokens-7JA5CPDL.js} +10 -7
- package/dist/{tokens-IXSQHPQK.js.map → tokens-7JA5CPDL.js.map} +1 -1
- package/dist/{viewer-K42REJU2.js → viewer-WXTDDQGK.js} +403 -26
- package/dist/viewer-WXTDDQGK.js.map +1 -0
- package/package.json +5 -1
- package/src/build.ts +57 -5
- package/src/commands/init.ts +6 -2
- package/src/core/__tests__/token-resolver.test.ts +82 -0
- package/src/core/discovery.ts +7 -1
- package/src/core/token-parser.ts +102 -0
- package/src/core/token-resolver.ts +155 -0
- package/src/migrate/detect.ts +4 -0
- package/src/service/__tests__/patch-generator.test.ts +2 -2
- package/src/service/patch-generator.ts +8 -1
- package/src/viewer/components/App.tsx +63 -2
- package/src/viewer/components/Layout.tsx +1 -1
- package/src/viewer/components/LeftSidebar.tsx +35 -77
- package/src/viewer/preview-frame.html +1 -1
- package/src/viewer/render-utils.ts +141 -0
- package/src/viewer/styles/globals.css +2 -1
- package/src/viewer/vite-plugin.ts +399 -24
- package/dist/chunk-3T6QL7IY.js.map +0 -1
- package/dist/chunk-7KUSBMI4.js.map +0 -1
- package/dist/chunk-GHYYFAQN.js.map +0 -1
- package/dist/chunk-GKX2HPZ6.js.map +0 -1
- package/dist/chunk-OOGTG5FM.js.map +0 -1
- package/dist/scan-V54HWRDY.js +0 -12
- package/dist/viewer-K42REJU2.js.map +0 -1
- /package/dist/{chunk-DQHWLAUV.js.map → chunk-TOIE7VXF.js.map} +0 -0
- /package/dist/{core-UQXZTBFZ.js.map → chunk-Z7EY4VHE.js.map} +0 -0
- /package/dist/{scan-V54HWRDY.js.map → core-3NMNCLFW.js.map} +0 -0
- /package/dist/{service-PVGTYUKX.js.map → discovery-Z4RDDFVR.js.map} +0 -0
- /package/dist/{static-viewer-KILKIVN7.js.map → scan-FZR6YVI5.js.map} +0 -0
package/README.md
CHANGED
package/dist/bin.js
CHANGED
|
@@ -9,10 +9,17 @@ import {
|
|
|
9
9
|
validateAll,
|
|
10
10
|
validateCoverage,
|
|
11
11
|
validateSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-S56I5FST.js";
|
|
13
13
|
import {
|
|
14
14
|
scan
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NEJ2FBTN.js";
|
|
16
|
+
import {
|
|
17
|
+
loadConfig,
|
|
18
|
+
loadFragmentFile
|
|
19
|
+
} from "./chunk-R6IZZSE7.js";
|
|
20
|
+
import {
|
|
21
|
+
discoverFragmentFiles
|
|
22
|
+
} from "./chunk-AWYCDRPG.js";
|
|
16
23
|
import {
|
|
17
24
|
FigmaClient,
|
|
18
25
|
StorageManager,
|
|
@@ -28,18 +35,15 @@ import {
|
|
|
28
35
|
renderAllComponentVariants,
|
|
29
36
|
scanCodebase,
|
|
30
37
|
shutdownSharedPool
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import {
|
|
33
|
-
discoverFragmentFiles,
|
|
34
|
-
loadConfig,
|
|
35
|
-
loadFragmentFile
|
|
36
|
-
} from "./chunk-3T6QL7IY.js";
|
|
38
|
+
} from "./chunk-YMPGYEWK.js";
|
|
37
39
|
import {
|
|
38
40
|
generateContext
|
|
39
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-UXLGIGSX.js";
|
|
42
|
+
import "./chunk-P33AKQJW.js";
|
|
40
43
|
import {
|
|
41
44
|
BRAND
|
|
42
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-EKLMXTWU.js";
|
|
46
|
+
import "./chunk-Z7EY4VHE.js";
|
|
43
47
|
|
|
44
48
|
// src/bin.ts
|
|
45
49
|
import { Command } from "commander";
|
|
@@ -1620,7 +1624,11 @@ async function discoverStoryFiles(projectRoot, patterns) {
|
|
|
1620
1624
|
"**/node_modules/**",
|
|
1621
1625
|
"**/dist/**",
|
|
1622
1626
|
"**/build/**",
|
|
1623
|
-
"**/.storybook/**"
|
|
1627
|
+
"**/.storybook/**",
|
|
1628
|
+
"**/*.test.stories.*",
|
|
1629
|
+
"**/*.stories.test.*",
|
|
1630
|
+
"**/*.test.story.*",
|
|
1631
|
+
"**/*.story.test.*"
|
|
1624
1632
|
]
|
|
1625
1633
|
});
|
|
1626
1634
|
return files.sort();
|
|
@@ -1785,7 +1793,7 @@ ${BRAND.name} Dev Server
|
|
|
1785
1793
|
}
|
|
1786
1794
|
}
|
|
1787
1795
|
}
|
|
1788
|
-
const { createDevServer } = await import("./viewer-
|
|
1796
|
+
const { createDevServer } = await import("./viewer-WXTDDQGK.js");
|
|
1789
1797
|
console.log(pc7.dim("\nStarting dev server..."));
|
|
1790
1798
|
const parsedPort = typeof port === "string" ? parseInt(port, 10) : port;
|
|
1791
1799
|
try {
|
|
@@ -5550,7 +5558,7 @@ Make sure the dev server is running: ${BRAND.cliCommand} dev`));
|
|
|
5550
5558
|
});
|
|
5551
5559
|
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) => {
|
|
5552
5560
|
try {
|
|
5553
|
-
const { generateViewerFromJson } = await import("./static-viewer-
|
|
5561
|
+
const { generateViewerFromJson } = await import("./static-viewer-VA2JXSCX.js");
|
|
5554
5562
|
const fs2 = await import("fs/promises");
|
|
5555
5563
|
const path = await import("path");
|
|
5556
5564
|
const inputPath = path.resolve(process.cwd(), options.input);
|
|
@@ -5598,7 +5606,7 @@ program.command("add").argument("[name]", 'Component name (e.g., "Button", "Text
|
|
|
5598
5606
|
});
|
|
5599
5607
|
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) => {
|
|
5600
5608
|
try {
|
|
5601
|
-
const { init } = await import("./init-
|
|
5609
|
+
const { init } = await import("./init-VYVYMVHH.js");
|
|
5602
5610
|
const result = await init({
|
|
5603
5611
|
projectRoot: process.cwd(),
|
|
5604
5612
|
force: options.force,
|
|
@@ -5618,7 +5626,7 @@ program.command("init").description("Initialize fragments in a project (interact
|
|
|
5618
5626
|
});
|
|
5619
5627
|
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) => {
|
|
5620
5628
|
try {
|
|
5621
|
-
const { tokens } = await import("./tokens-
|
|
5629
|
+
const { tokens } = await import("./tokens-7JA5CPDL.js");
|
|
5622
5630
|
const result = await tokens({
|
|
5623
5631
|
config: options.config,
|
|
5624
5632
|
json: options.json,
|
|
@@ -5637,7 +5645,7 @@ program.command("tokens").description("Discover and list design tokens from CSS/
|
|
|
5637
5645
|
});
|
|
5638
5646
|
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) => {
|
|
5639
5647
|
try {
|
|
5640
|
-
const { generate } = await import("./generate-
|
|
5648
|
+
const { generate } = await import("./generate-23VLX7QN.js");
|
|
5641
5649
|
const result = await generate({
|
|
5642
5650
|
projectRoot: process.cwd(),
|
|
5643
5651
|
component,
|
|
@@ -5664,7 +5672,7 @@ program.command("graph").description("Query the component relationship graph").a
|
|
|
5664
5672
|
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) => {
|
|
5665
5673
|
try {
|
|
5666
5674
|
const { config, configDir } = await loadConfig(options.config);
|
|
5667
|
-
const { runTestCommand, listTests } = await import("./test-
|
|
5675
|
+
const { runTestCommand, listTests } = await import("./test-VTD7R6G2.js");
|
|
5668
5676
|
if (options.list) {
|
|
5669
5677
|
await listTests(config, configDir, {
|
|
5670
5678
|
component: options.component,
|