@storybook/csf-plugin 7.1.0-alpha.8 → 7.1.0-beta.0
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/index.d.ts +3 -3
- package/dist/index.mjs +7 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import * as _unplugin from 'unplugin';
|
|
|
6
6
|
import { EnrichCsfOptions } from '@storybook/csf-tools';
|
|
7
7
|
|
|
8
8
|
type CsfPluginOptions = EnrichCsfOptions;
|
|
9
|
-
declare const unplugin: _unplugin.UnpluginInstance<EnrichCsfOptions,
|
|
9
|
+
declare const unplugin: _unplugin.UnpluginInstance<EnrichCsfOptions, boolean>;
|
|
10
10
|
declare const esbuild: (options: EnrichCsfOptions) => _esbuild.Plugin;
|
|
11
11
|
declare const webpack: (options: EnrichCsfOptions) => _webpack.WebpackPluginInstance;
|
|
12
|
-
declare const rollup: (options: EnrichCsfOptions) => _rollup.Plugin;
|
|
13
|
-
declare const vite: (options: EnrichCsfOptions) => _vite.Plugin;
|
|
12
|
+
declare const rollup: (options: EnrichCsfOptions) => _rollup.Plugin | _rollup.Plugin[];
|
|
13
|
+
declare const vite: (options: EnrichCsfOptions) => _vite.Plugin | _vite.Plugin[];
|
|
14
14
|
|
|
15
15
|
export { CsfPluginOptions, esbuild, rollup, unplugin, vite, webpack };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createUnplugin } from 'unplugin';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import { loadCsf, enrichCsf, formatCsf } from '@storybook/csf-tools';
|
|
4
|
+
|
|
5
|
+
var STORIES_REGEX=/\.(story|stories)\.[tj]sx?$/,logger=console,unplugin=createUnplugin(options=>({name:"unplugin-csf",enforce:"pre",loadInclude(id){return STORIES_REGEX.test(id)},async load(fname){let code=await fs.readFile(fname,"utf-8");try{let csf=loadCsf(code,{makeTitle:userTitle=>userTitle||"default"}).parse();return enrichCsf(csf,options),formatCsf(csf,{sourceMaps:!0})}catch(err){return err.message?.startsWith("CSF:")||logger.warn(err.message),code}}})),{esbuild}=unplugin,{webpack}=unplugin,{rollup}=unplugin,{vite}=unplugin;
|
|
6
|
+
|
|
7
|
+
export { esbuild, rollup, unplugin, vite, webpack };
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/csf-plugin",
|
|
3
|
-
"version": "7.1.0-
|
|
3
|
+
"version": "7.1.0-beta.0",
|
|
4
4
|
"description": "Enrich CSF files via static analysis",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
7
7
|
],
|
|
8
|
-
"homepage": "https://github.com/storybookjs/storybook/tree/
|
|
8
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/csf-plugin",
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/storybookjs/storybook/issues"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/storybookjs/storybook.git",
|
|
15
|
-
"directory": "lib/csf-plugin"
|
|
15
|
+
"directory": "code/lib/csf-plugin"
|
|
16
16
|
},
|
|
17
17
|
"funding": {
|
|
18
18
|
"type": "opencollective",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
25
26
|
"node": "./dist/index.js",
|
|
26
27
|
"require": "./dist/index.js",
|
|
27
|
-
"import": "./dist/index.mjs"
|
|
28
|
-
"types": "./dist/index.d.ts"
|
|
28
|
+
"import": "./dist/index.mjs"
|
|
29
29
|
},
|
|
30
30
|
"./package.json": "./package.json"
|
|
31
31
|
},
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@storybook/csf-tools": "7.1.0-
|
|
47
|
-
"unplugin": "^
|
|
46
|
+
"@storybook/csf-tools": "7.1.0-beta.0",
|
|
47
|
+
"unplugin": "^1.3.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"typescript": "~4.9.3"
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
],
|
|
65
65
|
"platform": "node"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
68
|
-
}
|
|
67
|
+
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17"
|
|
68
|
+
}
|