@cfp-studio/analyzer-api 0.1.9
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/LICENSE +21 -0
- package/dist/factory.d.mts +14 -0
- package/dist/factory.d.ts +14 -0
- package/dist/factory.mjs +18 -0
- package/dist/index.d.mts +174 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.mjs +16 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Zenc Labs Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnalyzerOptions, Analyzer, AnalyzerFactory } from './index.mjs';
|
|
2
|
+
import '@cfp-studio/serializable-values';
|
|
3
|
+
import '@cfp-studio/type-analyzer';
|
|
4
|
+
import '@cfp-studio/vfs';
|
|
5
|
+
import 'pino';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 给 AnalyzerFactory 工厂函数进行默认选项填充
|
|
9
|
+
* @param factory - 工厂函数名,接受包含默认选项的 AnalyzerFactoryOptions 并返回一个 Analyzer 实例
|
|
10
|
+
* @returns 一个新的 AnalyzerFactory 函数,该函数会在调用时填充默认选项
|
|
11
|
+
*/
|
|
12
|
+
declare function factoryWithDefaultOptions(factory: (options: Required<AnalyzerOptions>) => Analyzer): AnalyzerFactory;
|
|
13
|
+
|
|
14
|
+
export { factoryWithDefaultOptions };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnalyzerOptions, Analyzer, AnalyzerFactory } from './index.js';
|
|
2
|
+
import '@cfp-studio/serializable-values';
|
|
3
|
+
import '@cfp-studio/type-analyzer';
|
|
4
|
+
import '@cfp-studio/vfs';
|
|
5
|
+
import 'pino';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 给 AnalyzerFactory 工厂函数进行默认选项填充
|
|
9
|
+
* @param factory - 工厂函数名,接受包含默认选项的 AnalyzerFactoryOptions 并返回一个 Analyzer 实例
|
|
10
|
+
* @returns 一个新的 AnalyzerFactory 函数,该函数会在调用时填充默认选项
|
|
11
|
+
*/
|
|
12
|
+
declare function factoryWithDefaultOptions(factory: (options: Required<AnalyzerOptions>) => Analyzer): AnalyzerFactory;
|
|
13
|
+
|
|
14
|
+
export { factoryWithDefaultOptions };
|
package/dist/factory.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createFileSystemReader } from '@cfp-studio/vfs';
|
|
2
|
+
import pino from 'pino';
|
|
3
|
+
import PinoPretty from 'pino-pretty';
|
|
4
|
+
|
|
5
|
+
const { pino: createLogger } = pino;
|
|
6
|
+
const prettyLogger = PinoPretty;
|
|
7
|
+
function factoryWithDefaultOptions(factory) {
|
|
8
|
+
return (options) => factory({
|
|
9
|
+
// 展开传入的选项
|
|
10
|
+
...options,
|
|
11
|
+
// 如果 options 中没有提供 reader,则使用 createFileSystemReader 创建一个
|
|
12
|
+
reader: options.reader || createFileSystemReader(),
|
|
13
|
+
// 如果 options 中没有提供 logger,则创建一个默认的 logger
|
|
14
|
+
logger: options.logger || createLogger({ level: "debug" }, prettyLogger({ colorize: true }))
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { factoryWithDefaultOptions };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { SerializableValue } from '@cfp-studio/serializable-values';
|
|
2
|
+
import { TypeAnalyzer, ValueType, CollectedTypes } from '@cfp-studio/type-analyzer';
|
|
3
|
+
import { Reader } from '@cfp-studio/vfs';
|
|
4
|
+
import { Logger } from 'pino';
|
|
5
|
+
|
|
6
|
+
interface JSXNode {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
tag: string;
|
|
9
|
+
type: "element" | "fragment" | "text" | "expression";
|
|
10
|
+
isComponent?: boolean;
|
|
11
|
+
jsxAttr?: Record<string, unknown>;
|
|
12
|
+
children: JSXNode[];
|
|
13
|
+
location: {
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
type PreviewableId = {
|
|
19
|
+
filePath: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* 生成可预览 ID。
|
|
24
|
+
*
|
|
25
|
+
* @param options - 包含文件路径和名称的选项对象。
|
|
26
|
+
* @param options.filePath - 文件的路径。
|
|
27
|
+
* @param options.name - 与文件相关的名称。
|
|
28
|
+
* @returns 生成的可预览 ID,格式为 "文件路径:名称"。
|
|
29
|
+
*/
|
|
30
|
+
declare function generatePreviewableId(options: {
|
|
31
|
+
filePath: string;
|
|
32
|
+
name: string;
|
|
33
|
+
}): string;
|
|
34
|
+
/**
|
|
35
|
+
* 解码可预览 ID。
|
|
36
|
+
*
|
|
37
|
+
* @param id - 要解码的可预览 ID。
|
|
38
|
+
* @returns 包含文件路径和名称的对象。
|
|
39
|
+
* @throws 如果 ID 格式无效(不包含冒号),则抛出错误。
|
|
40
|
+
*/
|
|
41
|
+
declare function decodePreviewableId(id: string): PreviewableId;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 定义 Analyzer 类型,包含类型分析器、文件爬取方法和资源释放方法
|
|
45
|
+
*/
|
|
46
|
+
type Analyzer = {
|
|
47
|
+
/**
|
|
48
|
+
* 类型分析器,去除了 dispose 方法
|
|
49
|
+
*/
|
|
50
|
+
typeAnalyzer: Omit<TypeAnalyzer, "dispose">;
|
|
51
|
+
/**
|
|
52
|
+
* 爬取指定文件路径的文件,返回组件和故事的集合
|
|
53
|
+
* @param filePaths - 要爬取的文件路径数组
|
|
54
|
+
* @returns 包含组件和故事数组的 Promise
|
|
55
|
+
*/
|
|
56
|
+
crawlFiles: (filePaths: string[]) => Promise<{
|
|
57
|
+
components: Component[];
|
|
58
|
+
stories: Story[];
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* 释放 Analyzer 占用的资源
|
|
62
|
+
*/
|
|
63
|
+
dispose: () => void;
|
|
64
|
+
};
|
|
65
|
+
type AnalyzerOptions = {
|
|
66
|
+
rootDir: string;
|
|
67
|
+
reader?: Reader;
|
|
68
|
+
logger?: Logger;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* 定义 AnalyzerFactory 类型,是一个函数,用于创建 Analyzer 实例
|
|
72
|
+
* @param options - 创建 Analyzer 所需的选项
|
|
73
|
+
* @param options.rootDir - 根目录路径
|
|
74
|
+
* @param options.reader - 可选的读取器
|
|
75
|
+
* @param options.logger - 可选的日志记录器
|
|
76
|
+
* @returns 新创建的 Analyzer 实例
|
|
77
|
+
*/
|
|
78
|
+
type AnalyzerFactory = (options: AnalyzerOptions) => Analyzer;
|
|
79
|
+
/**
|
|
80
|
+
* 定义 BasePreviewable 接口,作为可预览对象的基础接口
|
|
81
|
+
*/
|
|
82
|
+
interface BasePreviewable {
|
|
83
|
+
/**
|
|
84
|
+
* 可预览对象的唯一标识符
|
|
85
|
+
*/
|
|
86
|
+
id: string;
|
|
87
|
+
/**
|
|
88
|
+
* 可预览对象在文件中的源位置
|
|
89
|
+
*/
|
|
90
|
+
sourcePosition: FileSourcePosition;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 定义 Component 接口,继承自 BasePreviewable 接口,代表一个组件
|
|
94
|
+
*/
|
|
95
|
+
interface Component extends BasePreviewable {
|
|
96
|
+
/**
|
|
97
|
+
* 指示组件是否被导出
|
|
98
|
+
*/
|
|
99
|
+
exported: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* 分析组件,返回组件分析结果的 Promise
|
|
102
|
+
* @returns 包含组件属性和类型信息的 ComponentAnalysis 对象的 Promise
|
|
103
|
+
*/
|
|
104
|
+
analyze: (withTreeData?: boolean) => Promise<ComponentAnalysis>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 定义 ComponentAnalysis 接口,包含组件分析的结果
|
|
108
|
+
*/
|
|
109
|
+
interface ComponentAnalysis {
|
|
110
|
+
/**
|
|
111
|
+
* 组件的属性类型
|
|
112
|
+
*/
|
|
113
|
+
props: ValueType;
|
|
114
|
+
/**
|
|
115
|
+
* 收集到的组件类型信息
|
|
116
|
+
*/
|
|
117
|
+
types: CollectedTypes;
|
|
118
|
+
jsxTree?: JSXNode;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 定义 Story 接口,继承自 BasePreviewable 接口,代表一个故事
|
|
122
|
+
*/
|
|
123
|
+
interface Story extends BasePreviewable {
|
|
124
|
+
/**
|
|
125
|
+
* 分析故事,返回故事分析结果的 Promise
|
|
126
|
+
* @returns 包含故事参数信息的 StoryAnalysis 对象的 Promise
|
|
127
|
+
*/
|
|
128
|
+
analyze: () => Promise<StoryAnalysis>;
|
|
129
|
+
/**
|
|
130
|
+
* 与故事关联的基本组件,可能为 null
|
|
131
|
+
*/
|
|
132
|
+
associatedComponent: BasicComponent | null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 定义 StoryAnalysis 接口,包含故事分析的结果
|
|
136
|
+
*/
|
|
137
|
+
interface StoryAnalysis {
|
|
138
|
+
/**
|
|
139
|
+
* 故事的参数,可能为 null
|
|
140
|
+
*/
|
|
141
|
+
args: StoryArgs | null;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 定义 StoryArgs 类型,包含故事参数的源位置和值
|
|
145
|
+
*/
|
|
146
|
+
type StoryArgs = {
|
|
147
|
+
/**
|
|
148
|
+
* 故事参数在文件中的源位置
|
|
149
|
+
*/
|
|
150
|
+
sourcePosition: FileSourcePosition;
|
|
151
|
+
/**
|
|
152
|
+
* 故事参数的值
|
|
153
|
+
*/
|
|
154
|
+
value: SerializableValue;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* 定义 FileSourcePosition 类型,包含文件中某个位置的起始和结束索引
|
|
158
|
+
*/
|
|
159
|
+
type FileSourcePosition = {
|
|
160
|
+
/**
|
|
161
|
+
* 起始索引
|
|
162
|
+
*/
|
|
163
|
+
start: number;
|
|
164
|
+
/**
|
|
165
|
+
* 结束索引
|
|
166
|
+
*/
|
|
167
|
+
end: number;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* 定义 BasicComponent 类型,是 Component 类型的部分属性集合
|
|
171
|
+
*/
|
|
172
|
+
type BasicComponent = Pick<Component, "id" | "analyze">;
|
|
173
|
+
|
|
174
|
+
export { type Analyzer, type AnalyzerFactory, type AnalyzerOptions, type BasePreviewable, type BasicComponent, type Component, type ComponentAnalysis, type FileSourcePosition, type JSXNode, type PreviewableId, type Story, type StoryAnalysis, type StoryArgs, decodePreviewableId, generatePreviewableId };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { SerializableValue } from '@cfp-studio/serializable-values';
|
|
2
|
+
import { TypeAnalyzer, ValueType, CollectedTypes } from '@cfp-studio/type-analyzer';
|
|
3
|
+
import { Reader } from '@cfp-studio/vfs';
|
|
4
|
+
import { Logger } from 'pino';
|
|
5
|
+
|
|
6
|
+
interface JSXNode {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
tag: string;
|
|
9
|
+
type: "element" | "fragment" | "text" | "expression";
|
|
10
|
+
isComponent?: boolean;
|
|
11
|
+
jsxAttr?: Record<string, unknown>;
|
|
12
|
+
children: JSXNode[];
|
|
13
|
+
location: {
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
type PreviewableId = {
|
|
19
|
+
filePath: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* 生成可预览 ID。
|
|
24
|
+
*
|
|
25
|
+
* @param options - 包含文件路径和名称的选项对象。
|
|
26
|
+
* @param options.filePath - 文件的路径。
|
|
27
|
+
* @param options.name - 与文件相关的名称。
|
|
28
|
+
* @returns 生成的可预览 ID,格式为 "文件路径:名称"。
|
|
29
|
+
*/
|
|
30
|
+
declare function generatePreviewableId(options: {
|
|
31
|
+
filePath: string;
|
|
32
|
+
name: string;
|
|
33
|
+
}): string;
|
|
34
|
+
/**
|
|
35
|
+
* 解码可预览 ID。
|
|
36
|
+
*
|
|
37
|
+
* @param id - 要解码的可预览 ID。
|
|
38
|
+
* @returns 包含文件路径和名称的对象。
|
|
39
|
+
* @throws 如果 ID 格式无效(不包含冒号),则抛出错误。
|
|
40
|
+
*/
|
|
41
|
+
declare function decodePreviewableId(id: string): PreviewableId;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 定义 Analyzer 类型,包含类型分析器、文件爬取方法和资源释放方法
|
|
45
|
+
*/
|
|
46
|
+
type Analyzer = {
|
|
47
|
+
/**
|
|
48
|
+
* 类型分析器,去除了 dispose 方法
|
|
49
|
+
*/
|
|
50
|
+
typeAnalyzer: Omit<TypeAnalyzer, "dispose">;
|
|
51
|
+
/**
|
|
52
|
+
* 爬取指定文件路径的文件,返回组件和故事的集合
|
|
53
|
+
* @param filePaths - 要爬取的文件路径数组
|
|
54
|
+
* @returns 包含组件和故事数组的 Promise
|
|
55
|
+
*/
|
|
56
|
+
crawlFiles: (filePaths: string[]) => Promise<{
|
|
57
|
+
components: Component[];
|
|
58
|
+
stories: Story[];
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* 释放 Analyzer 占用的资源
|
|
62
|
+
*/
|
|
63
|
+
dispose: () => void;
|
|
64
|
+
};
|
|
65
|
+
type AnalyzerOptions = {
|
|
66
|
+
rootDir: string;
|
|
67
|
+
reader?: Reader;
|
|
68
|
+
logger?: Logger;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* 定义 AnalyzerFactory 类型,是一个函数,用于创建 Analyzer 实例
|
|
72
|
+
* @param options - 创建 Analyzer 所需的选项
|
|
73
|
+
* @param options.rootDir - 根目录路径
|
|
74
|
+
* @param options.reader - 可选的读取器
|
|
75
|
+
* @param options.logger - 可选的日志记录器
|
|
76
|
+
* @returns 新创建的 Analyzer 实例
|
|
77
|
+
*/
|
|
78
|
+
type AnalyzerFactory = (options: AnalyzerOptions) => Analyzer;
|
|
79
|
+
/**
|
|
80
|
+
* 定义 BasePreviewable 接口,作为可预览对象的基础接口
|
|
81
|
+
*/
|
|
82
|
+
interface BasePreviewable {
|
|
83
|
+
/**
|
|
84
|
+
* 可预览对象的唯一标识符
|
|
85
|
+
*/
|
|
86
|
+
id: string;
|
|
87
|
+
/**
|
|
88
|
+
* 可预览对象在文件中的源位置
|
|
89
|
+
*/
|
|
90
|
+
sourcePosition: FileSourcePosition;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 定义 Component 接口,继承自 BasePreviewable 接口,代表一个组件
|
|
94
|
+
*/
|
|
95
|
+
interface Component extends BasePreviewable {
|
|
96
|
+
/**
|
|
97
|
+
* 指示组件是否被导出
|
|
98
|
+
*/
|
|
99
|
+
exported: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* 分析组件,返回组件分析结果的 Promise
|
|
102
|
+
* @returns 包含组件属性和类型信息的 ComponentAnalysis 对象的 Promise
|
|
103
|
+
*/
|
|
104
|
+
analyze: (withTreeData?: boolean) => Promise<ComponentAnalysis>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 定义 ComponentAnalysis 接口,包含组件分析的结果
|
|
108
|
+
*/
|
|
109
|
+
interface ComponentAnalysis {
|
|
110
|
+
/**
|
|
111
|
+
* 组件的属性类型
|
|
112
|
+
*/
|
|
113
|
+
props: ValueType;
|
|
114
|
+
/**
|
|
115
|
+
* 收集到的组件类型信息
|
|
116
|
+
*/
|
|
117
|
+
types: CollectedTypes;
|
|
118
|
+
jsxTree?: JSXNode;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 定义 Story 接口,继承自 BasePreviewable 接口,代表一个故事
|
|
122
|
+
*/
|
|
123
|
+
interface Story extends BasePreviewable {
|
|
124
|
+
/**
|
|
125
|
+
* 分析故事,返回故事分析结果的 Promise
|
|
126
|
+
* @returns 包含故事参数信息的 StoryAnalysis 对象的 Promise
|
|
127
|
+
*/
|
|
128
|
+
analyze: () => Promise<StoryAnalysis>;
|
|
129
|
+
/**
|
|
130
|
+
* 与故事关联的基本组件,可能为 null
|
|
131
|
+
*/
|
|
132
|
+
associatedComponent: BasicComponent | null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 定义 StoryAnalysis 接口,包含故事分析的结果
|
|
136
|
+
*/
|
|
137
|
+
interface StoryAnalysis {
|
|
138
|
+
/**
|
|
139
|
+
* 故事的参数,可能为 null
|
|
140
|
+
*/
|
|
141
|
+
args: StoryArgs | null;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 定义 StoryArgs 类型,包含故事参数的源位置和值
|
|
145
|
+
*/
|
|
146
|
+
type StoryArgs = {
|
|
147
|
+
/**
|
|
148
|
+
* 故事参数在文件中的源位置
|
|
149
|
+
*/
|
|
150
|
+
sourcePosition: FileSourcePosition;
|
|
151
|
+
/**
|
|
152
|
+
* 故事参数的值
|
|
153
|
+
*/
|
|
154
|
+
value: SerializableValue;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* 定义 FileSourcePosition 类型,包含文件中某个位置的起始和结束索引
|
|
158
|
+
*/
|
|
159
|
+
type FileSourcePosition = {
|
|
160
|
+
/**
|
|
161
|
+
* 起始索引
|
|
162
|
+
*/
|
|
163
|
+
start: number;
|
|
164
|
+
/**
|
|
165
|
+
* 结束索引
|
|
166
|
+
*/
|
|
167
|
+
end: number;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* 定义 BasicComponent 类型,是 Component 类型的部分属性集合
|
|
171
|
+
*/
|
|
172
|
+
type BasicComponent = Pick<Component, "id" | "analyze">;
|
|
173
|
+
|
|
174
|
+
export { type Analyzer, type AnalyzerFactory, type AnalyzerOptions, type BasePreviewable, type BasicComponent, type Component, type ComponentAnalysis, type FileSourcePosition, type JSXNode, type PreviewableId, type Story, type StoryAnalysis, type StoryArgs, decodePreviewableId, generatePreviewableId };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function generatePreviewableId(options) {
|
|
2
|
+
return `${options.filePath.replace(/\\/g, "/")}:${options.name}`;
|
|
3
|
+
}
|
|
4
|
+
function decodePreviewableId(id) {
|
|
5
|
+
const colonPosition = id.lastIndexOf(":");
|
|
6
|
+
if (colonPosition === -1) {
|
|
7
|
+
throw new Error(`\u65E0\u6548\u7684 ID: "${id}"`);
|
|
8
|
+
}
|
|
9
|
+
const [filePath, name] = id.split(":");
|
|
10
|
+
return {
|
|
11
|
+
filePath,
|
|
12
|
+
name
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { decodePreviewableId, generatePreviewableId };
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cfp-studio/analyzer-api",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.mjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/index.d.mts"
|
|
11
|
+
},
|
|
12
|
+
"./factory": {
|
|
13
|
+
"import": "./dist/factory.mjs",
|
|
14
|
+
"types": "./dist/factory.d.mts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@cfp-studio/serializable-values": "^9.0.6",
|
|
22
|
+
"@cfp-studio/type-analyzer": "^10.1.5",
|
|
23
|
+
"@cfp-studio/vfs": "^2.1.4",
|
|
24
|
+
"pino": "^9.5.0",
|
|
25
|
+
"pino-pretty": "^11.2.1"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"typescript": "5.7.3",
|
|
29
|
+
"unbuild": "2.0.0",
|
|
30
|
+
"vitest": "2.1.9"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc && unbuild",
|
|
34
|
+
"test": "vitest"
|
|
35
|
+
}
|
|
36
|
+
}
|