storybook-framework-cedarjs 1.0.0-canary.12749 → 1.0.0-rc.26

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Storybook for CedarJS
2
2
 
3
3
  Storybook Framework package for CedarJS. Uses the `@storybook/builder-vite`
4
- builder and `@storybook/react-vite` renderer.
4
+ builder and `@storybook/react` renderer.
5
5
 
6
6
  Intended to be used alongside the
7
7
  [CLI package](../cli-packages/storybook-vite/README.md), which handles the
package/dist/index.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- export * from '@storybook/react';
2
- export { __definePreview as definePreview } from '@storybook/react';
3
1
  export * from './types.js';
4
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,eAAe,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEnE,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1 @@
1
- export * from "@storybook/react";
2
- import { __definePreview } from "@storybook/react";
3
1
  export * from "./types.js";
4
- export {
5
- __definePreview as definePreview
6
- };
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * This is heavily based on the react-docgen `displayNameHandler`
3
3
  * (https://github.com/reactjs/react-docgen/blob/26c90c0dd105bf83499a83826f2a6ff7a724620d/src/handlers/displayNameHandler.ts)
4
- * but instead defines an `actualName` property on the generated docs that is taken first from the
5
- * component's actual name. This addresses an issue where the name that the generated docs are
6
- * stored under is incorrectly named with the `displayName` and not the component's actual name.
4
+ * but instead defines an `actualName` property on the generated docs that is taken first from the component's actual name.
5
+ * This addresses an issue where the name that the generated docs are stored under is incorrectly named with the `displayName`
6
+ * and not the component's actual name.
7
7
  *
8
- * This is inspired by `actualNameHandler` from
9
- * https://github.com/storybookjs/babel-plugin-react-docgen, but is modified directly from
10
- * displayNameHandler, using the same approach as babel-plugin-react-docgen.
8
+ * This is inspired by `actualNameHandler` from https://github.com/storybookjs/babel-plugin-react-docgen, but is modified
9
+ * directly from displayNameHandler, using the same approach as babel-plugin-react-docgen.
11
10
  */
12
11
  import type { Handler } from 'react-docgen';
13
12
  declare const actualNameHandler: Handler;
@@ -1 +1 @@
1
- {"version":3,"file":"actualNameHandler.d.ts","sourceRoot":"","sources":["../../../src/plugins/docgen-handlers/actualNameHandler.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,OAAO,EAA6B,MAAM,cAAc,CAAA;AAKtE,QAAA,MAAM,iBAAiB,EAAE,OA4CxB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
1
+ {"version":3,"file":"actualNameHandler.d.ts","sourceRoot":"","sources":["../../../src/plugins/docgen-handlers/actualNameHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAA6B,MAAM,cAAc,CAAA;AAKtE,QAAA,MAAM,iBAAiB,EAAE,OA0CxB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import { utils } from "react-docgen";
2
2
  const { getNameOrValue, isReactForwardRefCall } = utils;
3
3
  const actualNameHandler = function actualNameHandler2(documentation, componentDefinition) {
4
- documentation.set("definedInFile", componentDefinition.hub.file.opts.filename);
5
4
  if ((componentDefinition.isClassDeclaration() || componentDefinition.isFunctionDeclaration()) && componentDefinition.has("id")) {
6
5
  documentation.set(
7
6
  "actualName",
@@ -1,10 +1,8 @@
1
- import * as TsconfigPaths from 'tsconfig-paths';
2
1
  import type { PluginOption } from 'vite';
3
2
  type Options = {
4
3
  include?: string | RegExp | (string | RegExp)[];
5
4
  exclude?: string | RegExp | (string | RegExp)[];
6
5
  };
7
- export declare function reactDocgen({ include, exclude, }?: Options): Promise<PluginOption>;
8
- export declare function getReactDocgenImporter(matchPath: TsconfigPaths.MatchPath | undefined): import("react-docgen").Importer;
6
+ export declare function reactDocgen({ include, exclude, }?: Options): PluginOption;
9
7
  export {};
10
8
  //# sourceMappingURL=react-docgen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-docgen.d.ts","sourceRoot":"","sources":["../../src/plugins/react-docgen.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAgBxC,KAAK,OAAO,GAAG;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAC/C,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CAChD,CAAA;AAED,wBAAsB,WAAW,CAAC,EAChC,OAA8B,EAC9B,OAA8B,GAC/B,GAAE,OAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAuDtC;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,aAAa,CAAC,SAAS,GAAG,SAAS,mCA+B/C"}
1
+ {"version":3,"file":"react-docgen.d.ts","sourceRoot":"","sources":["../../src/plugins/react-docgen.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAYxC,KAAK,OAAO,GAAG;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAC/C,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CAChD,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,OAA0B,EAC1B,OAA8B,GAC/B,GAAE,OAAY,GAAG,YAAY,CA2C7B"}
@@ -1,67 +1,50 @@
1
- import { existsSync } from "node:fs";
2
- import { relative, sep } from "node:path";
1
+ import path from "path";
3
2
  import { createFilter } from "@rollup/pluginutils";
4
- import * as find from "empathic/find";
5
3
  import MagicString from "magic-string";
6
4
  import {
7
5
  ERROR_CODES,
6
+ parse,
8
7
  builtinHandlers as docgenHandlers,
9
8
  builtinResolvers as docgenResolver,
10
- makeFsImporter,
11
- parse
9
+ builtinImporters as docgenImporters
12
10
  } from "react-docgen";
13
- import { getProjectRoot } from "storybook/internal/common";
14
- import * as TsconfigPaths from "tsconfig-paths";
15
11
  import actualNameHandler from "./docgen-handlers/actualNameHandler.js";
16
- import {
17
- RESOLVE_EXTENSIONS,
18
- ReactDocgenResolveError,
19
- defaultLookupModule
20
- } from "./docgen-resolver.js";
21
12
  const defaultHandlers = Object.values(docgenHandlers).map((handler) => handler);
22
13
  const defaultResolver = new docgenResolver.FindExportedDefinitionsResolver();
14
+ const defaultImporter = docgenImporters.fsImporter;
23
15
  const handlers = [...defaultHandlers, actualNameHandler];
24
- async function reactDocgen({
25
- include = /\.(mjs|tsx?|jsx?)$/,
16
+ function reactDocgen({
17
+ include = /\.(tsx?|jsx?)$/,
26
18
  exclude = [/node_modules\/.*/]
27
19
  } = {}) {
28
20
  const cwd = process.cwd();
29
21
  const filter = createFilter(include, exclude);
30
- const tsconfigPath = find.up("tsconfig.json", { cwd, last: getProjectRoot() });
31
- const tsconfig = TsconfigPaths.loadConfig(tsconfigPath);
32
- let matchPath;
33
- if (tsconfig.resultType === "success") {
34
- matchPath = TsconfigPaths.createMatchPath(
35
- tsconfig.absoluteBaseUrl,
36
- tsconfig.paths,
37
- ["browser", "module", "main"]
38
- );
39
- }
40
22
  return {
41
23
  name: "storybook:react-docgen-plugin",
42
24
  enforce: "pre",
43
25
  async transform(src, id) {
44
- if (!filter(relative(cwd, id))) {
26
+ const relPath = path.relative(cwd, id);
27
+ if (!filter(relPath)) {
45
28
  return;
46
29
  }
47
30
  try {
48
31
  const docgenResults = parse(src, {
49
32
  resolver: defaultResolver,
50
33
  handlers,
51
- importer: getReactDocgenImporter(matchPath),
34
+ importer: defaultImporter,
52
35
  filename: id
53
36
  });
54
37
  const s = new MagicString(src);
55
38
  docgenResults.forEach((info) => {
56
- const { actualName, definedInFile, ...docgenInfo } = info;
57
- if (actualName && definedInFile == id) {
39
+ const { actualName, ...docgenInfo } = info;
40
+ if (actualName) {
58
41
  const docNode = JSON.stringify(docgenInfo);
59
42
  s.append(`;${actualName}.__docgenInfo=${docNode}`);
60
43
  }
61
44
  });
62
45
  return {
63
46
  code: s.toString(),
64
- map: s.generateMap({ hires: true, source: id })
47
+ map: s.generateMap()
65
48
  };
66
49
  } catch (e) {
67
50
  if (e.code === ERROR_CODES.MISSING_DEFINITION) {
@@ -72,35 +55,6 @@ async function reactDocgen({
72
55
  }
73
56
  };
74
57
  }
75
- function getReactDocgenImporter(matchPath) {
76
- return makeFsImporter((filename, basedir) => {
77
- const mappedFilenameByPaths = (() => {
78
- if (matchPath) {
79
- const match = matchPath(filename);
80
- return match || filename;
81
- } else {
82
- return filename;
83
- }
84
- })();
85
- const result = defaultLookupModule(mappedFilenameByPaths, basedir);
86
- if (result.includes(`${sep}react-native${sep}index.js`)) {
87
- const replaced = result.replace(
88
- `${sep}react-native${sep}index.js`,
89
- `${sep}react-native-web${sep}dist${sep}index.js`
90
- );
91
- if (existsSync(replaced)) {
92
- if (RESOLVE_EXTENSIONS.find((ext) => result.endsWith(ext))) {
93
- return replaced;
94
- }
95
- }
96
- }
97
- if (RESOLVE_EXTENSIONS.find((ext) => result.endsWith(ext))) {
98
- return result;
99
- }
100
- throw new ReactDocgenResolveError(filename);
101
- });
102
- }
103
58
  export {
104
- getReactDocgenImporter,
105
59
  reactDocgen
106
60
  };
package/dist/preset.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PresetProperty } from 'storybook/internal/types';
1
+ import type { PresetProperty } from '@storybook/types';
2
2
  import type { StorybookConfig } from './types.js';
3
3
  export declare const core: PresetProperty<'core'>;
4
4
  export declare const previewAnnotations: StorybookConfig['previewAnnotations'];
@@ -1 +1 @@
1
- {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAU9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAWjD,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,CAGvC,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAKpE,CAAA;AAID,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,WAAW,CA8BlD,CAAA"}
1
+ {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAUtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAWjD,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,CAGvC,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAKpE,CAAA;AAID,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,WAAW,CA6BlD,CAAA"}
package/dist/preset.js CHANGED
@@ -19,9 +19,9 @@ const core = {
19
19
  builder: getAbsolutePath("@storybook/builder-vite"),
20
20
  renderer: getAbsolutePath("@storybook/react")
21
21
  };
22
- const previewAnnotations = (entries = []) => {
22
+ const previewAnnotations = (entry) => {
23
23
  const createdRequire = createRequire(import.meta.url);
24
- return [...entries, createdRequire.resolve("./preview.js")];
24
+ return [...entry, createdRequire.resolve("./preview.js")];
25
25
  };
26
26
  const cedarProjectPaths = getPaths();
27
27
  const viteFinal = async (config) => {
@@ -39,16 +39,15 @@ const viteFinal = async (config) => {
39
39
  "~__REDWOOD__USER_WEB_SRC": cedarProjectPaths.web.src
40
40
  }
41
41
  },
42
- server: {
43
- // CI was flaky. Sometimes the Storybook tests would pass, sometimes they
44
- // wouldn't.
45
- // If the dev server starts serving requests before optimization
46
- // completes, it causes intermittent ESM/CJS loading errors, which locally
47
- // shows up as an infinite loading spinner in the web browser, and an
48
- // error in the browser console about missing exports.
49
- // Disabling pre-transform ensures the server waits for optimization to
50
- // complete before processing requests.
51
- preTransformRequests: false
42
+ optimizeDeps: {
43
+ // Without this, on first run, Vite throws: `The file does not exist at
44
+ // "{project path}/web/node_modules/.cache/sb-vite/deps/DocsRenderer-NNNQARDV-DEXCJJZJ.js?v=c640a8fa"
45
+ // which is in the optimize deps directory.`
46
+ // This refers to @storybook/addon-docs, which is included as part of @storybook/addon-essentials.
47
+ // the docs addon then includes itself here: https://github.com/storybookjs/storybook/blob/a496ec48c708eed753a5251d55fa07947a869e62/code/addons/docs/src/preset.ts#L198C3-L198C27
48
+ // which I believe gets included by the builder here: https://github.com/storybookjs/storybook/blob/a496ec48c708eed753a5251d55fa07947a869e62/code/builders/builder-vite/src/optimizeDeps.ts#L117
49
+ // TODO: Figure out why this error is being thrown so that this can be removed.
50
+ exclude: ["@storybook/addon-docs"]
52
51
  }
53
52
  });
54
53
  };
package/dist/preview.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Addon_DecoratorFunction, Addon_Loader } from 'storybook/internal/types';
1
+ import type { Addon_DecoratorFunction, Addon_Loader } from '@storybook/types';
2
2
  declare const _default: {
3
3
  decorators: Addon_DecoratorFunction<any>[];
4
4
  loaders: Addon_Loader<any>[];
@@ -1 +1 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../src/preview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,uBAAuB,EACvB,YAAY,EACb,MAAM,0BAA0B,CAAA;;;;;AAYjC,wBAGC"}
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../src/preview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;;;;;AAY7E,wBAGC"}
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { default as docgenTypescript } from '@joshwooding/vite-plugin-react-docgen-typescript';
2
2
  import type { StorybookConfigVite, BuilderOptions } from '@storybook/builder-vite';
3
- import type { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsBase } from 'storybook/internal/types';
3
+ import type { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsBase } from '@storybook/types';
4
4
  type FrameworkName = 'storybook-framework-cedarjs';
5
5
  type BuilderName = '@storybook/builder-vite';
6
6
  export type FrameworkOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kDAAkD,CAAA;AACnG,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,iBAAiB,IAAI,qBAAqB,EAC3C,MAAM,0BAA0B,CAAA;AAEjC,KAAK,aAAa,GAAG,6BAA6B,CAAA;AAClD,KAAK,WAAW,GAAG,yBAAyB,CAAA;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,SAAS,EACL,aAAa,GACb;QACE,IAAI,EAAE,aAAa,CAAA;QACnB,OAAO,EAAE,gBAAgB,CAAA;KAC1B,CAAA;IACL,IAAI,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG;QACnC,OAAO,CAAC,EACJ,WAAW,GACX;YACE,IAAI,EAAE,WAAW,CAAA;YACjB,OAAO,EAAE,cAAc,CAAA;SACxB,CAAA;KACN,CAAA;CACF,CAAA;AAED,KAAK,iBAAiB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAA;AAE7D,KAAK,iBAAiB,GAAG,qBAAqB,GAAG;IAC/C;;;;OAIG;IACH,WAAW,EAAE,yBAAyB,GAAG,cAAc,GAAG,KAAK,CAAA;IAC/D;;OAEG;IACH,4BAA4B,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;CAC/D,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,mBAAmB,EACnB,MAAM,mBAAmB,GAAG,MAAM,wBAAwB,GAAG,YAAY,CAC1E,GACC,mBAAmB,GACnB,wBAAwB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACxC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kDAAkD,CAAA;AACnG,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,iBAAiB,IAAI,qBAAqB,EAC3C,MAAM,kBAAkB,CAAA;AAEzB,KAAK,aAAa,GAAG,6BAA6B,CAAA;AAClD,KAAK,WAAW,GAAG,yBAAyB,CAAA;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,SAAS,EACL,aAAa,GACb;QACE,IAAI,EAAE,aAAa,CAAA;QACnB,OAAO,EAAE,gBAAgB,CAAA;KAC1B,CAAA;IACL,IAAI,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG;QACnC,OAAO,CAAC,EACJ,WAAW,GACX;YACE,IAAI,EAAE,WAAW,CAAA;YACjB,OAAO,EAAE,cAAc,CAAA;SACxB,CAAA;KACN,CAAA;CACF,CAAA;AAED,KAAK,iBAAiB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAA;AAE7D,KAAK,iBAAiB,GAAG,qBAAqB,GAAG;IAC/C;;;;OAIG;IACH,WAAW,EAAE,yBAAyB,GAAG,cAAc,GAAG,KAAK,CAAA;IAC/D;;OAEG;IACH,4BAA4B,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;CAC/D,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,mBAAmB,EACnB,MAAM,mBAAmB,GAAG,MAAM,wBAAwB,GAAG,YAAY,CAC1E,GACC,mBAAmB,GACnB,wBAAwB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACxC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-framework-cedarjs",
3
- "version": "1.0.0-canary.12749+b56167a72",
3
+ "version": "1.0.0-rc.26",
4
4
  "description": "Storybook for CedarJS",
5
5
  "keywords": [
6
6
  "Storybook",
@@ -52,19 +52,19 @@
52
52
  "test:watch": "vitest watch"
53
53
  },
54
54
  "dependencies": {
55
- "@cedarjs/testing": "1.0.0-canary.12749",
55
+ "@cedarjs/testing": "1.0.0-rc.26",
56
56
  "@joshwooding/vite-plugin-react-docgen-typescript": "0.6.2",
57
57
  "@rollup/pluginutils": "5.1.4",
58
- "@storybook/addon-docs": "9.1.16",
59
- "@storybook/builder-vite": "9.1.16",
60
- "@storybook/react-vite": "9.1.16",
61
- "empathic": "2.0.0",
58
+ "@storybook/addon-essentials": "7.6.20",
59
+ "@storybook/builder-vite": "7.6.20",
60
+ "@storybook/react": "7.6.20",
62
61
  "magic-string": "0.30.18",
63
62
  "react-docgen": "7.0.3",
64
63
  "unplugin-auto-import": "19.3.0",
65
64
  "vite-plugin-node-polyfills": "0.23.0"
66
65
  },
67
66
  "devDependencies": {
67
+ "@storybook/types": "7.6.20",
68
68
  "@types/node": "20.19.17",
69
69
  "tsx": "4.20.5",
70
70
  "typescript": "5.9.2",
@@ -72,11 +72,11 @@
72
72
  "vitest": "3.2.4"
73
73
  },
74
74
  "peerDependencies": {
75
- "@cedarjs/project-config": "1.0.0-canary.12749",
76
- "@cedarjs/router": "1.0.0-canary.12749",
77
- "react": "19.0.0-rc-f2df5694-20240916",
78
- "react-dom": "19.0.0-rc-f2df5694-20240916",
79
- "storybook": "9.1.16"
75
+ "@cedarjs/project-config": "1.0.0-rc.26",
76
+ "@cedarjs/router": "1.0.0-rc.26",
77
+ "react": "18.3.1",
78
+ "react-dom": "18.3.1",
79
+ "storybook": "7.6.20"
80
80
  },
81
81
  "engines": {
82
82
  "node": "=20.x"
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "platform": "node"
93
93
  },
94
- "gitHead": "b56167a72490d585fd4ce0ecb34235c9a39fa4f5"
94
+ "gitHead": "2ea84a564123f5d986dd88efcb6dddc55cbef367"
95
95
  }
@@ -1,7 +0,0 @@
1
- export declare class ReactDocgenResolveError extends Error {
2
- readonly code = "MODULE_NOT_FOUND";
3
- constructor(filename: string);
4
- }
5
- export declare const RESOLVE_EXTENSIONS: string[];
6
- export declare function defaultLookupModule(filename: string, basedir: string): string;
7
- //# sourceMappingURL=docgen-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"docgen-resolver.d.ts","sourceRoot":"","sources":["../../src/plugins/docgen-resolver.ts"],"names":[],"mappings":"AAQA,qBAAa,uBAAwB,SAAQ,KAAK;IAEhD,QAAQ,CAAC,IAAI,sBAAqB;gBAEtB,QAAQ,EAAE,MAAM;CAG7B;AASD,eAAO,MAAM,kBAAkB,UAa9B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsC7E"}
@@ -1,59 +0,0 @@
1
- import { extname } from "node:path";
2
- import resolve from "resolve";
3
- class ReactDocgenResolveError extends Error {
4
- // the magic string that react-docgen uses to check if a module is ignored
5
- code = "MODULE_NOT_FOUND";
6
- constructor(filename) {
7
- super(`'${filename}' was ignored by react-docgen.`);
8
- }
9
- }
10
- const RESOLVE_EXTENSIONS = [
11
- ".js",
12
- ".cts",
13
- ".mts",
14
- ".ctsx",
15
- ".mtsx",
16
- ".ts",
17
- ".tsx",
18
- ".mjs",
19
- ".cjs",
20
- ".mts",
21
- ".cts",
22
- ".jsx"
23
- ];
24
- function defaultLookupModule(filename, basedir) {
25
- const resolveOptions = {
26
- basedir,
27
- extensions: RESOLVE_EXTENSIONS,
28
- // we do not need to check core modules as we cannot import them anyway
29
- includeCoreModules: false
30
- };
31
- try {
32
- return resolve.sync(filename, resolveOptions);
33
- } catch (error) {
34
- const ext = extname(filename);
35
- let newFilename;
36
- switch (ext) {
37
- case ".js":
38
- case ".mjs":
39
- case ".cjs":
40
- newFilename = `${filename.slice(0, -2)}ts`;
41
- break;
42
- case ".jsx":
43
- newFilename = `${filename.slice(0, -3)}tsx`;
44
- break;
45
- default:
46
- throw error;
47
- }
48
- return resolve.sync(newFilename, {
49
- ...resolveOptions,
50
- // we already know that there is an extension at this point, so no need to check other extensions
51
- extensions: []
52
- });
53
- }
54
- }
55
- export {
56
- RESOLVE_EXTENSIONS,
57
- ReactDocgenResolveError,
58
- defaultLookupModule
59
- };