@sublang/spex 4.1.0 → 5.0.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/README.md +438 -54
- package/dist/cli.js +81 -31
- package/dist/commands/add.d.ts +12 -0
- package/dist/commands/add.js +138 -0
- package/dist/commands/auth-target.d.ts +11 -0
- package/dist/commands/auth-target.js +50 -0
- package/dist/commands/environment.d.ts +123 -0
- package/dist/commands/environment.js +411 -0
- package/dist/commands/export.d.ts +21 -0
- package/dist/commands/export.js +663 -0
- package/dist/commands/home.d.ts +56 -0
- package/dist/commands/home.js +215 -0
- package/dist/commands/install.d.ts +2 -0
- package/dist/commands/install.js +48 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.js +87 -0
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.js +211 -0
- package/dist/commands/logout.d.ts +2 -0
- package/dist/commands/logout.js +74 -0
- package/dist/commands/publish.d.ts +2 -0
- package/dist/commands/publish.js +120 -0
- package/dist/commands/remove.d.ts +2 -0
- package/dist/commands/remove.js +34 -0
- package/dist/commands/run.d.ts +50 -0
- package/dist/commands/run.js +309 -0
- package/dist/commands/search.d.ts +2 -0
- package/dist/commands/search.js +34 -0
- package/dist/commands/settle.d.ts +124 -0
- package/dist/commands/settle.js +475 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.js +37 -0
- package/dist/commands/whoami.d.ts +2 -0
- package/dist/commands/whoami.js +75 -0
- package/dist/lib/environment/agent-folders.d.ts +14 -0
- package/dist/lib/environment/agent-folders.js +11 -0
- package/dist/lib/environment/archive.d.ts +26 -0
- package/dist/lib/environment/archive.js +91 -0
- package/dist/lib/environment/builtins.d.ts +112 -0
- package/dist/lib/environment/builtins.js +539 -0
- package/dist/lib/environment/citations.d.ts +75 -0
- package/dist/lib/environment/citations.js +267 -0
- package/dist/lib/environment/exports.d.ts +190 -0
- package/dist/lib/environment/exports.js +1029 -0
- package/dist/lib/environment/format.d.ts +133 -0
- package/dist/lib/environment/format.js +651 -0
- package/dist/lib/environment/git-source.d.ts +41 -0
- package/dist/lib/environment/git-source.js +159 -0
- package/dist/lib/environment/index.d.ts +20 -0
- package/dist/lib/environment/index.js +27 -0
- package/dist/lib/environment/install.d.ts +140 -0
- package/dist/lib/environment/install.js +694 -0
- package/dist/lib/environment/layout.d.ts +15 -0
- package/dist/lib/environment/layout.js +50 -0
- package/dist/lib/environment/lock.d.ts +87 -0
- package/dist/lib/environment/lock.js +305 -0
- package/dist/lib/environment/marker.d.ts +15 -0
- package/dist/lib/environment/marker.js +31 -0
- package/dist/lib/environment/own-paths.d.ts +59 -0
- package/dist/lib/environment/own-paths.js +174 -0
- package/dist/lib/environment/placed-record.d.ts +32 -0
- package/dist/lib/environment/placed-record.js +72 -0
- package/dist/lib/environment/registries.d.ts +25 -0
- package/dist/lib/environment/registries.js +75 -0
- package/dist/lib/environment/registry.d.ts +173 -0
- package/dist/lib/environment/registry.js +390 -0
- package/dist/lib/environment/requests.d.ts +108 -0
- package/dist/lib/environment/requests.js +403 -0
- package/dist/lib/environment/resolve.d.ts +70 -0
- package/dist/lib/environment/resolve.js +451 -0
- package/dist/lib/environment/semver.d.ts +30 -0
- package/dist/lib/environment/semver.js +130 -0
- package/dist/lib/environment/store.d.ts +23 -0
- package/dist/lib/environment/store.js +123 -0
- package/dist/lib/environment/tar.d.ts +27 -0
- package/dist/lib/environment/tar.js +219 -0
- package/dist/lib/files.d.ts +66 -0
- package/dist/lib/files.js +233 -0
- package/dist/lib/git-host.d.ts +579 -0
- package/dist/lib/git-host.js +1363 -0
- package/dist/lib/home-file.d.ts +124 -0
- package/dist/lib/home-file.js +288 -0
- package/dist/lib/instance.d.ts +63 -0
- package/dist/lib/instance.js +130 -0
- package/dist/lib/words.d.ts +32 -0
- package/dist/lib/words.js +27 -0
- package/dist/lint.js +8 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +7 -0
- package/dist/testing/standin-registry.d.ts +94 -0
- package/dist/testing/standin-registry.js +449 -0
- package/package.json +37 -3
- package/dist/attached-cli.d.ts +0 -13
- package/dist/attached-cli.js +0 -247
- package/dist/attached-client.d.ts +0 -36
- package/dist/attached-client.js +0 -189
- package/dist/generated-protocol.d.ts +0 -2
- package/dist/generated-protocol.js +0 -6
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
3
|
+
// `spex export <org>/<pkg>` (cli-23, environments-10, environments-42,
|
|
4
|
+
// DR-174): a spec package under development built at
|
|
5
|
+
// `spex-packages/<org>/<pkg>/` under the environment's root, in the
|
|
6
|
+
// release layout the library reads, by copying the project's own files,
|
|
7
|
+
// which stay where they are. A first export takes its artifacts from
|
|
8
|
+
// `--skill` and `--spec` and writes `meta.yaml` with the kinds it
|
|
9
|
+
// `provides`, a README and the root's LICENSE; a later one keeps
|
|
10
|
+
// `meta.yaml` as the author left it, adding an entry per artifact a flag
|
|
11
|
+
// adds, and refreshes every artifact it names from the project by
|
|
12
|
+
// identity: the spec `<pkg>.md` wherever it stands under `specs/`, a
|
|
13
|
+
// skill from an agent folder of the root holding a folder of its name
|
|
14
|
+
// that no placement wrote. A playbook, a source or an applet stays as
|
|
15
|
+
// it is: the folder is its home. The spec's citations are rewritten for
|
|
16
|
+
// the release, each one removed or reduced printed as a warning. It
|
|
17
|
+
// requests nothing: the project has its files in place. Every rule is
|
|
18
|
+
// checked before anything is written; a refusal writes nothing.
|
|
19
|
+
import { chmodSync, copyFileSync, lstatSync, mkdirSync, readdirSync, readFileSync, renameSync, rmdirSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
20
|
+
import { randomBytes } from "node:crypto";
|
|
21
|
+
import { basename, dirname, join, posix, relative, resolve, sep } from "node:path";
|
|
22
|
+
import { parseDocument } from "yaml";
|
|
23
|
+
import { packageNameRefusal, parseManifestText, providedArtifacts, readPlacedRecord, rewriteForRelease, serializeManifest, } from "../lib/environment/index.js";
|
|
24
|
+
import { Environment, isDirectory } from "./environment.js";
|
|
25
|
+
import { exportedIn, projectFolders, table } from "./settle.js";
|
|
26
|
+
import { misuse, needs, Refusal } from "./run.js";
|
|
27
|
+
function refuse(message) {
|
|
28
|
+
throw new Refusal(message);
|
|
29
|
+
}
|
|
30
|
+
/** A lowercase kebab-case name of at most 64 characters: an org, a
|
|
31
|
+
* package's name, and an Agent Skills name alike (environments-1). */
|
|
32
|
+
const KEBAB = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
33
|
+
const isName = (value) => value.length <= 64 && KEBAB.test(value);
|
|
34
|
+
// BCP 47's langtag in its common form, or a private-use tag, as the
|
|
35
|
+
// core reads a release's language folders.
|
|
36
|
+
const LANGTAG = new RegExp("^(?:" +
|
|
37
|
+
"(?:[a-z]{2,3}(?:-[a-z]{3}){0,3}|[a-z]{4}|[a-z]{5,8})" +
|
|
38
|
+
"(?:-[a-z]{4})?" +
|
|
39
|
+
"(?:-(?:[a-z]{2}|\\d{3}))?" +
|
|
40
|
+
"(?:-(?:[a-z\\d]{5,8}|\\d[a-z\\d]{3}))*" +
|
|
41
|
+
"(?:-[\\da-wyz](?:-[a-z\\d]{2,8})+)*" +
|
|
42
|
+
"(?:-x(?:-[a-z\\d]{1,8})+)?" +
|
|
43
|
+
"|x(?:-[a-z\\d]{1,8})+" +
|
|
44
|
+
")$", "i");
|
|
45
|
+
const VALUED = new Set(["skill", "spec", "language", "description", "license"]);
|
|
46
|
+
// eslint-disable-next-line no-control-regex
|
|
47
|
+
const CONTROL = /[\u0000-\u001f\u007f-\u009f]/;
|
|
48
|
+
/** Parse the whole invocation before reading or writing anything. */
|
|
49
|
+
function parseExport(args) {
|
|
50
|
+
const words = [];
|
|
51
|
+
const skills = [];
|
|
52
|
+
const single = {};
|
|
53
|
+
for (let i = 0; i < args.length; i++) {
|
|
54
|
+
const arg = args[i];
|
|
55
|
+
if (!arg.startsWith("-")) {
|
|
56
|
+
words.push(arg);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const match = /^--([a-z-]+)(?:=([\s\S]*))?$/.exec(arg);
|
|
60
|
+
const key = match?.[1];
|
|
61
|
+
if (!key || !VALUED.has(key))
|
|
62
|
+
throw misuse("export", `unknown option ${arg.split("=")[0]}`);
|
|
63
|
+
const inline = match[2];
|
|
64
|
+
const value = inline ?? args[++i];
|
|
65
|
+
if (value === undefined || value === "" || (inline === undefined && value.startsWith("-")))
|
|
66
|
+
throw misuse("export", `--${key} needs ${needs("export", key)}`);
|
|
67
|
+
if (key === "skill") {
|
|
68
|
+
skills.push(value);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (Object.hasOwn(single, key))
|
|
72
|
+
throw misuse("export", `--${key} given twice — give it once`);
|
|
73
|
+
single[key] = value;
|
|
74
|
+
}
|
|
75
|
+
if (words.length === 0)
|
|
76
|
+
throw misuse("export", "missing <org>/<pkg>");
|
|
77
|
+
if (words.length > 1)
|
|
78
|
+
throw misuse("export", `unexpected argument ${words[1]}`);
|
|
79
|
+
const parts = words[0].split("/");
|
|
80
|
+
if (parts.length !== 2 || !isName(parts[0]) || !isName(parts[1]))
|
|
81
|
+
refuse(packageNameRefusal(words[0]));
|
|
82
|
+
const language = single.language ?? "en";
|
|
83
|
+
if (!LANGTAG.test(language) || language.length > 64)
|
|
84
|
+
refuse(`--language ${JSON.stringify(language)} is not a language tag — use one like en or zh-Hans`);
|
|
85
|
+
if (single.description !== undefined && CONTROL.test(single.description.replace(/[\n\t]/g, " ")))
|
|
86
|
+
refuse("--description holds control characters — remove them");
|
|
87
|
+
if (single.license !== undefined && CONTROL.test(single.license))
|
|
88
|
+
refuse("--license holds control characters — remove them");
|
|
89
|
+
if (single.license !== undefined && !single.license.trim())
|
|
90
|
+
throw misuse("export", `--license needs ${needs("export", "license")}`);
|
|
91
|
+
if (single.description !== undefined && !single.description.trim())
|
|
92
|
+
throw misuse("export", `--description needs ${needs("export", "description")}`);
|
|
93
|
+
return {
|
|
94
|
+
org: parts[0],
|
|
95
|
+
name: parts[1],
|
|
96
|
+
skills,
|
|
97
|
+
...(single.spec !== undefined ? { spec: single.spec } : {}),
|
|
98
|
+
language,
|
|
99
|
+
...(single.description !== undefined ? { description: single.description.trim() } : {}),
|
|
100
|
+
...(single.license !== undefined ? { license: single.license.trim() } : {}),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// -- SKILL.md frontmatter ------------------------------------------------
|
|
104
|
+
/** Plain YAML scalars the core schema reads as no string: a skill named
|
|
105
|
+
* so would be refused by the core's reader. */
|
|
106
|
+
const NON_STRING = /^(?:~|null|Null|NULL|true|True|TRUE|false|False|FALSE|[-+]?[0-9]+|0o[0-7]+|0x[0-9a-fA-F]+|[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)(?:[eE][-+]?[0-9]+)?|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/;
|
|
107
|
+
/** A plain value YAML refuses in a block mapping, so the core's reader
|
|
108
|
+
* reads no frontmatter at all. */
|
|
109
|
+
const REFUSED = Symbol("refused");
|
|
110
|
+
/** The top-level string fields of a SKILL.md's YAML frontmatter that
|
|
111
|
+
* matter here — `name` and `description` — read from the common YAML
|
|
112
|
+
* forms: plain, single- or double-quoted, and `|` or `>` blocks. A field
|
|
113
|
+
* of another form reads as absent. The frontmatter is found as a
|
|
114
|
+
* release's readers find it, from the text's first character: nothing
|
|
115
|
+
* before `---`, a byte order mark included, is skipped. */
|
|
116
|
+
export function skillFrontmatter(text) {
|
|
117
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(text);
|
|
118
|
+
if (!match)
|
|
119
|
+
return {};
|
|
120
|
+
const lines = match[1].split(/\r?\n/);
|
|
121
|
+
const out = {};
|
|
122
|
+
for (let i = 0; i < lines.length; i++) {
|
|
123
|
+
const field = /^(name|description)[ \t]*:(?:[ \t]+(.*)|)$/.exec(lines[i]);
|
|
124
|
+
if (!field)
|
|
125
|
+
continue;
|
|
126
|
+
const key = field[1];
|
|
127
|
+
// The value's continuation: the lines indented below its key.
|
|
128
|
+
const rest = [];
|
|
129
|
+
while (i + 1 < lines.length && (/^[ \t]/.test(lines[i + 1]) || lines[i + 1].trim() === ""))
|
|
130
|
+
rest.push(lines[++i]);
|
|
131
|
+
while (rest.length && rest[rest.length - 1].trim() === "")
|
|
132
|
+
rest.pop();
|
|
133
|
+
const value = scalar((field[2] ?? "").trim(), rest);
|
|
134
|
+
if (value === REFUSED)
|
|
135
|
+
out.unreadable ??= key;
|
|
136
|
+
else if (value !== undefined)
|
|
137
|
+
out[key] = value;
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
141
|
+
function scalar(head, rest) {
|
|
142
|
+
const block = /^([|>])[-+]?[1-9]?(?:[ \t]+#.*)?$/.exec(head);
|
|
143
|
+
if (block) {
|
|
144
|
+
const indent = Math.min(...rest.filter((line) => line.trim()).map((line) => /^[ \t]*/.exec(line)[0].length));
|
|
145
|
+
const body = rest.map((line) => line.slice(Math.min(indent, line.length)));
|
|
146
|
+
if (block[1] === "|")
|
|
147
|
+
return body.join("\n").trim() || undefined;
|
|
148
|
+
return body.join("\n").split(/\n[ \t]*\n/).map((p) => p.split("\n").map((l) => l.trim()).join(" ")).join("\n").trim() || undefined;
|
|
149
|
+
}
|
|
150
|
+
// A nested mapping is no string.
|
|
151
|
+
if (head === "" && rest[0] !== undefined && /^[ \t]+[^ \t#'"][^:]*:(?:[ \t]|$)/.test(rest[0]))
|
|
152
|
+
return undefined;
|
|
153
|
+
const joined = [head, ...rest.map((line) => line.trim())].filter((part) => part !== "").join(" ");
|
|
154
|
+
if (joined.startsWith('"')) {
|
|
155
|
+
const end = /^"((?:[^"\\]|\\.)*)"[ \t]*(?:#.*)?$/.exec(joined);
|
|
156
|
+
if (!end)
|
|
157
|
+
return undefined;
|
|
158
|
+
// An escaped space is a space; a tab stands as it is.
|
|
159
|
+
try {
|
|
160
|
+
return JSON.parse(`"${end[1].replace(/\\(?=[ \t])/g, "").replace(/\t/g, "\\t")}"`);
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (joined.startsWith("'")) {
|
|
167
|
+
const end = /^'((?:[^']|'')*)'[ \t]*(?:#.*)?$/.exec(joined);
|
|
168
|
+
return end ? end[1].replace(/''/g, "'") : undefined;
|
|
169
|
+
}
|
|
170
|
+
const plain = joined.replace(/[ \t]+#.*$/, "").trim();
|
|
171
|
+
if (!plain || NON_STRING.test(plain) || /^[[{&*!|>%@`]/.test(plain))
|
|
172
|
+
return undefined;
|
|
173
|
+
// `key: value: more` is no YAML: the whole frontmatter is refused.
|
|
174
|
+
if (/:[ \t]/.test(plain) || plain.endsWith(":"))
|
|
175
|
+
return REFUSED;
|
|
176
|
+
return plain;
|
|
177
|
+
}
|
|
178
|
+
// -- the spec's Intent ---------------------------------------------------
|
|
179
|
+
/** The first paragraph under a spec's Intent heading, its lines joined. */
|
|
180
|
+
export function intentParagraph(text) {
|
|
181
|
+
const lines = text.replace(/^/, "").split(/\r?\n/);
|
|
182
|
+
let i = lines.findIndex((line) => /^#{1,6}[ \t]+Intent[ \t]*#*[ \t]*$/i.test(line));
|
|
183
|
+
if (i < 0)
|
|
184
|
+
return undefined;
|
|
185
|
+
i++;
|
|
186
|
+
while (i < lines.length && lines[i].trim() === "")
|
|
187
|
+
i++;
|
|
188
|
+
const paragraph = [];
|
|
189
|
+
while (i < lines.length && lines[i].trim() !== "" && !/^#{1,6}(?:[ \t]|$)/.test(lines[i]))
|
|
190
|
+
paragraph.push(lines[i++].trim());
|
|
191
|
+
return paragraph.join(" ") || undefined;
|
|
192
|
+
}
|
|
193
|
+
// -- the license ---------------------------------------------------------
|
|
194
|
+
/** The license a root's LICENSE names (cli-23). */
|
|
195
|
+
export function detectLicense(text) {
|
|
196
|
+
const head = (text ?? "").replace(/^/, "").trimStart();
|
|
197
|
+
if (head.startsWith("Apache License"))
|
|
198
|
+
return "Apache-2.0";
|
|
199
|
+
if (head.startsWith("MIT License"))
|
|
200
|
+
return "MIT";
|
|
201
|
+
return "Apache-2.0";
|
|
202
|
+
}
|
|
203
|
+
function lstatOrNull(path) {
|
|
204
|
+
try {
|
|
205
|
+
return lstatSync(path);
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
if (error.code === "ENOENT" || error.code === "ENOTDIR")
|
|
209
|
+
return null;
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function isFile(path) {
|
|
214
|
+
try {
|
|
215
|
+
return statSync(path).isFile();
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/** A skill folder read whole: only folders and regular files, no link.
|
|
222
|
+
* `label` names it in a refusal: the option and its folder as given, or
|
|
223
|
+
* the agent folder it was found in. */
|
|
224
|
+
function readSkill(folder, label) {
|
|
225
|
+
const stat = lstatOrNull(folder);
|
|
226
|
+
if (stat?.isSymbolicLink())
|
|
227
|
+
refuse(`${label} is a link — name the skill's own folder`);
|
|
228
|
+
if (!stat?.isDirectory())
|
|
229
|
+
refuse(`${label} is not a folder holding a SKILL.md`);
|
|
230
|
+
const dirs = [];
|
|
231
|
+
const files = [];
|
|
232
|
+
const walk = (relativeDir) => {
|
|
233
|
+
for (const entry of readdirSync(join(folder, relativeDir)).sort()) {
|
|
234
|
+
const path = relativeDir ? `${relativeDir}/${entry}` : entry;
|
|
235
|
+
const entryStat = lstatSync(join(folder, path));
|
|
236
|
+
if (entryStat.isSymbolicLink())
|
|
237
|
+
refuse(`${label} holds a link at ${path} — a package holds files only`);
|
|
238
|
+
if (entryStat.isDirectory()) {
|
|
239
|
+
dirs.push(path);
|
|
240
|
+
walk(path);
|
|
241
|
+
}
|
|
242
|
+
else if (entryStat.isFile())
|
|
243
|
+
files.push(path);
|
|
244
|
+
else
|
|
245
|
+
refuse(`${label} holds a special file at ${path} — a package holds files only`);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
walk("");
|
|
249
|
+
if (!files.includes("SKILL.md"))
|
|
250
|
+
refuse(`${label} holds no SKILL.md`);
|
|
251
|
+
const text = readFileSync(join(folder, "SKILL.md"), "utf8");
|
|
252
|
+
// A release's readers find the frontmatter from the first byte, so a
|
|
253
|
+
// byte order mark would hide the name from the app and the registry.
|
|
254
|
+
if (text.startsWith(""))
|
|
255
|
+
refuse(`${label}: its SKILL.md begins with a byte order mark, which hides its name — save it as UTF-8 without one`);
|
|
256
|
+
const frontmatter = skillFrontmatter(text);
|
|
257
|
+
if (frontmatter.unreadable)
|
|
258
|
+
refuse(`${label}: its SKILL.md's ${frontmatter.unreadable} holds ": " unquoted, so its name cannot be read — put the value in quotes`);
|
|
259
|
+
if (frontmatter.name === undefined || !isName(frontmatter.name))
|
|
260
|
+
refuse(`${label}: its SKILL.md names no skill — give it a name of lowercase letters, digits and single hyphens, at most 64 characters`);
|
|
261
|
+
return { folder, id: frontmatter.name, ...(frontmatter.description ? { description: frontmatter.description } : {}), dirs, files };
|
|
262
|
+
}
|
|
263
|
+
/** A path under the root as a reader sees it, `/`-separated. */
|
|
264
|
+
function shownAt(root, path) {
|
|
265
|
+
return relative(root, path).split(sep).join("/") || ".";
|
|
266
|
+
}
|
|
267
|
+
/** A skill of the package found in the project by its id (cli-23): a
|
|
268
|
+
* folder of that name in an agent folder of the root that no placement
|
|
269
|
+
* wrote — not listed in that folder's exports manifest — a real folder
|
|
270
|
+
* before a link; null where none stands. */
|
|
271
|
+
function findSkill(root, id) {
|
|
272
|
+
const found = [];
|
|
273
|
+
for (const { folder } of projectFolders()) {
|
|
274
|
+
const path = join(root, ...folder.split("/"), id);
|
|
275
|
+
const stat = lstatOrNull(path);
|
|
276
|
+
if (!stat || !(stat.isDirectory() || stat.isSymbolicLink()))
|
|
277
|
+
continue;
|
|
278
|
+
if (exportedIn(root, folder).includes(id))
|
|
279
|
+
continue;
|
|
280
|
+
found.push({ folder: path, shown: `${folder}/${id}`, real: stat.isDirectory() });
|
|
281
|
+
}
|
|
282
|
+
return found.find((entry) => entry.real) ?? found[0] ?? null;
|
|
283
|
+
}
|
|
284
|
+
/** The spec `<name>.md` found under the root's `specs/`, whose
|
|
285
|
+
* basenames are unique (meta-10), in a walk of sorted entries that
|
|
286
|
+
* follows no link and passes over a file another package's install
|
|
287
|
+
* placed there; null where none stands. */
|
|
288
|
+
function findSpec(root, name, placedByOthers) {
|
|
289
|
+
const base = join(root, "specs");
|
|
290
|
+
const walk = (relativeDir) => {
|
|
291
|
+
let entries;
|
|
292
|
+
try {
|
|
293
|
+
entries = readdirSync(join(base, ...relativeDir.split("/").filter(Boolean))).sort();
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
for (const entry of entries) {
|
|
299
|
+
const path = relativeDir ? `${relativeDir}/${entry}` : entry;
|
|
300
|
+
const full = join(base, ...path.split("/"));
|
|
301
|
+
if (lstatOrNull(full)?.isDirectory()) {
|
|
302
|
+
const inner = walk(path);
|
|
303
|
+
if (inner !== null)
|
|
304
|
+
return inner;
|
|
305
|
+
}
|
|
306
|
+
else if (entry === `${name}.md` && isFile(full) && !placedByOthers.has(`specs/${path}`)) {
|
|
307
|
+
return full;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return null;
|
|
311
|
+
};
|
|
312
|
+
return walk("");
|
|
313
|
+
}
|
|
314
|
+
// -- the packages a citation may name ------------------------------------
|
|
315
|
+
/** A manifest standing in a folder, or null where none reads. */
|
|
316
|
+
function manifestIn(dir) {
|
|
317
|
+
if (dir === null)
|
|
318
|
+
return null;
|
|
319
|
+
try {
|
|
320
|
+
return parseManifestText(readFileSync(join(dir, "meta.yaml"), "utf8")).manifest;
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/** Whether a release provides its spec (environments-1, DR-174). */
|
|
327
|
+
function providesSpec(manifest) {
|
|
328
|
+
return manifest.artifacts[manifest.name]?.kind === "spec" && providedArtifacts(manifest).has(manifest.name);
|
|
329
|
+
}
|
|
330
|
+
/** The `<org>/<pkg>` names of the folders two levels below the root's
|
|
331
|
+
* `spex-packages/`, in name order. */
|
|
332
|
+
function developedNames(root) {
|
|
333
|
+
const base = join(root, "spex-packages");
|
|
334
|
+
const entries = (dir) => {
|
|
335
|
+
try {
|
|
336
|
+
return readdirSync(dir).filter((entry) => !entry.startsWith(".") && isDirectory(join(dir, entry))).sort();
|
|
337
|
+
}
|
|
338
|
+
catch {
|
|
339
|
+
return [];
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
return entries(base).flatMap((org) => entries(join(base, org)).map((pkg) => `${org}/${pkg}`));
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* The package whose provided spec a specs-relative file is, as building
|
|
346
|
+
* a release's spec asks it (environments-42): the package whose install
|
|
347
|
+
* placed that very file, by the placed specs' record; else, by the
|
|
348
|
+
* file's basename `<pkg>.md`, the one package under development at
|
|
349
|
+
* `spex-packages/<org>/<pkg>/` providing its spec, or, where two or more
|
|
350
|
+
* do, their claims, which leave the file no package's. Any other file —
|
|
351
|
+
* the project's own, though an installed package's spec shares its
|
|
352
|
+
* basename, or one outside `specs/` — is no package's.
|
|
353
|
+
*/
|
|
354
|
+
function specOwners(root) {
|
|
355
|
+
const placed = new Map();
|
|
356
|
+
for (const [name, spec] of Object.entries(readPlacedRecord(root)?.specs ?? {}))
|
|
357
|
+
placed.set(posix.normalize(spec.path), name);
|
|
358
|
+
// Each basename with the packages claiming it, in name order.
|
|
359
|
+
const byFile = new Map();
|
|
360
|
+
for (const name of developedNames(root)) {
|
|
361
|
+
const manifest = manifestIn(join(root, "spex-packages", ...name.split("/")));
|
|
362
|
+
if (manifest === null || `${manifest.org}/${manifest.name}` !== name || !providesSpec(manifest))
|
|
363
|
+
continue;
|
|
364
|
+
const file = `${manifest.name}.md`;
|
|
365
|
+
byFile.set(file, [...(byFile.get(file) ?? []), name]);
|
|
366
|
+
}
|
|
367
|
+
return (specsPath) => {
|
|
368
|
+
const path = posix.normalize(specsPath);
|
|
369
|
+
if (path === ".." || path.startsWith("../") || posix.isAbsolute(path))
|
|
370
|
+
return null;
|
|
371
|
+
const recorded = placed.get(`specs/${path}`);
|
|
372
|
+
if (recorded !== undefined)
|
|
373
|
+
return recorded;
|
|
374
|
+
const claims = byFile.get(posix.basename(path)) ?? [];
|
|
375
|
+
if (claims.length === 0)
|
|
376
|
+
return null;
|
|
377
|
+
return claims.length === 1 ? claims[0] : { claims };
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
/** A warning of the rewrite as a reader reads it (cli-23): the citing
|
|
381
|
+
* item and what it cited, with the packages claiming it alike. */
|
|
382
|
+
function warningLine(warning) {
|
|
383
|
+
if (warning.kind === "record")
|
|
384
|
+
return `Warning: ${warning.item} links ${warning.target} — the package keeps its text, not the link`;
|
|
385
|
+
const target = posix.normalize(`specs/${warning.target}`);
|
|
386
|
+
if (warning.claims !== undefined)
|
|
387
|
+
return `Warning: ${warning.item} cites ${target}, which ${claimants(warning.claims)} claim — left out of the package, its phrase kept`;
|
|
388
|
+
return `Warning: ${warning.item} cites ${target}, a spec of no package — left out of the package, its phrase kept`;
|
|
389
|
+
}
|
|
390
|
+
/** "a and b both", or "a, b and c all". */
|
|
391
|
+
function claimants(names) {
|
|
392
|
+
const listed = names.length === 2 ? names.join(" and ") : `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
|
|
393
|
+
return `${listed} ${names.length === 2 ? "both" : "all"}`;
|
|
394
|
+
}
|
|
395
|
+
function copyFile(from, to) {
|
|
396
|
+
copyFileSync(from, to);
|
|
397
|
+
chmodSync(to, statSync(from).mode & 0o777);
|
|
398
|
+
}
|
|
399
|
+
function skillPiece(skill, language) {
|
|
400
|
+
return {
|
|
401
|
+
path: `skills/${language}/${skill.id}`,
|
|
402
|
+
write: (into) => {
|
|
403
|
+
mkdirSync(into, { recursive: true });
|
|
404
|
+
for (const dir of skill.dirs)
|
|
405
|
+
mkdirSync(join(into, ...dir.split("/")), { recursive: true });
|
|
406
|
+
for (const file of skill.files)
|
|
407
|
+
copyFile(join(skill.folder, ...file.split("/")), join(into, ...file.split("/")));
|
|
408
|
+
},
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
function filePiece(path, bytes) {
|
|
412
|
+
return { path, write: (at) => writeFileSync(at, bytes) };
|
|
413
|
+
}
|
|
414
|
+
/** Put a staged piece at its place, the one standing there moved aside
|
|
415
|
+
* first and back where the move in fails. */
|
|
416
|
+
function swap(from, to, aside) {
|
|
417
|
+
mkdirSync(dirname(to), { recursive: true });
|
|
418
|
+
const had = lstatOrNull(to) !== null;
|
|
419
|
+
if (had)
|
|
420
|
+
renameSync(to, aside);
|
|
421
|
+
try {
|
|
422
|
+
renameSync(from, to);
|
|
423
|
+
}
|
|
424
|
+
catch (error) {
|
|
425
|
+
if (had)
|
|
426
|
+
renameSync(aside, to);
|
|
427
|
+
throw error;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
/** `spex export` (cli-23): build the folder from the project's files. */
|
|
431
|
+
export const exportPackage = async (args) => {
|
|
432
|
+
const cwd = process.cwd();
|
|
433
|
+
const options = parseExport(args);
|
|
434
|
+
const { org, name } = options;
|
|
435
|
+
const pkg = `${org}/${name}`;
|
|
436
|
+
// The environment's root, whose placed specs the spec's citations may
|
|
437
|
+
// name; nothing is requested of it.
|
|
438
|
+
const env = new Environment(cwd);
|
|
439
|
+
const root = env.root;
|
|
440
|
+
const registry = env.registryOf(env.readRequests()?.requests ?? null);
|
|
441
|
+
// The org is a folder, as npm's scopes are, so two orgs' packages of
|
|
442
|
+
// one name stand apart (environments-10, DR-165).
|
|
443
|
+
const packages = join(root, "spex-packages");
|
|
444
|
+
const parent = join(packages, org);
|
|
445
|
+
const destination = join(parent, name);
|
|
446
|
+
const folder = `spex-packages/${org}/${name}`;
|
|
447
|
+
const packagesStat = lstatOrNull(packages);
|
|
448
|
+
if (packagesStat && !packagesStat.isDirectory())
|
|
449
|
+
refuse(`spex-packages in ${root} is not a folder — move it aside, then retry`);
|
|
450
|
+
const parentStat = lstatOrNull(parent);
|
|
451
|
+
if (parentStat && !parentStat.isDirectory())
|
|
452
|
+
refuse(`spex-packages/${org} in ${root} is not a folder — move it aside, then retry`);
|
|
453
|
+
const destinationStat = lstatOrNull(destination);
|
|
454
|
+
if (destinationStat && !destinationStat.isDirectory())
|
|
455
|
+
refuse(`${folder} in ${root} is not a folder — move it aside, then retry`);
|
|
456
|
+
// A later export keeps the manifest the author left (cli-23).
|
|
457
|
+
const metaFile = join(destination, "meta.yaml");
|
|
458
|
+
const metaText = destinationStat && isFile(metaFile) ? readFileSync(metaFile, "utf8") : null;
|
|
459
|
+
let kept = null;
|
|
460
|
+
if (metaText !== null) {
|
|
461
|
+
const { manifest, issues } = parseManifestText(metaText);
|
|
462
|
+
if (!manifest)
|
|
463
|
+
refuse(`${folder}/meta.yaml cannot be read: ${issues.map((issue) => issue.message).join("; ")} — fix it, then retry`);
|
|
464
|
+
const held = `${manifest.org}/${manifest.name}`;
|
|
465
|
+
if (held !== pkg)
|
|
466
|
+
refuse(`${folder}/ holds ${held}, not ${pkg} — fix the name in its meta.yaml, or export ${held}`);
|
|
467
|
+
kept = manifest;
|
|
468
|
+
}
|
|
469
|
+
if (kept === null && options.skills.length === 0 && options.spec === undefined)
|
|
470
|
+
refuse("name at least one skill or spec — --skill <folder> or --spec <file>");
|
|
471
|
+
const hasSpec = options.spec !== undefined || kept?.artifacts[name]?.kind === "spec";
|
|
472
|
+
// The skills the flags name, each read whole.
|
|
473
|
+
const flagged = [];
|
|
474
|
+
for (const argument of options.skills) {
|
|
475
|
+
const skill = readSkill(resolve(cwd, argument), `--skill ${argument}`);
|
|
476
|
+
if (flagged.some((other) => other.id === skill.id))
|
|
477
|
+
refuse(`two skills are named ${skill.id} — give each its own name in its SKILL.md`);
|
|
478
|
+
if (hasSpec && skill.id === name)
|
|
479
|
+
refuse(`the skill ${skill.id} takes the spec's name ${name} — rename the skill or the package`);
|
|
480
|
+
const other = kept?.artifacts[skill.id];
|
|
481
|
+
if (other !== undefined && other.kind !== "skill")
|
|
482
|
+
refuse(`${folder}/ holds a ${other.kind} named ${skill.id} already — give the skill its own name in its SKILL.md`);
|
|
483
|
+
flagged.push(skill);
|
|
484
|
+
}
|
|
485
|
+
if (options.spec !== undefined && kept?.artifacts[name] !== undefined && kept.artifacts[name].kind !== "spec") {
|
|
486
|
+
refuse(`the ${kept.artifacts[name].kind} ${name} takes the spec's name ${name} — rename it or the package`);
|
|
487
|
+
}
|
|
488
|
+
// The spec the flag names.
|
|
489
|
+
const placedByOthers = new Set(Object.entries(readPlacedRecord(root)?.specs ?? {}).filter(([owner]) => owner !== pkg).map(([, spec]) => posix.normalize(spec.path)));
|
|
490
|
+
let specFile = null;
|
|
491
|
+
if (options.spec !== undefined) {
|
|
492
|
+
specFile = resolve(cwd, options.spec);
|
|
493
|
+
if (!isFile(specFile))
|
|
494
|
+
refuse(`--spec ${options.spec} is not a file — give your spec file, ${name}.md under specs/`);
|
|
495
|
+
if (basename(specFile) !== `${name}.md`)
|
|
496
|
+
refuse(`the spec file must be named ${name}.md, as its items are ${name}-<N> — rename it or the package`);
|
|
497
|
+
}
|
|
498
|
+
// Each artifact the manifest names and no flag does, refreshed from
|
|
499
|
+
// the project by identity (cli-23); one found nowhere is reported and
|
|
500
|
+
// stands as it was.
|
|
501
|
+
const refreshed = [];
|
|
502
|
+
const held = [];
|
|
503
|
+
const from = new Map();
|
|
504
|
+
for (const [id, artifact] of Object.entries(kept?.artifacts ?? {})) {
|
|
505
|
+
if (artifact.kind === "skill") {
|
|
506
|
+
if (flagged.some((skill) => skill.id === id))
|
|
507
|
+
continue;
|
|
508
|
+
const found = findSkill(root, id);
|
|
509
|
+
if (found === null) {
|
|
510
|
+
held.push({ kind: "skill", id, note: `not found in ${projectFolders().map((entry) => entry.folder).join(" or ")} — left as it was` });
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
const label = `the skill ${id} in ${found.shown}`;
|
|
514
|
+
const skill = readSkill(found.folder, label);
|
|
515
|
+
if (skill.id !== id)
|
|
516
|
+
refuse(`${label}: its SKILL.md names ${skill.id} — name it ${id}, or export it with --skill`);
|
|
517
|
+
refreshed.push(skill);
|
|
518
|
+
from.set(`skill:${id}`, `${found.shown}/`);
|
|
519
|
+
}
|
|
520
|
+
else if (artifact.kind === "spec") {
|
|
521
|
+
if (specFile !== null)
|
|
522
|
+
continue;
|
|
523
|
+
specFile = findSpec(root, name, placedByOthers);
|
|
524
|
+
if (specFile === null)
|
|
525
|
+
held.push({ kind: "spec", id, note: `no ${name}.md under specs/ — left as it was` });
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
held.push({ kind: artifact.kind, id, note: "left as it is" });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
let specText = null;
|
|
532
|
+
if (specFile !== null) {
|
|
533
|
+
specText = readFileSync(specFile, "utf8");
|
|
534
|
+
from.set(`spec:${name}`, shownAt(root, specFile));
|
|
535
|
+
}
|
|
536
|
+
for (const skill of flagged)
|
|
537
|
+
from.set(`skill:${skill.id}`, `${shownAt(root, skill.folder)}/`);
|
|
538
|
+
// A first export's description and license (cli-23).
|
|
539
|
+
let description;
|
|
540
|
+
let license;
|
|
541
|
+
let licenseText;
|
|
542
|
+
if (kept === null) {
|
|
543
|
+
description = options.description
|
|
544
|
+
?? flagged[0]?.description
|
|
545
|
+
?? (specText !== null ? intentParagraph(specText) : undefined);
|
|
546
|
+
if (!description)
|
|
547
|
+
refuse("no description in the first skill's SKILL.md or under the spec's Intent heading — pass --description <text>");
|
|
548
|
+
const licenseFile = join(root, "LICENSE");
|
|
549
|
+
if (isFile(licenseFile))
|
|
550
|
+
licenseText = readFileSync(licenseFile);
|
|
551
|
+
license = options.license ?? detectLicense(licenseText?.toString("utf8"));
|
|
552
|
+
}
|
|
553
|
+
// The spec, its citations rewritten for the release (environments-42).
|
|
554
|
+
let warnings = [];
|
|
555
|
+
let releaseSpec = null;
|
|
556
|
+
if (specFile !== null && specText !== null) {
|
|
557
|
+
const selfPath = relative(join(root, "specs"), specFile).split(sep).join("/");
|
|
558
|
+
const rewritten = rewriteForRelease(specText, { selfPath, packageOf: specOwners(root) });
|
|
559
|
+
releaseSpec = rewritten.text.replace(/\r\n/g, "\n");
|
|
560
|
+
warnings = rewritten.warnings;
|
|
561
|
+
}
|
|
562
|
+
// The pieces to write, the manifest last.
|
|
563
|
+
const languageOf = (id) => kept?.artifacts[id]?.language ?? options.language;
|
|
564
|
+
const added = [
|
|
565
|
+
...flagged.filter((skill) => kept?.artifacts[skill.id] === undefined).map((skill) => ({ id: skill.id, kind: "skill" })),
|
|
566
|
+
...(options.spec !== undefined && kept?.artifacts[name] === undefined ? [{ id: name, kind: "spec" }] : []),
|
|
567
|
+
];
|
|
568
|
+
const pieces = [
|
|
569
|
+
...[...flagged, ...refreshed].map((skill) => skillPiece(skill, languageOf(skill.id))),
|
|
570
|
+
...(releaseSpec !== null ? [filePiece(`specs/${languageOf(name)}/${name}.md`, releaseSpec)] : []),
|
|
571
|
+
];
|
|
572
|
+
let manifest;
|
|
573
|
+
if (kept === null) {
|
|
574
|
+
manifest = {
|
|
575
|
+
format: 2, org, name, version: "0.1.0", description: description, license: license, dependencies: {},
|
|
576
|
+
// The kinds given, in the order the artifacts are listed.
|
|
577
|
+
provides: [...(flagged.length > 0 ? ["skill"] : []), ...(options.spec !== undefined ? ["spec"] : [])],
|
|
578
|
+
artifacts: Object.fromEntries([
|
|
579
|
+
...flagged.map((skill) => [skill.id, { kind: "skill", language: options.language, requires: [] }]),
|
|
580
|
+
...(options.spec !== undefined ? [[name, { kind: "spec", language: options.language, requires: [] }]] : []),
|
|
581
|
+
]),
|
|
582
|
+
};
|
|
583
|
+
pieces.push(filePiece("README.md", `# ${pkg}\n\n${description}\n`));
|
|
584
|
+
if (licenseText)
|
|
585
|
+
pieces.push(filePiece("LICENSE", licenseText));
|
|
586
|
+
pieces.push(filePiece("meta.yaml", serializeManifest(manifest)));
|
|
587
|
+
}
|
|
588
|
+
else {
|
|
589
|
+
manifest = kept;
|
|
590
|
+
if (added.length > 0) {
|
|
591
|
+
// The author's file edited in place: its comments, order and
|
|
592
|
+
// fields kept, an entry added per artifact a flag adds.
|
|
593
|
+
const doc = parseDocument(metaText);
|
|
594
|
+
for (const artifact of added)
|
|
595
|
+
doc.setIn(["artifacts", artifact.id], doc.createNode({ kind: artifact.kind, language: options.language }));
|
|
596
|
+
manifest = { ...kept, artifacts: { ...kept.artifacts, ...Object.fromEntries(added.map((artifact) => [artifact.id, { kind: artifact.kind, language: options.language, requires: [] }])) } };
|
|
597
|
+
pieces.push(filePiece("meta.yaml", doc.toString({ lineWidth: 0 })));
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
// Everything is staged beside the folder: a first export's folder is
|
|
601
|
+
// renamed into place whole; a later one's pieces are swapped in one by
|
|
602
|
+
// one, so a session working in the folder keeps it.
|
|
603
|
+
if (pieces.length > 0) {
|
|
604
|
+
const madePackages = !packagesStat;
|
|
605
|
+
const madeParent = !parentStat;
|
|
606
|
+
mkdirSync(parent, { recursive: true });
|
|
607
|
+
// Made as any folder is, not owner-only as a temporary one.
|
|
608
|
+
const staging = join(parent, `.${name}.export-${randomBytes(6).toString("hex")}`);
|
|
609
|
+
mkdirSync(staging);
|
|
610
|
+
try {
|
|
611
|
+
const built = join(staging, "release");
|
|
612
|
+
mkdirSync(built);
|
|
613
|
+
for (const piece of pieces) {
|
|
614
|
+
const at = join(built, ...piece.path.split("/"));
|
|
615
|
+
mkdirSync(dirname(at), { recursive: true });
|
|
616
|
+
piece.write(at);
|
|
617
|
+
}
|
|
618
|
+
if (lstatOrNull(destination) === null)
|
|
619
|
+
renameSync(built, destination);
|
|
620
|
+
else
|
|
621
|
+
for (const [index, piece] of pieces.entries())
|
|
622
|
+
swap(join(built, ...piece.path.split("/")), join(destination, ...piece.path.split("/")), join(staging, `aside-${index}`));
|
|
623
|
+
}
|
|
624
|
+
catch (error) {
|
|
625
|
+
rmSync(staging, { recursive: true, force: true });
|
|
626
|
+
if (madeParent) {
|
|
627
|
+
try {
|
|
628
|
+
rmdirSync(parent);
|
|
629
|
+
}
|
|
630
|
+
catch { /* holds something else now */ }
|
|
631
|
+
}
|
|
632
|
+
if (madePackages) {
|
|
633
|
+
try {
|
|
634
|
+
rmdirSync(packages);
|
|
635
|
+
}
|
|
636
|
+
catch { /* holds something else now */ }
|
|
637
|
+
}
|
|
638
|
+
throw error;
|
|
639
|
+
}
|
|
640
|
+
rmSync(staging, { recursive: true, force: true });
|
|
641
|
+
}
|
|
642
|
+
console.log(`Publishing rights for ${org} are not checked — use a name you can claim at ${registry.origin}/account/orgs?scope=registry`);
|
|
643
|
+
for (const warning of warnings)
|
|
644
|
+
process.stderr.write(`${warningLine(warning)}\n`);
|
|
645
|
+
if (kept !== null && (options.description !== undefined || options.license !== undefined)) {
|
|
646
|
+
console.log("meta.yaml stays as you left it — edit its description and license there");
|
|
647
|
+
}
|
|
648
|
+
// What the folder holds, each artifact with where it came from or why
|
|
649
|
+
// it stands as it was, then the next steps (cli-23).
|
|
650
|
+
const notes = new Map(held.map((entry) => [`${entry.kind}:${entry.id}`, entry.note]));
|
|
651
|
+
const rows = Object.entries(manifest.artifacts).map(([id, artifact]) => {
|
|
652
|
+
const key = `${artifact.kind}:${id}`;
|
|
653
|
+
return [`${artifact.kind} ${id}`, from.has(key) ? `from ${from.get(key)}` : notes.get(key) ?? "left as it is"];
|
|
654
|
+
});
|
|
655
|
+
console.log([
|
|
656
|
+
`Exported ${pkg} ${manifest.version} to ${folder}/`,
|
|
657
|
+
...table(rows),
|
|
658
|
+
"Next:",
|
|
659
|
+
` spex publish ${pkg} --dry-run`,
|
|
660
|
+
` spex publish ${pkg}`,
|
|
661
|
+
].join("\n"));
|
|
662
|
+
};
|
|
663
|
+
//# sourceMappingURL=export.js.map
|