Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: bundle csf-tools with tsup #19141

Merged
merged 5 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -8183,7 +8183,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