@stll/oxlint-config 1.3.0 → 1.4.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.
Files changed (65) hide show
  1. package/README.md +254 -17
  2. package/dist/cloud-setup-cli.cjs +18 -38
  3. package/dist/cloud-setup-cli.cjs.map +1 -1
  4. package/dist/cloud-setup-cli.mjs +21 -41
  5. package/dist/cloud-setup-cli.mjs.map +1 -1
  6. package/dist/consumer-compat-cli.cjs +50 -249
  7. package/dist/consumer-compat-cli.cjs.map +1 -1
  8. package/dist/consumer-compat-cli.mjs +6 -205
  9. package/dist/consumer-compat-cli.mjs.map +1 -1
  10. package/dist/consumer-node-support.cjs +497 -0
  11. package/dist/consumer-node-support.cjs.map +1 -0
  12. package/dist/consumer-node-support.mjs +381 -0
  13. package/dist/consumer-node-support.mjs.map +1 -0
  14. package/dist/dependabot-cli.cjs +67 -0
  15. package/dist/dependabot-cli.cjs.map +1 -0
  16. package/dist/dependabot-cli.d.cts +1 -0
  17. package/dist/dependabot-cli.d.mts +1 -0
  18. package/dist/dependabot-cli.mjs +67 -0
  19. package/dist/dependabot-cli.mjs.map +1 -0
  20. package/dist/dependabot.cjs +5 -0
  21. package/dist/dependabot.d.cts +108 -0
  22. package/dist/dependabot.d.mts +108 -0
  23. package/dist/dependabot.mjs +3 -0
  24. package/dist/generated-file.cjs +61 -0
  25. package/dist/generated-file.cjs.map +1 -0
  26. package/dist/generated-file.mjs +44 -0
  27. package/dist/generated-file.mjs.map +1 -0
  28. package/dist/publish-artifact-syntax.cjs +1309 -0
  29. package/dist/publish-artifact-syntax.cjs.map +1 -0
  30. package/dist/publish-artifact-syntax.mjs +1265 -0
  31. package/dist/publish-artifact-syntax.mjs.map +1 -0
  32. package/dist/publish-contract-cli.cjs +53 -12
  33. package/dist/publish-contract-cli.cjs.map +1 -1
  34. package/dist/publish-contract-cli.mjs +49 -8
  35. package/dist/publish-contract-cli.mjs.map +1 -1
  36. package/dist/toolchain-changed.cjs +5 -1
  37. package/dist/toolchain-changed.cjs.map +1 -1
  38. package/dist/toolchain-changed.mjs +6 -2
  39. package/dist/toolchain-changed.mjs.map +1 -1
  40. package/dist/toolchain-dependabot.cjs +455 -0
  41. package/dist/toolchain-dependabot.cjs.map +1 -0
  42. package/dist/toolchain-dependabot.mjs +423 -0
  43. package/dist/toolchain-dependabot.mjs.map +1 -0
  44. package/dist/toolchain-guard.cjs +1096 -424
  45. package/dist/toolchain-guard.cjs.map +1 -1
  46. package/dist/toolchain-guard.mjs +1085 -413
  47. package/dist/toolchain-guard.mjs.map +1 -1
  48. package/dist/toolchain-inputs.cjs +122 -22
  49. package/dist/toolchain-inputs.cjs.map +1 -1
  50. package/dist/toolchain-inputs.mjs +117 -23
  51. package/dist/toolchain-inputs.mjs.map +1 -1
  52. package/dist/toolchain-schema.cjs +0 -493
  53. package/dist/toolchain-schema.cjs.map +1 -1
  54. package/dist/toolchain-schema.mjs +3 -379
  55. package/dist/toolchain-schema.mjs.map +1 -1
  56. package/dist/typecheck-parity.cjs +1 -1
  57. package/dist/typecheck-probe-cli.cjs +1 -1
  58. package/dist/typecheck-probe-cli.cjs.map +1 -1
  59. package/dist/typecheck-probe-cli.mjs +1 -1
  60. package/dist/typecheck-probe-cli.mjs.map +1 -1
  61. package/package.json +13 -1
  62. package/dist/publish-contract.cjs +0 -431
  63. package/dist/publish-contract.cjs.map +0 -1
  64. package/dist/publish-contract.mjs +0 -396
  65. package/dist/publish-contract.mjs.map +0 -1
