@cfp-studio/plugin-react 17.3.6 → 17.3.7
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.mts +52 -39
- package/dist/index.mjs +1 -1
- package/package.json +9 -8
- package/preview/error-boundary.tsx +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import * as fs$1 from "node:fs";
|
|
3
3
|
import * as url$1 from "node:url";
|
|
4
4
|
import { URL as URL$1 } from "node:url";
|
|
5
|
-
import { Reader } from "@cfp-studio/vfs";
|
|
6
5
|
import { Analyzer } from "@cfp-studio/analyzer-api";
|
|
6
|
+
import { Reader } from "@cfp-studio/vfs";
|
|
7
|
+
import { FrameworkPluginInfo, Logger } from "@cfp-studio/api";
|
|
7
8
|
import * as http from "node:http";
|
|
8
9
|
import { Agent, ClientRequest, ClientRequestArgs, IncomingMessage, OutgoingHttpHeaders, Server } from "node:http";
|
|
9
10
|
import { Http2SecureServer } from "node:http2";
|
|
@@ -15,26 +16,12 @@ import * as stream from "node:stream";
|
|
|
15
16
|
import { Duplex, DuplexOptions } from "node:stream";
|
|
16
17
|
import { SecureContextOptions } from "node:tls";
|
|
17
18
|
import { ZlibOptions } from "node:zlib";
|
|
19
|
+
import Lightningcss from "lightningcss";
|
|
18
20
|
import SassEmbedded from "sass-embedded";
|
|
19
21
|
import Less from "less";
|
|
20
22
|
import Stylus from "stylus";
|
|
21
23
|
|
|
22
|
-
//#region
|
|
23
|
-
/**
|
|
24
|
-
* 定义一个框架插件信息的类型,包含插件名称和 API 版本。
|
|
25
|
-
*/
|
|
26
|
-
type FrameworkPluginInfo = {
|
|
27
|
-
name: string;
|
|
28
|
-
apiVersion: number;
|
|
29
|
-
}; //#endregion
|
|
30
|
-
//#region src/axios-api.d.ts
|
|
31
|
-
/**
|
|
32
|
-
* 创建一个基于 Axios 的 API 实例
|
|
33
|
-
* @param url - API 基础 URL
|
|
34
|
-
* @returns 实现了 Api 接口的 AxiosApi 实例
|
|
35
|
-
*/
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region ../../../../node_modules/.pnpm/@types+estree@1.0.8/node_modules/@types/estree/index.d.ts
|
|
24
|
+
//#region ../../../../node_modules/.pnpm/@types+estree@1.0.9/node_modules/@types/estree/index.d.ts
|
|
38
25
|
// This definition file follows a somewhat unusual format. ESTree allows
|
|
39
26
|
// runtime type checks based on the `type` parameter. In order to explain this
|
|
40
27
|
// to typescript we want to use discriminated union types:
|
|
@@ -284,7 +271,7 @@ interface PrivateIdentifier extends BaseNode {
|
|
|
284
271
|
}
|
|
285
272
|
interface Property extends BaseNode {
|
|
286
273
|
type: "Property";
|
|
287
|
-
key: Expression
|
|
274
|
+
key: Expression;
|
|
288
275
|
value: Expression | Pattern; // Could be an AssignmentProperty
|
|
289
276
|
kind: "init" | "get" | "set";
|
|
290
277
|
method: boolean;
|
|
@@ -558,7 +545,7 @@ interface AwaitExpression extends BaseExpression {
|
|
|
558
545
|
argument: Expression;
|
|
559
546
|
}
|
|
560
547
|
//#endregion
|
|
561
|
-
//#region ../../../../node_modules/.pnpm/rollup@4.
|
|
548
|
+
//#region ../../../../node_modules/.pnpm/rollup@4.65.0/node_modules/rollup/dist/rollup.d.ts
|
|
562
549
|
declare module 'estree' {
|
|
563
550
|
export interface Decorator extends BaseNode {
|
|
564
551
|
type: 'Decorator';
|
|
@@ -638,11 +625,11 @@ type DecodedSourceMapOrMissing = {
|
|
|
638
625
|
missing?: false | undefined;
|
|
639
626
|
});
|
|
640
627
|
interface SourceMap$1 {
|
|
641
|
-
file
|
|
628
|
+
file?: string | undefined;
|
|
642
629
|
mappings: string;
|
|
643
630
|
names: string[];
|
|
644
631
|
sources: string[];
|
|
645
|
-
sourcesContent?: string[] | undefined;
|
|
632
|
+
sourcesContent?: (string | null)[] | undefined;
|
|
646
633
|
version: number;
|
|
647
634
|
debugId?: string | undefined;
|
|
648
635
|
toString(): string;
|
|
@@ -664,7 +651,8 @@ interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
|
|
|
664
651
|
}
|
|
665
652
|
interface TransformModuleJSON {
|
|
666
653
|
ast?: ProgramNode | undefined;
|
|
667
|
-
code: string;
|
|
654
|
+
code: string;
|
|
655
|
+
safeVariableNames: Record<string, string> | null; // note if plugins use new this.cache to opt-out auto transform cache
|
|
668
656
|
customTransformCache: boolean;
|
|
669
657
|
originalCode: string;
|
|
670
658
|
originalSourcemap: ExistingDecodedSourceMap | null;
|
|
@@ -672,6 +660,7 @@ interface TransformModuleJSON {
|
|
|
672
660
|
transformDependencies: string[];
|
|
673
661
|
}
|
|
674
662
|
interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
|
|
663
|
+
safeVariableNames: Record<string, string> | null;
|
|
675
664
|
ast: ProgramNode;
|
|
676
665
|
dependencies: string[];
|
|
677
666
|
id: string;
|
|
@@ -727,6 +716,7 @@ interface ModuleInfo extends ModuleOptions {
|
|
|
727
716
|
dynamicallyImportedIds: readonly string[];
|
|
728
717
|
exportedBindings: Record<string, string[]> | null;
|
|
729
718
|
exports: string[] | null;
|
|
719
|
+
safeVariableNames: Record<string, string> | null;
|
|
730
720
|
hasDefaultExport: boolean | null;
|
|
731
721
|
id: string;
|
|
732
722
|
implicitlyLoadedAfterOneOf: readonly string[];
|
|
@@ -774,6 +764,7 @@ interface PluginContext extends MinimalPluginContext$1 {
|
|
|
774
764
|
} & Partial<PartialNull<ModuleOptions>>) => Promise<ModuleInfo>;
|
|
775
765
|
parse: ParseAst;
|
|
776
766
|
resolve: (source: string, importer?: string, options?: {
|
|
767
|
+
importerAttributes?: Record<string, string>;
|
|
777
768
|
attributes?: Record<string, string>;
|
|
778
769
|
custom?: CustomPluginOptions;
|
|
779
770
|
isEntry?: boolean;
|
|
@@ -810,10 +801,12 @@ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
|
|
810
801
|
type ResolveIdHook = (this: PluginContext, source: string, importer: string | undefined, options: {
|
|
811
802
|
attributes: Record<string, string>;
|
|
812
803
|
custom?: CustomPluginOptions;
|
|
804
|
+
importerAttributes?: Record<string, string> | undefined;
|
|
813
805
|
isEntry: boolean;
|
|
814
806
|
}) => ResolveIdResult;
|
|
815
807
|
type ShouldTransformCachedModuleHook = (this: PluginContext, options: {
|
|
816
808
|
ast: ProgramNode;
|
|
809
|
+
attributes: Record<string, string>;
|
|
817
810
|
code: string;
|
|
818
811
|
id: string;
|
|
819
812
|
meta: CustomPluginOptions;
|
|
@@ -824,7 +817,12 @@ type ShouldTransformCachedModuleHook = (this: PluginContext, options: {
|
|
|
824
817
|
type IsExternal = (source: string, importer: string | undefined, isResolved: boolean) => boolean;
|
|
825
818
|
type HasModuleSideEffects = (id: string, external: boolean) => boolean;
|
|
826
819
|
type LoadResult = SourceDescription | string | NullValue;
|
|
827
|
-
type LoadHook = (this: PluginContext, id: string
|
|
820
|
+
type LoadHook = (this: PluginContext, id: string, // temporarily marked as optional for better Vite type-compatibility
|
|
821
|
+
options?: {
|
|
822
|
+
// unused, temporarily added for better Vite type-compatibility
|
|
823
|
+
ssr?: boolean | undefined; // temporarily marked as optional for better Vite type-compatibility
|
|
824
|
+
attributes?: Record<string, string>;
|
|
825
|
+
} | undefined) => LoadResult;
|
|
828
826
|
interface TransformPluginContext extends PluginContext {
|
|
829
827
|
debug: LoggingFunctionWithPosition;
|
|
830
828
|
error: (error: RollupError | string, pos?: number | {
|
|
@@ -836,7 +834,12 @@ interface TransformPluginContext extends PluginContext {
|
|
|
836
834
|
warn: LoggingFunctionWithPosition;
|
|
837
835
|
}
|
|
838
836
|
type TransformResult$2 = string | NullValue | Partial<SourceDescription>;
|
|
839
|
-
type TransformHook = (this: TransformPluginContext, code: string, id: string
|
|
837
|
+
type TransformHook = (this: TransformPluginContext, code: string, id: string, // temporarily marked as optional for better Vite type-compatibility
|
|
838
|
+
options?: {
|
|
839
|
+
// unused, temporarily added for better Vite type-compatibility
|
|
840
|
+
ssr?: boolean | undefined; // temporarily marked as optional for better Vite type-compatibility
|
|
841
|
+
attributes?: Record<string, string>;
|
|
842
|
+
} | undefined) => TransformResult$2;
|
|
840
843
|
type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
|
|
841
844
|
type RenderChunkHook = (this: PluginContext, code: string, chunk: RenderedChunk, options: NormalizedOutputOptions, meta: {
|
|
842
845
|
chunks: Record<string, RenderedChunk>;
|
|
@@ -846,13 +849,16 @@ type RenderChunkHook = (this: PluginContext, code: string, chunk: RenderedChunk,
|
|
|
846
849
|
} | string | NullValue;
|
|
847
850
|
type ResolveDynamicImportHook = (this: PluginContext, specifier: string | AstNode, importer: string, options: {
|
|
848
851
|
attributes: Record<string, string>;
|
|
852
|
+
importerAttributes: Record<string, string>;
|
|
849
853
|
}) => ResolveIdResult;
|
|
850
854
|
type ResolveImportMetaHook = (this: PluginContext, property: string | null, options: {
|
|
855
|
+
attributes: Record<string, string>;
|
|
851
856
|
chunkId: string;
|
|
852
857
|
format: InternalModuleFormat;
|
|
853
858
|
moduleId: string;
|
|
854
859
|
}) => string | NullValue;
|
|
855
860
|
type ResolveFileUrlHook = (this: PluginContext, options: {
|
|
861
|
+
attributes: Record<string, string>;
|
|
856
862
|
chunkId: string;
|
|
857
863
|
fileName: string;
|
|
858
864
|
format: InternalModuleFormat;
|
|
@@ -903,6 +909,7 @@ interface FunctionPluginHooks {
|
|
|
903
909
|
chunk: PreRenderedChunkWithFileName;
|
|
904
910
|
targetChunk: PreRenderedChunkWithFileName | null;
|
|
905
911
|
getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
|
|
912
|
+
targetModuleAttributes: Record<string, string>;
|
|
906
913
|
}) => {
|
|
907
914
|
left: string;
|
|
908
915
|
right: string;
|
|
@@ -1318,16 +1325,14 @@ interface AwaitingEventEmitter<T extends Record<string, (...parameters: any) =>
|
|
|
1318
1325
|
off<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
|
|
1319
1326
|
/**
|
|
1320
1327
|
* Registers an event listener that will be awaited before Rollup continues.
|
|
1321
|
-
* All listeners
|
|
1322
|
-
*
|
|
1328
|
+
* All listeners are invoked and awaited in parallel. Rollup waits until all
|
|
1329
|
+
* of them have settled and then throws the first rejection, if any.
|
|
1323
1330
|
*/
|
|
1324
1331
|
on<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
|
|
1325
1332
|
/**
|
|
1326
|
-
* Registers an event listener
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1329
|
-
* Listeners are removed automatically when removeListenersForCurrentRun is
|
|
1330
|
-
* called, which happens automatically after each run.
|
|
1333
|
+
* Registers an event listener like `on`. Listeners are removed automatically
|
|
1334
|
+
* when removeListenersForCurrentRun is called, which happens right before each
|
|
1335
|
+
* rebuild, after the changes that triggered it were announced.
|
|
1331
1336
|
*/
|
|
1332
1337
|
onCurrentRun<K extends keyof T>(event: K, listener: (...parameters: Parameters<T[K]>) => Promise<ReturnType<T[K]>>): this;
|
|
1333
1338
|
removeAllListeners(): this;
|
|
@@ -1428,7 +1433,7 @@ interface RollupFileStats {
|
|
|
1428
1433
|
birthtime: Date;
|
|
1429
1434
|
}
|
|
1430
1435
|
//#endregion
|
|
1431
|
-
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.
|
|
1436
|
+
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.1_d5dfe5fcbde62b2ff1de970aa6c74477/node_modules/vite/types/hmrPayload.d.ts
|
|
1432
1437
|
type HotPayload = ConnectedPayload | PingPayload | UpdatePayload | FullReloadPayload | CustomPayload | ErrorPayload | PrunePayload;
|
|
1433
1438
|
interface ConnectedPayload {
|
|
1434
1439
|
type: 'connected';
|
|
@@ -1487,7 +1492,7 @@ interface ErrorPayload {
|
|
|
1487
1492
|
};
|
|
1488
1493
|
}
|
|
1489
1494
|
//#endregion
|
|
1490
|
-
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.
|
|
1495
|
+
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.1_d5dfe5fcbde62b2ff1de970aa6c74477/node_modules/vite/types/customEvent.d.ts
|
|
1491
1496
|
interface CustomEventMap {
|
|
1492
1497
|
'vite:beforeUpdate': UpdatePayload;
|
|
1493
1498
|
'vite:afterUpdate': UpdatePayload;
|
|
@@ -1518,7 +1523,7 @@ interface InvalidatePayload {
|
|
|
1518
1523
|
*/
|
|
1519
1524
|
type InferCustomEventPayload<T extends string> = T extends keyof CustomEventMap ? CustomEventMap[T] : any;
|
|
1520
1525
|
//#endregion
|
|
1521
|
-
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.
|
|
1526
|
+
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.1_d5dfe5fcbde62b2ff1de970aa6c74477/node_modules/vite/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts
|
|
1522
1527
|
interface FetchFunctionOptions {
|
|
1523
1528
|
cached?: boolean;
|
|
1524
1529
|
startOffset?: number;
|
|
@@ -2181,12 +2186,12 @@ declare global {
|
|
|
2181
2186
|
interface URL {}
|
|
2182
2187
|
}
|
|
2183
2188
|
//#endregion
|
|
2184
|
-
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.
|
|
2189
|
+
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.1_d5dfe5fcbde62b2ff1de970aa6c74477/node_modules/vite/types/internal/lightningcssOptions.d.ts
|
|
2185
2190
|
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
|
2186
2191
|
type LightningCSSOptions = Omit<Lightningcss.BundleAsyncOptions<Lightningcss.CustomAtRules>, 'filename' | 'resolver' | 'minify' | 'sourceMap' | 'analyzeDependencies' // properties not overridden by Vite, but does not make sense to set by end users
|
|
2187
2192
|
| 'inputSourceMap' | 'projectRoot'>;
|
|
2188
2193
|
//#endregion
|
|
2189
|
-
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.
|
|
2194
|
+
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.1_d5dfe5fcbde62b2ff1de970aa6c74477/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts
|
|
2190
2195
|
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
|
2191
2196
|
// https://github.com/type-challenges/type-challenges/issues/29285
|
|
2192
2197
|
type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
|
|
@@ -2209,7 +2214,7 @@ declare global {
|
|
|
2209
2214
|
interface HTMLLinkElement {}
|
|
2210
2215
|
}
|
|
2211
2216
|
//#endregion
|
|
2212
|
-
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.
|
|
2217
|
+
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.1_d5dfe5fcbde62b2ff1de970aa6c74477/node_modules/vite/types/metadata.d.ts
|
|
2213
2218
|
interface ChunkMetadata {
|
|
2214
2219
|
importedAssets: Set<string>;
|
|
2215
2220
|
importedCss: Set<string>;
|
|
@@ -2242,7 +2247,7 @@ declare module 'rollup' {
|
|
|
2242
2247
|
}
|
|
2243
2248
|
}
|
|
2244
2249
|
//#endregion
|
|
2245
|
-
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.
|
|
2250
|
+
//#region ../../../../node_modules/.pnpm/vite@6.4.5_@types+node@24.1_d5dfe5fcbde62b2ff1de970aa6c74477/node_modules/vite/dist/node/index.d.ts
|
|
2246
2251
|
interface Alias {
|
|
2247
2252
|
find: string | RegExp;
|
|
2248
2253
|
replacement: string;
|
|
@@ -5673,6 +5678,7 @@ interface PluginHookUtils {
|
|
|
5673
5678
|
type ResolveFn = (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean) => Promise<string | undefined>;
|
|
5674
5679
|
//#endregion
|
|
5675
5680
|
//#region ../../engine/core/dist/index.d.mts
|
|
5681
|
+
//#endregion
|
|
5676
5682
|
//#region src/plugins/dependencies.d.ts
|
|
5677
5683
|
/**
|
|
5678
5684
|
* 定义包依赖项的类型,它是一个记录类型,键为包名,值为包含主要版本号和读取已安装版本方法的对象
|
|
@@ -5687,7 +5693,14 @@ type PackageDependencies = Record<string, {
|
|
|
5687
5693
|
* @returns {Promise<string | null>} - 一个 Promise,解析为已安装包的版本号字符串,如果读取失败则为 null
|
|
5688
5694
|
*/
|
|
5689
5695
|
readInstalledVersion(): Promise<string | null>;
|
|
5690
|
-
}>;
|
|
5696
|
+
}>;
|
|
5697
|
+
/**
|
|
5698
|
+
* 从指定根目录下的 package.json 文件中提取所有依赖项的信息
|
|
5699
|
+
* @param {Logger} logger - 用于记录错误信息的日志记录器
|
|
5700
|
+
* @param {string} rootDir - 项目的根目录路径
|
|
5701
|
+
* @returns {Promise<PackageDependencies>} - 一个 Promise,解析为包含所有依赖项信息的对象
|
|
5702
|
+
*/
|
|
5703
|
+
//#endregion
|
|
5691
5704
|
//#region src/plugins/framework.d.ts
|
|
5692
5705
|
/**
|
|
5693
5706
|
* 定义框架插件工厂的接口。
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";import t from"node:fs";import n from"node:path";import r from"node:url";import i from"@vitejs/plugin-react";import{polyfillNode as a}from"esbuild-plugin-polyfill-node";import{createAnalyzer as o}from"@cfp-studio/analyzer-api/analyzer";import{createFileSystemReader as s,createStackedReader as c}from"@cfp-studio/vfs";import l from"typescript";import{decodePreviewableId as u,defineSpecialTypes as d,generatePreviewableId as f}from"@cfp-studio/analyzer-api";import{parseSerializableValue as p}from"@cfp-studio/serializable-values";import{extractArgs as m,extractCsf3Stories as h,extractStoriesInfo as g,resolvePreviewableId as _}from"@cfp-studio/storybook-helpers";import{EMPTY_OBJECT_TYPE as v,NODE_TYPE as y,UNKNOWN_TYPE as b,arrayType as x,dereferenceType as S,functionType as C,helpers as w,maybeOptionalType as T,objectType as E,stripUnusedTypes as D}from"@cfp-studio/type-analyzer";function O(e,t){for(let n of e.statements)if(l.isExpressionStatement(n)&&l.isBinaryExpression(n.expression)&&n.expression.operatorToken.kind===l.SyntaxKind.EqualsToken&&l.isPropertyAccessExpression(n.expression.left)&&l.isIdentifier(n.expression.left.expression)){if(n.expression.left.expression.text!==t)continue;if(n.expression.left.name.text===`propTypes`)return n.expression.right}else if(l.isClassDeclaration(n)&&n.name){if(n.name.text!==t)continue;for(let e of n.members)if(l.isPropertyDeclaration(e)&&e.initializer&&e.name.getText()===`propTypes`)return e.initializer}return null}function k(e,t,n,r,i){let a=t.sourceFile(n),o=null;a&&(o=O(a,r));let s=null;return s=o?j(t,o):A(e,t,i),{props:s.type,types:{...s.collected}}}function A(e,t,n){let r=n.getParameters()[0];if(!r)return{type:v,collected:{}};if(!r.valueDeclaration)return{type:b,collected:{}};let i=t.checker.getTypeOfSymbolAtLocation(r,r.valueDeclaration);try{let{type:e,collected:n}=t.resolveType(i);if([e]=S(e,n,[]),e.kind===`object`&&l.isParameter(r.valueDeclaration)&&l.isObjectBindingPattern(r.valueDeclaration.name)){let t=r.valueDeclaration.name,n=new Set,i=new Set,a=!1;for(let e of t.elements){if(e.dotDotDotToken){a=!0;break}let t=e.propertyName||e.name;if(!l.isIdentifier(t)){a=!0;break}n.add(t.text),e.initializer&&i.add(t.text)}a||(e=E(Object.fromEntries(Object.entries(e.fields).filter(([e])=>n.has(e)).map(([e,t])=>[e,T(t,i.has(e))]))))}return{type:e,collected:n}}catch(n){e.warn(`Unable to resolve props type for ${t.checker.typeToString(i)}`),e.error(n.toString())}return{type:b,collected:{}}}function j(e,t){let n=e.checker.getTypeAtLocation(t),r={},i={};for(let t of n.getProperties())r[t.name]=(()=>{if(!t.valueDeclaration)return b;let n=e.checker.getTypeAtLocation(t.valueDeclaration),r=e.resolveTypeArguments(n),a=r.types[0];return a?(i={...i,...r.collected},T(a,n.symbol.name===`Requireable`)):b})();let a=E(r);return{type:a,collected:D(i,[a])}}async function M(e,t,r,i){let a=t.sourceFile(i);if(!a)return[];let o=[];for(let e of a.statements)if(l.isExportAssignment(e)){if(l.isIdentifier(e.expression))continue;o.push([`default`,e,e.expression])}else if(l.isVariableStatement(e))for(let t of e.declarationList.declarations)!l.isIdentifier(t.name)||!t.initializer||o.push([t.name.text,e,t.initializer]);else if(l.isFunctionDeclaration(e)){let t=!!e.modifiers?.find(e=>e.kind===l.SyntaxKind.ExportKeyword)&&!!e.modifiers?.find(e=>e.kind===l.SyntaxKind.DefaultKeyword),n=e.name?.text;(t||n)&&o.push([n||`default`,e,e])}else l.isClassDeclaration(e)&&e.name&&o.push([e.name.text,e,e]);let s=g(a);e.debug(`**storiresInfo: ${s}`);let c=[],d=m(a),_=w.extractExportedNames(a);async function v(n,a,o){if(o===`default`&&s)return null;let c=d[o],l=o===`default`||!!_[o],u=P(t.checker,a);if(s&&l&&(c||u?.parameters.length===0)){let i=N(e,t,r,s.component);return{...n,analyze:async()=>({args:c?{sourcePosition:{start:c.getStart(),end:c.getEnd()},value:await p(c)}:null}),associatedComponent:i}}return u?{...n,exported:l,analyze:async()=>k(e,t,i,o,u)}:null}for(let[e,t,a]of o){let o=await v({id:f({filePath:n.relative(r,i),name:e}),sourcePosition:{start:t.getStart(),end:t.getEnd()}},a,e);o&&c.push(o)}return[...c,...await h(r,t,a,async i=>{let{filePath:a}=u(i),o=(await M(e,t,r,n.join(r,a))).find(e=>e.id===i);return!o||!(`exported`in o)?{props:b,types:{}}:o.analyze()})]}function N(e,t,r,i){let a=_(r,t.checker,i);return i&&a?{id:a,analyze:async()=>{let o=P(t.checker,i);if(!o)return{props:b,types:{}};let{filePath:s,name:c}=u(a);return k(e,t,n.join(r,s),c,o)}}:null}function P(e,t){let n=e.getTypeAtLocation(t);if(n.flags===l.TypeFlags.Any&&l.isCallExpression(t)&&l.isPropertyAccessExpression(t.expression)&&l.isIdentifier(t.expression.name)&&t.expression.name.text===`bind`){let r=e.getSymbolAtLocation(t.expression.expression);r?.valueDeclaration&&l.isVariableDeclaration(r.valueDeclaration)&&r.valueDeclaration.initializer&&(n=e.getTypeAtLocation(r.valueDeclaration.initializer))}for(let e of n.getCallSignatures())if(F(e.getReturnType()))return e;if(n.symbol){let r=e.getTypeOfSymbolAtLocation(n.symbol,t);for(let e of r.getConstructSignatures())if(e.getReturnType().getProperty(`render`))return e}return null}function F(e){return!!L(e)}const I=new Set([`Element`,`ReactElement`]);function L(e){if(e.isUnion()){for(let t of e.types)if(L(t))return!0}return I.has(e.symbol?.getEscapedName().toString())}const R=d({Component:y,ComponentClass:C(y),FunctionComponent:C(y),ReactElement:y,ReactNode:y,ReactNodeArray:x(y),ReactPortal:y}),z=o({typeAnalyzerOptions:({reader:e,rootDir:i})=>{let a=r.fileURLToPath(new URL(`.`,import.meta.url)),o=n.join(a,`..`,`types`),u=n.join(a,`..`,`node_modules`),d=t.existsSync(o)?o:u;return{reader:c([e,s({mapping:{from:d,to:n.join(i,`node_modules`)},watch:!1}),...d===o?[s({mapping:{from:o,to:n.join(i,`node_modules`,`@types`)},watch:!1})]:[]]),specialTypes:R,tsCompilerOptions:{jsx:l.JsxEmit.ReactJSX,jsxImportSource:`react`}}},crawlFile:({logger:e,resolver:t,rootDir:n,absoluteFilePath:r})=>M(e,t,n,r)}),B={line:`data-inspector-line`,column:`data-inspector-column`,relativePath:`data-inspector-relative-path`};function V(e){return e.includes(B.relativePath)}function H(e,t){if(!e.includes(`<`)||V(e))return;let n=l.createSourceFile(t.relativePath,e,l.ScriptTarget.Latest,!0,l.ScriptKind.TSX),r=[],i=e=>{if(l.isJsxElement(e)||l.isJsxSelfClosingElement(e)){let i=l.isJsxElement(e)?e.openingElement:e,a=i.tagName.getStart(n),{line:o,character:s}=n.getLineAndCharacterOfPosition(a),c=i.tagName.getEnd(),u=` ${B.line}="${o+1}" ${B.column}="${s+1}" ${B.relativePath}="${U(t.relativePath)}"`;r.push({at:c,text:u})}l.forEachChild(e,i)};if(i(n),r.length===0)return;r.sort((e,t)=>t.at-e.at);let a=e;for(let{at:e,text:t}of r)a=a.slice(0,e)+t+a.slice(e);return a}function U(e){return e.replace(/&/g,`&`).replace(/"/g,`"`)}const W=/import (\* as )?React[ ,]/;function G(){return{name:`previewjs:react-js-imports`,async transform(e,t){return t.includes(`node_modules`)||n.extname(t)!==`.js`||W.test(e)?e:`import React from 'react';${e}`}}}const K=e(import.meta.url),q=[`fsevents`];function J(e,t){if(t.react)return{};let r={};for(let t of[`react`,`react-dom`]){let i=Y(t,e,$);i&&(r[t]=n.dirname(i))}return r}function Y(t,n,r){let i=`${t}/package.json`;try{return K.resolve(i,{paths:[n]})}catch{}for(let t of r)try{return e(K.resolve(t,{paths:[n]})).resolve(i)}catch{}return null}function X(t,n,r=[]){let i=Z(()=>K.resolve(t,{paths:[n]}));if(i)return i;for(let i of r){let r=Z(()=>e(K.resolve(i,{paths:[n]})).resolve(t));if(r)return r}return null}function Z(e){try{let r=e();if(!r)return null;let i=n.dirname(r);for(;i!==n.dirname(i);){let e=n.join(i,`package.json`);if(t.existsSync(e)){let n=JSON.parse(t.readFileSync(e,`utf8`));return typeof n.version==`string`?n.version:null}i=n.dirname(i)}return null}catch{return null}}const Q=[`src/.umi/**`,`src/.umi-production/**`,`src/.umi-test/**`,`src/.umi-tmp/**`],$=[`umi`,`@umijs/max`];function ee(){let e=``;return{name:`previewjs:inspector-attrs`,enforce:`pre`,configResolved(t){e=t.root},transform(t,r){let i=r.split(`?`)[0]??r;if(!/\.[jt]sx$/.test(i)||i.includes(`node_modules`)||i.includes(`__previewjs__`)||i.includes(`__previewjs_internal__`))return;let a=H(t,{relativePath:n.relative(e,i).split(n.sep).join(`/`)});if(a!==void 0)return{code:a,map:null}}}}const te={info:{apiVersion:5,name:`@cfp-studio/plugin-react`},isCompatible:async(e,t)=>{let n=await e.react?.readInstalledVersion();if(!n&&t&&(n=X(`react`,t,$)),!n)return!1;let[r,i]=n.split(`.`).map(e=>Number.parseInt(e));return Number.isNaN(r)||Number.isNaN(i)?!1:r>=17||r===16&&i>=14},async create({rootDir:e,reader:o,logger:s,dependencies:c}){let l=r.fileURLToPath(new URL(`.`,import.meta.url)),u=await c.umi?.readInstalledVersion()??await c[`@umijs/max`]?.readInstalledVersion(),d=u?Number.parseInt(u.split(`.`)[0]??`0`)>=4:!1,f=z({rootDir:e,reader:o,logger:s}),p=n.join(l,`..`,`preview`),m=J(e,c),h=`/__previewjs_internal__/renderer/shims/umi.tsx`,g=n.join(e,`src`),_={};if(d){t.existsSync(g)&&(_[`@`]=g);let r=n.join(g,`.umi`);t.existsSync(r)?_[`@@`]=r:s.debug(`umi: 跳过 @@ 别名,src/.umi 不存在(dev server 未启动)`);let i=(()=>{try{return n.dirname(K.resolve(`umi`,{paths:[e]}))}catch{try{return n.dirname(K.resolve(`@umijs/max`,{paths:[e]}))}catch{return e}}})();for(let e of[`react-router`,`react-router-dom`])try{let t=K.resolve(`${e}/package.json`,{paths:[i]});_[e]=n.dirname(t)}catch{s.debug(`umi: 跳过 ${e} 别名,解析不到实际安装位置`)}}return{defaultWrapperPath:`__previewjs__/Wrapper.tsx`,previewDirPath:p,ignoredPaths:d?Q:[],...f,viteConfig:e=>{let t=e.find(e=>e.name.startsWith(`vite:react-`));return{optimizeDeps:{...d?{exclude:q}:{},esbuildOptions:{plugins:c.next?[a()]:[]}},resolve:{alias:{"react-native":`react-native-web`,...m,...d?{umi:h,"@umijs/max":h,..._}:{}}},plugins:[ee(),G(),...e,...t?[]:[i()],{name:`previewjs:update-react-import`,async transform(e,t){if(!t.endsWith(`__previewjs_internal__/renderer/index.tsx`))return;let n=Number.parseInt(await c.react?.readInstalledVersion()||`0`);return e.replace(/__PREVIEWJS_PLUGIN_REACT_IMPORT_PATH__/g,n>=18?`./render-18`:`./render-16`)}}]}}}}};export{Q as UMI_GENERATED_DIR_GLOBS,q as UMI_NATIVE_MODULES_TO_EXCLUDE,te as default,X as resolveInstalledVersion};
|
|
1
|
+
import{createRequire as e}from"node:module";import t from"node:fs";import n from"node:path";import r from"node:url";import{decodePreviewableId as i,defineSpecialTypes as a,generatePreviewableId as o,readOwnVersion as s}from"@cfp-studio/analyzer-api";import c from"@vitejs/plugin-react";import{polyfillNode as l}from"esbuild-plugin-polyfill-node";import{createAnalyzer as u}from"@cfp-studio/analyzer-api/analyzer";import{createFileSystemReader as d,createStackedReader as f}from"@cfp-studio/vfs";import p from"typescript";import{parseSerializableValue as m}from"@cfp-studio/serializable-values";import{extractArgs as h,extractCsf3Stories as g,extractStoriesInfo as _,resolvePreviewableId as v}from"@cfp-studio/storybook-helpers";import{EMPTY_OBJECT_TYPE as y,NODE_TYPE as b,UNKNOWN_TYPE as x,arrayType as ee,dereferenceType as S,functionType as C,helpers as w,maybeOptionalType as T,objectType as E,stripUnusedTypes as D}from"@cfp-studio/type-analyzer";function O(e,t){for(let n of e.statements)if(p.isExpressionStatement(n)&&p.isBinaryExpression(n.expression)&&n.expression.operatorToken.kind===p.SyntaxKind.EqualsToken&&p.isPropertyAccessExpression(n.expression.left)&&p.isIdentifier(n.expression.left.expression)){if(n.expression.left.expression.text!==t)continue;if(n.expression.left.name.text===`propTypes`)return n.expression.right}else if(p.isClassDeclaration(n)&&n.name){if(n.name.text!==t)continue;for(let e of n.members)if(p.isPropertyDeclaration(e)&&e.initializer&&e.name.getText()===`propTypes`)return e.initializer}return null}function k(e,t,n,r,i){let a=t.sourceFile(n),o=null;a&&(o=O(a,r));let s=null;return s=o?j(t,o):A(e,t,i),{props:s.type,types:{...s.collected}}}function A(e,t,n){let r=n.getParameters()[0];if(!r)return{type:y,collected:{}};if(!r.valueDeclaration)return{type:x,collected:{}};let i=t.checker.getTypeOfSymbolAtLocation(r,r.valueDeclaration);try{let{type:e,collected:n}=t.resolveType(i);if([e]=S(e,n,[]),e.kind===`object`&&p.isParameter(r.valueDeclaration)&&p.isObjectBindingPattern(r.valueDeclaration.name)){let t=r.valueDeclaration.name,n=new Set,i=new Set,a=!1;for(let e of t.elements){if(e.dotDotDotToken){a=!0;break}let t=e.propertyName||e.name;if(!p.isIdentifier(t)){a=!0;break}n.add(t.text),e.initializer&&i.add(t.text)}a||(e=E(Object.fromEntries(Object.entries(e.fields).filter(([e])=>n.has(e)).map(([e,t])=>[e,T(t,i.has(e))]))))}return{type:e,collected:n}}catch(n){e.warn(`Unable to resolve props type for ${t.checker.typeToString(i)}`),e.error(n.toString())}return{type:x,collected:{}}}function j(e,t){let n=e.checker.getTypeAtLocation(t),r={},i={};for(let t of n.getProperties())r[t.name]=(()=>{if(!t.valueDeclaration)return x;let n=e.checker.getTypeAtLocation(t.valueDeclaration),r=e.resolveTypeArguments(n),a=r.types[0];return a?(i={...i,...r.collected},T(a,n.symbol.name===`Requireable`)):x})();let a=E(r);return{type:a,collected:D(i,[a])}}async function M(e,t,r,a){let s=t.sourceFile(a);if(!s)return[];let c=[];for(let e of s.statements)if(p.isExportAssignment(e)){if(p.isIdentifier(e.expression))continue;c.push([`default`,e,e.expression])}else if(p.isVariableStatement(e))for(let t of e.declarationList.declarations)!p.isIdentifier(t.name)||!t.initializer||c.push([t.name.text,e,t.initializer]);else if(p.isFunctionDeclaration(e)){let t=!!e.modifiers?.find(e=>e.kind===p.SyntaxKind.ExportKeyword)&&!!e.modifiers?.find(e=>e.kind===p.SyntaxKind.DefaultKeyword),n=e.name?.text;(t||n)&&c.push([n||`default`,e,e])}else p.isClassDeclaration(e)&&e.name&&c.push([e.name.text,e,e]);let l=_(s);e.debug(`**storiresInfo: ${l}`);let u=[],d=h(s),f=w.extractExportedNames(s);async function v(n,i,o){if(o===`default`&&l)return null;let s=d[o],c=o===`default`||!!f[o],u=P(t.checker,i);if(l&&c&&(s||u?.parameters.length===0)){let i=N(e,t,r,l.component);return{...n,analyze:async()=>({args:s?{sourcePosition:{start:s.getStart(),end:s.getEnd()},value:await m(s)}:null}),associatedComponent:i}}return u?{...n,exported:c,analyze:async()=>k(e,t,a,o,u)}:null}for(let[e,t,i]of c){let s=await v({id:o({filePath:n.relative(r,a),name:e}),sourcePosition:{start:t.getStart(),end:t.getEnd()}},i,e);s&&u.push(s)}return[...u,...await g(r,t,s,async a=>{let{filePath:o}=i(a),s=(await M(e,t,r,n.join(r,o))).find(e=>e.id===a);return!s||!(`exported`in s)?{props:x,types:{}}:s.analyze()})]}function N(e,t,r,a){let o=v(r,t.checker,a);return a&&o?{id:o,analyze:async()=>{let s=P(t.checker,a);if(!s)return{props:x,types:{}};let{filePath:c,name:l}=i(o);return k(e,t,n.join(r,c),l,s)}}:null}function P(e,t){let n=e.getTypeAtLocation(t);if(n.flags===p.TypeFlags.Any&&p.isCallExpression(t)&&p.isPropertyAccessExpression(t.expression)&&p.isIdentifier(t.expression.name)&&t.expression.name.text===`bind`){let r=e.getSymbolAtLocation(t.expression.expression);r?.valueDeclaration&&p.isVariableDeclaration(r.valueDeclaration)&&r.valueDeclaration.initializer&&(n=e.getTypeAtLocation(r.valueDeclaration.initializer))}for(let e of n.getCallSignatures())if(F(e.getReturnType()))return e;if(n.symbol){let r=e.getTypeOfSymbolAtLocation(n.symbol,t);for(let e of r.getConstructSignatures())if(e.getReturnType().getProperty(`render`))return e}return null}function F(e){return!!L(e)}const I=new Set([`Element`,`ReactElement`]);function L(e){if(e.isUnion()){for(let t of e.types)if(L(t))return!0}return I.has(e.symbol?.getEscapedName().toString())}const R=a({Component:b,ComponentClass:C(b),FunctionComponent:C(b),ReactElement:b,ReactNode:b,ReactNodeArray:ee(b),ReactPortal:b}),z=u({typeAnalyzerOptions:({reader:e,rootDir:i})=>{let a=r.fileURLToPath(new URL(`.`,import.meta.url)),o=n.join(a,`..`,`types`),s=n.join(a,`..`,`node_modules`),c=t.existsSync(o)?o:s;return{reader:f([e,d({mapping:{from:c,to:n.join(i,`node_modules`)},watch:!1}),...c===o?[d({mapping:{from:o,to:n.join(i,`node_modules`,`@types`)},watch:!1})]:[]]),specialTypes:R,tsCompilerOptions:{jsx:p.JsxEmit.ReactJSX,jsxImportSource:`react`}}},crawlFile:({logger:e,resolver:t,rootDir:n,absoluteFilePath:r})=>M(e,t,n,r)}),B={line:`data-inspector-line`,column:`data-inspector-column`,relativePath:`data-inspector-relative-path`};function V(e){return e.includes(B.relativePath)}function H(e,t){if(!e.includes(`<`)||V(e))return;let n=p.createSourceFile(t.relativePath,e,p.ScriptTarget.Latest,!0,p.ScriptKind.TSX),r=[],i=e=>{if(p.isJsxElement(e)||p.isJsxSelfClosingElement(e)){let i=p.isJsxElement(e)?e.openingElement:e,a=i.tagName.getStart(n),{line:o,character:s}=n.getLineAndCharacterOfPosition(a),c=i.tagName.getEnd(),l=` ${B.line}="${o+1}" ${B.column}="${s+1}" ${B.relativePath}="${U(t.relativePath)}"`;r.push({at:c,text:l})}p.forEachChild(e,i)};if(i(n),r.length===0)return;r.sort((e,t)=>t.at-e.at);let a=e;for(let{at:e,text:t}of r)a=a.slice(0,e)+t+a.slice(e);return a}function U(e){return e.replace(/&/g,`&`).replace(/"/g,`"`)}const W=/import (\* as )?React[ ,]/;function G(){return{name:`previewjs:react-js-imports`,async transform(e,t){return t.includes(`node_modules`)||n.extname(t)!==`.js`||W.test(e)?e:`import React from 'react';${e}`}}}const K=e(import.meta.url),q=[`fsevents`];function J(e,t){if(t.react)return{};let r={};for(let t of[`react`,`react-dom`]){let i=Y(t,e,$);i&&(r[t]=n.dirname(i))}return r}function Y(t,n,r){let i=`${t}/package.json`;try{return K.resolve(i,{paths:[n]})}catch{}for(let t of r)try{return e(K.resolve(t,{paths:[n]})).resolve(i)}catch{}return null}function X(t,n,r=[]){let i=Z(()=>K.resolve(t,{paths:[n]}));if(i)return i;for(let i of r){let r=Z(()=>e(K.resolve(i,{paths:[n]})).resolve(t));if(r)return r}return null}function Z(e){try{let r=e();if(!r)return null;let i=n.dirname(r);for(;i!==n.dirname(i);){let e=n.join(i,`package.json`);if(t.existsSync(e)){let n=JSON.parse(t.readFileSync(e,`utf8`));return typeof n.version==`string`?n.version:null}i=n.dirname(i)}return null}catch{return null}}const Q=[`src/.umi/**`,`src/.umi-production/**`,`src/.umi-test/**`,`src/.umi-tmp/**`],$=[`umi`,`@umijs/max`];function te(){let e=``;return{name:`previewjs:inspector-attrs`,enforce:`pre`,configResolved(t){e=t.root},transform(t,r){let i=r.split(`?`)[0]??r;if(!/\.[jt]sx$/.test(i)||i.includes(`node_modules`)||i.includes(`__previewjs__`)||i.includes(`__previewjs_internal__`))return;let a=H(t,{relativePath:n.relative(e,i).split(n.sep).join(`/`)});if(a!==void 0)return{code:a,map:null}}}}const ne={info:{apiVersion:5,version:s(import.meta.url),name:`@cfp-studio/plugin-react`},isCompatible:async(e,t)=>{let n=await e.react?.readInstalledVersion();if(!n&&t&&(n=X(`react`,t,$)),!n)return!1;let[r,i]=n.split(`.`).map(e=>Number.parseInt(e));return Number.isNaN(r)||Number.isNaN(i)?!1:r>=17||r===16&&i>=14},async create({rootDir:e,reader:i,logger:a,dependencies:o}){let s=r.fileURLToPath(new URL(`.`,import.meta.url)),u=await o.umi?.readInstalledVersion()??await o[`@umijs/max`]?.readInstalledVersion(),d=u?Number.parseInt(u.split(`.`)[0]??`0`)>=4:!1,f=z({rootDir:e,reader:i,logger:a}),p=n.join(s,`..`,`preview`),m=J(e,o),h=`/__previewjs_internal__/renderer/shims/umi.tsx`,g=n.join(e,`src`),_={};if(d){t.existsSync(g)&&(_[`@`]=g);let r=n.join(g,`.umi`);t.existsSync(r)?_[`@@`]=r:a.debug(`umi: 跳过 @@ 别名,src/.umi 不存在(dev server 未启动)`);let i=(()=>{try{return n.dirname(K.resolve(`umi`,{paths:[e]}))}catch{try{return n.dirname(K.resolve(`@umijs/max`,{paths:[e]}))}catch{return e}}})();for(let e of[`react-router`,`react-router-dom`])try{let t=K.resolve(`${e}/package.json`,{paths:[i]});_[e]=n.dirname(t)}catch{a.debug(`umi: 跳过 ${e} 别名,解析不到实际安装位置`)}}return{defaultWrapperPath:`__previewjs__/Wrapper.tsx`,previewDirPath:p,ignoredPaths:d?Q:[],...f,viteConfig:e=>{let t=e.find(e=>e.name.startsWith(`vite:react-`));return{optimizeDeps:{...d?{exclude:q}:{},esbuildOptions:{plugins:o.next?[l()]:[]}},resolve:{alias:{"react-native":`react-native-web`,...m,...d?{umi:h,"@umijs/max":h,..._}:{}}},plugins:[te(),G(),...e,...t?[]:[c()],{name:`previewjs:update-react-import`,async transform(e,t){if(!t.endsWith(`__previewjs_internal__/renderer/index.tsx`))return;let n=Number.parseInt(await o.react?.readInstalledVersion()||`0`);return e.replace(/__PREVIEWJS_PLUGIN_REACT_IMPORT_PATH__/g,n>=18?`./render-18`:`./render-16`)}}]}}}}};export{Q as UMI_GENERATED_DIR_GLOBS,q as UMI_NATIVE_MODULES_TO_EXCLUDE,ne as default,X as resolveInstalledVersion};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfp-studio/plugin-react",
|
|
3
|
-
"version": "17.3.
|
|
3
|
+
"version": "17.3.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
"@vitejs/plugin-react": "4.3.4",
|
|
16
16
|
"esbuild-plugin-polyfill-node": "0.3.0",
|
|
17
17
|
"typescript": "5.9.3",
|
|
18
|
-
"@cfp-studio/
|
|
18
|
+
"@cfp-studio/api": "16.1.2",
|
|
19
|
+
"@cfp-studio/analyzer-api": "0.1.16",
|
|
19
20
|
"@cfp-studio/storybook-helpers": "6.0.2",
|
|
20
|
-
"@cfp-studio/
|
|
21
|
+
"@cfp-studio/serializable-values": "9.0.8",
|
|
21
22
|
"@cfp-studio/vfs": "2.1.8",
|
|
22
|
-
"@cfp-studio/
|
|
23
|
+
"@cfp-studio/type-analyzer": "10.1.9"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@playwright/test": "1.64.1",
|
|
@@ -28,14 +29,14 @@
|
|
|
28
29
|
"@types/react-dom": "18.3.5",
|
|
29
30
|
"csstype": "3.1.3",
|
|
30
31
|
"pino": "9.11.0",
|
|
31
|
-
"pino-pretty": "
|
|
32
|
+
"pino-pretty": "13.1.1",
|
|
32
33
|
"react": "18.3.1",
|
|
33
34
|
"react-dom": "18.3.1",
|
|
34
35
|
"vite": "6.4.5",
|
|
35
36
|
"vitest": "5.0.5",
|
|
36
|
-
"@cfp-studio/
|
|
37
|
-
"@cfp-studio/
|
|
38
|
-
"@cfp-studio/
|
|
37
|
+
"@cfp-studio/iframe": "18.4.6",
|
|
38
|
+
"@cfp-studio/testing": "14.0.1",
|
|
39
|
+
"@cfp-studio/core": "1.0.13"
|
|
39
40
|
},
|
|
40
41
|
"engines": {
|
|
41
42
|
"node": ">=20"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describeError, renderErrorPanel, type RenderErrorPanelOptions } from "@cfp-studio/analyzer-api";
|
|
1
|
+
import { describeError, renderErrorPanel, type RenderErrorPanelOptions } from "@cfp-studio/analyzer-api/error-panel";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { Component } from "react";
|
|
4
4
|
|