@fragments-sdk/cli 0.7.1 → 0.7.2

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.
Files changed (39) hide show
  1. package/LICENSE +77 -14
  2. package/dist/bin.js +12 -12
  3. package/dist/bin.js.map +1 -1
  4. package/dist/{chunk-5ITIP3ES.js → chunk-3T6QL7IY.js} +22 -4
  5. package/dist/chunk-3T6QL7IY.js.map +1 -0
  6. package/dist/{chunk-U6VTHBNI.js → chunk-7KUSBMI4.js} +7 -5
  7. package/dist/chunk-7KUSBMI4.js.map +1 -0
  8. package/dist/{chunk-32VIEOQY.js → chunk-DH4ETVSM.js} +2 -2
  9. package/dist/{chunk-GCZMFLDI.js → chunk-OOGTG5FM.js} +5 -2
  10. package/dist/{chunk-GCZMFLDI.js.map → chunk-OOGTG5FM.js.map} +1 -1
  11. package/dist/{core-SFHPYR5H.js → core-UQXZTBFZ.js} +2 -2
  12. package/dist/{generate-54GJAWUY.js → generate-GP6ZLAQB.js} +3 -3
  13. package/dist/index.js +3 -3
  14. package/dist/{init-EIM5WNMP.js → init-W72WBSU2.js} +3 -3
  15. package/dist/mcp-bin.js +2 -2
  16. package/dist/{scan-KQBKUS64.js → scan-V54HWRDY.js} +4 -4
  17. package/dist/{service-ED2LNCTU.js → service-PVGTYUKX.js} +2 -2
  18. package/dist/{static-viewer-Q4F4QP5M.js → static-viewer-KILKIVN7.js} +2 -2
  19. package/dist/{test-6VN2DA3S.js → test-3YRYQRGV.js} +2 -2
  20. package/dist/{tokens-P2B7ZAM3.js → tokens-IXSQHPQK.js} +3 -3
  21. package/dist/{viewer-GM7IQPPB.js → viewer-K42REJU2.js} +12 -12
  22. package/package.json +13 -2
  23. package/src/build.ts +4 -2
  24. package/src/commands/graph.ts +2 -2
  25. package/src/core/loader.ts +0 -3
  26. package/src/core/parser.ts +41 -1
  27. package/src/core/token-parser.ts +9 -1
  28. package/dist/chunk-5ITIP3ES.js.map +0 -1
  29. package/dist/chunk-U6VTHBNI.js.map +0 -1
  30. /package/dist/{chunk-32VIEOQY.js.map → chunk-DH4ETVSM.js.map} +0 -0
  31. /package/dist/{core-SFHPYR5H.js.map → core-UQXZTBFZ.js.map} +0 -0
  32. /package/dist/{generate-54GJAWUY.js.map → generate-GP6ZLAQB.js.map} +0 -0
  33. /package/dist/{init-EIM5WNMP.js.map → init-W72WBSU2.js.map} +0 -0
  34. /package/dist/{scan-KQBKUS64.js.map → scan-V54HWRDY.js.map} +0 -0
  35. /package/dist/{service-ED2LNCTU.js.map → service-PVGTYUKX.js.map} +0 -0
  36. /package/dist/{static-viewer-Q4F4QP5M.js.map → static-viewer-KILKIVN7.js.map} +0 -0
  37. /package/dist/{test-6VN2DA3S.js.map → test-3YRYQRGV.js.map} +0 -0
  38. /package/dist/{tokens-P2B7ZAM3.js.map → tokens-IXSQHPQK.js.map} +0 -0
  39. /package/dist/{viewer-GM7IQPPB.js.map → viewer-K42REJU2.js.map} +0 -0
package/LICENSE CHANGED
@@ -1,21 +1,84 @@
1
- MIT License
1
+ Functional Source License, Version 1.1, MIT Future License
2
2
 
3
- Copyright (c) 2024 Conan McNicholl
3
+ Licensor: Conan McNicholl
4
+ Software: Fragments SDK (@fragments-sdk/cli, @fragments-sdk/mcp, @fragments-sdk/context)
4
5
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
6
+ IMPORTANT: The @fragments-sdk/ui package is licensed separately under the MIT License.
7
+ See libs/ui/LICENSE for details.
11
8
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
9
+ ---
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The individual or entity listed above.
16
+
17
+ ### The Software
18
+
19
+ The software identified above, including all source code, object code,
20
+ documentation, and other files provided by the Licensor.
21
+
22
+ ### Grant of Rights
23
+
24
+ Subject to the conditions below, the Licensor grants you a non-exclusive,
25
+ worldwide, royalty-free license to use, copy, modify, create derivative works,
26
+ and redistribute the Software, in each case subject to the limitations below.
27
+
28
+ ### Limitation — Competing Use
29
+
30
+ You may not use the Software in, or to provide, a Commercial Product or Service
31
+ that competes with the Software or with any product or service that the Licensor
32
+ provides using the Software. A "Commercial Product or Service" is any product or
33
+ service offered to third parties for a fee or other consideration.
34
+
35
+ For clarity, the following uses are always permitted regardless of this limitation:
36
+
37
+ - Using the Software for your own internal business purposes
38
+ - Using the Software to build and deploy your own applications
39
+ - Using the Software for personal, educational, or evaluation purposes
40
+ - Providing professional services (consulting, integration) to your clients
41
+ that involve configuring or extending the Software
42
+
43
+ The following are examples of Competing Use that are NOT permitted:
44
+
45
+ - Offering a hosted developer tools service that repackages or exposes
46
+ the functionality of the Software
47
+ - Selling or distributing a product that is a substitute for any product
48
+ or service offered by the Licensor
49
+ - Building and offering an MCP server, CLI tool, or code intelligence
50
+ platform that is substantially derived from the Software
51
+
52
+ ### Change Date and License
53
+
54
+ On the second anniversary of each version's release date, the Licensor grants
55
+ you the rights under the terms of the MIT License for that version.
56
+ The "MIT License" means the license identified by SPDX as "MIT" and published
57
+ at https://opensource.org/licenses/MIT.
58
+
59
+ ### No Warranties
14
60
 
