Conversation
… be async, which this package cannot deal with, it seems
…e esbuild-register dependency in package.json and yarn.lock
shilman
left a comment
There was a problem hiding this comment.
This looks fine to me. I don't understand why we can't provide that functionality from Storybook in SB10, but I'll take your word for it!
…t external modules
…dules from external dependencies
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #569 +/- ##
==========================================
- Coverage 93.19% 92.53% -0.67%
==========================================
Files 15 16 +1
Lines 294 308 +14
Branches 78 82 +4
==========================================
+ Hits 274 285 +11
- Misses 20 23 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…rything is becoming ESM-only
…mit for test runs
…flow to streamline test execution and coverage reporting
transform all to CJS in tests
| transform: { | ||
| '^.+\\.[t|j]sx?$': 'babel-jest', | ||
| }, |
There was a problem hiding this comment.
Is this "the recipe"? 🤔💭❗
…tion of playwright-core and @babel/plugin-transform-modules-commonjs, and upgrade several Babel packages to their latest versions for improved compatibility and performance.
… utility functions for story normalization, and updating Jest configuration for improved compatibility with Playwright. This includes the introduction of a project root utility and normalization logic for story entries, alongside various type imports for better type safety.
…ases in hooks.test.ts to cast page as 'any' for compatibility with Playwright. This enhances type safety and ensures proper function calls in the test suite.
…t to the latest ESM-only branch for improved compatibility with modern module systems.
…WC Jest transformer settings, enhancing compatibility with modern JavaScript features.
…ommit for improved compatibility with modern module systems.
…0.0-beta.0, and add new dependencies for improved compatibility and functionality.
…arn.lock to point to the latest ESM branch, and change TypeScript module resolution to 'esnext' for improved compatibility with modern JavaScript features.
|
I tested out the canary in my project along with SB10, and it works well except that the type definitions file |
|
@IanVS thanks for trying this out ❤️ Seems you're correct, the type file(s) are completely missing in the canary. @shilman I'll let you be the judge if that should block the sb10 final release, but my guess is, it does. A cheap way out would be to write the definition files manually. |
tsup.config.ts
Outdated
| @@ -21,6 +50,7 @@ export default defineConfig([ | |||
| format: ['esm'], | |||
| dts: false, | |||
There was a problem hiding this comment.
would setting this to true enable having a .d.ts for the package, or are these types normally generated otherwise? https://www.jsdocs.io/package/tsup#:~:text=dts?:%20boolean%20|%20string%20|%20DtsConfig;
There was a problem hiding this comment.
❯ yarn build
CLI Building entry: ./src/index.ts, ./src/test-storybook.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v6.7.0
CLI Using tsup config: /Users/calebjasik/Git/test-runner/tsup.config.ts
CLI Building entry: ./src/setup-page-script.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v6.7.0
CLI Using tsup config: /Users/calebjasik/Git/test-runner/tsup.config.ts
CLI Target: es2020
CJS Build start
CLI Target: es2020
ESM Build start
ESM dist/setup-page-script.mjs 15.96 KB
ESM ⚡️ Build success in 12ms
DTS Build start
"default" is imported from external module "fs" but never used in "dist/index.js".
"statSync" is imported from external module "fs" but never used in "dist/test-storybook.js".
"copyFile" is imported from external module "fs/promises" but never used in "dist/chunk-RZYS5LNG.js".
"stripVTControlCharacters" is imported from external module "util" but never used in "dist/chunk-RZYS5LNG.js".
"execFileSync" is imported from external module "child_process" but never used in "dist/chunk-RZYS5LNG.js".
DTS ⚡️ Build success in 1511ms
DTS dist/setup-page-script.d.ts 567.00 B
CJS dist/index.js 193.97 KB
CJS dist/test-storybook.js 1.68 MB
CJS dist/chunk-RZYS5LNG.js 5.93 MB
CJS ⚡️ Build success in 5666msEh, for some reason it only generates a type file for setup-page-script.d.ts 🤷
There was a problem hiding this comment.
LOL nvm, I forgot to enable for all of the file entries. Looks like the build fails when enabling that though...
❯ yarn build
CLI Building entry: ./src/index.ts, ./src/test-storybook.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v6.7.0
CLI Using tsup config: /Users/calebjasik/Git/test-runner/tsup.config.ts
CLI Building entry: ./src/setup-page-script.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v6.7.0
CLI Using tsup config: /Users/calebjasik/Git/test-runner/tsup.config.ts
CLI Target: es2020
CJS Build start
CLI Target: es2020
ESM Build start
ESM dist/setup-page-script.mjs 15.96 KB
ESM ⚡️ Build success in 33ms
DTS Build start
DTS Build start
"default" is imported from external module "fs" but never used in "dist/index.js".
"statSync" is imported from external module "fs" but never used in "dist/test-storybook.js".
"copyFile" is imported from external module "fs/promises" but never used in "dist/chunk-RZYS5LNG.js".
"stripVTControlCharacters" is imported from external module "util" but never used in "dist/chunk-RZYS5LNG.js".
"execFileSync" is imported from external module "child_process" but never used in "dist/chunk-RZYS5LNG.js".
DTS ⚡️ Build success in 1759ms
DTS dist/setup-page-script.d.ts 567.00 B
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'Identifier' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'StringLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'NumericLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'NullLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'BooleanLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'RegExpLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TemplateLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'BigIntLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'DecimalLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ArrayExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'AssignmentExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'BinaryExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'CallExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ConditionalExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'FunctionExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'LogicalExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'MemberExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'NewExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ObjectExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'SequenceExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ParenthesizedExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ThisExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'UnaryExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'UpdateExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ArrowFunctionExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ClassExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ImportExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'MetaProperty' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'Super' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TaggedTemplateExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'YieldExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'AwaitExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'Import' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'OptionalMemberExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'OptionalCallExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TypeCastExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'JSXElement' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'JSXFragment' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'BindExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'DoExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'RecordExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TupleExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ModuleExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TopicReference' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'PipelineTopicExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'PipelineBareFunction' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'PipelinePrimaryTopicReference' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSInstantiationExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSAsExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSSatisfiesExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSTypeAssertion' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSNonNullExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
Error: error occured in dts build
at Worker.<anonymous> (/Users/calebjasik/Git/test-runner/node_modules/tsup/dist/index.js:2281:26)
at Worker.emit (node:events:519:28)
at MessagePort.<anonymous> (node:internal/worker:263:53)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
DTS Build error
RollupError: Failed to compile. Check the logs above.
at error (/Users/calebjasik/Git/test-runner/node_modules/rollup/dist/shared/rollup.js:353:30)
at Object.error (/Users/calebjasik/Git/test-runner/node_modules/rollup/dist/shared/rollup.js:1721:20)
at Object.error (/Users/calebjasik/Git/test-runner/node_modules/rollup/dist/shared/rollup.js:25627:42)
at generateDtsFromTs (/Users/calebjasik/Git/test-runner/node_modules/tsup/dist/rollup.js:7498:22)
at /Users/calebjasik/Git/test-runner/node_modules/tsup/dist/rollup.js:7505:59
at _nullishCoalesce (/Users/calebjasik/Git/test-runner/node_modules/tsup/dist/rollup.js:1:198)
at Object.transform (/Users/calebjasik/Git/test-runner/node_modules/tsup/dist/rollup.js:7505:18)
at /Users/calebjasik/Git/test-runner/node_modules/rollup/dist/shared/rollup.js:1914:40
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'Identifier' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'StringLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'NumericLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'NullLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'BooleanLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'RegExpLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TemplateLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'BigIntLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'DecimalLiteral' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ArrayExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'AssignmentExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'BinaryExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'CallExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ConditionalExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'FunctionExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'LogicalExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'MemberExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'NewExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ObjectExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'SequenceExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ParenthesizedExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ThisExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'UnaryExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'UpdateExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ArrowFunctionExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ClassExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ImportExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'MetaProperty' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'Super' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TaggedTemplateExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'YieldExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'AwaitExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'Import' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'OptionalMemberExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'OptionalCallExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TypeCastExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'JSXElement' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'JSXFragment' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'BindExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'DoExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'RecordExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TupleExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'ModuleExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TopicReference' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'PipelineTopicExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'PipelineBareFunction' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'PipelinePrimaryTopicReference' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSInstantiationExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSAsExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSSatisfiesExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSTypeAssertion' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
src/csf/transformCsf.ts(30,14): error TS4023: Exported variable 'prefixFunction' has or is using name 'TSNonNullExpression' from external module "/Users/calebjasik/Git/test-runner/node_modules/storybook/dist/babel/index" but cannot be named.
CJS dist/index.js 193.97 KB
CJS dist/test-storybook.js 1.68 MB
CJS dist/chunk-RZYS5LNG.js 5.93 MB
CJS ⚡️ Build success in 6133msThere was a problem hiding this comment.
I'll have a quick look, maybe fixing it is really easy.
There was a problem hiding this comment.
Thanks @jasikpark that pushed me in the right direction.
The newest canary should have types
cc @IanVS
@storybook/test-runner@0.23.1--canary.2c9779a.0
see: https://github.com/storybookjs/test-runner/actions/runs/17668286147/job/50214128006
…te import statements to use 'node:' prefix in src/test-storybook.ts, and refactor prefixFunction declaration in transformCsf.ts.
| "@jest/types": "^29.6.3", | ||
| "@swc/core": "^1.5.22", | ||
| "@swc/jest": "^0.2.23", | ||
| "esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0", |
There was a problem hiding this comment.
This looks pretty annoying to keep up to date. Is the intention that each time esbuild releases a new version, this will be updated? Why not use >= 0.18.0?
There was a problem hiding this comment.
You're right @IanVS
However the version range you mention promises to be compatible with "all future versions" of esbuild.
I think that's a promise that can't be kept.
And it locks libraries into a really bad spot.. if they release a new major version, they risk breaking the ecosystem.
There was a problem hiding this comment.
That's fair. Though I think you can use 0.18 - 0.25 just to keep the list from becoming unmanageably long.
| "slash": "^3.0.0", | ||
| "storybook": "^0.0.0-0 || ^8.2.0 || ^9.0.0 || ^9.1.0-0", | ||
| "storybook-src": "git+https://github.com/storybookjs/storybook.git#next", | ||
| "strip-ansi": "^7.1.0", |
There was a problem hiding this comment.
There are a lot of devDependencies being added here, and they don't all seem to be used. For example, searching for strip-ansi in this PR returns no results.
There was a problem hiding this comment.
Yes, I honestly never intentioned this to be the final way we do things.
So I performed no cleanup.
Though devDependencies should not impact users/usage, so the impact is neglectable.
There was a problem hiding this comment.
Not users, but it will have an impact on contributors, since they'll have to download all of these. Not that it's a huge deal, but it's also somewhat confusing to see dependencies that aren't used in a package.json. But I wouldn't want a cleanup to block getting this released.
|
This has been working great for us @DefinedNet, has even reduced some timeout and flakey tests we've had in the past, possibly! |
|
Replaced by #571 |
What I did
Storybook 10 wil be ESM-only.
In V9
storybook/internal/commonexposes a utility-function calledserverRequire. This function will either no longer exist or becomeasync, in v10, due to the ESM-only project.I've experimented with making this code accept the async nature of the util-function, but I couldn't get it to work.
I then experimented with having some glue-code that makes the
asyncutil-functionsyncagain.This mostly worked.
I then experimented (together with @shilman) on the solution where instead of actually loading/
require-ing themain.tsfile, toAST-read it.This would have worked, it it wasn't for the fact that in this very repo, a
main.tsexists that cannot be used for this purpose.I finally decided that I'd essentially back-port the old
serverRequireinto the test-runner.The test-runner now depends on
esbuildandesbuild-registerso it's able to load themain.tsfile.Checklist for Contributors
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
Checklist for Maintainers
Make sure this PR contains one of the labels below:
Available labels
skip-release: Skip any releases, e.g., documentation only changes, CI config etc.patch: Upgrade patch version (e.g. 0.0.x)minor: Upgrade patch version (e.g. 0.x.0)major: Upgrade patch version (e.g. x.0.0)