Skip to content

Commit

Permalink
Merge pull request #19141 from storybookjs/tsup/csf-tools
Browse files Browse the repository at this point in the history
Build: bundle csf-tools with tsup
  • Loading branch information
ndelangen authored Sep 26, 2022
2 parents c04e571 + 6c6291e commit b725ff9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions code/lib/core-server/src/utils/StoryIndexGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { userOrAutoTitleFromSpecifier, sortStoriesV7 } from '@storybook/store';
import type { StoryIndexer, NormalizedStoriesSpecifier, DocsOptions } from '@storybook/core-common';
import { normalizeStoryPath } from '@storybook/core-common';
import { logger } from '@storybook/node-logger';
import { getStorySortParameter } from '@storybook/csf-tools';
import { getStorySortParameter, NoMetaError } from '@storybook/csf-tools';
import type { ComponentTitle, StoryName } from '@storybook/csf';
import { toId } from '@storybook/csf';

Expand Down Expand Up @@ -235,7 +235,7 @@ export class StoryIndexGenerator {
}
}
} catch (err) {
if (err.name === 'NoMetaError') {
if (err instanceof NoMetaError) {
logger.info(`💡 Skipping ${relativePath}: ${err}`);
} else {
logger.warn(`🚨 Extraction error on ${relativePath}: ${err}`);
Expand Down
22 changes: 17 additions & 5 deletions code/lib/csf-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@
},
"license": "MIT",
"sideEffects": false,
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md",
Expand All @@ -31,15 +39,14 @@
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"prep": "node ../../../scripts/prepare.js"
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@babel/generator": "^7.12.11",
"@babel/parser": "^7.12.11",
"@babel/traverse": "^7.12.11",
"@babel/types": "^7.12.11",
"@storybook/csf": "0.0.2--canary.0899bb7.0",
"core-js": "^3.8.2",
"fs-extra": "^9.0.1",
"ts-dedent": "^2.0.0"
},
Expand All @@ -51,5 +58,10 @@
"publishConfig": {
"access": "public"
},
"bundler": {
"entries": [
"./src/index.ts"
]
},
"gitHead": "5da5b0fabd04cc5cd5771e8242a960f05d03234a"
}
1 change: 0 additions & 1 deletion code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8103,7 +8103,6 @@ __metadata:
"@babel/types": ^7.12.11
"@storybook/csf": 0.0.2--canary.0899bb7.0
"@types/fs-extra": ^9.0.6
core-js: ^3.8.2
fs-extra: ^9.0.1
js-yaml: ^3.14.1
ts-dedent: ^2.0.0
Expand Down

0 comments on commit b725ff9

Please sign in to comment.