@dev-to/vue-plugin 0.2.3 → 0.3.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.
@@ -0,0 +1,44 @@
1
+ import { type ConfigEnv, type UserConfig } from 'vite';
2
+ import type { DevToVuePluginOptions, ResolvedDevComponentConfig } from './types.js';
3
+ /** 判断是否为 lib 模式构建 */
4
+ export declare function isLibBuild(env?: ConfigEnv): boolean;
5
+ /** 转换为安全的输出目录名 */
6
+ export declare function toSafeOutDirName(componentName: string): string;
7
+ /** 转换为合法的 UMD 全局变量名 */
8
+ export declare function toSafeUmdName(componentName: string): string;
9
+ /** 校验是否为合法 JS 标识符 */
10
+ export declare function isValidJsIdentifier(name: string): boolean;
11
+ /** 生成库模式的虚拟入口模块代码(智能处理导出) */
12
+ export declare function generateLibVirtualEntryCode(params: {
13
+ rootDir: string;
14
+ defaultEntryAbs: string;
15
+ componentName: string;
16
+ }): string;
17
+ /** 生成虚拟入口模块路径(用于 lib.entry 配置) */
18
+ export declare function getLibVirtualEntryPath(componentName: string): string;
19
+ /** 将生成的 CSS 文件重命名为与 Component 同名 */
20
+ export declare function normalizeLibCss(outDir: string, baseName: string): void;
21
+ /** 解析当前的构建目标列表 */
22
+ export declare function resolveBuildTargets(params: {
23
+ componentMap: Record<string, string>;
24
+ requestedRaw: string;
25
+ defaultEntryAbs: string;
26
+ }): string[];
27
+ /** 生成库模式的构建配置 */
28
+ export declare function generateLibBuildNextConfig(params: {
29
+ rootDir: string;
30
+ configDir?: string;
31
+ picked: string;
32
+ componentMap: Record<string, string>;
33
+ resolvedConfig: ResolvedDevComponentConfig;
34
+ options: DevToVuePluginOptions;
35
+ userConfig: UserConfig;
36
+ }): {
37
+ next: UserConfig;
38
+ outDir: string;
39
+ outBase: string;
40
+ buildTargets: string[];
41
+ virtualEntryCode: string;
42
+ resolvedEntryAbs: string;
43
+ };
44
+ //# sourceMappingURL=libBuildUtils.d.ts.map
@@ -0,0 +1 @@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AAA;IACpC,cAAc,EAAE,0BAA0B,CAAA;IAC1C,OAAO,EAAE,qBAAqB,CAAA;IAC9B,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG;IACF,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAqGA"}
@@ -0,0 +1,13 @@
1
+ interface CreateLoaderUmdWrapperOptions {
2
+ componentName: string;
3
+ origin: string;
4
+ contractEndpoint?: string;
5
+ vueLoaderUrl?: string;
6
+ }
7
+ /**
8
+ * Generate a lightweight UMD wrapper that uses @dev-to/vue-loader to load the component.
9
+ * This wrapper depends on vue-loader UMD build being available.
10
+ */
11
+ export declare function createLoaderUmdWrapper(options: CreateLoaderUmdWrapperOptions): string;
12
+ export {};
13
+ //# sourceMappingURL=loaderUmdWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loaderUmdWrapper.d.ts","sourceRoot":"","sources":["../src/loaderUmdWrapper.ts"],"names":[],"mappings":"AAGA,UAAU,6BAA6B;IACrC,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,MAAM,CAyOrF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-to/vue-plugin",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",