deck-plugin-sdk 1.11.0 → 1.12.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 +97 -97
- package/bin/deck-plugin.mjs +158 -158
- package/build-plugin.mjs +172 -172
- package/package.json +60 -60
- package/packages.mjs +107 -107
- package/permissions.json +252 -248
- package/publish.mjs +116 -116
- package/shim/bridge.js +253 -249
- package/shim/p2p.d.ts +1 -1
- package/shim/settings.d.ts +1 -1
- package/shim/terminals.d.ts +1 -1
- package/shim/ui.d.ts +10 -10
- package/template/AGENTS.md +81 -81
- package/template/CLAUDE.md +1 -1
- package/template/LICENSE +21 -21
- package/template/README.md +20 -20
- package/template/gitignore +4 -4
- package/template/plugin.json +10 -10
- package/template/src/assets.d.ts +16 -16
- package/template/src/plugin.tsx +65 -65
- package/types/components/FileIcon.d.ts +1 -1
- package/types/components/TabStrip.d.ts +5 -2
- package/types/core/{settingsstore.d.ts → app/settingsstore.d.ts} +1 -1
- package/types/core/bridge.d.ts +1190 -1167
- package/types/core/{bookmarks.d.ts → browser/bookmarks.d.ts} +4 -2
- package/types/core/{browser.d.ts → browser/browser.d.ts} +1 -1
- package/types/core/{editorsettings.d.ts → editor/editorsettings.d.ts} +1 -1
- package/types/core/{icontheme.d.ts → editor/icontheme.d.ts} +1 -1
- package/types/core/workspaces/layout.d.ts +168 -0
- package/types/core/workspaces/terminals.d.ts +252 -0
- package/types/core/workspaces/zones.d.ts +215 -0
- package/types/modules/editor/MonacoHosts.d.ts +3 -3
- package/types/modules/editor/{DiffPeek.d.ts → git/DiffPeek.d.ts} +1 -1
- package/types/modules/editor/models.d.ts +1 -1
- package/types/modules/editor/{tree.d.ts → tree/tree.d.ts} +1 -1
- package/validate.mjs +112 -112
- package/types/core/terminals.d.ts +0 -573
- /package/types/core/{p2p.d.ts → app/p2p.d.ts} +0 -0
- /package/types/core/{theme.d.ts → app/theme.d.ts} +0 -0
- /package/types/core/{timeFormat.d.ts → app/timeFormat.d.ts} +0 -0
- /package/types/core/{browserurl.d.ts → browser/browserurl.d.ts} +0 -0
- /package/types/core/{dap.d.ts → editor/dap.d.ts} +0 -0
- /package/types/core/{debugtargets.d.ts → editor/debugtargets.d.ts} +0 -0
- /package/types/core/{decode.d.ts → editor/decode.d.ts} +0 -0
- /package/types/core/{editorsession.d.ts → editor/editorsession.d.ts} +0 -0
- /package/types/core/{inlay.d.ts → editor/inlay.d.ts} +0 -0
- /package/types/core/{langmap.d.ts → editor/langmap.d.ts} +0 -0
- /package/types/core/{lsp.d.ts → editor/lsp.d.ts} +0 -0
- /package/types/core/{monaco.d.ts → editor/monaco.d.ts} +0 -0
- /package/types/core/{patterntokens.d.ts → editor/patterntokens.d.ts} +0 -0
- /package/types/core/{snippets.d.ts → editor/snippets.d.ts} +0 -0
- /package/types/core/{treehide.d.ts → editor/treehide.d.ts} +0 -0
- /package/types/core/{keys.d.ts → keys/keys.d.ts} +0 -0
- /package/types/core/{keystore.d.ts → keys/keystore.d.ts} +0 -0
- /package/types/core/{notifications.d.ts → notifications/notifications.d.ts} +0 -0
- /package/types/core/{notifyapi.d.ts → notifications/notifyapi.d.ts} +0 -0
- /package/types/core/{fileview.d.ts → plugins/fileview.d.ts} +0 -0
- /package/types/core/{portal.d.ts → workspaces/portal.d.ts} +0 -0
- /package/types/core/{remotepath.d.ts → workspaces/remotepath.d.ts} +0 -0
- /package/types/core/{shellpath.d.ts → workspaces/shellpath.d.ts} +0 -0
- /package/types/core/{windows.d.ts → workspaces/windows.d.ts} +0 -0
- /package/types/modules/editor/{diffline.d.ts → git/diffline.d.ts} +0 -0
- /package/types/modules/editor/{hunks.d.ts → git/hunks.d.ts} +0 -0
- /package/types/modules/editor/{MarkdownLive.d.ts → viewers/MarkdownLive.d.ts} +0 -0
- /package/types/modules/editor/{viewers.d.ts → viewers/viewers.d.ts} +0 -0
package/publish.mjs
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
// `deck-plugin publish`: put this version of a plugin in Deck's registry.
|
|
2
|
-
//
|
|
3
|
-
// deck-plugin publish --dry-run check everything, publish nothing
|
|
4
|
-
// deck-plugin publish tag, release on GitHub, and open the submission PR
|
|
5
|
-
//
|
|
6
|
-
// Runs on the author's machine the checks the registry runs on its own (validate.mjs, shared),
|
|
7
|
-
// so a submission that would fail fails here, before anything is public:
|
|
8
|
-
// the manifest, README, LICENSE and package-lock.json; a clean, pushed git tree; a build from
|
|
9
|
-
// the lockfile exactly as the registry will repeat it (npm ci, then this SDK's build); the
|
|
10
|
-
// release's files and sizes; and that its permissions cover what the bundle calls.
|
|
11
|
-
// Then it tags v<version>, makes the GitHub release with the built files, and opens a pull
|
|
12
|
-
// request to the registry adding submissions/<id>.json, through the author's fork. The registry's
|
|
13
|
-
// checks run on that PR and merge it when they pass.
|
|
14
|
-
//
|
|
15
|
-
// Needs git and the GitHub CLI (gh), signed in.
|
|
16
|
-
import { execFileSync } from "node:child_process";
|
|
17
|
-
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
18
|
-
import { dirname, join } from "node:path";
|
|
19
|
-
import { fileURLToPath } from "node:url";
|
|
20
|
-
import { checkAssets, checkId, checkLockfile, checkManifest, checkPermissions } from "./validate.mjs";
|
|
21
|
-
|
|
22
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
23
|
-
const REGISTRY = "deck-desktop/deck-registry";
|
|
24
|
-
|
|
25
|
-
/** npm's own entry point, run with node: on Windows npm is npm.cmd, which Node will not execFile. */
|
|
26
|
-
function npmCli() {
|
|
27
|
-
for (const p of [join(dirname(process.execPath), "node_modules", "npm", "bin", "npm-cli.js"),
|
|
28
|
-
join(dirname(process.execPath), "..", "lib", "node_modules", "npm", "bin", "npm-cli.js")]) if (existsSync(p)) return p;
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export async function publish(dir, manifest, { dryRun, buildPlugin }) {
|
|
33
|
-
const run = (cmd, args, opts = {}) => execFileSync(cmd, args, { cwd: dir, stdio: ["ignore", "pipe", "pipe"], ...opts }).toString().trim();
|
|
34
|
-
const ok = (cmd, args) => { try { run(cmd, args); return true; } catch { return false; } };
|
|
35
|
-
const errors = [], notes = [];
|
|
36
|
-
const say = (s) => console.log(s);
|
|
37
|
-
|
|
38
|
-
// ---- what is in the folder ----
|
|
39
|
-
errors.push(...checkId(manifest.id ?? ""), ...checkManifest(manifest));
|
|
40
|
-
if (!existsSync(join(dir, "README.md"))) errors.push("no README.md: it is the plugin's page in Deck and on the website");
|
|
41
|
-
if (!["LICENSE", "LICENSE.md", "LICENSE.txt", "COPYING"].some((f) => existsSync(join(dir, f)))) errors.push("no LICENSE: say how others may use it (the scaffold's is MIT)");
|
|
42
|
-
if (existsSync(join(dir, ".npmrc"))) errors.push("there is an .npmrc: the registry installs from registry.npmjs.org only, so remove it");
|
|
43
|
-
const lockAt = join(dir, "package-lock.json");
|
|
44
|
-
if (!existsSync(lockAt)) errors.push("no package-lock.json: commit it, so the registry can repeat the build exactly");
|
|
45
|
-
else errors.push(...checkLockfile(JSON.parse(readFileSync(lockAt, "utf8"))));
|
|
46
|
-
const custom = existsSync(join(dir, "deck-plugin.config.mjs"));
|
|
47
|
-
if (custom) notes.push("It has a deck-plugin.config.mjs, which the build runs, so the registry will not rebuild it to check it: it is listed as build not verified.");
|
|
48
|
-
|
|
49
|
-
// ---- git and GitHub ----
|
|
50
|
-
if (!ok("git", ["rev-parse", "--is-inside-work-tree"])) errors.push("this is not a git repository");
|
|
51
|
-
let repo = "";
|
|
52
|
-
try {
|
|
53
|
-
const url = run("git", ["remote", "get-url", "origin"]);
|
|
54
|
-
repo = /github\.com[:/]([\w.-]+\/[\w.-]+?)(?:\.git)?$/.exec(url)?.[1] ?? "";
|
|
55
|
-
if (!repo) errors.push(`origin is ${url}, not a GitHub repository`);
|
|
56
|
-
} catch { errors.push("there is no origin remote: push it to a public GitHub repository first"); }
|
|
57
|
-
if (ok("git", ["rev-parse", "HEAD"]) && run("git", ["status", "--porcelain"])) errors.push("there are uncommitted changes: commit them, so the release is what the repository holds");
|
|
58
|
-
if (!ok("gh", ["auth", "status"])) errors.push("the GitHub CLI is not signed in: run `gh auth login`");
|
|
59
|
-
const tag = `v${manifest.version}`;
|
|
60
|
-
if (ok("git", ["rev-parse", "-q", "--verify", `refs/tags/${tag}`])) errors.push(`${tag} is already tagged: bump the version in plugin.json`);
|
|
61
|
-
if (repo && ok("gh", ["release", "view", tag, "--repo", repo])) errors.push(`${repo} already has a release ${tag}: bump the version in plugin.json`);
|
|
62
|
-
if (repo && ok("gh", ["api", `repos/${repo}`]) && JSON.parse(run("gh", ["api", `repos/${repo}`])).private) errors.push(`${repo} is private: a package's source has to be public`);
|
|
63
|
-
|
|
64
|
-
if (errors.length) {
|
|
65
|
-
for (const e of errors) console.error(` ✗ ${e}`);
|
|
66
|
-
process.exit(1);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// ---- the build, exactly as the registry will repeat it ----
|
|
70
|
-
say("Building from the lockfile, as the registry will…");
|
|
71
|
-
const npm = npmCli();
|
|
72
|
-
if (!npm) { console.error(" ✗ npm was not found beside node"); process.exit(1); }
|
|
73
|
-
run(process.execPath, [npm, "ci", "--ignore-scripts", "--no-audit", "--no-fund"]);
|
|
74
|
-
await buildPlugin(dir);
|
|
75
|
-
const files = ["plugin.json", "plugin.js", "mcp.js"].filter((f) => existsSync(join(dir, f)));
|
|
76
|
-
errors.push(...checkAssets("plugin", files.map((f) => ({ name: f, size: statSync(join(dir, f)).size }))));
|
|
77
|
-
const table = JSON.parse(readFileSync(join(here, "permissions.json"), "utf8"));
|
|
78
|
-
const perms = checkPermissions(manifest.permissions, readFileSync(join(dir, "plugin.js"), "utf8"), table);
|
|
79
|
-
errors.push(...perms.errors);
|
|
80
|
-
notes.push(...perms.notes);
|
|
81
|
-
if (errors.length) {
|
|
82
|
-
for (const e of errors) console.error(` ✗ ${e}`);
|
|
83
|
-
process.exit(1);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
say(`\n${manifest.name} ${manifest.version} is ready: ${files.join(", ")}${manifest.permissions.length ? `; it uses ${manifest.permissions.join(", ")}` : ""}.`);
|
|
87
|
-
for (const n of notes) say(` note: ${n}`);
|
|
88
|
-
if (dryRun) {
|
|
89
|
-
say(`\nDry run: nothing was tagged, released or submitted. Without --dry-run this tags ${tag}, releases it on ${repo}, and opens a PR to ${REGISTRY}.`);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// ---- tag, release, submit ----
|
|
94
|
-
say(`Tagging ${tag} and pushing…`);
|
|
95
|
-
run("git", ["tag", tag]);
|
|
96
|
-
run("git", ["push", "-q", "origin", "HEAD", tag]);
|
|
97
|
-
say(`Releasing ${tag} on ${repo}…`);
|
|
98
|
-
run("gh", ["release", "create", tag, ...files.map((f) => join(dir, f)), "--repo", repo,
|
|
99
|
-
"--title", `${manifest.name} ${manifest.version}`, "--notes", `${manifest.name} ${manifest.version}, for Deck ${manifest.minDeck} and later.`]);
|
|
100
|
-
|
|
101
|
-
say(`Opening the submission to ${REGISTRY}…`);
|
|
102
|
-
const me = JSON.parse(run("gh", ["api", "user"])).login;
|
|
103
|
-
ok("gh", ["repo", "fork", REGISTRY, "--clone=false"]);
|
|
104
|
-
const fork = `${me}/${REGISTRY.split("/")[1]}`;
|
|
105
|
-
// The fork may be behind; the submission branch starts from the registry's main as it is now.
|
|
106
|
-
ok("gh", ["repo", "sync", fork, "--source", REGISTRY]);
|
|
107
|
-
const sha = JSON.parse(run("gh", ["api", `repos/${fork}/git/ref/heads/main`])).object.sha;
|
|
108
|
-
const branch = `submit/${manifest.id}-${manifest.version}`;
|
|
109
|
-
run("gh", ["api", "-X", "POST", `repos/${fork}/git/refs`, "-f", `ref=refs/heads/${branch}`, "-f", `sha=${sha}`]);
|
|
110
|
-
const body = JSON.stringify({ kind: "plugin", repo, tag }) + "\n";
|
|
111
|
-
run("gh", ["api", "-X", "PUT", `repos/${fork}/contents/submissions/${manifest.id}.json`,
|
|
112
|
-
"-f", `message=Submit ${manifest.id} ${tag}`, "-f", `content=${Buffer.from(body).toString("base64")}`, "-f", `branch=${branch}`]);
|
|
113
|
-
const pr = run("gh", ["pr", "create", "--repo", REGISTRY, "--base", "main", "--head", `${me}:${branch}`,
|
|
114
|
-
"--title", `Submit ${manifest.id} ${tag}`, "--body", `${manifest.name} ${manifest.version} from ${repo}.\n\nOpened by \`deck-plugin publish\`.`]);
|
|
115
|
-
say(`\nSubmitted: ${pr}\nThe registry's checks run there and comment what they find; when they pass it is merged and listed.`);
|
|
116
|
-
}
|
|
1
|
+
// `deck-plugin publish`: put this version of a plugin in Deck's registry.
|
|
2
|
+
//
|
|
3
|
+
// deck-plugin publish --dry-run check everything, publish nothing
|
|
4
|
+
// deck-plugin publish tag, release on GitHub, and open the submission PR
|
|
5
|
+
//
|
|
6
|
+
// Runs on the author's machine the checks the registry runs on its own (validate.mjs, shared),
|
|
7
|
+
// so a submission that would fail fails here, before anything is public:
|
|
8
|
+
// the manifest, README, LICENSE and package-lock.json; a clean, pushed git tree; a build from
|
|
9
|
+
// the lockfile exactly as the registry will repeat it (npm ci, then this SDK's build); the
|
|
10
|
+
// release's files and sizes; and that its permissions cover what the bundle calls.
|
|
11
|
+
// Then it tags v<version>, makes the GitHub release with the built files, and opens a pull
|
|
12
|
+
// request to the registry adding submissions/<id>.json, through the author's fork. The registry's
|
|
13
|
+
// checks run on that PR and merge it when they pass.
|
|
14
|
+
//
|
|
15
|
+
// Needs git and the GitHub CLI (gh), signed in.
|
|
16
|
+
import { execFileSync } from "node:child_process";
|
|
17
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
18
|
+
import { dirname, join } from "node:path";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
import { checkAssets, checkId, checkLockfile, checkManifest, checkPermissions } from "./validate.mjs";
|
|
21
|
+
|
|
22
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
23
|
+
const REGISTRY = "deck-desktop/deck-registry";
|
|
24
|
+
|
|
25
|
+
/** npm's own entry point, run with node: on Windows npm is npm.cmd, which Node will not execFile. */
|
|
26
|
+
function npmCli() {
|
|
27
|
+
for (const p of [join(dirname(process.execPath), "node_modules", "npm", "bin", "npm-cli.js"),
|
|
28
|
+
join(dirname(process.execPath), "..", "lib", "node_modules", "npm", "bin", "npm-cli.js")]) if (existsSync(p)) return p;
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function publish(dir, manifest, { dryRun, buildPlugin }) {
|
|
33
|
+
const run = (cmd, args, opts = {}) => execFileSync(cmd, args, { cwd: dir, stdio: ["ignore", "pipe", "pipe"], ...opts }).toString().trim();
|
|
34
|
+
const ok = (cmd, args) => { try { run(cmd, args); return true; } catch { return false; } };
|
|
35
|
+
const errors = [], notes = [];
|
|
36
|
+
const say = (s) => console.log(s);
|
|
37
|
+
|
|
38
|
+
// ---- what is in the folder ----
|
|
39
|
+
errors.push(...checkId(manifest.id ?? ""), ...checkManifest(manifest));
|
|
40
|
+
if (!existsSync(join(dir, "README.md"))) errors.push("no README.md: it is the plugin's page in Deck and on the website");
|
|
41
|
+
if (!["LICENSE", "LICENSE.md", "LICENSE.txt", "COPYING"].some((f) => existsSync(join(dir, f)))) errors.push("no LICENSE: say how others may use it (the scaffold's is MIT)");
|
|
42
|
+
if (existsSync(join(dir, ".npmrc"))) errors.push("there is an .npmrc: the registry installs from registry.npmjs.org only, so remove it");
|
|
43
|
+
const lockAt = join(dir, "package-lock.json");
|
|
44
|
+
if (!existsSync(lockAt)) errors.push("no package-lock.json: commit it, so the registry can repeat the build exactly");
|
|
45
|
+
else errors.push(...checkLockfile(JSON.parse(readFileSync(lockAt, "utf8"))));
|
|
46
|
+
const custom = existsSync(join(dir, "deck-plugin.config.mjs"));
|
|
47
|
+
if (custom) notes.push("It has a deck-plugin.config.mjs, which the build runs, so the registry will not rebuild it to check it: it is listed as build not verified.");
|
|
48
|
+
|
|
49
|
+
// ---- git and GitHub ----
|
|
50
|
+
if (!ok("git", ["rev-parse", "--is-inside-work-tree"])) errors.push("this is not a git repository");
|
|
51
|
+
let repo = "";
|
|
52
|
+
try {
|
|
53
|
+
const url = run("git", ["remote", "get-url", "origin"]);
|
|
54
|
+
repo = /github\.com[:/]([\w.-]+\/[\w.-]+?)(?:\.git)?$/.exec(url)?.[1] ?? "";
|
|
55
|
+
if (!repo) errors.push(`origin is ${url}, not a GitHub repository`);
|
|
56
|
+
} catch { errors.push("there is no origin remote: push it to a public GitHub repository first"); }
|
|
57
|
+
if (ok("git", ["rev-parse", "HEAD"]) && run("git", ["status", "--porcelain"])) errors.push("there are uncommitted changes: commit them, so the release is what the repository holds");
|
|
58
|
+
if (!ok("gh", ["auth", "status"])) errors.push("the GitHub CLI is not signed in: run `gh auth login`");
|
|
59
|
+
const tag = `v${manifest.version}`;
|
|
60
|
+
if (ok("git", ["rev-parse", "-q", "--verify", `refs/tags/${tag}`])) errors.push(`${tag} is already tagged: bump the version in plugin.json`);
|
|
61
|
+
if (repo && ok("gh", ["release", "view", tag, "--repo", repo])) errors.push(`${repo} already has a release ${tag}: bump the version in plugin.json`);
|
|
62
|
+
if (repo && ok("gh", ["api", `repos/${repo}`]) && JSON.parse(run("gh", ["api", `repos/${repo}`])).private) errors.push(`${repo} is private: a package's source has to be public`);
|
|
63
|
+
|
|
64
|
+
if (errors.length) {
|
|
65
|
+
for (const e of errors) console.error(` ✗ ${e}`);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ---- the build, exactly as the registry will repeat it ----
|
|
70
|
+
say("Building from the lockfile, as the registry will…");
|
|
71
|
+
const npm = npmCli();
|
|
72
|
+
if (!npm) { console.error(" ✗ npm was not found beside node"); process.exit(1); }
|
|
73
|
+
run(process.execPath, [npm, "ci", "--ignore-scripts", "--no-audit", "--no-fund"]);
|
|
74
|
+
await buildPlugin(dir);
|
|
75
|
+
const files = ["plugin.json", "plugin.js", "mcp.js"].filter((f) => existsSync(join(dir, f)));
|
|
76
|
+
errors.push(...checkAssets("plugin", files.map((f) => ({ name: f, size: statSync(join(dir, f)).size }))));
|
|
77
|
+
const table = JSON.parse(readFileSync(join(here, "permissions.json"), "utf8"));
|
|
78
|
+
const perms = checkPermissions(manifest.permissions, readFileSync(join(dir, "plugin.js"), "utf8"), table);
|
|
79
|
+
errors.push(...perms.errors);
|
|
80
|
+
notes.push(...perms.notes);
|
|
81
|
+
if (errors.length) {
|
|
82
|
+
for (const e of errors) console.error(` ✗ ${e}`);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
say(`\n${manifest.name} ${manifest.version} is ready: ${files.join(", ")}${manifest.permissions.length ? `; it uses ${manifest.permissions.join(", ")}` : ""}.`);
|
|
87
|
+
for (const n of notes) say(` note: ${n}`);
|
|
88
|
+
if (dryRun) {
|
|
89
|
+
say(`\nDry run: nothing was tagged, released or submitted. Without --dry-run this tags ${tag}, releases it on ${repo}, and opens a PR to ${REGISTRY}.`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ---- tag, release, submit ----
|
|
94
|
+
say(`Tagging ${tag} and pushing…`);
|
|
95
|
+
run("git", ["tag", tag]);
|
|
96
|
+
run("git", ["push", "-q", "origin", "HEAD", tag]);
|
|
97
|
+
say(`Releasing ${tag} on ${repo}…`);
|
|
98
|
+
run("gh", ["release", "create", tag, ...files.map((f) => join(dir, f)), "--repo", repo,
|
|
99
|
+
"--title", `${manifest.name} ${manifest.version}`, "--notes", `${manifest.name} ${manifest.version}, for Deck ${manifest.minDeck} and later.`]);
|
|
100
|
+
|
|
101
|
+
say(`Opening the submission to ${REGISTRY}…`);
|
|
102
|
+
const me = JSON.parse(run("gh", ["api", "user"])).login;
|
|
103
|
+
ok("gh", ["repo", "fork", REGISTRY, "--clone=false"]);
|
|
104
|
+
const fork = `${me}/${REGISTRY.split("/")[1]}`;
|
|
105
|
+
// The fork may be behind; the submission branch starts from the registry's main as it is now.
|
|
106
|
+
ok("gh", ["repo", "sync", fork, "--source", REGISTRY]);
|
|
107
|
+
const sha = JSON.parse(run("gh", ["api", `repos/${fork}/git/ref/heads/main`])).object.sha;
|
|
108
|
+
const branch = `submit/${manifest.id}-${manifest.version}`;
|
|
109
|
+
run("gh", ["api", "-X", "POST", `repos/${fork}/git/refs`, "-f", `ref=refs/heads/${branch}`, "-f", `sha=${sha}`]);
|
|
110
|
+
const body = JSON.stringify({ kind: "plugin", repo, tag }) + "\n";
|
|
111
|
+
run("gh", ["api", "-X", "PUT", `repos/${fork}/contents/submissions/${manifest.id}.json`,
|
|
112
|
+
"-f", `message=Submit ${manifest.id} ${tag}`, "-f", `content=${Buffer.from(body).toString("base64")}`, "-f", `branch=${branch}`]);
|
|
113
|
+
const pr = run("gh", ["pr", "create", "--repo", REGISTRY, "--base", "main", "--head", `${me}:${branch}`,
|
|
114
|
+
"--title", `Submit ${manifest.id} ${tag}`, "--body", `${manifest.name} ${manifest.version} from ${repo}.\n\nOpened by \`deck-plugin publish\`.`]);
|
|
115
|
+
say(`\nSubmitted: ${pr}\nThe registry's checks run there and comment what they find; when they pass it is merged and listed.`);
|
|
116
|
+
}
|