@weapp-vite/volar 1.0.0 → 2.0.1
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.js → index.cjs} +47 -15
- package/dist/index.mjs +8 -1
- package/package.json +9 -9
|
@@ -1,17 +1,49 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name2 in all)
|
|
10
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
4
29
|
|
|
5
30
|
// src/index.ts
|
|
6
|
-
var
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
default: () => index_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
var import_node_module = require("module");
|
|
37
|
+
var import_node_path = __toESM(require("path"));
|
|
38
|
+
var import_node_process = __toESM(require("process"));
|
|
7
39
|
|
|
8
40
|
// package.json
|
|
9
41
|
var name = "@weapp-vite/volar";
|
|
10
42
|
|
|
11
43
|
// src/schema.ts
|
|
12
|
-
var
|
|
44
|
+
var import_schematics = require("@weapp-core/schematics");
|
|
13
45
|
function getSchemaForType(type) {
|
|
14
|
-
const definition =
|
|
46
|
+
const definition = import_schematics.JSON_SCHEMA_DEFINITIONS.find((d) => d.typeName === type);
|
|
15
47
|
if (!definition) {
|
|
16
48
|
return null;
|
|
17
49
|
}
|
|
@@ -42,12 +74,14 @@ var VOID_CAPABILITIES = {
|
|
|
42
74
|
structure: false,
|
|
43
75
|
format: false
|
|
44
76
|
};
|
|
45
|
-
var require2 =
|
|
77
|
+
var require2 = (0, import_node_module.createRequire)(
|
|
78
|
+
typeof module !== "undefined" && module.filename ? module.filename : import_node_path.default.join(import_node_process.default.cwd(), "weapp-vite-volar.cjs")
|
|
79
|
+
);
|
|
46
80
|
var hasSchematicsTypes = false;
|
|
47
81
|
try {
|
|
48
82
|
require2.resolve("@weapp-core/schematics");
|
|
49
83
|
hasSchematicsTypes = true;
|
|
50
|
-
} catch
|
|
84
|
+
} catch {
|
|
51
85
|
hasSchematicsTypes = false;
|
|
52
86
|
}
|
|
53
87
|
function normalizeFilename(filename) {
|
|
@@ -138,11 +172,11 @@ ${schemaLine},${content.slice(leftBraceIndex + 1)}`;
|
|
|
138
172
|
return `${leading}${injected}${trailing}`;
|
|
139
173
|
}
|
|
140
174
|
var plugin = (ctx) => {
|
|
141
|
-
let tsModule =
|
|
175
|
+
let tsModule = ctx?.modules?.typescript;
|
|
142
176
|
if (!tsModule) {
|
|
143
177
|
try {
|
|
144
178
|
tsModule = require2("typescript");
|
|
145
|
-
} catch
|
|
179
|
+
} catch {
|
|
146
180
|
tsModule = void 0;
|
|
147
181
|
}
|
|
148
182
|
}
|
|
@@ -264,8 +298,6 @@ var plugin = (ctx) => {
|
|
|
264
298
|
};
|
|
265
299
|
};
|
|
266
300
|
var index_default = plugin;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
module.exports = exports.default;
|
|
301
|
+
if (typeof module !== "undefined") {
|
|
302
|
+
module.exports = plugin;
|
|
303
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { createRequire } from "module";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import process from "process";
|
|
3
5
|
|
|
4
6
|
// package.json
|
|
5
7
|
var name = "@weapp-vite/volar";
|
|
@@ -38,7 +40,9 @@ var VOID_CAPABILITIES = {
|
|
|
38
40
|
structure: false,
|
|
39
41
|
format: false
|
|
40
42
|
};
|
|
41
|
-
var require2 = createRequire(
|
|
43
|
+
var require2 = createRequire(
|
|
44
|
+
typeof module !== "undefined" && module.filename ? module.filename : path.join(process.cwd(), "weapp-vite-volar.cjs")
|
|
45
|
+
);
|
|
42
46
|
var hasSchematicsTypes = false;
|
|
43
47
|
try {
|
|
44
48
|
require2.resolve("@weapp-core/schematics");
|
|
@@ -260,6 +264,9 @@ var plugin = (ctx) => {
|
|
|
260
264
|
};
|
|
261
265
|
};
|
|
262
266
|
var index_default = plugin;
|
|
267
|
+
if (typeof module !== "undefined") {
|
|
268
|
+
module.exports = plugin;
|
|
269
|
+
}
|
|
263
270
|
export {
|
|
264
271
|
index_default as default
|
|
265
272
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/volar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Volar plugin for weapp-vite - Provides IntelliSense and type checking for WeChat mini-program config blocks",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
-
"types":
|
|
29
|
-
"import": "./dist/index.d.mts",
|
|
30
|
-
"require": "./dist/index.d.ts"
|
|
31
|
-
},
|
|
28
|
+
"types": "./dist/index.d.mts",
|
|
32
29
|
"import": "./dist/index.mjs",
|
|
33
|
-
"require": "./dist/index.
|
|
30
|
+
"require": "./dist/index.cjs"
|
|
34
31
|
}
|
|
35
32
|
},
|
|
36
|
-
"main": "./dist/index.
|
|
33
|
+
"main": "./dist/index.cjs",
|
|
37
34
|
"module": "./dist/index.mjs",
|
|
38
|
-
"types": "./dist/index.d.
|
|
35
|
+
"types": "./dist/index.d.mts",
|
|
39
36
|
"files": [
|
|
40
37
|
"dist"
|
|
41
38
|
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
41
|
+
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@weapp-core/schematics": "
|
|
43
|
+
"@weapp-core/schematics": "6.0.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"dev": "tsup --watch --sourcemap",
|