@storybook/cli 10.4.0-alpha.14 → 10.4.0-alpha.16
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/_node-chunks/{block-dependencies-versions-AM5QANNI.js → block-dependencies-versions-S3TJGYC2.js} +11 -11
- package/dist/_node-chunks/{block-experimental-addon-test-SKHKW34G.js → block-experimental-addon-test-WWZCXLB2.js} +9 -9
- package/dist/_node-chunks/{block-major-version-UAH3KKTU.js → block-major-version-JNM4ZAKB.js} +9 -9
- package/dist/_node-chunks/{block-node-version-HKDPGBID.js → block-node-version-HDPTJUPH.js} +9 -9
- package/dist/_node-chunks/{block-webpack5-frameworks-2TXPVSTJ.js → block-webpack5-frameworks-TETWAJLZ.js} +11 -11
- package/dist/_node-chunks/chunk-7BQI2DK6.js +20 -0
- package/dist/_node-chunks/chunk-7H4XHFS5.js +527 -0
- package/dist/_node-chunks/chunk-JYLYIY6L.js +810 -0
- package/dist/_node-chunks/{chunk-JTNWFOHX.js → chunk-NDN75UAD.js} +7 -7
- package/dist/_node-chunks/chunk-QBNIQBHH.js +23 -0
- package/dist/_node-chunks/{chunk-6JZE6CV7.js → chunk-QQ7E4GEX.js} +15 -15
- package/dist/_node-chunks/chunk-TSPB5MCI.js +11 -0
- package/dist/_node-chunks/{chunk-YIHJSEST.js → chunk-TZ336D6R.js} +6 -6
- package/dist/_node-chunks/{chunk-3OJ2R5RR.js → chunk-UKVJ7RQN.js} +7 -7
- package/dist/_node-chunks/{globby-WUDQ574N.js → globby-5IGUGWE7.js} +8 -8
- package/dist/_node-chunks/monorepo-4B4ULRGC.js +110 -0
- package/dist/_node-chunks/optimized-tests-MJI5NXQA.js +106 -0
- package/dist/_node-chunks/{p-limit-RP5MZM3R.js → p-limit-VO6RWWBJ.js} +7 -7
- package/dist/_node-chunks/pattern-copy-play-JNOATHUQ.js +20 -0
- package/dist/_node-chunks/relaxed-limits-MKAIPGR2.js +106 -0
- package/dist/_node-chunks/{run-Q5F4R4Z7.js → run-EJWCFREQ.js} +303 -1040
- package/dist/_node-chunks/{setup-VLUMEC3Q.js → setup-PUNMMEGI.js} +10 -10
- package/dist/bin/index.js +7 -7
- package/package.json +4 -4
- package/dist/_node-chunks/chunk-TLXEGV2N.js +0 -11
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__commonJS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TZ336D6R.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/semver/internal/constants.js
|
|
17
17
|
var require_constants = __commonJS({
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/ai/utils/docs-markdown-url.ts
|
|
14
|
+
function getDocsMarkdownUrl(path, projectInfo) {
|
|
15
|
+
let { majorVersion, renderer = "react", language = "ts" } = projectInfo ?? {}, versionSegment = majorVersion ? `/${majorVersion}` : "", params = new URLSearchParams();
|
|
16
|
+
renderer && params.set("renderer", renderer), params.set("language", language);
|
|
17
|
+
let query = params.toString();
|
|
18
|
+
return `https://storybook.js.org/docs${versionSegment}/${path}.md${query ? `?${query}` : ""}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
getDocsMarkdownUrl
|
|
23
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,14 +12,14 @@ var require = CJS_COMPAT_NODE_MODULE_wkto8xz8oup.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
globby,
|
|
14
14
|
globbySync
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UKVJ7RQN.js";
|
|
16
16
|
import {
|
|
17
17
|
require_semver
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NDN75UAD.js";
|
|
19
19
|
import {
|
|
20
20
|
__commonJS,
|
|
21
21
|
__toESM
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TZ336D6R.js";
|
|
23
23
|
|
|
24
24
|
// ../../../node_modules/picocolors/picocolors.js
|
|
25
25
|
var require_picocolors = __commonJS({
|
|
@@ -123,11 +123,11 @@ var import_picocolors2 = __toESM(require_picocolors(), 1), import_semver = __toE
|
|
|
123
123
|
// src/autoblock/index.ts
|
|
124
124
|
var blockers = () => [
|
|
125
125
|
// add/remove blockers here
|
|
126
|
-
import("./block-dependencies-versions-
|
|
127
|
-
import("./block-node-version-
|
|
128
|
-
import("./block-webpack5-frameworks-
|
|
129
|
-
import("./block-major-version-
|
|
130
|
-
import("./block-experimental-addon-test-
|
|
126
|
+
import("./block-dependencies-versions-S3TJGYC2.js"),
|
|
127
|
+
import("./block-node-version-HDPTJUPH.js"),
|
|
128
|
+
import("./block-webpack5-frameworks-TETWAJLZ.js"),
|
|
129
|
+
import("./block-major-version-JNM4ZAKB.js"),
|
|
130
|
+
import("./block-experimental-addon-test-WWZCXLB2.js")
|
|
131
131
|
], autoblock = async (options, list = blockers()) => list.length === 0 ? null : await Promise.all(
|
|
132
132
|
list.map(async (i) => {
|
|
133
133
|
let blocker = (await i).blocker;
|
|
@@ -351,7 +351,7 @@ var processProject = async ({
|
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
353
|
}, collectProjects = async (options, configDirs, onProjectScanStart) => {
|
|
354
|
-
let { default: pLimit } = await import("./p-limit-
|
|
354
|
+
let { default: pLimit } = await import("./p-limit-VO6RWWBJ.js"), currentCLIVersion = versions.storybook, limit = pLimit(5), projectPromises = configDirs.map(
|
|
355
355
|
(configDir) => limit(
|
|
356
356
|
() => processProject({
|
|
357
357
|
configDir,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__commonJS,
|
|
14
14
|
__require,
|
|
15
15
|
__toESM
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TZ336D6R.js";
|
|
17
17
|
|
|
18
18
|
// ../../../node_modules/fast-glob/out/utils/array.js
|
|
19
19
|
var require_array = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
isGitIgnoredSync,
|
|
22
22
|
isIgnoredByIgnoreFiles,
|
|
23
23
|
isIgnoredByIgnoreFilesSync
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-UKVJ7RQN.js";
|
|
25
|
+
import "./chunk-TZ336D6R.js";
|
|
26
26
|
export {
|
|
27
27
|
convertPathToPattern,
|
|
28
28
|
generateGlobTasks,
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
batchTestsRule,
|
|
14
|
+
buildPortalStep,
|
|
15
|
+
buildSharedPreviewStep,
|
|
16
|
+
cleanupStep,
|
|
17
|
+
discoveryStepStrict,
|
|
18
|
+
editOverWriteRule,
|
|
19
|
+
ext,
|
|
20
|
+
interactionPlayStep,
|
|
21
|
+
listRules,
|
|
22
|
+
listSteps,
|
|
23
|
+
monorepoRule,
|
|
24
|
+
monorepoStep,
|
|
25
|
+
mswStep,
|
|
26
|
+
noPolishRule,
|
|
27
|
+
nodeModuleReadsRule,
|
|
28
|
+
packageManagerRule,
|
|
29
|
+
preferSharedFixesRule,
|
|
30
|
+
readBudgetRule,
|
|
31
|
+
toolsVsShellRule,
|
|
32
|
+
verifyStep,
|
|
33
|
+
writeStoriesStep
|
|
34
|
+
} from "./chunk-7H4XHFS5.js";
|
|
35
|
+
import {
|
|
36
|
+
getDocsMarkdownUrl
|
|
37
|
+
} from "./chunk-QBNIQBHH.js";
|
|
38
|
+
import "./chunk-TZ336D6R.js";
|
|
39
|
+
|
|
40
|
+
// src/ai/setup-prompts/monorepo.ts
|
|
41
|
+
import { dedent } from "ts-dedent";
|
|
42
|
+
function instructions(projectInfo) {
|
|
43
|
+
let { configDir, language, packageManager, packageManagerName } = projectInfo, tsx = ext(language, !0), ts = ext(language, !1), docsUrl = (path) => getDocsMarkdownUrl(path, projectInfo), mswInstall = packageManager.getInstallCommand(
|
|
44
|
+
["msw", "msw-storybook-addon", "mockdate"],
|
|
45
|
+
!0
|
|
46
|
+
), ctx = {
|
|
47
|
+
configDir,
|
|
48
|
+
docsUrl,
|
|
49
|
+
mswInstall,
|
|
50
|
+
packageManager,
|
|
51
|
+
packageManagerName,
|
|
52
|
+
tsx,
|
|
53
|
+
ts
|
|
54
|
+
};
|
|
55
|
+
return dedent`
|
|
56
|
+
Your goal is to make Storybook fully functional in this project: configure \`${configDir}/preview.${tsx}\` with the right decorators, add MSW for data, and write up to 10 colocated \`*.stories.${tsx}\` files. Add \`play\` functions only where they prove something non-trivial.
|
|
57
|
+
|
|
58
|
+
## Rules of engagement (follow strictly — these are time budgets, not suggestions)
|
|
59
|
+
|
|
60
|
+
${listRules([
|
|
61
|
+
toolsVsShellRule(ctx),
|
|
62
|
+
nodeModuleReadsRule(ctx),
|
|
63
|
+
monorepoRule(ctx),
|
|
64
|
+
readBudgetRule(ctx),
|
|
65
|
+
editOverWriteRule(ctx),
|
|
66
|
+
batchTestsRule(ctx),
|
|
67
|
+
packageManagerRule(ctx),
|
|
68
|
+
preferSharedFixesRule(ctx),
|
|
69
|
+
noPolishRule(ctx)
|
|
70
|
+
])}
|
|
71
|
+
|
|
72
|
+
## Plan (do not skip steps, but keep each step lean)
|
|
73
|
+
|
|
74
|
+
${listSteps(
|
|
75
|
+
[
|
|
76
|
+
discoveryStepStrict(projectInfo, ctx),
|
|
77
|
+
monorepoStep(projectInfo, ctx),
|
|
78
|
+
buildSharedPreviewStep(projectInfo, ctx),
|
|
79
|
+
buildPortalStep(projectInfo, ctx),
|
|
80
|
+
mswStep(projectInfo, ctx),
|
|
81
|
+
writeStoriesStep(projectInfo, ctx),
|
|
82
|
+
interactionPlayStep(projectInfo, ctx),
|
|
83
|
+
verifyStep(projectInfo, ctx),
|
|
84
|
+
cleanupStep(projectInfo, ctx)
|
|
85
|
+
],
|
|
86
|
+
{ level: 3 }
|
|
87
|
+
)}
|
|
88
|
+
|
|
89
|
+
## Done when
|
|
90
|
+
|
|
91
|
+
- **Exactly one \`CssCheck\` story exists** somewhere in the new stories, asserting a concrete computed style value read from the component's source (added at the end of Step 5).
|
|
92
|
+
- Every story file you wrote that vitest confirmed passing has had \`'needs-work'\` stripped, leaving \`tags: ['ai-generated']\`. Anything still failing keeps \`['ai-generated', 'needs-work']\`.
|
|
93
|
+
- \`npx vitest --project storybook run\` passes for the new files.
|
|
94
|
+
- The project's TypeScript check passes for changed files.
|
|
95
|
+
- The shared preview is strong enough that stories don't need per-story fetch/provider workarounds.
|
|
96
|
+
|
|
97
|
+
## Reference (only fetch if stuck)
|
|
98
|
+
|
|
99
|
+
- Docs index: https://storybook.js.org/llms.txt
|
|
100
|
+
- Writing stories: ${docsUrl("writing-stories")}
|
|
101
|
+
- Decorators: ${docsUrl("writing-stories/decorators")}
|
|
102
|
+
- Play functions: ${docsUrl("writing-stories/play-function")}
|
|
103
|
+
- Vitest integration: ${docsUrl("writing-tests/vitest-plugin")}
|
|
104
|
+
|
|
105
|
+
Append \`?codeOnly=true\` to any docs URL for code-only snippets. Don't fetch unless a specific question can't be answered from this prompt.
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
instructions
|
|
110
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
batchTestsRule,
|
|
14
|
+
buildPortalStep,
|
|
15
|
+
buildSharedPreviewStep,
|
|
16
|
+
cleanupStep,
|
|
17
|
+
discoveryStepStrict,
|
|
18
|
+
editOverWriteRule,
|
|
19
|
+
ext,
|
|
20
|
+
interactionPlayStep,
|
|
21
|
+
listRules,
|
|
22
|
+
listSteps,
|
|
23
|
+
mswStep,
|
|
24
|
+
noPolishRule,
|
|
25
|
+
nodeModuleReadsRule,
|
|
26
|
+
packageManagerRule,
|
|
27
|
+
preferSharedFixesRule,
|
|
28
|
+
readBudgetRule,
|
|
29
|
+
toolsVsShellRule,
|
|
30
|
+
verifyStep,
|
|
31
|
+
writeStoriesStep
|
|
32
|
+
} from "./chunk-7H4XHFS5.js";
|
|
33
|
+
import {
|
|
34
|
+
getDocsMarkdownUrl
|
|
35
|
+
} from "./chunk-QBNIQBHH.js";
|
|
36
|
+
import "./chunk-TZ336D6R.js";
|
|
37
|
+
|
|
38
|
+
// src/ai/setup-prompts/optimized-tests.ts
|
|
39
|
+
import { dedent } from "ts-dedent";
|
|
40
|
+
function instructions(projectInfo) {
|
|
41
|
+
let { configDir, language, packageManager, packageManagerName } = projectInfo, tsx = ext(language, !0), ts = ext(language, !1), docsUrl = (path) => getDocsMarkdownUrl(path, projectInfo), mswInstall = packageManager.getInstallCommand(
|
|
42
|
+
["msw", "msw-storybook-addon", "mockdate"],
|
|
43
|
+
!0
|
|
44
|
+
), ctx = {
|
|
45
|
+
configDir,
|
|
46
|
+
docsUrl,
|
|
47
|
+
mswInstall,
|
|
48
|
+
packageManager,
|
|
49
|
+
packageManagerName,
|
|
50
|
+
tsx,
|
|
51
|
+
ts
|
|
52
|
+
};
|
|
53
|
+
return dedent`
|
|
54
|
+
Your goal is to make Storybook fully functional in this project: configure \`${configDir}/preview.${tsx}\` with the right decorators, add MSW for data, and write up to 10 colocated \`*.stories.${tsx}\` files. Add \`play\` functions only where they prove something non-trivial.
|
|
55
|
+
|
|
56
|
+
## Rules of engagement (follow strictly — these are time budgets, not suggestions)
|
|
57
|
+
|
|
58
|
+
${listRules([
|
|
59
|
+
toolsVsShellRule(ctx),
|
|
60
|
+
nodeModuleReadsRule(ctx),
|
|
61
|
+
readBudgetRule(ctx),
|
|
62
|
+
editOverWriteRule(ctx),
|
|
63
|
+
batchTestsRule(ctx),
|
|
64
|
+
packageManagerRule(ctx),
|
|
65
|
+
preferSharedFixesRule(ctx),
|
|
66
|
+
noPolishRule(ctx)
|
|
67
|
+
])}
|
|
68
|
+
|
|
69
|
+
## Plan (do not skip steps, but keep each step lean)
|
|
70
|
+
|
|
71
|
+
${listSteps(
|
|
72
|
+
[
|
|
73
|
+
discoveryStepStrict(projectInfo, ctx),
|
|
74
|
+
buildSharedPreviewStep(projectInfo, ctx),
|
|
75
|
+
buildPortalStep(projectInfo, ctx),
|
|
76
|
+
mswStep(projectInfo, ctx),
|
|
77
|
+
writeStoriesStep(projectInfo, ctx),
|
|
78
|
+
interactionPlayStep(projectInfo, ctx),
|
|
79
|
+
verifyStep(projectInfo, ctx),
|
|
80
|
+
cleanupStep(projectInfo, ctx)
|
|
81
|
+
],
|
|
82
|
+
{ level: 3 }
|
|
83
|
+
)}
|
|
84
|
+
|
|
85
|
+
## Done when
|
|
86
|
+
|
|
87
|
+
- **Exactly one \`CssCheck\` story exists** somewhere in the new stories, asserting a concrete computed style value read from the component's source (added at the end of Step 5).
|
|
88
|
+
- Every story file you wrote that vitest confirmed passing has had \`'needs-work'\` stripped, leaving \`tags: ['ai-generated']\`. Anything still failing keeps \`['ai-generated', 'needs-work']\`.
|
|
89
|
+
- \`npx vitest --project storybook run\` passes for the new files.
|
|
90
|
+
- The project's TypeScript check passes for changed files.
|
|
91
|
+
- The shared preview is strong enough that stories don't need per-story fetch/provider workarounds.
|
|
92
|
+
|
|
93
|
+
## Reference (only fetch if stuck)
|
|
94
|
+
|
|
95
|
+
- Docs index: https://storybook.js.org/llms.txt
|
|
96
|
+
- Writing stories: ${docsUrl("writing-stories")}
|
|
97
|
+
- Decorators: ${docsUrl("writing-stories/decorators")}
|
|
98
|
+
- Play functions: ${docsUrl("writing-stories/play-function")}
|
|
99
|
+
- Vitest integration: ${docsUrl("writing-tests/vitest-plugin")}
|
|
100
|
+
|
|
101
|
+
Append \`?codeOnly=true\` to any docs URL for code-only snippets. Don't fetch unless a specific question can't be answered from this prompt.
|
|
102
|
+
`;
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
instructions
|
|
106
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-TZ336D6R.js";
|
|
13
13
|
|
|
14
14
|
// ../../../node_modules/yocto-queue/index.js
|
|
15
15
|
var Node = class {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
instructions
|
|
14
|
+
} from "./chunk-JYLYIY6L.js";
|
|
15
|
+
import "./chunk-QBNIQBHH.js";
|
|
16
|
+
import "./chunk-7BQI2DK6.js";
|
|
17
|
+
import "./chunk-TZ336D6R.js";
|
|
18
|
+
export {
|
|
19
|
+
instructions
|
|
20
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_sgh3w93ap7c from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_sgh3w93ap7c from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_sgh3w93ap7c from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_sgh3w93ap7c.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_sgh3w93ap7c.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_sgh3w93ap7c.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
batchTestsRule,
|
|
14
|
+
buildPortalStep,
|
|
15
|
+
buildSharedPreviewStep,
|
|
16
|
+
cleanupStep,
|
|
17
|
+
discoveryStepRelaxed,
|
|
18
|
+
editOverWriteRule,
|
|
19
|
+
ext,
|
|
20
|
+
interactionPlayStep,
|
|
21
|
+
listRules,
|
|
22
|
+
listSteps,
|
|
23
|
+
mswStep,
|
|
24
|
+
noPolishRule,
|
|
25
|
+
nodeModuleReadsRule,
|
|
26
|
+
packageManagerRule,
|
|
27
|
+
preferSharedFixesRule,
|
|
28
|
+
readBudgetRuleRelaxed,
|
|
29
|
+
toolsVsShellRule,
|
|
30
|
+
verifyStep,
|
|
31
|
+
writeStoriesStep
|
|
32
|
+
} from "./chunk-7H4XHFS5.js";
|
|
33
|
+
import {
|
|
34
|
+
getDocsMarkdownUrl
|
|
35
|
+
} from "./chunk-QBNIQBHH.js";
|
|
36
|
+
import "./chunk-TZ336D6R.js";
|
|
37
|
+
|
|
38
|
+
// src/ai/setup-prompts/relaxed-limits.ts
|
|
39
|
+
import { dedent } from "ts-dedent";
|
|
40
|
+
function instructions(projectInfo) {
|
|
41
|
+
let { configDir, language, packageManager, packageManagerName } = projectInfo, tsx = ext(language, !0), ts = ext(language, !1), docsUrl = (path) => getDocsMarkdownUrl(path, projectInfo), mswInstall = packageManager.getInstallCommand(
|
|
42
|
+
["msw", "msw-storybook-addon", "mockdate"],
|
|
43
|
+
!0
|
|
44
|
+
), ctx = {
|
|
45
|
+
configDir,
|
|
46
|
+
docsUrl,
|
|
47
|
+
mswInstall,
|
|
48
|
+
packageManager,
|
|
49
|
+
packageManagerName,
|
|
50
|
+
tsx,
|
|
51
|
+
ts
|
|
52
|
+
};
|
|
53
|
+
return dedent`
|
|
54
|
+
Your goal is to make Storybook fully functional in this project: configure \`${configDir}/preview.${tsx}\` with the right decorators, add MSW for data, and write up to 10 colocated \`*.stories.${tsx}\` files. Add \`play\` functions only where they prove something non-trivial.
|
|
55
|
+
|
|
56
|
+
## Rules of engagement (follow strictly — these are time budgets, not suggestions)
|
|
57
|
+
|
|
58
|
+
${listRules([
|
|
59
|
+
toolsVsShellRule(ctx),
|
|
60
|
+
nodeModuleReadsRule(ctx),
|
|
61
|
+
readBudgetRuleRelaxed(ctx),
|
|
62
|
+
editOverWriteRule(ctx),
|
|
63
|
+
batchTestsRule(ctx),
|
|
64
|
+
packageManagerRule(ctx),
|
|
65
|
+
preferSharedFixesRule(ctx),
|
|
66
|
+
noPolishRule(ctx)
|
|
67
|
+
])}
|
|
68
|
+
|
|
69
|
+
## Plan (do not skip steps, but keep each step lean)
|
|
70
|
+
|
|
71
|
+
${listSteps(
|
|
72
|
+
[
|
|
73
|
+
discoveryStepRelaxed(projectInfo, ctx),
|
|
74
|
+
buildSharedPreviewStep(projectInfo, ctx),
|
|
75
|
+
buildPortalStep(projectInfo, ctx),
|
|
76
|
+
mswStep(projectInfo, ctx),
|
|
77
|
+
writeStoriesStep(projectInfo, ctx),
|
|
78
|
+
interactionPlayStep(projectInfo, ctx),
|
|
79
|
+
verifyStep(projectInfo, ctx),
|
|
80
|
+
cleanupStep(projectInfo, ctx)
|
|
81
|
+
],
|
|
82
|
+
{ level: 3 }
|
|
83
|
+
)}
|
|
84
|
+
|
|
85
|
+
## Done when
|
|
86
|
+
|
|
87
|
+
- **Exactly one \`CssCheck\` story exists** somewhere in the new stories, asserting a concrete computed style value read from the component's source (added at the end of Step 5).
|
|
88
|
+
- Every story file you wrote that vitest confirmed passing has had \`'needs-work'\` stripped, leaving \`tags: ['ai-generated']\`. Anything still failing keeps \`['ai-generated', 'needs-work']\`.
|
|
89
|
+
- \`npx vitest --project storybook run\` passes for the new files.
|
|
90
|
+
- The project's TypeScript check passes for changed files.
|
|
91
|
+
- The shared preview is strong enough that stories don't need per-story fetch/provider workarounds.
|
|
92
|
+
|
|
93
|
+
## Reference (only fetch if stuck)
|
|
94
|
+
|
|
95
|
+
- Docs index: https://storybook.js.org/llms.txt
|
|
96
|
+
- Writing stories: ${docsUrl("writing-stories")}
|
|
97
|
+
- Decorators: ${docsUrl("writing-stories/decorators")}
|
|
98
|
+
- Play functions: ${docsUrl("writing-stories/play-function")}
|
|
99
|
+
- Vitest integration: ${docsUrl("writing-tests/vitest-plugin")}
|
|
100
|
+
|
|
101
|
+
Append \`?codeOnly=true\` to any docs URL for code-only snippets. Don't fetch unless a specific question can't be answered from this prompt.
|
|
102
|
+
`;
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
instructions
|
|
106
|
+
};
|