@@ -0,0 +1,1309 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime.cjs");
2
+ const require_toolchain_inputs = require("./toolchain-inputs.cjs");
3
+ const require_consumer_node_support = require("./consumer-node-support.cjs");
4
+ let node_child_process = require("node:child_process");
5
+ let node_path = require("node:path");
6
+ node_path = require_rolldown_runtime.__toESM(node_path, 1);
7
+ let semver = require("semver");
8
+ let node_util = require("node:util");
9
+ let yaml = require("yaml");
10
+ let node_os = require("node:os");
11
+ let node_module = require("node:module");
12
+ node_module = require_rolldown_runtime.__toESM(node_module, 1);
13
+ let node_fs_promises = require("node:fs/promises");
14
+ let acorn = require("acorn");
15
+ let node_url = require("node:url");
16
+ let node_events = require("node:events");
17
+ let node_readline = require("node:readline");
18
+ //#region src/consumer-release-pack.ts
19
+ const record$4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
20
+ const exactVersion = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/;
21
+ const outputDirectory = "<consumer-release-pack-output>";
22
+ const packerSetupExpression = /^npm\s+install\s+((?:(?:--global|-g|--ignore-scripts)\s+)+)(npm|pnpm)@([^\s]+)$/;
23
+ const defaultRunShell = (defaults) => {
24
+ if (!record$4(defaults) || !record$4(defaults["run"])) return void 0;
25
+ return defaults["run"]["shell"];
26
+ };
27
+ const packArguments = (line) => {
28
+ const command = /^(npm|pnpm)\s+pack(?:\s+(.*))?$/.exec(line);
29
+ const manager = command?.[1];
30
+ if (manager !== "npm" && manager !== "pnpm") throw new Error("Unsupported release pack command");
31
+ const tokens = (command?.[2] ?? "").match(/"[^"\n]*"|'[^'\n]*'|[^\s]+/g) ?? [];
32
+ const args = [];
33
+ let destination = false;
34
+ for (let index = 0; index < tokens.length; index++) {
35
+ const token = tokens.at(index);
36
+ if (token === "--pack-destination") {
37
+ if (destination) throw new Error("Repeated release pack destination");
38
+ const value = tokens.at(++index);
39
+ if (value === void 0 || !/^(?:"\$GITHUB_WORKSPACE\/[A-Za-z0-9_/-]+"|[A-Za-z0-9_/-]+)$/.test(value) || value.split("/").includes("..")) throw new Error("Unsupported release pack destination");
40
+ destination = true;
41
+ args.push(token, outputDirectory);
42
+ continue;
43
+ }
44
+ if (token !== "--ignore-scripts" && !(manager === "pnpm" && token === "--config.ignore-scripts=true") && token !== "--json" && token !== "--silent") throw new Error("Unsupported release pack arguments");
45
+ if (args.includes(token)) throw new Error("Repeated release pack flag");
46
+ args.push(token);
47
+ }
48
+ if (!destination || !args.includes("--ignore-scripts") && !args.includes("--config.ignore-scripts=true")) throw new Error("Release pack requires scripts disabled and --pack-destination");
49
+ return {
50
+ manager,
51
+ arguments: args
52
+ };
53
+ };
54
+ /** Both setup provenance and packing require unconditional shell commands. */
55
+ const assertReleaseShellContext = ({ step, kind, location, inheritedShell }) => {
56
+ const run = step["run"];
57
+ if (typeof run !== "string") throw new Error(`Unsupported release ${kind} shell context: ${location}`);
58
+ const shell = step["shell"] === void 0 ? inheritedShell : step["shell"];
59
+ if (shell !== void 0 && shell !== "bash" && shell !== "sh") throw new Error(`Unsupported release ${kind} shell context: ${location}`);
60
+ let quote;
61
+ let code = "";
62
+ for (let index = 0; index < run.length; index += 1) {
63
+ const char = run[index];
64
+ if (char === "\n") {
65
+ if (quote !== void 0) throw new Error(`Unsupported release ${kind} shell context: ${location}`);
66
+ code += "\n";
67
+ continue;
68
+ }
69
+ if (quote !== "single" && char === "\\") {
70
+ if (run[index + 1] === "\n" || run[index + 1] === "\r" && run[index + 2] === "\n") throw new Error(`Unsupported release ${kind} shell context: ${location}`);
71
+ index += 1;
72
+ code += " ";
73
+ continue;
74
+ }
75
+ if (quote !== "single" && (char === "`" || char === "$" && run[index + 1] === "(")) throw new Error(`Unsupported release ${kind} shell context: ${location}`);
76
+ if (quote === "single") {
77
+ if (char === "'") quote = void 0;
78
+ code += " ";
79
+ continue;
80
+ }
81
+ if (quote === "double") {
82
+ if (char === "\"") quote = void 0;
83
+ code += " ";
84
+ continue;
85
+ }
86
+ if (char === "'") {
87
+ quote = "single";
88
+ code += " ";
89
+ continue;
90
+ }
91
+ if (char === "\"") {
92
+ quote = "double";
93
+ code += " ";
94
+ continue;
95
+ }
96
+ if (char === "#" && (index === 0 || /\s/.test(run[index - 1] ?? ""))) {
97
+ while (index + 1 < run.length && run[index + 1] !== "\n") index += 1;
98
+ continue;
99
+ }
100
+ code += char;
101
+ }
102
+ if (quote !== void 0 || /[;&|<>]/.test(code) || code.split("\n").some((line) => /^\s*(?:if|then|elif|else|fi|for|do|done|while|until|case|esac|function|select|exit|return|exec|break|continue|trap|eval|source|hash|alias|unalias)\b/.test(line)) || /(?:^|\n)\s*\.(?:\s|$)/.test(code) || /(?:^|\n)\s*[A-Za-z_]\w*\s*\(\s*\)\s*[{(]/.test(code) || kind === "setup" && /[(){}]/.test(code)) throw new Error(`Unsupported release ${kind} shell context: ${location}`);
103
+ if (kind !== "setup") return;
104
+ for (const line of run.split("\n")) {
105
+ const command = line.trim();
106
+ if (command === "" || command.startsWith("#")) continue;
107
+ if (packerSetupExpression.test(command) || /^(?:npm|pnpm)\s+pack(?:\s|$)/.test(command) || [
108
+ "set -e",
109
+ "set -eu",
110
+ "set -euo pipefail"
111
+ ].includes(command)) continue;
112
+ throw new Error(`Unsupported release setup command context: ${location}`);
113
+ }
114
+ };
115
+ /** Resolve the repository's release packer without substituting another manager. */
116
+ const resolveConsumerReleasePack = (files) => {
117
+ const candidates = [];
118
+ for (const [file, text] of Object.entries(files)) {
119
+ if (require_toolchain_inputs.githubAutomationFileKind(file) !== "workflow") continue;
120
+ const document = (0, yaml.parseDocument)(text, {
121
+ uniqueKeys: true,
122
+ merge: true
123
+ });
124
+ if (document.errors.length > 0) throw new Error(`Invalid release workflow YAML: ${file}`);
125
+ const source = document.toJS({ maxAliasCount: 100 });
126
+ if (!record$4(source) || !record$4(source["jobs"])) continue;
127
+ for (const [jobName, job] of Object.entries(source["jobs"])) {
128
+ if (!record$4(job) || !Array.isArray(job["steps"])) continue;
129
+ if (!job["steps"].some((step) => record$4(step) && typeof step["run"] === "string" && step["run"].split("\n").some((line) => !line.trimStart().startsWith("#") && /\b(?:npm|pnpm)\s+pack\b/.test(line)))) continue;
130
+ const jobShell = defaultRunShell(job["defaults"]);
131
+ const inheritedShell = jobShell === void 0 ? defaultRunShell(source["defaults"]) : jobShell;
132
+ const versions = /* @__PURE__ */ new Map();
133
+ let packed;
134
+ for (const step of job["steps"]) {
135
+ if (!record$4(step)) continue;
136
+ if (typeof step["uses"] === "string" && step["uses"].startsWith("pnpm/action-setup@")) {
137
+ if (step["if"] !== void 0 || step["continue-on-error"] !== void 0) throw new Error(`Conditional release packer setup: ${file}:${jobName}`);
138
+ const inputs = step["with"];
139
+ const version = record$4(inputs) ? inputs["version"] : void 0;
140
+ if (typeof version !== "string" || !exactVersion.test(version)) throw new Error(`Release pnpm setup requires an exact version: ${file}:${jobName}`);
141
+ const values = versions.get("pnpm") ?? [];
142
+ values.push(version);
143
+ versions.set("pnpm", values);
144
+ }
145
+ if (typeof step["run"] !== "string") continue;
146
+ for (const rawLine of step["run"].split("\n")) {
147
+ const line = rawLine.trim();
148
+ if (line.startsWith("#")) continue;
149
+ const setupCommand = /\bnpm\s+(?:install|i)\b[^\n]*\b(?:npm|pnpm)@/.test(line);
150
+ if (setupCommand) assertReleaseShellContext({
151
+ step,
152
+ kind: "setup",
153
+ location: `${file}:${jobName}`,
154
+ inheritedShell
155
+ });
156
+ const setup = packerSetupExpression.exec(line);
157
+ if (setupCommand && setup === null) throw new Error(`Unsupported release packer setup command: ${file}:${jobName}`);
158
+ if (setup !== null && /(?:^|\s)(?:--global|-g)(?:\s|$)/.test(setup[1] ?? "")) {
159
+ if (step["if"] !== void 0 || step["continue-on-error"] !== void 0) throw new Error(`Conditional release packer setup: ${file}:${jobName}`);
160
+ const manager = setup[2];
161
+ const version = setup[3];
162
+ if (manager === void 0 || version === void 0 || !exactVersion.test(version)) throw new Error(`Release packer setup requires an exact version: ${file}:${jobName}`);
163
+ const values = versions.get(manager) ?? [];
164
+ values.push(version);
165
+ versions.set(manager, values);
166
+ }
167
+ if (!/\b(?:npm|pnpm)\s+pack\b/.test(line)) continue;
168
+ if (job["if"] !== void 0 || step["if"] !== void 0 || step["continue-on-error"] !== void 0 || packed !== void 0) throw new Error(`Ambiguous release pack command: ${file}:${jobName}`);
169
+ assertReleaseShellContext({
170
+ step,
171
+ kind: "pack",
172
+ location: `${file}:${jobName}`,
173
+ inheritedShell
174
+ });
175
+ const command = packArguments(line);
176
+ const selected = versions.get(command.manager);
177
+ const version = selected?.at(0);
178
+ if (selected?.length !== 1 || version === void 0) throw new Error(`Missing or ambiguous exact release packer version: ${file}:${jobName}`);
179
+ packed = {
180
+ manager: command.manager,
181
+ version,
182
+ arguments: command.arguments
183
+ };
184
+ }
185
+ }
186
+ if (packed !== void 0) candidates.push(packed);
187
+ }
188
+ }
189
+ const selected = candidates.at(0);
190
+ if (candidates.length !== 1 || selected === void 0) throw new Error("Require exactly one identifiable release pack job");
191
+ return selected;
192
+ };
193
+ const consumerReleasePackArguments = ({ packer, directory }) => {
194
+ if (directory.length === 0) throw new Error("Release pack output directory is required");
195
+ return ["pack", ...packer.arguments.map((argument) => argument === outputDirectory ? directory : argument)];
196
+ };
197
+ //#endregion
198
+ //#region src/publish-artifact-parser.ts
199
+ const record$3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
200
+ const packageMode = (files, file) => {
201
+ let directory = node_path.default.posix.dirname(file);
202
+ while (directory !== ".") {
203
+ const source = files.get(`${directory}/package.json`);
204
+ if (source !== void 0) {
205
+ const manifest = JSON.parse(source);
206
+ if (!record$3(manifest)) throw new Error(`Invalid packed manifest: ${directory}`);
207
+ if (manifest["type"] === "module") return "module";
208
+ if (manifest["type"] === "commonjs") return "script";
209
+ if (manifest["type"] !== void 0) throw new Error(`Invalid packed package type: ${directory}`);
210
+ return "detect";
211
+ }
212
+ directory = node_path.default.posix.dirname(directory);
213
+ }
214
+ return "detect";
215
+ };
216
+ const parseArtifactSource = (source, options) => {
217
+ const script = options.sourceType === "script";
218
+ const content = script ? source.replace(/^\uFEFF/, "").replace(/^#![^\r\n]*/, "") : source;
219
+ try {
220
+ return (0, acorn.parse)(script ? node_module.default.wrap(content) : content, options);
221
+ } catch (error) {
222
+ if (!script || !(error instanceof SyntaxError) || !record$3(error) || typeof error["pos"] !== "number") throw error;
223
+ const prefixLength = node_module.default.wrap("\0").indexOf("\0");
224
+ const position = Math.max(0, Math.min(source.length, error["pos"] - prefixLength + source.length - content.length));
225
+ const lines = source.slice(0, position).split(/\r\n|[\n\r\u2028\u2029]/);
226
+ const location = `(${lines.length}:${lines.at(-1)?.length ?? 0})`;
227
+ throw new SyntaxError(error.message.replace(/\(\d+:\d+\)$/, location));
228
+ }
229
+ };
230
+ //#endregion
231
+ //#region src/publish-contract.ts
232
+ const record$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
233
+ const object = (value, field) => {
234
+ if (!record$2(value)) throw new Error(`${field} must be an object`);
235
+ return value;
236
+ };
237
+ const closedKeys = (value, allowed, field) => {
238
+ for (const key of Object.keys(value)) if (!allowed.includes(key)) throw new Error(`${field}.${key} is unsupported`);
239
+ };
240
+ const text = (value, field) => {
241
+ if (typeof value !== "string" || value.trim() === "") throw new Error(`${field} must be a nonempty string`);
242
+ return value;
243
+ };
244
+ const stringMap = (value, field) => {
245
+ const result = /* @__PURE__ */ new Map();
246
+ for (const [key, entry] of Object.entries(object(value, field))) result.set(text(key, field), text(entry, `${field}.${key}`));
247
+ return Object.fromEntries(result);
248
+ };
249
+ const exportTarget = (value, field) => {
250
+ if (value === null) return null;
251
+ if (typeof value === "string") return text(value, field);
252
+ if (Array.isArray(value)) return value.map((entry, index) => exportTarget(entry, `${field}[${index}]`));
253
+ const result = /* @__PURE__ */ new Map();
254
+ for (const [key, entry] of Object.entries(object(value, field))) result.set(text(key, field), exportTarget(entry, `${field}.${key}`));
255
+ return Object.fromEntries(result);
256
+ };
257
+ const typesVersions = (value) => {
258
+ const result = /* @__PURE__ */ new Map();
259
+ for (const [range, paths] of Object.entries(object(value, "typesVersions"))) {
260
+ const mappings = /* @__PURE__ */ new Map();
261
+ for (const [pattern, entries] of Object.entries(object(paths, `typesVersions.${range}`))) {
262
+ if (!Array.isArray(entries)) throw new Error(`typesVersions.${range}.${pattern} must be an array`);
263
+ mappings.set(text(pattern, "typesVersions pattern"), entries.map((entry) => text(entry, "typesVersions path")));
264
+ }
265
+ result.set(text(range, "typesVersions range"), Object.fromEntries(mappings));
266
+ }
267
+ return Object.fromEntries(result);
268
+ };
269
+ const entryPointKeys = [
270
+ "type",
271
+ "exports",
272
+ "main",
273
+ "module",
274
+ "types",
275
+ "typings",
276
+ "bin",
277
+ "typesVersions"
278
+ ];
279
+ const publishConfigOverrideKeys = entryPointKeys.filter((key) => key !== "type");
280
+ const entryPoints = (value) => {
281
+ const source = object(value, "entryPoints");
282
+ closedKeys(source, entryPointKeys, "entryPoints");
283
+ const result = {};
284
+ if ("type" in source) {
285
+ if (source["type"] !== "module" && source["type"] !== "commonjs") throw new Error("entryPoints.type must be module or commonjs");
286
+ result.type = source["type"];
287
+ }
288
+ if ("exports" in source) result.exports = exportTarget(source["exports"], "entryPoints.exports");
289
+ for (const key of [
290
+ "main",
291
+ "module",
292
+ "types",
293
+ "typings"
294
+ ]) if (key in source) result[key] = text(source[key], `entryPoints.${key}`);
295
+ if ("bin" in source) result.bin = typeof source["bin"] === "string" ? text(source["bin"], "entryPoints.bin") : stringMap(source["bin"], "entryPoints.bin");
296
+ if ("typesVersions" in source) result.typesVersions = typesVersions(source["typesVersions"]);
297
+ return result;
298
+ };
299
+ const publishTarget = (value) => {
300
+ const source = object(value, "target");
301
+ if (source["type"] === "types-only") {
302
+ closedKeys(source, ["type"], "target");
303
+ return { type: "types-only" };
304
+ }
305
+ if (source["type"] !== "javascript") throw new Error("target.type must be javascript or types-only");
306
+ closedKeys(source, ["type", "targets"], "target");
307
+ if (!Array.isArray(source["targets"]) || source["targets"].length === 0) throw new Error("target.targets must be a nonempty array");
308
+ const targets = Array.from(source["targets"]).map((entry) => {
309
+ const target = text(entry, "target.targets");
310
+ if (/[\s,]/.test(target) || Array.from(target).some((character) => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127)) throw new Error("target.targets must contain resolved target identifiers");
311
+ return target;
312
+ });
313
+ return {
314
+ type: "javascript",
315
+ targets: [...new Set(targets)].sort()
316
+ };
317
+ };
318
+ const parsePublishContract = (value) => {
319
+ const source = object(value, "publish contract");
320
+ closedKeys(source, [
321
+ "engines",
322
+ "peerDependencies",
323
+ "target",
324
+ "entryPoints"
325
+ ], "publish contract");
326
+ return {
327
+ engines: stringMap(source["engines"], "engines"),
328
+ peerDependencies: stringMap(source["peerDependencies"], "peerDependencies"),
329
+ target: publishTarget(source["target"]),
330
+ entryPoints: entryPoints(source["entryPoints"])
331
+ };
332
+ };
333
+ const publishPackers = ["npm", "pnpm"];
334
+ const resolveManifestContract = ({ packer, manifest, target }) => {
335
+ if (!publishPackers.includes(packer)) throw new Error("publish packer must be npm or pnpm");
336
+ const source = object(manifest, "package manifest");
337
+ const config = "publishConfig" in source ? object(source["publishConfig"], "publishConfig") : {};
338
+ closedKeys(config, [
339
+ ...publishConfigOverrideKeys,
340
+ "access",
341
+ "registry"
342
+ ], "publishConfig");
343
+ if (packer === "npm") {
344
+ for (const key of publishConfigOverrideKeys) if (Object.hasOwn(config, key) && !(key === "exports" || key === "typesVersions" ? JSON.stringify(config[key]) === JSON.stringify(source[key]) : (0, node_util.isDeepStrictEqual)(config[key], source[key]))) throw new Error(`npm pack does not apply differing publishConfig.${key}; move the published entry to package.json or use pnpm`);
345
+ }
346
+ for (const field of [
347
+ "browser",
348
+ "esnext",
349
+ "es2015",
350
+ "unpkg",
351
+ "umd:main"
352
+ ]) if (Object.hasOwn(source, field) || Object.hasOwn(config, field)) throw new Error(`published entry field ${field} is unsupported`);
353
+ const published = {};
354
+ for (const key of entryPointKeys) if (packer === "pnpm" && key !== "type" && key in config) published[key] = config[key];
355
+ else if (key in source) published[key] = source[key];
356
+ if (typeof published["bin"] === "string") {
357
+ const command = text(source["name"], "package name for bin").split("/").at(-1);
358
+ if (command === void 0 || command === "") throw new Error("package name must determine its bin command");
359
+ published["bin"] = { [command]: published["bin"] };
360
+ }
361
+ let engines = {};
362
+ if (Object.hasOwn(source, "engines")) engines = source["engines"];
363
+ return parsePublishContract({
364
+ engines,
365
+ peerDependencies: Object.hasOwn(source, "peerDependencies") ? source["peerDependencies"] : {},
366
+ target,
367
+ entryPoints: published
368
+ });
369
+ };
370
+ const consumerPolicy = (policy) => {
371
+ closedKeys(object(policy, "consumer policy"), ["node", "typescript"], "consumer policy");
372
+ for (const [field, major] of [["node", 22], ["typescript", 6]]) {
373
+ const version = (0, semver.parse)(policy[field]);
374
+ if (version === null || version.version !== policy[field] || version.major !== major || version.prerelease.length !== 0) throw new Error(`consumer policy ${field} must pin an exact stable ${major}.x release`);
375
+ }
376
+ };
377
+ /** Share the accepted Node target grammar between static and packed checks. */
378
+ const publishedNodeTargetSupportsConsumer = ({ target, node }) => {
379
+ const match = /^node([1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?$/i.exec(target);
380
+ const version = match === null ? null : (0, semver.parse)(`${match[1]}.${match[2] ?? "0"}.${match[3] ?? "0"}`);
381
+ return version !== null && (0, semver.lte)(version, node);
382
+ };
383
+ const checkPublishContract = ({ packer, manifest, target, contract, policy }) => {
384
+ consumerPolicy(policy);
385
+ const current = resolveManifestContract({
386
+ packer,
387
+ manifest,
388
+ target
389
+ });
390
+ const committed = parsePublishContract(contract);
391
+ const diagnostics = [];
392
+ const add = (field, message) => diagnostics.push({
393
+ field,
394
+ message
395
+ });
396
+ const compare = (field, expected, actual) => {
397
+ if (field !== "entryPoints.exports" && field !== "entryPoints.typesVersions" && record$2(expected) && record$2(actual)) {
398
+ for (const key of /* @__PURE__ */ new Set([...Object.keys(expected), ...Object.keys(actual)])) compare(`${field}.${key}`, Object.hasOwn(expected, key) ? expected[key] : void 0, Object.hasOwn(actual, key) ? actual[key] : void 0);
399
+ return;
400
+ }
401
+ if (JSON.stringify(expected) !== JSON.stringify(actual)) add(field, `published ${field} differs from the committed contract`);
402
+ };
403
+ for (const field of [
404
+ "engines",
405
+ "peerDependencies",
406
+ "target",
407
+ "entryPoints"
408
+ ]) compare(field, committed[field], current[field]);
409
+ const support = (field, range, version) => {
410
+ if (range !== void 0 && !(0, semver.satisfies)(version, range)) add(field, `${field} must support consumer version ${version}`);
411
+ };
412
+ if (!require_consumer_node_support.consumerNodeSupportMatches({
413
+ range: current.engines["node"],
414
+ node: policy.node
415
+ })) add("engines.node", `engines.node must support consumer version ${policy.node}`);
416
+ support("engines.typescript", current.engines["typescript"], policy.typescript);
417
+ support("peerDependencies.typescript", current.peerDependencies["typescript"], policy.typescript);
418
+ if ("bun" in current.engines) add("engines.bun", "published packages must not require Bun");
419
+ for (const peer of [
420
+ "bun",
421
+ "bun-types",
422
+ "@types/bun",
423
+ "@typescript/native"
424
+ ]) if (Object.hasOwn(current.peerDependencies, peer)) add(`peerDependencies.${peer}`, "published packages must not require development runtime or compiler packages");
425
+ if (current.target.type === "javascript") for (const selected of current.target.targets) {
426
+ if (/^bun(?:$|[0-9])/i.test(selected)) {
427
+ add("target", "published JavaScript must not require Bun");
428
+ continue;
429
+ }
430
+ if (!/^node/i.test(selected)) continue;
431
+ if (!publishedNodeTargetSupportsConsumer({
432
+ target: selected,
433
+ node: policy.node
434
+ })) add("target", `JavaScript target ${selected} must support consumer Node ${policy.node}`);
435
+ }
436
+ return diagnostics;
437
+ };
438
+ //#endregion
439
+ //#region src/publish-node-resolver.ts
440
+ const worker = String.raw`
441
+ import {createRequire, isBuiltin} from 'node:module';
442
+ import {readFileSync, existsSync} from 'node:fs';
443
+ import path from 'node:path';
444
+ import {pathToFileURL} from 'node:url';
445
+ import {createInterface} from 'node:readline';
446
+ const selfReference = (specifier, file) => {
447
+ let directory = path.dirname(file);
448
+ while (true) {
449
+ const manifest = path.join(directory, 'package.json');
450
+ if (existsSync(manifest)) {
451
+ const {name} = JSON.parse(readFileSync(manifest, 'utf8'));
452
+ return typeof name === 'string' &&
453
+ (specifier === name || specifier.startsWith(name + '/'));
454
+ }
455
+ const parent = path.dirname(directory);
456
+ if (parent === directory) return false;
457
+ directory = parent;
458
+ }
459
+ };
460
+ const bare = specifier => typeof specifier === 'string' &&
461
+ !specifier.startsWith('.') && !specifier.startsWith('/') &&
462
+ !specifier.startsWith('#') && !specifier.includes(':');
463
+ for await (const line of createInterface({input: process.stdin})) {
464
+ const {specifier, file, mode} = JSON.parse(line);
465
+ try {
466
+ const resolved = mode === 'require'
467
+ ? createRequire(file).resolve(specifier)
468
+ : import.meta.resolve(specifier, pathToFileURL(file).href);
469
+ console.log(JSON.stringify({url: isBuiltin(resolved) ||
470
+ (bare(specifier) && !selfReference(specifier, file)) ? null :
471
+ mode === 'require' ? pathToFileURL(resolved).href : resolved}));
472
+ } catch (error) {
473
+ // Node reports the selected missing dependency, including external #imports
474
+ // targets. Never reinterpret its exports/imports selection ourselves.
475
+ const missing = /^Cannot find (?:package|module) '([^']+)'/.exec(error.message)?.[1];
476
+ if (bare(missing) && !selfReference(missing, file) &&
477
+ ['MODULE_NOT_FOUND', 'ERR_MODULE_NOT_FOUND'].includes(error.code))
478
+ console.log(JSON.stringify({url: null}));
479
+ else console.log(JSON.stringify({error: String(error)}));
480
+ }
481
+ }
482
+ `;
483
+ /** One metadata-only Node process per archive, with default import/require conditions. */
484
+ const createPackedNodeResolver = () => {
485
+ const child = (0, node_child_process.spawn)("node", [
486
+ "--experimental-import-meta-resolve",
487
+ "--input-type=module",
488
+ "--eval",
489
+ worker
490
+ ], {
491
+ stdio: [
492
+ "pipe",
493
+ "pipe",
494
+ "pipe"
495
+ ],
496
+ env: {
497
+ ...process.env,
498
+ NODE_OPTIONS: void 0,
499
+ NODE_PATH: void 0
500
+ }
501
+ });
502
+ let stderr = "";
503
+ child.stderr.setEncoding("utf8");
504
+ child.stderr.on("data", (chunk) => {
505
+ if (stderr.length < 16384) stderr += chunk;
506
+ });
507
+ child.on("error", (error) => child.stdout.destroy(error));
508
+ const output = (0, node_readline.createInterface)({ input: child.stdout });
509
+ const lines = output[Symbol.asyncIterator]();
510
+ return {
511
+ resolve: async (request) => {
512
+ const timeout = setTimeout(() => child.kill(), 1e4);
513
+ try {
514
+ child.stdin.write(`${JSON.stringify(request)}\n`);
515
+ const line = await lines.next();
516
+ if (line.done === true) throw new Error(`Node resolver stopped: ${stderr}`);
517
+ const response = JSON.parse(line.value);
518
+ if (typeof response !== "object" || response === null) throw new Error("Invalid Node resolver response");
519
+ if ("error" in response && typeof response.error === "string") throw new Error(response.error);
520
+ if (!("url" in response) || response.url !== null && typeof response.url !== "string") throw new Error("Invalid Node resolver URL");
521
+ return response.url;
522
+ } finally {
523
+ clearTimeout(timeout);
524
+ }
525
+ },
526
+ close: async () => {
527
+ output.close();
528
+ if (child.pid !== void 0 && child.exitCode === null && child.signalCode === null) {
529
+ const exited = (0, node_events.once)(child, "exit");
530
+ child.kill();
531
+ await exited;
532
+ }
533
+ }
534
+ };
535
+ };
536
+ //#endregion
537
+ //#region src/publish-runtime-imports.ts
538
+ const record$1 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
539
+ const javascript$1 = /\.(?:js|mjs|cjs)$/iu;
540
+ const opaque = /\.(?:json|node)$/u;
541
+ const declarationFile = /\.d\.[cm]?ts$/iu;
542
+ const packagePath = (file) => {
543
+ const normalized = node_path.default.posix.normalize(file);
544
+ if (normalized !== "package" && !normalized.startsWith("package/") || file.includes("\\")) throw new Error(`Runtime import escapes the packed package: ${file}`);
545
+ return normalized;
546
+ };
547
+ const targets = (value) => {
548
+ if (typeof value === "string") return [value];
549
+ if (value === void 0 || value === null) return [];
550
+ if (Array.isArray(value)) return value.flatMap(targets);
551
+ if (!record$1(value)) throw new Error("Invalid packed runtime entry target");
552
+ return Object.entries(value).flatMap(([key, entry]) => key === "types" || key === "typings" ? [] : targets(entry));
553
+ };
554
+ const identifier = (value) => record$1(value) && value["type"] === "Identifier" && typeof value["name"] === "string" ? value["name"] : void 0;
555
+ const literal = (value) => record$1(value) && value["type"] === "Literal" && typeof value["value"] === "string" ? value["value"] : void 0;
556
+ const nodes = (value) => {
557
+ if (Array.isArray(value)) return value.flatMap(nodes);
558
+ return record$1(value) && typeof value["type"] === "string" ? [value] : [];
559
+ };
560
+ const children = (node) => Object.values(node).flatMap(nodes);
561
+ const patternNames = (value) => {
562
+ const name = identifier(value);
563
+ if (name !== void 0) return [name];
564
+ if (!record$1(value)) return [];
565
+ switch (value["type"]) {
566
+ case "ObjectPattern": return nodes(value["properties"]).flatMap((property) => patternNames(property["type"] === "RestElement" ? property["argument"] : property["value"]));
567
+ case "ArrayPattern": return nodes(value["elements"]).flatMap(patternNames);
568
+ case "RestElement": return patternNames(value["argument"]);
569
+ case "AssignmentPattern": return patternNames(value["left"]);
570
+ default: return [];
571
+ }
572
+ };
573
+ const bindingScope = (scopes, name) => scopes.findLast((scope) => scope.has(name));
574
+ const binding = (scopes, name) => bindingScope(scopes, name)?.get(name);
575
+ const memberName = (value) => value["computed"] === true ? literal(value["property"]) : identifier(value["property"]);
576
+ const loaderBinding = (value, scopes) => {
577
+ const name = identifier(value);
578
+ if (name !== void 0) {
579
+ const resolved = binding(scopes, name);
580
+ return resolved === "filename" ? "other" : resolved;
581
+ }
582
+ if (!record$1(value) || value["type"] !== "MemberExpression") return void 0;
583
+ const owner = identifier(value["object"]);
584
+ if (owner === void 0) return void 0;
585
+ const kind = binding(scopes, owner);
586
+ const property = memberName(value);
587
+ if (kind === "module-api" && property === "createRequire") return "factory";
588
+ if (kind === "module" && property === "require") return "require";
589
+ if (kind === "require" && property === "resolve") return "require";
590
+ };
591
+ const scopeDeclarations = (node) => {
592
+ if ((node["type"] === "ExportNamedDeclaration" || node["type"] === "ExportDefaultDeclaration") && record$1(node["declaration"])) return scopeDeclarations(node["declaration"]);
593
+ return [node];
594
+ };
595
+ const functionNode = (node) => [
596
+ "FunctionDeclaration",
597
+ "FunctionExpression",
598
+ "ArrowFunctionExpression"
599
+ ].includes(String(node["type"]));
600
+ /** Read syntax only; known loaders must have statically resolvable bindings. */
601
+ const staticImports = (tree, mode) => {
602
+ const result = [];
603
+ const functionScopes = /* @__PURE__ */ new WeakMap();
604
+ const resolvedFactories = /* @__PURE__ */ new Set();
605
+ const resolvedNamespaces = /* @__PURE__ */ new Set();
606
+ const allowedLoaderReferences = /* @__PURE__ */ new Set();
607
+ const allowReference = (value) => {
608
+ for (const node of nodes(value)) {
609
+ allowedLoaderReferences.add(node);
610
+ for (const child of children(node)) allowReference(child);
611
+ }
612
+ };
613
+ const allowPattern = (value) => {
614
+ if (!record$1(value)) return;
615
+ if (value["type"] === "Identifier") allowedLoaderReferences.add(value);
616
+ else if (value["type"] === "Property") allowPattern(value["value"]);
617
+ else if (value["type"] === "AssignmentPattern") allowPattern(value["left"]);
618
+ else if (value["type"] === "RestElement") allowPattern(value["argument"]);
619
+ else if (["ObjectPattern", "ArrayPattern"].includes(String(value["type"]))) for (const child of children(value)) allowPattern(child);
620
+ };
621
+ const unresolvable = (description) => /* @__PURE__ */ new Error(`Unresolvable dynamic loader: ${description}`);
622
+ const loaderName = (name, scopes) => {
623
+ const previous = binding(scopes, name);
624
+ return mode === "script" && [
625
+ "require",
626
+ "module",
627
+ "createRequire"
628
+ ].includes(name) || previous !== void 0 && previous !== "other" && previous !== "filename";
629
+ };
630
+ const loaderValue = (value, scopes) => {
631
+ if (!record$1(value)) return false;
632
+ const kind = loaderBinding(value, scopes);
633
+ if (kind !== void 0 && kind !== "other") return true;
634
+ if (functionNode(value) || [
635
+ "CallExpression",
636
+ "MemberExpression",
637
+ "UnaryExpression",
638
+ "BinaryExpression",
639
+ "TemplateLiteral"
640
+ ].includes(String(value["type"]))) return false;
641
+ if (value["type"] === "Property") return loaderValue(value["value"], scopes);
642
+ return children(value).some((child) => loaderValue(child, scopes));
643
+ };
644
+ const exportedLoader = (value, scopes) => {
645
+ if (!record$1(value) || functionNode(value)) return false;
646
+ if (loaderValue(value, scopes)) return true;
647
+ if (value["type"] === "CallExpression") {
648
+ const callee = loaderBinding(value["callee"], scopes);
649
+ return callee === "factory" || callee === "require" && ["node:module", "module"].includes(literal(nodes(value["arguments"]).at(0)) ?? "");
650
+ }
651
+ if (value["type"] === "Property") return exportedLoader(value["value"], scopes);
652
+ if ([
653
+ "ObjectExpression",
654
+ "ArrayExpression",
655
+ "ConditionalExpression",
656
+ "LogicalExpression",
657
+ "SequenceExpression"
658
+ ].includes(String(value["type"]))) return children(value).some((child) => exportedLoader(child, scopes));
659
+ return false;
660
+ };
661
+ const unsupportedPropagation = () => unresolvable("unsupported loader propagation across module exports");
662
+ const walk = (node, scopes, parent) => {
663
+ const kind = node["type"];
664
+ if (kind === "Program" || kind === "BlockStatement" || functionNode(node) || kind === "CatchClause" || kind === "ForStatement" || kind === "ForOfStatement" || kind === "ForInStatement") {
665
+ const local = /* @__PURE__ */ new Map();
666
+ const bind = (pattern) => {
667
+ allowPattern(pattern);
668
+ for (const name of patternNames(pattern)) {
669
+ if (loaderName(name, scopes)) throw unresolvable(`unsupported loader binding: ${name}`);
670
+ local.set(name, "other");
671
+ }
672
+ };
673
+ const bindVariable = (entry, declarationKind) => {
674
+ if (declarationKind === "var" && node["type"] === "BlockStatement" && node !== root) return;
675
+ allowPattern(entry["id"]);
676
+ for (const name of patternNames(entry["id"])) {
677
+ if (mode === "script" && node === root && declarationKind === "var" && entry["init"] === null && (name === "require" || name === "module")) continue;
678
+ local.set(name, "other");
679
+ }
680
+ };
681
+ if (functionNode(node)) {
682
+ if (kind !== "ArrowFunctionExpression") functionScopes.set(local, "function");
683
+ bind(node["id"]);
684
+ for (const parameter of nodes(node["params"])) bind(parameter);
685
+ }
686
+ if (kind === "CatchClause") bind(node["param"]);
687
+ if (kind === "ArrowFunctionExpression" && record$1(node["body"]) && node["body"]["type"] !== "BlockStatement" && loaderValue(node["body"], [...scopes, local])) throw unresolvable("loader returned through an unsupported function");
688
+ const statements = kind === "Program" || kind === "BlockStatement" ? nodes(node["body"]).flatMap(scopeDeclarations) : children(node).flatMap(scopeDeclarations);
689
+ const declarations = [];
690
+ for (const statement of statements) if (statement["type"] === "VariableDeclaration") for (const entry of nodes(statement["declarations"])) {
691
+ bindVariable(entry, statement["kind"]);
692
+ declarations.push(entry);
693
+ }
694
+ else if (statement["type"] === "FunctionDeclaration" || statement["type"] === "ClassDeclaration") bind(statement["id"]);
695
+ else if (statement["type"] === "ImportDeclaration") {
696
+ allowReference(statement["specifiers"]);
697
+ const moduleImport = ["node:module", "module"].includes(literal(statement["source"]) ?? "");
698
+ const specifiers = nodes(statement["specifiers"]);
699
+ if (moduleImport && specifiers.length === 0) throw unresolvable("module import needs recognized static bindings");
700
+ for (const specifier of specifiers) {
701
+ const name = identifier(specifier["local"]);
702
+ if (name === void 0) throw unresolvable("import binding cannot be resolved statically");
703
+ if (!moduleImport) {
704
+ local.set(name, "other");
705
+ continue;
706
+ }
707
+ const imported = identifier(specifier["imported"]) ?? literal(specifier["imported"]);
708
+ if (imported === "createRequire") local.set(name, "factory");
709
+ else if (["ImportDefaultSpecifier", "ImportNamespaceSpecifier"].includes(String(specifier["type"])) || imported === "Module" || imported === "default") local.set(name, "module-api");
710
+ else throw unresolvable("unsupported node:module import binding");
711
+ }
712
+ }
713
+ if (functionNode(node) || kind === "Program" || node === root) {
714
+ const hoisted = (entry) => {
715
+ if (functionNode(entry)) return;
716
+ if (entry["type"] === "VariableDeclaration" && entry["kind"] === "var") for (const declaration of nodes(entry["declarations"])) {
717
+ bindVariable(declaration, "var");
718
+ if (!declarations.includes(declaration)) declarations.push(declaration);
719
+ }
720
+ for (const child of children(entry)) hoisted(child);
721
+ };
722
+ for (const statement of statements) hoisted(statement);
723
+ }
724
+ const nested = [...scopes, local];
725
+ let changed = true;
726
+ const assign = (name, value) => {
727
+ const owner = bindingScope(nested, name);
728
+ if (owner === void 0) throw unresolvable("loader declaration has no owning scope");
729
+ if (owner.get(name) === value) return;
730
+ if (owner.get(name) !== "other") throw unresolvable("conflicting loader binding declarations");
731
+ owner.set(name, value);
732
+ changed = true;
733
+ };
734
+ while (changed) {
735
+ changed = false;
736
+ for (const entry of declarations) {
737
+ const name = identifier(entry["id"]);
738
+ const initial = entry["init"];
739
+ if (!record$1(initial)) continue;
740
+ const alias = loaderBinding(initial, nested);
741
+ const nodeModule = initial["type"] === "CallExpression" && loaderBinding(initial["callee"], nested) === "require" && ["node:module", "module"].includes(literal(nodes(initial["arguments"]).at(0)) ?? "");
742
+ if ((nodeModule || alias === "module-api") && record$1(entry["id"]) && entry["id"]["type"] === "ObjectPattern") for (const property of nodes(entry["id"]["properties"])) {
743
+ const key = property["computed"] === true ? literal(property["key"]) : identifier(property["key"]) ?? literal(property["key"]);
744
+ if (property["type"] === "RestElement" || key === void 0) throw unresolvable("module loader destructuring cannot be resolved statically");
745
+ const factoryName = identifier(property["value"]);
746
+ if (key === "createRequire" || key === "Module" || key === "default") {
747
+ if (factoryName === void 0) throw unresolvable("module loader binding pattern cannot be resolved statically");
748
+ assign(factoryName, key === "createRequire" ? "factory" : "module-api");
749
+ } else throw unresolvable("unsupported module namespace destructuring");
750
+ }
751
+ else if (name === void 0 && alias !== void 0 && alias !== "other") throw unresolvable("loader destructuring cannot be resolved statically");
752
+ if (nodeModule) resolvedNamespaces.add(initial);
753
+ if (alias !== void 0 && alias !== "other") allowReference(initial);
754
+ if (name === void 0) continue;
755
+ if (alias !== void 0 && alias !== "other") assign(name, alias);
756
+ if (nodeModule) assign(name, "module-api");
757
+ if (initial["type"] === "CallExpression" && loaderBinding(initial["callee"], nested) === "factory") {
758
+ const argument = nodes(initial["arguments"]).at(0);
759
+ const object = argument?.["object"];
760
+ const importMeta = record$1(object) && object["type"] === "MetaProperty" && identifier(object["meta"]) === "import" && identifier(object["property"]) === "meta";
761
+ if (nodes(initial["arguments"]).length !== 1 || !(identifier(argument) === "__filename" && binding(nested, "__filename") === "filename" || argument?.["type"] === "MemberExpression" && argument["computed"] === false && importMeta && identifier(argument["property"]) === "url")) throw unresolvable("createRequire needs import.meta.url or __filename");
762
+ assign(name, "require");
763
+ resolvedFactories.add(initial);
764
+ }
765
+ }
766
+ }
767
+ for (const entry of declarations) {
768
+ const initial = entry["init"];
769
+ for (const name of patternNames(entry["id"])) {
770
+ if (loaderName(name, scopes) && binding(nested, name) === "other") throw unresolvable(`unknown loader declaration: ${name}`);
771
+ const resolved = binding(nested, name);
772
+ const source = loaderBinding(initial, nested);
773
+ if (initial !== null && resolved !== void 0 && resolved !== "other" && (source === void 0 || source === "other") && (!record$1(initial) || !resolvedFactories.has(initial) && !resolvedNamespaces.has(initial))) throw unresolvable(`unknown loader initializer: ${name}`);
774
+ }
775
+ if (loaderBinding(initial, nested) === void 0 && loaderValue(initial, nested)) throw unresolvable("binding initializer cannot be resolved statically");
776
+ }
777
+ for (const child of children(node)) walk(child, nested, node);
778
+ return;
779
+ }
780
+ if (kind === "ExportDefaultDeclaration" && exportedLoader(node["declaration"], scopes)) throw unsupportedPropagation();
781
+ if (kind === "ExportNamedDeclaration") {
782
+ const declaration = node["declaration"];
783
+ if (record$1(declaration) && declaration["type"] === "VariableDeclaration") {
784
+ for (const entry of nodes(declaration["declarations"])) if (patternNames(entry["id"]).some((name) => {
785
+ const resolved = binding(scopes, name);
786
+ return resolved !== void 0 && resolved !== "other" && resolved !== "filename";
787
+ }) || exportedLoader(entry["init"], scopes)) throw unsupportedPropagation();
788
+ }
789
+ if (literal(node["source"]) === void 0) {
790
+ for (const specifier of nodes(node["specifiers"])) if (exportedLoader(specifier["local"], scopes)) throw unsupportedPropagation();
791
+ }
792
+ allowReference(node["specifiers"]);
793
+ }
794
+ if (kind === "ImportDeclaration" || kind === "ExportNamedDeclaration" || kind === "ExportAllDeclaration") {
795
+ const specifier = literal(node["source"]);
796
+ if (kind !== "ImportDeclaration" && ["node:module", "module"].includes(specifier ?? "")) throw unsupportedPropagation();
797
+ if (specifier !== void 0) result.push({
798
+ specifier,
799
+ mode: "import"
800
+ });
801
+ }
802
+ if (kind === "ImportExpression") {
803
+ const specifier = literal(node["source"]);
804
+ if (specifier === void 0) throw unresolvable("dynamic import needs a literal module specifier");
805
+ if (["node:module", "module"].includes(specifier)) throw unresolvable("dynamic module namespace imports are unsupported");
806
+ result.push({
807
+ specifier,
808
+ mode: "import"
809
+ });
810
+ }
811
+ if (kind === "CallExpression") {
812
+ const callee = node["callee"];
813
+ const resolved = loaderBinding(callee, scopes);
814
+ const specifier = literal(nodes(node["arguments"]).at(0));
815
+ if (resolved === "require") {
816
+ if (specifier === void 0 || nodes(node["arguments"]).length !== 1) throw unresolvable("require/resolve needs one literal module specifier");
817
+ allowReference(callee);
818
+ if (["node:module", "module"].includes(specifier) && !resolvedNamespaces.has(node)) throw unresolvable("module namespace needs a resolvable local binding");
819
+ result.push({
820
+ specifier,
821
+ mode: "require"
822
+ });
823
+ }
824
+ if (resolved === "factory") {
825
+ if (!resolvedFactories.has(node)) throw unresolvable("createRequire result needs a resolvable local binding");
826
+ allowReference(callee);
827
+ }
828
+ if (record$1(callee) && callee["type"] === "MemberExpression" && ["require", "factory"].includes(loaderBinding(callee["object"], scopes) ?? "") && resolved === void 0) throw unresolvable("loader method cannot be resolved statically");
829
+ if (resolved !== "require" && resolved !== "factory" && nodes(node["arguments"]).some((argument) => loaderValue(argument, scopes))) throw unresolvable("loader passed through an unsupported call");
830
+ }
831
+ if (kind === "AssignmentExpression") {
832
+ const assigned = loaderBinding(node["right"], scopes);
833
+ if (exportedLoader(node["right"], scopes) && (node["operator"] !== "=" || loaderBinding(node["left"], scopes) !== assigned || assigned === void 0)) throw unsupportedPropagation();
834
+ for (const name of patternNames(node["left"])) {
835
+ const previous = binding(scopes, name);
836
+ if (loaderName(name, scopes) && (previous === void 0 || previous === "other")) throw unresolvable(`unknown loader assignment: ${name}`);
837
+ if (previous !== void 0 && previous !== "other" && (node["operator"] !== "=" || loaderBinding(node["right"], scopes) !== previous)) throw unresolvable("loader reassignment cannot be resolved statically");
838
+ }
839
+ }
840
+ if (kind === "ReturnStatement" && loaderValue(node["argument"], scopes)) throw unresolvable("loader returned through an unsupported function");
841
+ const nonReference = parent !== void 0 && (parent["type"] === "MemberExpression" && parent["computed"] === false && parent["property"] === node || [
842
+ "Property",
843
+ "MethodDefinition",
844
+ "PropertyDefinition"
845
+ ].includes(String(parent["type"])) && parent["computed"] === false && parent["key"] === node && parent["value"] !== node);
846
+ const reference = loaderBinding(node, scopes);
847
+ const name = identifier(node);
848
+ if (!nonReference && !allowedLoaderReferences.has(node)) {
849
+ const owner = scopes.findLast((scope) => functionScopes.has(scope));
850
+ if (name === "arguments" && owner !== void 0 && functionScopes.get(owner) === "wrapper" || name === "eval" || name === "Function") throw unresolvable(`unsupported dynamic loader escape: ${name}`);
851
+ }
852
+ if (kind === "MemberExpression") {
853
+ const owner = identifier(node["object"]);
854
+ const property = memberName(node);
855
+ const ownerBinding = loaderBinding(node["object"], scopes);
856
+ if (ownerBinding === "module" && (property === "constructor" || property === "require") || ownerBinding === "require" && [
857
+ "cache",
858
+ "extensions",
859
+ "main"
860
+ ].includes(property ?? "") || owner === "process" && property === "mainModule" || (owner === "globalThis" || owner === "global") && [
861
+ "require",
862
+ "eval",
863
+ "Function"
864
+ ].includes(property ?? "")) throw unresolvable("unsupported dynamic loader escape property");
865
+ }
866
+ if (name !== void 0 && loaderName(name, scopes) && (reference === void 0 || reference === "other") && !nonReference && !allowedLoaderReferences.has(node)) throw unresolvable(`unknown loader reference: ${name}`);
867
+ const moduleExports = reference === "module" && parent?.["type"] === "MemberExpression" && parent["object"] === node && memberName(parent) === "exports";
868
+ if (reference !== void 0 && reference !== "other" && !moduleExports && !nonReference && !allowedLoaderReferences.has(node)) throw unresolvable("loader reference is not a recognized static form");
869
+ for (const child of children(node)) walk(child, scopes, node);
870
+ };
871
+ const root = nodes(tree).at(0);
872
+ if (root !== void 0) {
873
+ const wrapper = /* @__PURE__ */ new Map();
874
+ if (mode === "script") {
875
+ wrapper.set("require", "require");
876
+ wrapper.set("module", "module");
877
+ wrapper.set("__filename", "filename");
878
+ functionScopes.set(wrapper, "wrapper");
879
+ }
880
+ walk(root, [wrapper]);
881
+ }
882
+ return result;
883
+ };
884
+ /** Validate the static local runtime closure against regular packed members. */
885
+ const assertPackedRuntimeImports = async ({ members, readSource, assertRegular }) => {
886
+ const files = /* @__PURE__ */ new Map();
887
+ const read = async (file) => {
888
+ if (!members.has(file)) throw new Error(`Missing packed runtime file: ${file}`);
889
+ await assertRegular(file);
890
+ const cached = files.get(file);
891
+ if (cached !== void 0) return cached;
892
+ const source = await readSource(file);
893
+ files.set(file, source);
894
+ return source;
895
+ };
896
+ const manifest = async (file) => {
897
+ const value = JSON.parse(await read(file));
898
+ if (!record$1(value)) throw new Error(`Invalid packed manifest: ${file}`);
899
+ return value;
900
+ };
901
+ const scratch = await (0, node_fs_promises.realpath)(await (0, node_fs_promises.mkdtemp)(node_path.default.join((0, node_os.tmpdir)(), "packed-node-resolution-")));
902
+ const resolver = createPackedNodeResolver();
903
+ try {
904
+ for (const file of members) {
905
+ const directory = file.endsWith("/");
906
+ const member = directory ? file.slice(0, -1) : file;
907
+ if (packagePath(member) !== member) throw new Error(`Invalid packed member path: ${file}`);
908
+ const destination = node_path.default.join(scratch, member);
909
+ if (directory) {
910
+ await (0, node_fs_promises.mkdir)(destination, { recursive: true });
911
+ continue;
912
+ }
913
+ await (0, node_fs_promises.mkdir)(node_path.default.dirname(destination), { recursive: true });
914
+ await (0, node_fs_promises.writeFile)(destination, node_path.default.posix.basename(file) === "package.json" ? await read(file) : "");
915
+ }
916
+ const externalFiles = /* @__PURE__ */ new Set();
917
+ for (const file of members) {
918
+ if (node_path.default.posix.basename(file) !== "package.json") continue;
919
+ const owner = await manifest(file);
920
+ for (const target of targets(owner["imports"])) {
921
+ if (target.startsWith(".") || target.startsWith("#") || target.includes(":")) continue;
922
+ const parts = target.split("/");
923
+ const name = target.startsWith("@") ? parts.slice(0, 2).join("/") : parts.at(0);
924
+ if (name === void 0 || !/^(?:@[a-z0-9._~-]+\/)?[a-z0-9._~-]+$/iu.test(name) || name.split("/").some((part) => part === "." || part === "..")) throw new Error(`Unsupported external import mapping: ${target}`);
925
+ if (name === owner["name"]) continue;
926
+ const directory = node_path.default.join(scratch, "node_modules", name);
927
+ await (0, node_fs_promises.mkdir)(directory, { recursive: true });
928
+ await (0, node_fs_promises.writeFile)(node_path.default.join(directory, "package.json"), JSON.stringify({
929
+ name,
930
+ exports: {
931
+ ".": "./external.cjs",
932
+ "./*": "./external.cjs"
933
+ }
934
+ }));
935
+ const entry = node_path.default.join(directory, "external.cjs");
936
+ await (0, node_fs_promises.writeFile)(entry, "");
937
+ externalFiles.add(entry);
938
+ }
939
+ }
940
+ const resolveImport = async ({ specifier, mode, importer }) => {
941
+ let resolved;
942
+ try {
943
+ resolved = await resolver.resolve({
944
+ specifier,
945
+ mode,
946
+ file: node_path.default.join(scratch, importer)
947
+ });
948
+ } catch (error) {
949
+ throw new Error(`Missing packed runtime import: ${importer} -> ${specifier}: ${String(error)}`, { cause: error });
950
+ }
951
+ if (resolved === null) return [];
952
+ const url = new URL(resolved);
953
+ if (url.protocol !== "file:") throw new Error(`Unsupported packed runtime URL: ${resolved}`);
954
+ const destination = (0, node_url.fileURLToPath)(url);
955
+ if (externalFiles.has(destination)) return [];
956
+ const file = packagePath(node_path.default.relative(scratch, destination).split(node_path.default.sep).join("/"));
957
+ if (!members.has(file)) throw new Error(`Missing packed runtime import: ${importer} -> ${specifier} (${file})`);
958
+ return [file];
959
+ };
960
+ for (const file of members) if (node_path.default.posix.basename(file) === "package.json") await manifest(file);
961
+ const root = await manifest("package/package.json");
962
+ const pending = [...members].filter((file) => javascript$1.test(file));
963
+ const scripts = new Set(pending);
964
+ const bin = root["bin"];
965
+ const bins = [];
966
+ if (typeof bin === "string") bins.push(bin);
967
+ else if (record$1(bin)) bins.push(...Object.values(bin));
968
+ else if (bin !== void 0) throw new Error("Invalid packed bin declaration");
969
+ for (const entry of bins) {
970
+ if (typeof entry !== "string" || entry === "" || node_path.default.posix.isAbsolute(entry) || entry.includes("\\")) throw new Error("Invalid packed bin entry");
971
+ const file = packagePath(node_path.default.posix.join("package", entry));
972
+ scripts.add(file);
973
+ pending.push(file);
974
+ }
975
+ const addEntry = (entry, mode) => {
976
+ if (declarationFile.test(entry)) return;
977
+ if (node_path.default.posix.isAbsolute(entry) || entry.includes("\\")) throw new Error(`Runtime entry escapes the packed package: ${entry}`);
978
+ if (mode === "url" && /%2f|%5c/iu.test(entry)) throw new Error(`Invalid packed entry URL: ${entry}`);
979
+ const file = packagePath(mode === "url" ? (0, node_url.fileURLToPath)(new URL(entry, "file:///package/package.json")).slice(1) : node_path.default.posix.join("package", entry));
980
+ if (!file.includes("*")) {
981
+ if (javascript$1.test(file) || node_path.default.posix.extname(file) === "") scripts.add(file);
982
+ pending.push(file);
983
+ return;
984
+ }
985
+ const [prefix, suffix] = file.split("*");
986
+ if (prefix === void 0 || suffix === void 0 || file.split("*").length !== 2) throw new Error(`Unsupported packed entry pattern: ${entry}`);
987
+ const matches = [...members].filter((candidate) => !candidate.endsWith("/") && candidate.length >= prefix.length + suffix.length && candidate.startsWith(prefix) && candidate.endsWith(suffix));
988
+ if (matches.length === 0) throw new Error(`Missing packed runtime entry pattern: ${entry}`);
989
+ for (const match of matches) if (javascript$1.test(match)) scripts.add(match);
990
+ pending.push(...matches);
991
+ };
992
+ for (const target of targets(root["module"])) addEntry(target, "file");
993
+ for (const target of targets(root["exports"])) addEntry(target, "url");
994
+ if (root["main"] !== void 0) {
995
+ const entry = root["main"];
996
+ if (typeof entry !== "string" || node_path.default.posix.isAbsolute(entry) || entry.includes("\\")) throw new Error("Invalid packed main entry");
997
+ if (!declarationFile.test(entry)) {
998
+ const resolved = (await resolveImport({
999
+ specifier: "./package",
1000
+ mode: "require",
1001
+ importer: "entry.cjs"
1002
+ })).at(0);
1003
+ if (resolved === void 0) throw new Error(`Missing packed runtime main: ${entry}`);
1004
+ if (!opaque.test(resolved)) scripts.add(resolved);
1005
+ pending.push(resolved);
1006
+ }
1007
+ }
1008
+ const validated = /* @__PURE__ */ new Set();
1009
+ const traversed = /* @__PURE__ */ new Set();
1010
+ while (pending.length > 0) {
1011
+ const file = pending.pop();
1012
+ if (file === void 0) continue;
1013
+ if (!validated.has(file)) {
1014
+ if (!members.has(file)) throw new Error(`Missing packed runtime file: ${file}`);
1015
+ await assertRegular(file);
1016
+ validated.add(file);
1017
+ }
1018
+ if (!scripts.has(file) || traversed.has(file)) continue;
1019
+ traversed.add(file);
1020
+ const source = await read(file);
1021
+ let mode;
1022
+ if (/\.mjs$/iu.test(file)) mode = "module";
1023
+ else if (/\.cjs$/iu.test(file)) mode = "script";
1024
+ else mode = packageMode(files, file);
1025
+ const parse = (sourceType) => {
1026
+ try {
1027
+ const tree = parseArtifactSource(source, {
1028
+ ecmaVersion: "latest",
1029
+ sourceType,
1030
+ allowHashBang: true,
1031
+ allowReturnOutsideFunction: sourceType === "script"
1032
+ });
1033
+ if (sourceType === "script") {
1034
+ const statement = tree.body.at(0);
1035
+ if (statement?.type === "ExpressionStatement" && statement.expression.type === "FunctionExpression") return {
1036
+ tree: statement.expression.body,
1037
+ mode: sourceType
1038
+ };
1039
+ }
1040
+ return {
1041
+ tree,
1042
+ mode: sourceType
1043
+ };
1044
+ } catch (error) {
1045
+ if (!(error instanceof SyntaxError)) throw error;
1046
+ throw new SyntaxError(`Packed runtime import syntax ${file}: ${error.message}`, { cause: error });
1047
+ }
1048
+ };
1049
+ let parsed;
1050
+ if (mode === "detect") try {
1051
+ parsed = parse("script");
1052
+ } catch {
1053
+ parsed = parse("module");
1054
+ }
1055
+ else parsed = parse(mode);
1056
+ let dependencies;
1057
+ try {
1058
+ dependencies = staticImports(parsed.tree, parsed.mode);
1059
+ } catch (error) {
1060
+ throw new Error(`Packed runtime imports ${file}: ${String(error)}`, { cause: error });
1061
+ }
1062
+ for (const dependency of dependencies) {
1063
+ const resolved = await resolveImport({
1064
+ ...dependency,
1065
+ importer: file
1066
+ });
1067
+ for (const target of resolved) {
1068
+ if (javascript$1.test(target) || node_path.default.posix.extname(target) === "" || dependency.mode === "require" && !opaque.test(target)) scripts.add(target);
1069
+ pending.push(target);
1070
+ }
1071
+ }
1072
+ }
1073
+ } finally {
1074
+ try {
1075
+ await resolver.close();
1076
+ } finally {
1077
+ await (0, node_fs_promises.rm)(scratch, {
1078
+ recursive: true,
1079
+ force: true
1080
+ });
1081
+ }
1082
+ }
1083
+ };
1084
+ //#endregion
1085
+ //#region src/publish-artifact-syntax.ts
1086
+ const command = (0, node_util.promisify)(node_child_process.execFile);
1087
+ const record = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1088
+ const javascript = /\.(?:js|mjs|cjs)$/i;
1089
+ const syntaxYears = new Map(Object.entries({
1090
+ es5: 5,
1091
+ es2015: 2015,
1092
+ es2016: 2016,
1093
+ es2017: 2017,
1094
+ es2018: 2018,
1095
+ es2019: 2019,
1096
+ es2020: 2020,
1097
+ es2021: 2021,
1098
+ es2022: 2022,
1099
+ es2023: 2023,
1100
+ es2024: 2024,
1101
+ es2025: 2025
1102
+ }));
1103
+ /** Explicit ECMAScript targets bound syntax; unbounded targets use native Node. */
1104
+ const artifactEcmaVersion = ({ target, node }) => {
1105
+ if (target.type === "types-only") return "latest";
1106
+ if (target.targets.length === 0) throw new Error("Packed JavaScript requires a declared target");
1107
+ let version = "latest";
1108
+ for (const identifier of target.targets) {
1109
+ if (identifier === "esnext") continue;
1110
+ const year = syntaxYears.get(identifier);
1111
+ if (year !== void 0) {
1112
+ if (version === "latest" || year < version) version = year;
1113
+ continue;
1114
+ }
1115
+ if (publishedNodeTargetSupportsConsumer({
1116
+ target: identifier,
1117
+ node
1118
+ })) continue;
1119
+ throw new Error(`Unsupported packed JavaScript syntax target ${identifier}; use an explicit ECMAScript year or a supported Node target`);
1120
+ }
1121
+ return version;
1122
+ };
1123
+ const packedBinFiles = (files) => {
1124
+ const result = /* @__PURE__ */ new Set();
1125
+ for (const [file, source] of files) {
1126
+ if (node_path.default.posix.basename(file) !== "package.json") continue;
1127
+ const manifest = JSON.parse(source);
1128
+ if (!record(manifest)) throw new Error(`Invalid packed manifest: ${file}`);
1129
+ const bin = manifest["bin"];
1130
+ if (bin === void 0) continue;
1131
+ let entries;
1132
+ if (typeof bin === "string") entries = [bin];
1133
+ else if (record(bin)) entries = Object.values(bin);
1134
+ if (entries === void 0) throw new Error(`Unsupported packed bin declaration: ${file}`);
1135
+ for (const entry of entries) {
1136
+ if (typeof entry !== "string" || entry === "" || node_path.default.posix.isAbsolute(entry) || entry.includes("\\") || entry.split("/").includes("..")) throw new Error(`Unsafe packed bin declaration: ${file}`);
1137
+ result.add(node_path.default.posix.join(node_path.default.posix.dirname(file), entry));
1138
+ }
1139
+ }
1140
+ return result;
1141
+ };
1142
+ const syntaxFiles = (files) => {
1143
+ const bins = packedBinFiles(files);
1144
+ for (const file of bins) {
1145
+ const source = files.get(file);
1146
+ if (source === void 0) throw new Error(`Missing packed executable: ${file}`);
1147
+ if (!javascript.test(file) && !/^#!(?:[^\n]*\/node|\/usr\/bin\/env(?: -S)? node)(?:[ \r\n]|$)/.test(source)) throw new Error(`Unsupported packed executable language: ${file}`);
1148
+ }
1149
+ return [...new Set([...files.keys()].filter((file) => javascript.test(file)).concat([...bins]))];
1150
+ };
1151
+ /** Enumerate all chunks and bins, including JavaScript outside declared exports. */
1152
+ const assertPackedArtifactSyntax = ({ files, target, node }) => {
1153
+ const ecmaVersion = artifactEcmaVersion({
1154
+ target,
1155
+ node
1156
+ });
1157
+ const selected = syntaxFiles(files);
1158
+ if (target.type === "types-only" && selected.length > 0) throw new Error(`Types-only artifact contains JavaScript: ${selected[0]}`);
1159
+ for (const file of selected) {
1160
+ const source = files.get(file);
1161
+ if (source === void 0) throw new Error(`Missing packed JavaScript: ${file}`);
1162
+ let mode = packageMode(files, file);
1163
+ if (/\.mjs$/i.test(file)) mode = "module";
1164
+ if (/\.cjs$/i.test(file)) mode = "script";
1165
+ const parseMode = (sourceType) => {
1166
+ const tree = parseArtifactSource(source, {
1167
+ ecmaVersion,
1168
+ sourceType,
1169
+ allowHashBang: true,
1170
+ allowReturnOutsideFunction: sourceType === "script"
1171
+ });
1172
+ if (ecmaVersion === 5 && tree.body.some((item) => /^(?:Import|Export)/.test(item.type))) throw new Error("Module declarations exceed ES5");
1173
+ };
1174
+ try {
1175
+ if (mode === "detect") try {
1176
+ parseMode("script");
1177
+ } catch {
1178
+ parseMode("module");
1179
+ }
1180
+ else parseMode(mode);
1181
+ } catch (error) {
1182
+ throw new Error(`Packed JavaScript ${file} exceeds its declared syntax target: ${String(error)}`);
1183
+ }
1184
+ }
1185
+ };
1186
+ const archiveMembers = (members) => {
1187
+ const seen = /* @__PURE__ */ new Set();
1188
+ for (const file of members) {
1189
+ const parts = file.split("/");
1190
+ if (!file.startsWith("package/") || file.includes("\\") || file.split("").some((character) => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127) || parts.some((part) => part === ".." || part === ".") || parts.slice(0, -1).some((part) => part === "") || seen.has(file)) throw new Error(`Unsupported packed artifact member: ${file}`);
1191
+ seen.add(file);
1192
+ }
1193
+ return members;
1194
+ };
1195
+ const checkPackedJavaScriptWithNode = async ({ files, target, node, executable }) => {
1196
+ assertPackedArtifactSyntax({
1197
+ files,
1198
+ target,
1199
+ node
1200
+ });
1201
+ archiveMembers([...files.keys()]);
1202
+ const scratch = await (0, node_fs_promises.mkdtemp)(node_path.default.join((0, node_os.tmpdir)(), "stll-artifact-syntax-"));
1203
+ try {
1204
+ for (const [file, source] of files) {
1205
+ const destination = node_path.default.join(scratch, file);
1206
+ await (0, node_fs_promises.mkdir)(node_path.default.dirname(destination), { recursive: true });
1207
+ await (0, node_fs_promises.writeFile)(destination, source);
1208
+ }
1209
+ for (const file of syntaxFiles(files)) try {
1210
+ await command(executable, ["--check", node_path.default.join(scratch, file)], {
1211
+ cwd: scratch,
1212
+ env: {
1213
+ PATH: "/usr/bin:/bin",
1214
+ HOME: scratch
1215
+ }
1216
+ });
1217
+ } catch (error) {
1218
+ throw new Error(`Packed JavaScript ${file} is incompatible with consumer Node ${node}: ${String(error)}`);
1219
+ }
1220
+ } finally {
1221
+ await (0, node_fs_promises.rm)(scratch, {
1222
+ recursive: true,
1223
+ force: true
1224
+ });
1225
+ }
1226
+ };
1227
+ /** Read bytes without extracting archive-controlled paths or links. */
1228
+ const readPackedSyntaxFiles = async (archive) => {
1229
+ const { stdout: listing } = await command("tar", ["-tzf", archive], { maxBuffer: 16777216 });
1230
+ const files = /* @__PURE__ */ new Map();
1231
+ const members = new Set(archiveMembers(listing.split("\n").filter((entry) => entry !== "")));
1232
+ const regularFiles = /* @__PURE__ */ new Set();
1233
+ const assertRegular = async (file) => {
1234
+ if (!members.has(file)) throw new Error(`Missing packed syntax input: ${file}`);
1235
+ if (regularFiles.has(file)) return;
1236
+ const { stdout: metadata } = await command("tar", [
1237
+ "-tvzf",
1238
+ archive,
1239
+ file
1240
+ ]);
1241
+ if (!metadata.startsWith("-") || metadata.trimEnd().split("\n").length !== 1) throw new Error(`Packed syntax input must be a regular file: ${file}`);
1242
+ regularFiles.add(file);
1243
+ };
1244
+ const readSource = async (file) => {
1245
+ const cached = files.get(file);
1246
+ if (cached !== void 0) return cached;
1247
+ await assertRegular(file);
1248
+ const { stdout } = await command("tar", [
1249
+ "-xOf",
1250
+ archive,
1251
+ file
1252
+ ], { maxBuffer: 16777216 });
1253
+ files.set(file, stdout);
1254
+ return stdout;
1255
+ };
1256
+ for (const file of members) if (javascript.test(file) || node_path.default.posix.basename(file) === "package.json") await readSource(file);
1257
+ for (const file of packedBinFiles(files)) if (!files.has(file)) await readSource(file);
1258
+ await assertPackedRuntimeImports({
1259
+ members,
1260
+ readSource,
1261
+ assertRegular
1262
+ });
1263
+ return files;
1264
+ };
1265
+ //#endregion
1266
+ Object.defineProperty(exports, "checkPackedJavaScriptWithNode", {
1267
+ enumerable: true,
1268
+ get: function() {
1269
+ return checkPackedJavaScriptWithNode;
1270
+ }
1271
+ });
1272
+ Object.defineProperty(exports, "checkPublishContract", {
1273
+ enumerable: true,
1274
+ get: function() {
1275
+ return checkPublishContract;
1276
+ }
1277
+ });
1278
+ Object.defineProperty(exports, "consumerReleasePackArguments", {
1279
+ enumerable: true,
1280
+ get: function() {
1281
+ return consumerReleasePackArguments;
1282
+ }
1283
+ });
1284
+ Object.defineProperty(exports, "parsePublishContract", {
1285
+ enumerable: true,
1286
+ get: function() {
1287
+ return parsePublishContract;
1288
+ }
1289
+ });
1290
+ Object.defineProperty(exports, "readPackedSyntaxFiles", {
1291
+ enumerable: true,
1292
+ get: function() {
1293
+ return readPackedSyntaxFiles;
1294
+ }
1295
+ });
1296
+ Object.defineProperty(exports, "resolveConsumerReleasePack", {
1297
+ enumerable: true,
1298
+ get: function() {
1299
+ return resolveConsumerReleasePack;
1300
+ }
1301
+ });
1302
+ Object.defineProperty(exports, "resolveManifestContract", {
1303
+ enumerable: true,
1304
+ get: function() {
1305
+ return resolveManifestContract;
1306
+ }
1307
+ });
1308
+
1309
+ //# sourceMappingURL=publish-artifact-syntax.cjs.map