@alexgorbatchev/shadcn 0.0.58 → 0.0.59
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/prototype.js +41 -12
- package/package.json +7 -5
package/dist/prototype.js
CHANGED
|
@@ -2051,7 +2051,7 @@ var program = new Command;
|
|
|
2051
2051
|
// package.json
|
|
2052
2052
|
var package_default = {
|
|
2053
2053
|
name: "@alexgorbatchev/shadcn",
|
|
2054
|
-
version: "0.0.
|
|
2054
|
+
version: "0.0.59",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -3107,9 +3107,10 @@ var package_default = {
|
|
|
3107
3107
|
},
|
|
3108
3108
|
scripts: {
|
|
3109
3109
|
test: "vitest run --config .storybook/vitest.config.ts && bun run test:native && bun run test:package",
|
|
3110
|
-
"test:package": "
|
|
3111
|
-
"test:preview": "bun
|
|
3112
|
-
"test:prototype": "bun
|
|
3110
|
+
"test:package": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts package",
|
|
3111
|
+
"test:preview": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts preview",
|
|
3112
|
+
"test:prototype": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts prototype",
|
|
3113
|
+
"test:cli": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts cli",
|
|
3113
3114
|
"test:native": "vitest run --config .storybook/vitest.native.config.ts",
|
|
3114
3115
|
"test:coverage": "vitest run --config .storybook/vitest.coverage.config.ts --coverage",
|
|
3115
3116
|
"test:contrast": "vitest run --config .storybook/vitest.contrast.config.ts",
|
|
@@ -3118,7 +3119,7 @@ var package_default = {
|
|
|
3118
3119
|
lint: "oxlint --deny-warnings src .storybook scripts cli templates/prototype/src templates/prototype/vite.config.ts && oxfmt --check . && bun run lint:unused",
|
|
3119
3120
|
"lint:unused": "ts-unused check tsconfig.json",
|
|
3120
3121
|
storybook: "bun scripts/buildLlmDocs.ts && storybook dev --host 127.0.0.1 -p 6006 --no-open",
|
|
3121
|
-
"build-storybook": "bun scripts/
|
|
3122
|
+
"build-storybook": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts storybook",
|
|
3122
3123
|
prepack: "bun run build",
|
|
3123
3124
|
"test:reduced-motion": "vitest run --config .storybook/vitest.reduced-motion.config.ts",
|
|
3124
3125
|
"test:visual": "vitest run --config .storybook/vitest.visual.config.ts Button.stories.tsx Badge.stories.tsx Card.stories.tsx Input.stories.tsx ScrollArea.stories.tsx",
|
|
@@ -3187,6 +3188,7 @@ var package_default = {
|
|
|
3187
3188
|
"embla-carousel-autoplay": "8.6.0",
|
|
3188
3189
|
"embla-carousel-react": "^8.6.0",
|
|
3189
3190
|
"es-toolkit": "1.52.0",
|
|
3191
|
+
execa: "10.2.1",
|
|
3190
3192
|
"heat-graph": "0.0.25",
|
|
3191
3193
|
"input-otp": "1.5.0",
|
|
3192
3194
|
leaflet: "^1.9.4",
|
|
@@ -3577,28 +3579,55 @@ async function runWorkspace(directory, action, port) {
|
|
|
3577
3579
|
|
|
3578
3580
|
// cli/createProgram.ts
|
|
3579
3581
|
function createProgram(options) {
|
|
3582
|
+
const width = Number.isFinite(options.width) && options.width >= 1 ? Math.floor(options.width) : 100;
|
|
3580
3583
|
const program = new Command("shadcn-prototype").description("Create and preview editable React mockups.").version(package_default.version).exitOverride().showHelpAfterError();
|
|
3581
3584
|
program.configureOutput({ writeOut: options.writeOut, writeErr: options.writeErr });
|
|
3582
3585
|
program.configureHelp({
|
|
3586
|
+
helpWidth: width,
|
|
3587
|
+
minWidthToWrap: 1,
|
|
3588
|
+
displayWidth: Bun.stringWidth,
|
|
3583
3589
|
formatHelp(command, helper) {
|
|
3584
|
-
const
|
|
3585
|
-
|
|
3586
|
-
|
|
3590
|
+
const wrap = (text) => options.isAgent ? text : helper.boxWrap(text, width);
|
|
3591
|
+
const formatItem = (term, description, prefix = " ", continuation = " ") => {
|
|
3592
|
+
const prefixWidth = helper.displayWidth(prefix);
|
|
3593
|
+
const descriptionColumn = Math.max(prefixWidth + 2, Math.min(45, Math.floor(width / 2)));
|
|
3594
|
+
const termWidth = descriptionColumn - 4;
|
|
3595
|
+
const connect = (line) => continuation + line.slice(continuation.length);
|
|
3596
|
+
if (prefixWidth + helper.displayWidth(term) + 2 > descriptionColumn) {
|
|
3597
|
+
const wrappedTerm = helper.boxWrap(term, Math.max(1, width - prefixWidth)).split(`
|
|
3598
|
+
`).map((line, index) => `${index === 0 ? prefix : continuation}${line}`).join(`
|
|
3599
|
+
`);
|
|
3600
|
+
if (!description)
|
|
3601
|
+
return wrappedTerm;
|
|
3602
|
+
const wrappedDescription = helper.formatItem("", termWidth, description, helper).split(`
|
|
3603
|
+
`).map(connect);
|
|
3604
|
+
return [wrappedTerm, ...wrappedDescription].join(`
|
|
3605
|
+
`);
|
|
3606
|
+
}
|
|
3607
|
+
return helper.formatItem(`${prefix.slice(2)}${term}`, termWidth, description, helper).split(`
|
|
3608
|
+
`).map((line, index) => index === 0 ? line : connect(line)).join(`
|
|
3609
|
+
`);
|
|
3610
|
+
};
|
|
3611
|
+
const lines = [wrap(`Usage: ${helper.commandUsage(command)}`), "", wrap(command.description()), "", "Options:"];
|
|
3612
|
+
for (const option of helper.visibleOptions(command)) {
|
|
3613
|
+
lines.push(options.isAgent ? ` ${option.flags} ${option.description}` : formatItem(option.flags, option.description));
|
|
3614
|
+
}
|
|
3587
3615
|
const visit = (parent, prefix) => {
|
|
3588
3616
|
const commands = helper.visibleCommands(parent);
|
|
3589
3617
|
for (const [index, child] of commands.entries()) {
|
|
3590
3618
|
const isLast = index === commands.length - 1;
|
|
3591
3619
|
const marker = options.isAgent ? "- " : isLast ? "\u2570\u2500 " : "\u251C\u2500 ";
|
|
3592
|
-
const
|
|
3593
|
-
|
|
3594
|
-
|
|
3620
|
+
const term = helper.subcommandTerm(child);
|
|
3621
|
+
const continuation = `${prefix}${options.isAgent ? " " : isLast ? " " : "\u2502 "}`;
|
|
3622
|
+
lines.push(options.isAgent ? `${prefix}${marker}${term}: ${child.description()}` : formatItem(term, child.description(), `${prefix}${marker}`, continuation));
|
|
3623
|
+
visit(child, continuation);
|
|
3595
3624
|
}
|
|
3596
3625
|
};
|
|
3597
3626
|
if (command.commands.length) {
|
|
3598
3627
|
lines.push("", "Commands:");
|
|
3599
3628
|
visit(command, " ");
|
|
3600
3629
|
}
|
|
3601
|
-
const body = lines.
|
|
3630
|
+
const body = lines.join(`
|
|
3602
3631
|
`) + `
|
|
3603
3632
|
`;
|
|
3604
3633
|
return options.isAgent ? "ALERT: Agents must read `AGENT=1 shadcn-prototype skill` before using this tool.\n" + body : body;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexgorbatchev/shadcn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"description": "Sharp, monospace React components with compact and comfortable densities.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -1056,9 +1056,10 @@
|
|
|
1056
1056
|
},
|
|
1057
1057
|
"scripts": {
|
|
1058
1058
|
"test": "vitest run --config .storybook/vitest.config.ts && bun run test:native && bun run test:package",
|
|
1059
|
-
"test:package": "
|
|
1060
|
-
"test:preview": "bun
|
|
1061
|
-
"test:prototype": "bun
|
|
1059
|
+
"test:package": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts package",
|
|
1060
|
+
"test:preview": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts preview",
|
|
1061
|
+
"test:prototype": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts prototype",
|
|
1062
|
+
"test:cli": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts cli",
|
|
1062
1063
|
"test:native": "vitest run --config .storybook/vitest.native.config.ts",
|
|
1063
1064
|
"test:coverage": "vitest run --config .storybook/vitest.coverage.config.ts --coverage",
|
|
1064
1065
|
"test:contrast": "vitest run --config .storybook/vitest.contrast.config.ts",
|
|
@@ -1067,7 +1068,7 @@
|
|
|
1067
1068
|
"lint": "oxlint --deny-warnings src .storybook scripts cli templates/prototype/src templates/prototype/vite.config.ts && oxfmt --check . && bun run lint:unused",
|
|
1068
1069
|
"lint:unused": "ts-unused check tsconfig.json",
|
|
1069
1070
|
"storybook": "bun scripts/buildLlmDocs.ts && storybook dev --host 127.0.0.1 -p 6006 --no-open",
|
|
1070
|
-
"build-storybook": "bun scripts/
|
|
1071
|
+
"build-storybook": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts storybook",
|
|
1071
1072
|
"prepack": "bun run build",
|
|
1072
1073
|
"test:reduced-motion": "vitest run --config .storybook/vitest.reduced-motion.config.ts",
|
|
1073
1074
|
"test:visual": "vitest run --config .storybook/vitest.visual.config.ts Button.stories.tsx Badge.stories.tsx Card.stories.tsx Input.stories.tsx ScrollArea.stories.tsx",
|
|
@@ -1136,6 +1137,7 @@
|
|
|
1136
1137
|
"embla-carousel-autoplay": "8.6.0",
|
|
1137
1138
|
"embla-carousel-react": "^8.6.0",
|
|
1138
1139
|
"es-toolkit": "1.52.0",
|
|
1140
|
+
"execa": "10.2.1",
|
|
1139
1141
|
"heat-graph": "0.0.25",
|
|
1140
1142
|
"input-otp": "1.5.0",
|
|
1141
1143
|
"leaflet": "^1.9.4",
|