@vizejs/babel-plugin 0.790.0 → 0.792.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/babel-plugin",
3
- "version": "0.790.0",
3
+ "version": "0.792.0",
4
4
  "description": "Vue JSX and TSX compilation through the shared Vize compiler",
5
5
  "homepage": "https://github.com/ubugeeei-prod/vize",
6
6
  "bugs": {
@@ -14,7 +14,8 @@
14
14
  },
15
15
  "files": [
16
16
  "dist",
17
- "README.md"
17
+ "README.md",
18
+ "scripts/package-tasks.cjs"
18
19
  ],
19
20
  "type": "module",
20
21
  "main": "./dist/index.cjs",
@@ -37,7 +38,7 @@
37
38
  },
38
39
  "dependencies": {
39
40
  "@jridgewell/remapping": "2.3.5",
40
- "@vizejs/native": "0.790.0",
41
+ "@vizejs/native": "0.792.0",
41
42
  "convert-source-map": "2.0.0"
42
43
  },
43
44
  "devDependencies": {
@@ -63,7 +64,7 @@
63
64
  },
64
65
  "scripts": {
65
66
  "build": "vp pack",
66
- "check": "vp check src vite.config.ts && tsc -p test/tsconfig.json",
67
+ "check": "node ./scripts/package-tasks.cjs check",
67
68
  "test": "node --test test/packed-hosts.test.ts test/runtime-renderers.test.ts test/style-guards.test.ts"
68
69
  }
69
70
  }
@@ -0,0 +1,152 @@
1
+ // Generated from tools/config/pkl/package-tasks/npm/builder/babel/tasks.pkl
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ //#region \0rolldown/runtime.js
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
21
+ value: mod,
22
+ enumerable: true
23
+ }) : target, mod));
24
+ //#endregion
25
+ let node_child_process = require("node:child_process");
26
+ let node_fs = require("node:fs");
27
+ node_fs = __toESM(node_fs, 1);
28
+ let node_os = require("node:os");
29
+ let node_path = require("node:path");
30
+ node_path = __toESM(node_path, 1);
31
+ //#region tools/support/command-invocation.ts
32
+ function windowsInvocation(command, args) {
33
+ if (process.platform !== "win32") return {
34
+ command,
35
+ args: [...args],
36
+ verbatim: false
37
+ };
38
+ let executable = command;
39
+ if (!node_path.default.extname(executable)) {
40
+ const directories = command.includes("/") || command.includes("\\") ? [""] : (process.env.PATH ?? "").split(node_path.default.delimiter);
41
+ const extensions = (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";");
42
+ outer: for (const directory of directories) for (const extension of extensions) {
43
+ const candidate = node_path.default.join(directory, command + extension.toLowerCase());
44
+ if (node_fs.default.statSync(candidate, { throwIfNoEntry: false })?.isFile()) {
45
+ executable = candidate;
46
+ break outer;
47
+ }
48
+ }
49
+ }
50
+ if (!/\.(cmd|bat)$/i.test(executable)) return {
51
+ command: executable,
52
+ args: [...args],
53
+ verbatim: false
54
+ };
55
+ const doubleEscape = /node_modules[\\/]\.bin[\\/]/i.test(executable);
56
+ const escaped = args.map((arg) => escapeWindowsArgument(arg, doubleEscape));
57
+ const line = [node_path.default.normalize(executable).replace(WINDOWS_META, "^$1"), ...escaped].join(" ");
58
+ return {
59
+ command: process.env.ComSpec ?? "cmd.exe",
60
+ args: [
61
+ "/d",
62
+ "/s",
63
+ "/c",
64
+ `"${line}"`
65
+ ],
66
+ verbatim: true
67
+ };
68
+ }
69
+ /*! Argument escaping adapted from cross-spawn (MIT), Copyright (c) 2018 Made With
70
+ * MOXY Lda <hello@moxy.studio>. Permission is hereby granted, free of charge, to
71
+ * any person obtaining a copy of this software and associated documentation
72
+ * files (the "Software"), to deal in the Software without restriction, including
73
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
74
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom
75
+ * the Software is furnished to do so, subject to the following conditions:
76
+ * The above copyright notice and this permission notice shall be included in
77
+ * all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
78
+ * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
79
+ * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
80
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
81
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
82
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
83
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
84
+ */
85
+ var WINDOWS_META = /([()\][%!^"`<>&|;, *?])/g;
86
+ function escapeWindowsArgument(value, twice) {
87
+ const escaped = `"${value.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"").replace(/(?=(\\+?)?)\1$/, "$1$1")}"`.replace(WINDOWS_META, "^$1");
88
+ return twice ? escaped.replace(WINDOWS_META, "^$1") : escaped;
89
+ }
90
+ //#endregion
91
+ //#region tools/support/tasks/package-task.ts
92
+ function argumentValues(command, cwd) {
93
+ return (command.arguments ?? []).flatMap((argument) => {
94
+ if (command.absolutePaths?.includes(argument)) return [node_path.default.resolve(cwd, argument)];
95
+ if (process.platform === "win32" || !command.globs?.includes(argument)) return [argument];
96
+ const files = (0, node_fs.globSync)(argument.split("/").map((part) => part === "**" ? "*" : part).join("/"), { cwd }).sort((left, right) => left < right ? -1 : left > right ? 1 : 0);
97
+ return files.length ? files : [argument];
98
+ });
99
+ }
100
+ function runPackageTask(tasks, argv, environment = process.env) {
101
+ const [name, ...forwarded] = argv;
102
+ if (!name || !Object.hasOwn(tasks, name)) throw new Error("Unknown package task: " + name);
103
+ const commands = tasks[name];
104
+ for (const [index, command] of commands.entries()) {
105
+ const cwd = (0, node_fs.realpathSync)(command.directory ?? ".");
106
+ const env = {
107
+ ...environment,
108
+ ...command.environment
109
+ };
110
+ for (const [key, value] of Object.entries(command.defaults ?? {})) if (!env[key]) env[key] = value;
111
+ const args = argumentValues(command, cwd);
112
+ if (index === commands.length - 1) args.push(...forwarded);
113
+ const invocation = windowsInvocation(command.program, args);
114
+ const result = (0, node_child_process.spawnSync)(invocation.command, invocation.args, {
115
+ cwd,
116
+ env,
117
+ stdio: "inherit",
118
+ windowsVerbatimArguments: invocation.verbatim
119
+ });
120
+ if (result.error) {
121
+ console.error(result.error.message);
122
+ return result.error.code === "ENOENT" ? 127 : 126;
123
+ }
124
+ if (result.signal) return 128 + node_os.constants.signals[result.signal];
125
+ if (result.status !== 0) return result.status ?? 1;
126
+ }
127
+ return 0;
128
+ }
129
+ //#endregion
130
+ exports.runPackageTask = runPackageTask;
131
+
132
+ const tasks = {
133
+ "check": [
134
+ {
135
+ "program": "vp",
136
+ "arguments": [
137
+ "check",
138
+ "src",
139
+ "vite.config.ts"
140
+ ]
141
+ },
142
+ {
143
+ "program": "tsc",
144
+ "arguments": [
145
+ "-p",
146
+ "test/tsconfig.json"
147
+ ]
148
+ }
149
+ ]
150
+ };
151
+ exports.tasks = tasks;
152
+ if (require.main === module) process.exitCode = exports.runPackageTask(tasks, process.argv.slice(2));