@vizejs/composable 0.790.0 → 0.791.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 +7 -6
- package/registry/registry.json +1 -1
- package/scripts/package-tasks.cjs +182 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/composable",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.791.0",
|
|
4
4
|
"description": "Lifecycle-safe composable foundations for Vize applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"composables",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
|
-
"registry"
|
|
24
|
+
"registry",
|
|
25
|
+
"scripts/package-tasks.cjs"
|
|
25
26
|
],
|
|
26
27
|
"type": "module",
|
|
27
28
|
"sideEffects": false,
|
|
@@ -977,7 +978,7 @@
|
|
|
977
978
|
},
|
|
978
979
|
"devDependencies": {
|
|
979
980
|
"@types/node": "25.9.2",
|
|
980
|
-
"@vizejs/native": "0.
|
|
981
|
+
"@vizejs/native": "0.791.0",
|
|
981
982
|
"happy-dom": "21.0.4",
|
|
982
983
|
"typescript": "6.0.3",
|
|
983
984
|
"vite-plus": "0.1.24",
|
|
@@ -997,11 +998,11 @@
|
|
|
997
998
|
}
|
|
998
999
|
},
|
|
999
1000
|
"scripts": {
|
|
1000
|
-
"build": "
|
|
1001
|
+
"build": "node ./scripts/package-tasks.cjs build",
|
|
1001
1002
|
"dev": "vp pack --watch",
|
|
1002
|
-
"pretest": "
|
|
1003
|
+
"pretest": "node ./scripts/package-tasks.cjs pretest",
|
|
1003
1004
|
"test": "vp exec node --test 'src/**/*.test.ts' 'scripts/**/*.test.ts'",
|
|
1004
|
-
"check": "
|
|
1005
|
+
"check": "node ./scripts/package-tasks.cjs check",
|
|
1005
1006
|
"check:fix": "vp check --fix src scripts vite.config.ts",
|
|
1006
1007
|
"build:registry": "vp exec node scripts/build-source-registry.ts",
|
|
1007
1008
|
"check:size": "node scripts/check-size.ts",
|
package/registry/registry.json
CHANGED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// Generated from tools/config/pkl/package-tasks/npm/compose/core/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
|
+
"build": [
|
|
134
|
+
{
|
|
135
|
+
"program": "vp",
|
|
136
|
+
"arguments": [
|
|
137
|
+
"pack"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"program": "vp",
|
|
142
|
+
"arguments": [
|
|
143
|
+
"exec",
|
|
144
|
+
"node",
|
|
145
|
+
"scripts/build-source-registry.ts"
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"pretest": [
|
|
150
|
+
{
|
|
151
|
+
"program": "vp",
|
|
152
|
+
"arguments": [
|
|
153
|
+
"pack"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"program": "pnpm",
|
|
158
|
+
"arguments": [
|
|
159
|
+
"check:size"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"check": [
|
|
164
|
+
{
|
|
165
|
+
"program": "vp",
|
|
166
|
+
"arguments": [
|
|
167
|
+
"check",
|
|
168
|
+
"src",
|
|
169
|
+
"scripts",
|
|
170
|
+
"vite.config.ts"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"program": "pnpm",
|
|
175
|
+
"arguments": [
|
|
176
|
+
"check:types"
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
};
|
|
181
|
+
exports.tasks = tasks;
|
|
182
|
+
if (require.main === module) process.exitCode = exports.runPackageTask(tasks, process.argv.slice(2));
|