@fragments-sdk/cli 0.4.0 → 0.4.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.
- package/dist/bin.js +11 -11
- package/dist/{chunk-OZQ7Z6C3.js → chunk-5CKYLCJH.js} +28 -1
- package/dist/{chunk-OZQ7Z6C3.js.map → chunk-5CKYLCJH.js.map} +1 -1
- package/dist/{chunk-5JNME72P.js → chunk-5ZYEOHYK.js} +11 -9
- package/dist/chunk-5ZYEOHYK.js.map +1 -0
- package/dist/{chunk-FYIYMXGA.js → chunk-G3M3MPQ6.js} +13 -2
- package/dist/chunk-G3M3MPQ6.js.map +1 -0
- package/dist/{chunk-LDKNZ55O.js → chunk-J4SI5RIH.js} +3 -3
- package/dist/{chunk-ODXQAQQX.js → chunk-ZFKGX3QK.js} +4 -4
- package/dist/{core-F3VT277E.js → core-LNXDLXDP.js} +2 -2
- package/dist/{generate-PNIUR75D.js → generate-OIXXHOWR.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/{init-ON6WYG66.js → init-EVPXIDW4.js} +3 -3
- package/dist/mcp-bin.js +44 -43
- package/dist/mcp-bin.js.map +1 -1
- package/dist/scan-YVYD64GD.js +12 -0
- package/dist/{service-U7AR2PC2.js → service-K52ORLCJ.js} +3 -3
- package/dist/{static-viewer-QL2SCWYB.js → static-viewer-JNQIHA4B.js} +2 -2
- package/dist/{test-PBPKJ4WJ.js → test-USARUEFW.js} +8 -4
- package/dist/test-USARUEFW.js.map +1 -0
- package/dist/{tokens-4J4PRIGT.js → tokens-C6YHBOQE.js} +4 -4
- package/dist/{viewer-6VCZMA3T.js → viewer-H7TVFT4E.js} +14 -14
- package/dist/{viewer-6VCZMA3T.js.map → viewer-H7TVFT4E.js.map} +1 -1
- package/package.json +2 -1
- package/src/core/parser.ts +48 -0
- package/src/core/storyAdapter.ts +1 -1
- package/src/core/storybook-csf.ts +11 -0
- package/src/core/types.ts +1 -1
- package/src/mcp/__tests__/findFragmentsJson.test.ts +308 -0
- package/src/mcp/server.ts +59 -55
- 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/test/reporters/junit.ts +7 -3
- package/src/test/runner.ts +4 -4
- package/src/test/watch.ts +2 -2
- 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/utils/colorSchemes.ts +3 -3
- package/dist/chunk-5JNME72P.js.map +0 -1
- package/dist/chunk-FYIYMXGA.js.map +0 -1
- package/dist/scan-E6U644RS.js +0 -12
- package/dist/test-PBPKJ4WJ.js.map +0 -1
- /package/dist/{chunk-LDKNZ55O.js.map → chunk-J4SI5RIH.js.map} +0 -0
- /package/dist/{chunk-ODXQAQQX.js.map → chunk-ZFKGX3QK.js.map} +0 -0
- /package/dist/{core-F3VT277E.js.map → core-LNXDLXDP.js.map} +0 -0
- /package/dist/{generate-PNIUR75D.js.map → generate-OIXXHOWR.js.map} +0 -0
- /package/dist/{init-ON6WYG66.js.map → init-EVPXIDW4.js.map} +0 -0
- /package/dist/{scan-E6U644RS.js.map → scan-YVYD64GD.js.map} +0 -0
- /package/dist/{service-U7AR2PC2.js.map → service-K52ORLCJ.js.map} +0 -0
- /package/dist/{static-viewer-QL2SCWYB.js.map → static-viewer-JNQIHA4B.js.map} +0 -0
- /package/dist/{tokens-4J4PRIGT.js.map → tokens-C6YHBOQE.js.map} +0 -0
|
@@ -956,7 +956,7 @@ var FigmaClient = class {
|
|
|
956
956
|
* - https://www.figma.com/file/abc123/name?node-id=1%3A2 (URL-encoded)
|
|
957
957
|
*/
|
|
958
958
|
parseUrl(url) {
|
|
959
|
-
const urlPattern = /figma\.com\/(?:file|design)\/([
|
|
959
|
+
const urlPattern = /figma\.com\/(?:file|design)\/([^/]+)\/[^?]*\?.*node-id=([^&]+)/i;
|
|
960
960
|
const match = url.match(urlPattern);
|
|
961
961
|
if (!match) {
|
|
962
962
|
throw new FigmaError(
|
|
@@ -1028,7 +1028,7 @@ var FigmaClient = class {
|
|
|
1028
1028
|
* Works with URLs that may or may not have a node-id.
|
|
1029
1029
|
*/
|
|
1030
1030
|
parseFileUrl(url) {
|
|
1031
|
-
const urlPattern = /figma\.com\/(?:file|design)\/([
|
|
1031
|
+
const urlPattern = /figma\.com\/(?:file|design)\/([^/]+)/i;
|
|
1032
1032
|
const match = url.match(urlPattern);
|
|
1033
1033
|
if (!match) {
|
|
1034
1034
|
throw new FigmaError(
|
|
@@ -3526,12 +3526,13 @@ function generateUnifiedDiff(file, fixes, options) {
|
|
|
3526
3526
|
function generateHunk(cssProperty, currentValue, suggestedFix, styleType) {
|
|
3527
3527
|
const lines = [];
|
|
3528
3528
|
switch (styleType) {
|
|
3529
|
-
case "inline":
|
|
3529
|
+
case "inline": {
|
|
3530
3530
|
const camelProp = toCamelCase(cssProperty);
|
|
3531
3531
|
lines.push(`@@ -1,1 +1,1 @@ inline style`);
|
|
3532
3532
|
lines.push(`- ${camelProp}: '${currentValue}',`);
|
|
3533
3533
|
lines.push(`+ ${camelProp}: 'var(${suggestedFix.tokenName})',`);
|
|
3534
3534
|
break;
|
|
3535
|
+
}
|
|
3535
3536
|
case "styled-components":
|
|
3536
3537
|
case "emotion":
|
|
3537
3538
|
lines.push(`@@ -1,1 +1,1 @@ ${styleType}`);
|
|
@@ -3940,11 +3941,12 @@ var MetricsStore = class {
|
|
|
3940
3941
|
const date = new Date(snapshot.timestamp);
|
|
3941
3942
|
let key;
|
|
3942
3943
|
switch (groupBy) {
|
|
3943
|
-
case "week":
|
|
3944
|
+
case "week": {
|
|
3944
3945
|
const weekStart = new Date(date);
|
|
3945
3946
|
weekStart.setDate(date.getDate() - date.getDay());
|
|
3946
3947
|
key = weekStart.toISOString().split("T")[0];
|
|
3947
3948
|
break;
|
|
3949
|
+
}
|
|
3948
3950
|
case "month":
|
|
3949
3951
|
key = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}`;
|
|
3950
3952
|
break;
|
|
@@ -5016,7 +5018,7 @@ function extractJSDoc(comments) {
|
|
|
5016
5018
|
tags: {}
|
|
5017
5019
|
};
|
|
5018
5020
|
const lines = content.split("\n");
|
|
5019
|
-
|
|
5021
|
+
const currentDescription = [];
|
|
5020
5022
|
let currentTag = null;
|
|
5021
5023
|
let currentTagContent = [];
|
|
5022
5024
|
for (const line of lines) {
|
|
@@ -5056,7 +5058,7 @@ function processTag(docs, tag, content) {
|
|
|
5056
5058
|
if (propMatch) {
|
|
5057
5059
|
const [, type, nameRaw, description] = propMatch;
|
|
5058
5060
|
const isOptional = nameRaw.startsWith("[");
|
|
5059
|
-
const name = nameRaw.
|
|
5061
|
+
const name = nameRaw.replaceAll("[", "").replaceAll("]", "");
|
|
5060
5062
|
docs.props?.push({
|
|
5061
5063
|
name,
|
|
5062
5064
|
type,
|
|
@@ -5552,7 +5554,7 @@ function camelToTitle(str) {
|
|
|
5552
5554
|
}
|
|
5553
5555
|
function inferComponentFromPath(filePath) {
|
|
5554
5556
|
const fileName = basename3(filePath);
|
|
5555
|
-
|
|
5557
|
+
const name = fileName.replace(/\.stories\.(tsx?|jsx?|mdx?)$/, "");
|
|
5556
5558
|
return name;
|
|
5557
5559
|
}
|
|
5558
5560
|
async function findStoryFiles(rootDir, include = ["**/*.stories.{tsx,ts,jsx,js}"], exclude = ["**/node_modules/**", "**/dist/**"]) {
|
|
@@ -6059,7 +6061,7 @@ function getJSDocInfo(node, sourceFile) {
|
|
|
6059
6061
|
}
|
|
6060
6062
|
function parseJSDocContent(content, result) {
|
|
6061
6063
|
const lines = content.split("\n");
|
|
6062
|
-
|
|
6064
|
+
const currentDescription = [];
|
|
6063
6065
|
let currentTag = null;
|
|
6064
6066
|
let currentTagContent = [];
|
|
6065
6067
|
for (const line of lines) {
|
|
@@ -6633,4 +6635,4 @@ export {
|
|
|
6633
6635
|
getStorybookStoryIds,
|
|
6634
6636
|
renderAllComponentVariants
|
|
6635
6637
|
};
|
|
6636
|
-
//# sourceMappingURL=chunk-
|
|
6638
|
+
//# sourceMappingURL=chunk-5ZYEOHYK.js.map
|