15
61
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
62
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
64
+
65
+ ### Limitation of Liability
66
+
67
+ IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
68
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
69
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
70
+ THE SOFTWARE.
71
+
72
+ ### General
73
+
74
+ If any provision of this License is held to be unenforceable, that provision
75
+ shall be reformed only to the extent necessary to make it enforceable, and the
76
+ remaining provisions shall continue in full force and effect.
77
+
78
+ This License does not grant permission to use the trade names, trademarks,
79
+ service marks, or product names of the Licensor, except as required for
80
+ reasonable and customary use in describing the origin of the Software.
81
+
82
+ ---
83
+
84
+ For more information about the Functional Source License, see https://fsl.software/
package/dist/bin.js CHANGED
@@ -9,10 +9,10 @@ import {
9
9
  validateAll,
10
10
  validateCoverage,
11
11
  validateSchema
12
- } from "./chunk-U6VTHBNI.js";
12
+ } from "./chunk-7KUSBMI4.js";
13
13
  import {
14
14
  scan
15
- } from "./chunk-32VIEOQY.js";
15
+ } from "./chunk-DH4ETVSM.js";
16
16
  import {
17
17
  FigmaClient,
18
18
  StorageManager,
@@ -33,10 +33,10 @@ import {
33
33
  discoverFragmentFiles,
34
34
  loadConfig,
35
35
  loadFragmentFile
36
- } from "./chunk-5ITIP3ES.js";
36
+ } from "./chunk-3T6QL7IY.js";
37
37
  import {
38
38
  generateContext
39
- } from "./chunk-GCZMFLDI.js";
39
+ } from "./chunk-OOGTG5FM.js";
40
40
  import {
41
41
  BRAND
42
42
  } from "./chunk-GHYYFAQN.js";
@@ -1785,7 +1785,7 @@ ${BRAND.name} Dev Server
1785
1785
  }
1786
1786
  }
1787
1787
  }
1788
- const { createDevServer } = await import("./viewer-GM7IQPPB.js");
1788
+ const { createDevServer } = await import("./viewer-K42REJU2.js");
1789
1789
  console.log(pc7.dim("\nStarting dev server..."));
1790
1790
  const parsedPort = typeof port === "string" ? parseInt(port, 10) : port;
1791
1791
  try {
@@ -5115,8 +5115,8 @@ Composition: ${component}
5115
5115
  if (tree.subComponents.length > 0) {
5116
5116
  console.log(` ${pc20.cyan("Sub-components:")}`);
5117
5117
  for (const sub of tree.subComponents) {
5118
- const isRequired = tree.requiredChildren.includes(sub);
5119
- console.log(` ${pc20.yellow(sub)}${isRequired ? pc20.red(" (required)") : ""}`);
5118
+ const isChild = tree.children.includes(sub);
5119
+ console.log(` ${pc20.yellow(sub)}${isChild ? pc20.dim(" (child)") : ""}`);
5120
5120
  }
5121
5121
  }
5122
5122
  if (tree.siblings.length > 0) {
@@ -5550,7 +5550,7 @@ Make sure the dev server is running: ${BRAND.cliCommand} dev`));
5550
5550
  });
5551
5551
  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
5552
  try {
5553
- const { generateViewerFromJson } = await import("./static-viewer-Q4F4QP5M.js");
5553
+ const { generateViewerFromJson } = await import("./static-viewer-KILKIVN7.js");
5554
5554
  const fs2 = await import("fs/promises");
5555
5555
  const path = await import("path");
5556
5556
  const inputPath = path.resolve(process.cwd(), options.input);
@@ -5598,7 +5598,7 @@ program.command("add").argument("[name]", 'Component name (e.g., "Button", "Text
5598
5598
  });
5599
5599
  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
5600
  try {
5601
- const { init } = await import("./init-EIM5WNMP.js");
5601
+ const { init } = await import("./init-W72WBSU2.js");
5602
5602
  const result = await init({
5603
5603
  projectRoot: process.cwd(),
5604
5604
  force: options.force,
@@ -5618,7 +5618,7 @@ program.command("init").description("Initialize fragments in a project (interact
5618
5618
  });
5619
5619
  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
5620
  try {
5621
- const { tokens } = await import("./tokens-P2B7ZAM3.js");
5621
+ const { tokens } = await import("./tokens-IXSQHPQK.js");
5622
5622
  const result = await tokens({
5623
5623
  config: options.config,
5624
5624
  json: options.json,
@@ -5637,7 +5637,7 @@ program.command("tokens").description("Discover and list design tokens from CSS/
5637
5637
  });
5638
5638
  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
5639
  try {
5640
- const { generate } = await import("./generate-54GJAWUY.js");
5640
+ const { generate } = await import("./generate-GP6ZLAQB.js");
5641
5641
  const result = await generate({
5642
5642
  projectRoot: process.cwd(),
5643
5643
  component,
@@ -5664,7 +5664,7 @@ program.command("graph").description("Query the component relationship graph").a
5664
5664
  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
5665
  try {
5666
5666
  const { config, configDir } = await loadConfig(options.config);
5667
- const { runTestCommand, listTests } = await import("./test-6VN2DA3S.js");
5667
+ const { runTestCommand, listTests } = await import("./test-3YRYQRGV.js");
5668
5668
  if (options.list) {
5669
5669
  await listTests(config, configDir, {
5670
5670
  component: options.component,