@vibedropio/publisher 0.22.8 → 0.24.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-publisher",
|
|
3
3
|
"displayName": "Git Publisher",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.24.0",
|
|
5
5
|
"description": "Publish an app folder to the platform and keep it updated (\"publish my app\", \"update my app\", \"fetch the engineered version\").",
|
|
6
6
|
"author": { "name": "VibeDrop" },
|
|
7
7
|
"keywords": ["git", "publish", "deploy", "serverless"]
|
|
@@ -28,7 +28,7 @@ Every command accepts `--json` and prints exactly one JSON object on stdout. Exi
|
|
|
28
28
|
publisher --version
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
If the command is not found, or the version is older than 0.
|
|
31
|
+
If the command is not found, or the version is older than 0.24.0, install it:
|
|
32
32
|
`npm install -g @vibedropio/publisher@latest` (it needs Node.js 22 (22.12 or later) or Node.js 24). In a Claude Cowork task
|
|
33
33
|
this is normal: the sandbox starts empty every time, so install it without asking. On the person's
|
|
34
34
|
own computer, say in one line that you are installing the publisher. If `npm` itself is missing,
|
|
@@ -187,7 +187,7 @@ following, for when the person asks not to wait.
|
|
|
187
187
|
`--no-wait`) and pass on its `hint`:
|
|
188
188
|
- `kind: "settled"` with `ending` `"live"`: the app is live. A new app opens only to the person
|
|
189
189
|
and the admins until it is shared: offer `publisher share` (the `sync-app` skill). `"not-deployed"`: published and
|
|
190
|
-
checked, and this
|
|
190
|
+
checked, and this workspace does not deploy automatically. `"failed"` with `findings`: it
|
|
191
191
|
did not pass its checks, and `findings` says why — fix them as "When the checks find something"
|
|
192
192
|
below says. `"failed"` without `findings`: it stopped at `failedAt`; the portal says why — do
|
|
193
193
|
not guess the reason. A fault on our side can be tried again: to find out, run `publisher
|
|
@@ -210,10 +210,10 @@ following, for when the person asks not to wait.
|
|
|
210
210
|
moment between the merge and the publish. Run `publisher sync . --json` once more
|
|
211
211
|
(`publication.next.command` says the same).
|
|
212
212
|
- `REF_FORBIDDEN`: the user may not publish this branch; tell them which branch and stop.
|
|
213
|
-
When it comes as `error.code` with a `hint`, a limit of the
|
|
213
|
+
When it comes as `error.code` with a `hint`, a limit of the workspace refused it: tell them
|
|
214
214
|
the reason and whom to ask that the `hint` gives, and stop.
|
|
215
|
-
When `error.details.feature` names a feature, that feature is off for the
|
|
216
|
-
the `hint` as it is, and stop. Nobody in the
|
|
215
|
+
When `error.details.feature` names a feature, that feature is off for the workspace: pass on
|
|
216
|
+
the `hint` as it is, and stop. Nobody in the workspace can turn it on, so name nobody to ask.
|
|
217
217
|
- `MISSING_OBJECTS`: the local copy is incomplete (for example a shallow clone). Tell the user to
|
|
218
218
|
publish from a complete copy: `publisher checkout <new folder> --repo <id>`.
|
|
219
219
|
- `LIMIT_EXCEEDED`, `PACK_INVALID`: quote the message; suggest removing very large files from the
|
|
@@ -227,13 +227,13 @@ following, for when the person asks not to wait.
|
|
|
227
227
|
|
|
228
228
|
### When the app moved
|
|
229
229
|
|
|
230
|
-
`REPOSITORY_MOVED` means the app moved to another
|
|
230
|
+
`REPOSITORY_MOVED` means the app moved to another workspace (the person's team adopted it).
|
|
231
231
|
This folder can no longer publish; nothing was lost, and it can still be read. It comes as a
|
|
232
232
|
`"rejected"` publication, or as `error.code` when the publish was refused before it started; both
|
|
233
233
|
carry a `hint` and `details.movedTo` (in `publication.rejection.details` or `error.details`).
|
|
234
234
|
Pass the `hint` on, then:
|
|
235
235
|
|
|
236
|
-
1. Tell the person to sign in again and choose the
|
|
236
|
+
1. Tell the person to sign in again and choose the workspace the app moved to:
|
|
237
237
|
`publisher login`. Never ask them for a token.
|
|
238
238
|
2. Find the app there: `publisher checkout <new folder> --repo <details.movedTo> --json` when
|
|
239
239
|
`details.movedTo` is set; otherwise `publisher list --json` and pick the app by its name.
|
|
@@ -292,7 +292,7 @@ folder. Never `init` or `sync` an empty new folder in its place: that makes a se
|
|
|
292
292
|
In a sandbox (Claude Cowork, Claude Code on the web) a `NETWORK` error, or `CONNECT tunnel failed,
|
|
293
293
|
response 403`, usually means the sandbox's network does not allow the platform. Tell the person that
|
|
294
294
|
their Claude settings must allow the platform's domain and its storage (`*.s3.<region>.amazonaws.com`)
|
|
295
|
-
under Settings → Capabilities, or that their
|
|
295
|
+
under Settings → Capabilities, or that their workspace's owner must, on a Team or Enterprise plan.
|
|
296
296
|
Do not retry until they say it is done.
|
|
297
297
|
|
|
298
298
|
## 6. Interrupted earlier?
|
|
@@ -23,9 +23,9 @@ published elsewhere was brought in (`"fast-forward"` or `"merge"`); mention it w
|
|
|
23
23
|
## When the app moved
|
|
24
24
|
|
|
25
25
|
A sync that ends with `REPOSITORY_MOVED` — `publication.rejection.code`, or `error.code` when it
|
|
26
|
-
was refused before anything was sent — means the app moved to another
|
|
26
|
+
was refused before anything was sent — means the app moved to another workspace (the person's
|
|
27
27
|
team adopted it). Pass on its `hint`, and do what the `publish-app` skill's "When the app moved"
|
|
28
|
-
says: sign in again with `publisher login` and choose that
|
|
28
|
+
says: sign in again with `publisher login` and choose that workspace, then
|
|
29
29
|
`publisher checkout <new folder> --repo <details.movedTo>` (or find the app with
|
|
30
30
|
`publisher list --json` when `details.movedTo` is `null`), and publish from the new folder. Do not
|
|
31
31
|
sync this folder again.
|
|
@@ -33,7 +33,7 @@ sync this folder again.
|
|
|
33
33
|
## When it waits for an answer
|
|
34
34
|
|
|
35
35
|
Sometimes the app's preparation asks one business question before it can go on (for example
|
|
36
|
-
whether to use the
|
|
36
|
+
whether to use the workspace's data). `follow` then stops with `kind: "waiting"` and
|
|
37
37
|
`next.command`. Read the question:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
@@ -111,7 +111,7 @@ then `publisher start <starter> --replaces "<what it replaces>"`.
|
|
|
111
111
|
To say where the folder stands without changing anything:
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
publisher
|
|
114
|
+
publisher checkout-status . --json # state + hint; exit 2 means conflict
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
| state | meaning | what to do |
|
package/dist/publisher.cjs
CHANGED
|
@@ -19763,7 +19763,7 @@ var getCapabilities = {
|
|
|
19763
19763
|
maxProcessMemoryBytes: external_exports.int().gt(0),
|
|
19764
19764
|
maxTemporaryBytes: external_exports.int().gt(0),
|
|
19765
19765
|
gitTimeoutMs: external_exports.int().gt(0),
|
|
19766
|
-
|
|
19766
|
+
maxRepositoriesPerWorkspace: external_exports.int().gt(0),
|
|
19767
19767
|
maxFilePublicationBytes: external_exports.int().gt(0),
|
|
19768
19768
|
maxFilePublicationPaths: external_exports.int().gt(0),
|
|
19769
19769
|
maxShownFileBytes: external_exports.int().gt(0)
|
|
@@ -19886,7 +19886,7 @@ var postRepos = {
|
|
|
19886
19886
|
maxProcessMemoryBytes: external_exports.int().gt(0),
|
|
19887
19887
|
maxTemporaryBytes: external_exports.int().gt(0),
|
|
19888
19888
|
gitTimeoutMs: external_exports.int().gt(0),
|
|
19889
|
-
|
|
19889
|
+
maxRepositoriesPerWorkspace: external_exports.int().gt(0),
|
|
19890
19890
|
maxFilePublicationBytes: external_exports.int().gt(0),
|
|
19891
19891
|
maxFilePublicationPaths: external_exports.int().gt(0),
|
|
19892
19892
|
maxShownFileBytes: external_exports.int().gt(0)
|
|
@@ -19945,7 +19945,7 @@ var postRepos = {
|
|
|
19945
19945
|
maxProcessMemoryBytes: external_exports.int().gt(0),
|
|
19946
19946
|
maxTemporaryBytes: external_exports.int().gt(0),
|
|
19947
19947
|
gitTimeoutMs: external_exports.int().gt(0),
|
|
19948
|
-
|
|
19948
|
+
maxRepositoriesPerWorkspace: external_exports.int().gt(0),
|
|
19949
19949
|
maxFilePublicationBytes: external_exports.int().gt(0),
|
|
19950
19950
|
maxFilePublicationPaths: external_exports.int().gt(0),
|
|
19951
19951
|
maxShownFileBytes: external_exports.int().gt(0)
|
|
@@ -20009,7 +20009,7 @@ var getReposByRepoId = {
|
|
|
20009
20009
|
maxProcessMemoryBytes: external_exports.int().gt(0),
|
|
20010
20010
|
maxTemporaryBytes: external_exports.int().gt(0),
|
|
20011
20011
|
gitTimeoutMs: external_exports.int().gt(0),
|
|
20012
|
-
|
|
20012
|
+
maxRepositoriesPerWorkspace: external_exports.int().gt(0),
|
|
20013
20013
|
maxFilePublicationBytes: external_exports.int().gt(0),
|
|
20014
20014
|
maxFilePublicationPaths: external_exports.int().gt(0),
|
|
20015
20015
|
maxShownFileBytes: external_exports.int().gt(0)
|
|
@@ -20732,7 +20732,7 @@ async function writeAssociation(repoDir, a) {
|
|
|
20732
20732
|
await setConfig(repoDir, "publisher.remote", a.remote);
|
|
20733
20733
|
}
|
|
20734
20734
|
|
|
20735
|
-
// ../client/src/folder/
|
|
20735
|
+
// ../client/src/folder/checkout.ts
|
|
20736
20736
|
var import_promises2 = require("node:fs/promises");
|
|
20737
20737
|
var import_node_path2 = require("node:path");
|
|
20738
20738
|
var import_node_crypto2 = require("node:crypto");
|
|
@@ -20903,10 +20903,10 @@ async function listPending(repoDir) {
|
|
|
20903
20903
|
return (await openPending(repoDir)).list();
|
|
20904
20904
|
}
|
|
20905
20905
|
|
|
20906
|
-
// ../client/src/folder/
|
|
20907
|
-
var NS = "publisher.
|
|
20906
|
+
// ../client/src/folder/checkout.ts
|
|
20907
|
+
var NS = "publisher.checkout";
|
|
20908
20908
|
var PARTIAL_MARKER = ".gitpub-checkout.json";
|
|
20909
|
-
async function
|
|
20909
|
+
async function getCheckoutMapping(directory) {
|
|
20910
20910
|
const dir = (0, import_node_path2.resolve)(directory);
|
|
20911
20911
|
const section = await getConfigSection(dir, "publisher").catch(() => null);
|
|
20912
20912
|
if (!section) {
|
|
@@ -20945,10 +20945,10 @@ async function writeMapping(dir, m) {
|
|
|
20945
20945
|
await setConfig(dir, `${NS}.checkedoutat`, m.checkedOutAt);
|
|
20946
20946
|
await setConfig(dir, `${NS}.baseadvancedat`, m.baseAdvancedAt);
|
|
20947
20947
|
}
|
|
20948
|
-
async function
|
|
20949
|
-
const m = await
|
|
20948
|
+
async function advanceCheckoutBase(directory, next, now = /* @__PURE__ */ new Date()) {
|
|
20949
|
+
const m = await getCheckoutMapping(directory);
|
|
20950
20950
|
if (!m) {
|
|
20951
|
-
throw new PublisherError("LOCAL_STATE", "not a
|
|
20951
|
+
throw new PublisherError("LOCAL_STATE", "not a checkout (no publisher.checkout mapping)");
|
|
20952
20952
|
}
|
|
20953
20953
|
if (next.generation < m.baseGeneration) {
|
|
20954
20954
|
return m;
|
|
@@ -20966,7 +20966,7 @@ async function noteAcceptedPublication(directory, outcome2, now = /* @__PURE__ *
|
|
|
20966
20966
|
if (outcome2.state !== "accepted" || outcome2.resultGeneration === null) {
|
|
20967
20967
|
return;
|
|
20968
20968
|
}
|
|
20969
|
-
const m = await
|
|
20969
|
+
const m = await getCheckoutMapping(directory).catch(() => null);
|
|
20970
20970
|
if (!m || m.repoId !== outcome2.repoId) {
|
|
20971
20971
|
return;
|
|
20972
20972
|
}
|
|
@@ -20974,11 +20974,11 @@ async function noteAcceptedPublication(directory, outcome2, now = /* @__PURE__ *
|
|
|
20974
20974
|
if (!oid) {
|
|
20975
20975
|
return;
|
|
20976
20976
|
}
|
|
20977
|
-
await
|
|
20977
|
+
await advanceCheckoutBase(directory, { oid, generation: outcome2.resultGeneration }, now);
|
|
20978
20978
|
}
|
|
20979
|
-
async function
|
|
20979
|
+
async function adoptCheckout(client, directory, call2 = {}, now = /* @__PURE__ */ new Date()) {
|
|
20980
20980
|
const dir = (0, import_node_path2.resolve)(directory);
|
|
20981
|
-
const existing = await
|
|
20981
|
+
const existing = await getCheckoutMapping(dir);
|
|
20982
20982
|
if (existing) {
|
|
20983
20983
|
return existing;
|
|
20984
20984
|
}
|
|
@@ -21023,7 +21023,7 @@ async function adoptWorkspace(client, directory, call2 = {}, now = /* @__PURE__
|
|
|
21023
21023
|
checkedOutAt: now.toISOString(),
|
|
21024
21024
|
baseAdvancedAt: now.toISOString()
|
|
21025
21025
|
});
|
|
21026
|
-
return await
|
|
21026
|
+
return await getCheckoutMapping(dir);
|
|
21027
21027
|
}
|
|
21028
21028
|
async function isEmptyDir(p) {
|
|
21029
21029
|
try {
|
|
@@ -21066,7 +21066,7 @@ async function removeStalePartials(target, repoId) {
|
|
|
21066
21066
|
}
|
|
21067
21067
|
return removed;
|
|
21068
21068
|
}
|
|
21069
|
-
async function
|
|
21069
|
+
async function createCheckout(client, opts, call2 = {}, now = /* @__PURE__ */ new Date()) {
|
|
21070
21070
|
const target = (0, import_node_path2.resolve)(opts.directory);
|
|
21071
21071
|
const remote = opts.remote ?? "publisher";
|
|
21072
21072
|
const empty2 = await isEmptyDir(target);
|
|
@@ -21123,7 +21123,7 @@ async function checkoutWorkspace(client, opts, call2 = {}, now = /* @__PURE__ */
|
|
|
21123
21123
|
}
|
|
21124
21124
|
throw e;
|
|
21125
21125
|
}
|
|
21126
|
-
return await
|
|
21126
|
+
return await getCheckoutMapping(target);
|
|
21127
21127
|
}
|
|
21128
21128
|
async function isAncestor(dir, ancestor, descendant) {
|
|
21129
21129
|
const r = await runGit(["merge-base", "--is-ancestor", ancestor, descendant], { cwd: dir, allowFailure: true });
|
|
@@ -21133,9 +21133,9 @@ async function countCommits(dir, range) {
|
|
|
21133
21133
|
const r = await runGit(["rev-list", "--count", range], { cwd: dir, allowFailure: true });
|
|
21134
21134
|
return r.code === 0 ? Number(r.stdout.toString("utf8").trim()) : 0;
|
|
21135
21135
|
}
|
|
21136
|
-
async function
|
|
21136
|
+
async function inspectCheckout(client, directory, call2 = {}) {
|
|
21137
21137
|
const dir = (0, import_node_path2.resolve)(directory);
|
|
21138
|
-
const mapping = await
|
|
21138
|
+
const mapping = await getCheckoutMapping(dir);
|
|
21139
21139
|
const pending = await listPending(dir).catch(() => []);
|
|
21140
21140
|
if (!mapping) {
|
|
21141
21141
|
return {
|
|
@@ -21145,7 +21145,7 @@ async function inspectWorkspace(client, directory, call2 = {}) {
|
|
|
21145
21145
|
remote: null,
|
|
21146
21146
|
pending,
|
|
21147
21147
|
conflicts: [],
|
|
21148
|
-
hint: "not a
|
|
21148
|
+
hint: "not a checkout yet; run sync here (an associated folder adopts itself), or checkout to create one"
|
|
21149
21149
|
};
|
|
21150
21150
|
}
|
|
21151
21151
|
const branchRef = `refs/heads/${mapping.branch}`;
|
|
@@ -21168,7 +21168,7 @@ async function inspectWorkspace(client, directory, call2 = {}) {
|
|
|
21168
21168
|
if (checkedOut !== mapping.branch && !(checkedOut === null && head === null && tip === null)) {
|
|
21169
21169
|
return done(
|
|
21170
21170
|
"detached",
|
|
21171
|
-
checkedOut === null ? `HEAD is detached at ${head?.slice(0, 12) ?? "unknown"}; check out ${mapping.branch} (git checkout ${mapping.branch}) before syncing or publishing` : `branch ${checkedOut} is checked out, the
|
|
21171
|
+
checkedOut === null ? `HEAD is detached at ${head?.slice(0, 12) ?? "unknown"}; check out ${mapping.branch} (git checkout ${mapping.branch}) before syncing or publishing` : `branch ${checkedOut} is checked out, the checkout tracks ${mapping.branch}; check it out before syncing or publishing`
|
|
21172
21172
|
);
|
|
21173
21173
|
}
|
|
21174
21174
|
if (!remoteOid) {
|
|
@@ -21210,16 +21210,16 @@ async function inspectWorkspace(client, directory, call2 = {}) {
|
|
|
21210
21210
|
}
|
|
21211
21211
|
return done(
|
|
21212
21212
|
"conflict",
|
|
21213
|
-
`both sides changed ${merge2.conflicts.map((c) => c.path).join(", ")}; resolve with git merge ${remoteOid} in the
|
|
21213
|
+
`both sides changed ${merge2.conflicts.map((c) => c.path).join(", ")}; resolve with git merge ${remoteOid} in the checkout, then publish`,
|
|
21214
21214
|
merge2.conflicts.map((c) => c.path)
|
|
21215
21215
|
);
|
|
21216
21216
|
}
|
|
21217
|
-
async function
|
|
21217
|
+
async function syncCheckout(client, opts, call2 = {}, now = /* @__PURE__ */ new Date()) {
|
|
21218
21218
|
const dir = (0, import_node_path2.resolve)(opts.directory);
|
|
21219
|
-
await
|
|
21220
|
-
const before = await
|
|
21219
|
+
await adoptCheckout(client, dir, call2, now);
|
|
21220
|
+
const before = await inspectCheckout(client, dir, call2);
|
|
21221
21221
|
if (!before.mapping) {
|
|
21222
|
-
throw new PublisherError("LOCAL_STATE", "not a
|
|
21222
|
+
throw new PublisherError("LOCAL_STATE", "not a checkout; run checkout");
|
|
21223
21223
|
}
|
|
21224
21224
|
const mapping = before.mapping;
|
|
21225
21225
|
const branchRef = `refs/heads/${mapping.branch}`;
|
|
@@ -21246,10 +21246,10 @@ async function syncWorkspace(client, opts, call2 = {}, now = /* @__PURE__ */ new
|
|
|
21246
21246
|
if (before.remote?.oid) {
|
|
21247
21247
|
const tipNow = await revParse(dir, branchRef);
|
|
21248
21248
|
if (tipNow && (tipNow === before.remote.oid || await isAncestor(dir, before.remote.oid, tipNow))) {
|
|
21249
|
-
updated = await
|
|
21249
|
+
updated = await advanceCheckoutBase(dir, { oid: before.remote.oid, generation: before.remote.generation }, now);
|
|
21250
21250
|
}
|
|
21251
21251
|
}
|
|
21252
|
-
const after = applied ? (await
|
|
21252
|
+
const after = applied ? (await inspectCheckout(client, dir, call2)).state : before.state;
|
|
21253
21253
|
return { before, applied, mapping: updated, after };
|
|
21254
21254
|
}
|
|
21255
21255
|
|
|
@@ -21823,7 +21823,7 @@ function isRecord(value) {
|
|
|
21823
21823
|
}
|
|
21824
21824
|
function mergedSay(body) {
|
|
21825
21825
|
const error62 = isRecord(body) ? body["error"] : void 0;
|
|
21826
|
-
if (!isRecord(error62) || error62["code"] !== "
|
|
21826
|
+
if (!isRecord(error62) || error62["code"] !== "workspace-merged") {
|
|
21827
21827
|
return null;
|
|
21828
21828
|
}
|
|
21829
21829
|
const details = error62["details"];
|
|
@@ -21840,10 +21840,10 @@ function featureOffSay(body) {
|
|
|
21840
21840
|
}
|
|
21841
21841
|
function featureOffWords(feature) {
|
|
21842
21842
|
if (feature === TERMINAL_FEATURE) {
|
|
21843
|
-
return "The publisher command is not available for this
|
|
21843
|
+
return "The publisher command is not available for this workspace, and no one in the workspace can turn it on.";
|
|
21844
21844
|
}
|
|
21845
21845
|
const named = typeof feature === "string" && feature !== "" ? ` (the feature "${feature}")` : "";
|
|
21846
|
-
return `This is not available for this
|
|
21846
|
+
return `This is not available for this workspace${named}, and no one in the workspace can turn it on.`;
|
|
21847
21847
|
}
|
|
21848
21848
|
|
|
21849
21849
|
// ../client/src/clients/applications/refusal.ts
|
|
@@ -21941,10 +21941,10 @@ var ERROR_CODES = [
|
|
|
21941
21941
|
"UNAUTHORIZED",
|
|
21942
21942
|
"FORBIDDEN",
|
|
21943
21943
|
"REF_FORBIDDEN",
|
|
21944
|
-
// The credential names no
|
|
21945
|
-
// code rather than FORBIDDEN: a caller can act on it (sign in again, choosing
|
|
21944
|
+
// The credential names no workspace, so there is nothing to publish a repository FOR. Its own
|
|
21945
|
+
// code rather than FORBIDDEN: a caller can act on it (sign in again, choosing a workspace),
|
|
21946
21946
|
// and a test that could not tell it from "you may not" would prove nothing about the check.
|
|
21947
|
-
"
|
|
21947
|
+
"WORKSPACE_REQUIRED",
|
|
21948
21948
|
// A repository is created only by the platform's application maker (the portal), for a person,
|
|
21949
21949
|
// after it has made the application the repository will belong to. Its own code: a terminal that
|
|
21950
21950
|
// meets it is an older client calling this route directly, and can say "upgrade" rather than
|
|
@@ -21959,13 +21959,13 @@ var ERROR_CODES = [
|
|
|
21959
21959
|
"REPOSITORY_NOT_FOUND",
|
|
21960
21960
|
"REPOSITORY_CONFLICT",
|
|
21961
21961
|
"REPOSITORY_ARCHIVED",
|
|
21962
|
-
// The repository moved to another
|
|
21962
|
+
// The repository moved to another workspace (an adoption): it refuses every write and still
|
|
21963
21963
|
// admits reads. `details.movedTo` names the new repository only to a caller with a grant on it,
|
|
21964
21964
|
// and is null for everybody else. A client that does not know the code reads it as its 409.
|
|
21965
21965
|
"REPOSITORY_MOVED",
|
|
21966
|
-
// A copy for an adoption names the
|
|
21966
|
+
// A copy for an adoption names the workspace it moves the application from, and the source
|
|
21967
21967
|
// repository is in another one. Its own code: the portal tells it from a moved repository.
|
|
21968
|
-
"
|
|
21968
|
+
"REPOSITORY_NOT_IN_WORKSPACE",
|
|
21969
21969
|
"ACCESS_CONFLICT",
|
|
21970
21970
|
// A write of the grants that names no version in If-Match. The CLI writes no grant.
|
|
21971
21971
|
"MISSING_IF_MATCH",
|
|
@@ -23346,26 +23346,26 @@ var Publisher = class {
|
|
|
23346
23346
|
await noteAcceptedPublication(options.repoDir, outcome2);
|
|
23347
23347
|
return outcome2;
|
|
23348
23348
|
}
|
|
23349
|
-
// ----
|
|
23350
|
-
/** Create a NEW editable
|
|
23349
|
+
// ---- checkouts (docs/archive/checkout-parity.md) -------------------------------------------------
|
|
23350
|
+
/** Create a NEW editable checkout (clone + mapping) for a published repository. */
|
|
23351
23351
|
async checkout(options, call2 = {}) {
|
|
23352
|
-
return
|
|
23352
|
+
return createCheckout(this, options, call2);
|
|
23353
23353
|
}
|
|
23354
|
-
/** Make an associated folder a
|
|
23355
|
-
async
|
|
23356
|
-
return
|
|
23354
|
+
/** Make an associated folder a checkout (idempotent); `init` and `sync` both call it. */
|
|
23355
|
+
async adoptCheckout(directory, call2 = {}) {
|
|
23356
|
+
return adoptCheckout(this, directory, call2);
|
|
23357
23357
|
}
|
|
23358
|
-
/** Offline: the persisted
|
|
23359
|
-
async
|
|
23360
|
-
return
|
|
23358
|
+
/** Offline: the persisted checkout mapping, or null. */
|
|
23359
|
+
async checkoutMapping(directory) {
|
|
23360
|
+
return getCheckoutMapping(directory);
|
|
23361
23361
|
}
|
|
23362
|
-
/** Where the
|
|
23363
|
-
async
|
|
23364
|
-
return
|
|
23362
|
+
/** Where the checkout stands relative to the server (decided on real objects). */
|
|
23363
|
+
async checkoutStatus(directory, call2 = {}) {
|
|
23364
|
+
return inspectCheckout(this, directory, call2);
|
|
23365
23365
|
}
|
|
23366
23366
|
/** Fetch and, with `apply`, fast-forward or merge cleanly; advances the base. */
|
|
23367
23367
|
async sync(options, call2 = {}) {
|
|
23368
|
-
return
|
|
23368
|
+
return syncCheckout(this, options, call2);
|
|
23369
23369
|
}
|
|
23370
23370
|
/**
|
|
23371
23371
|
* A creator's whole round trip in one call, so nobody runs git: record their changes, bring in
|
|
@@ -23373,8 +23373,8 @@ var Publisher = class {
|
|
|
23373
23373
|
* having published nothing, on a conflict; the recorded commit stays, so nothing is lost.
|
|
23374
23374
|
*
|
|
23375
23375
|
* Everything that can refuse without touching the folder refuses first: a folder with no
|
|
23376
|
-
* association (or one pinned elsewhere) and a HEAD off the
|
|
23377
|
-
* a commit and then an error. `
|
|
23376
|
+
* association (or one pinned elsewhere) and a HEAD off the checkout branch would otherwise get
|
|
23377
|
+
* a commit and then an error. `syncCheckout` itself still never commits or publishes; this is
|
|
23378
23378
|
* the composition, and the only one.
|
|
23379
23379
|
*/
|
|
23380
23380
|
async syncChanges(options, call2 = {}) {
|
|
@@ -23384,12 +23384,12 @@ var Publisher = class {
|
|
|
23384
23384
|
if (!branch) {
|
|
23385
23385
|
throw new PublisherError("LOCAL_STATE", "HEAD is detached; check out the branch this folder publishes, then run sync again");
|
|
23386
23386
|
}
|
|
23387
|
-
const mapped = await
|
|
23387
|
+
const mapped = await getCheckoutMapping(dir);
|
|
23388
23388
|
if (mapped && mapped.branch !== branch) {
|
|
23389
23389
|
throw new PublisherError("LOCAL_STATE", `branch ${branch} is checked out, but this folder publishes ${mapped.branch}; check it out, then run sync again`);
|
|
23390
23390
|
}
|
|
23391
23391
|
const recorded = await recordChanges({ dir, ...options.message ? { message: options.message } : {} });
|
|
23392
|
-
const reconciled = await
|
|
23392
|
+
const reconciled = await syncCheckout(this, { directory: dir, apply: true }, call2);
|
|
23393
23393
|
const base = { recorded: { commit: recorded.commit, committed: recorded.committed, excluded: recorded.excluded }, reconciled };
|
|
23394
23394
|
if (reconciled.after === "conflict") {
|
|
23395
23395
|
const remote = reconciled.before.remote?.oid ?? null;
|
|
@@ -23777,7 +23777,7 @@ async function discoverEndpoint(portal, fetchImpl = fetch) {
|
|
|
23777
23777
|
|
|
23778
23778
|
// src/terminal/limited.ts
|
|
23779
23779
|
var REFUSED = /* @__PURE__ */ new Set(["REF_FORBIDDEN", "FORBIDDEN"]);
|
|
23780
|
-
var ASK = "Ask the owner or an admin of the
|
|
23780
|
+
var ASK = "Ask the owner or an admin of the workspace.";
|
|
23781
23781
|
var Limited = class _Limited {
|
|
23782
23782
|
/** The lines for a refusal with `code` and `details`, or null when it is not a permission's or names no reason and no maker. */
|
|
23783
23783
|
static hint(code, details) {
|
|
@@ -23796,7 +23796,7 @@ var Limited = class _Limited {
|
|
|
23796
23796
|
const text = (value) => typeof value === "string" && value.trim() !== "" ? value.trim() : null;
|
|
23797
23797
|
const reason = text(details?.["reason"]);
|
|
23798
23798
|
const contactId = text(details?.["contactId"]);
|
|
23799
|
-
return [reason === null ? null : `The
|
|
23799
|
+
return [reason === null ? null : `The workspace's reason: ${reason}`, contactId === null ? null : ASK].filter((line) => line !== null);
|
|
23800
23800
|
}
|
|
23801
23801
|
};
|
|
23802
23802
|
|
|
@@ -24021,7 +24021,7 @@ function progressHint(r, portal, answerable = false) {
|
|
|
24021
24021
|
case "live":
|
|
24022
24022
|
return "Your app is live.";
|
|
24023
24023
|
case "not-deployed":
|
|
24024
|
-
return "Published and checked; this
|
|
24024
|
+
return "Published and checked; this workspace does not deploy automatically.";
|
|
24025
24025
|
case "failed":
|
|
24026
24026
|
return inPortal(portal, `This version stopped at "${r.failedAt ?? "a step"}".${r.reason === null ? "" : ` ${r.reason}`}`, r.reason === null ? "See why" : "See it");
|
|
24027
24027
|
case "stopped":
|
|
@@ -24309,7 +24309,7 @@ async function finish(ctx, got, clock) {
|
|
|
24309
24309
|
isDefault: named !== null && file2.defaultProfile === named,
|
|
24310
24310
|
server: caps.server,
|
|
24311
24311
|
credentialsFile: path,
|
|
24312
|
-
// Which setting chose that path: a sandbox that keeps only
|
|
24312
|
+
// Which setting chose that path: a sandbox that keeps only one folder needs it to be in that folder.
|
|
24313
24313
|
credentialsFrom: credentialsLocation().from,
|
|
24314
24314
|
timings
|
|
24315
24315
|
});
|
|
@@ -24613,14 +24613,14 @@ async function linkFolder(inv, p, endpoint, dir, attach) {
|
|
|
24613
24613
|
await p.getRepository(repoId);
|
|
24614
24614
|
}
|
|
24615
24615
|
await p.associate(dir, repoId);
|
|
24616
|
-
const
|
|
24616
|
+
const checkout2 = await p.adoptCheckout(dir).catch(() => null);
|
|
24617
24617
|
return {
|
|
24618
24618
|
repoId,
|
|
24619
24619
|
appId,
|
|
24620
24620
|
created: attach.repoId === void 0,
|
|
24621
24621
|
placement,
|
|
24622
24622
|
onboarding: onboarding ? { commit: onboarding.commit, committed: onboarding.committed.length, excluded: onboarding.excluded } : null,
|
|
24623
|
-
|
|
24623
|
+
checkout: checkout2 === null ? null : { branch: checkout2.branch, baseOid: checkout2.baseOid, baseGeneration: checkout2.baseGeneration }
|
|
24624
24624
|
};
|
|
24625
24625
|
}
|
|
24626
24626
|
|
|
@@ -24637,7 +24637,7 @@ var Moved = class {
|
|
|
24637
24637
|
}
|
|
24638
24638
|
const movedTo = details?.["movedTo"];
|
|
24639
24639
|
const next = typeof movedTo === "string" ? `then run publisher checkout <new folder> --repo ${movedTo}` : "then run publisher list to find it there";
|
|
24640
|
-
return `This app moved to another
|
|
24640
|
+
return `This app moved to another workspace. Sign in again with publisher login, choose that workspace, ${next}.`;
|
|
24641
24641
|
}
|
|
24642
24642
|
};
|
|
24643
24643
|
|
|
@@ -24842,9 +24842,9 @@ async function portalAt(endpoint, opts) {
|
|
|
24842
24842
|
}
|
|
24843
24843
|
}
|
|
24844
24844
|
var REFUSED2 = {
|
|
24845
|
-
read: "the portal will not show this sign-in the preparation in this
|
|
24846
|
-
answer: "the portal will not let this sign-in answer for this
|
|
24847
|
-
retry: "the portal will not let this sign-in try it again in this
|
|
24845
|
+
read: "the portal will not show this sign-in the preparation in this workspace",
|
|
24846
|
+
answer: "the portal will not let this sign-in answer for this workspace (the owner or an admin can, or the app's creator for the first preparation after an adoption)",
|
|
24847
|
+
retry: "the portal will not let this sign-in try it again in this workspace (the owner or an admin can, or the app's creator, except for the first preparation after an adoption)"
|
|
24848
24848
|
};
|
|
24849
24849
|
function shown(portal, r, refused) {
|
|
24850
24850
|
switch (r.kind) {
|
|
@@ -24855,7 +24855,7 @@ function shown(portal, r, refused) {
|
|
|
24855
24855
|
case "nothing-prepared":
|
|
24856
24856
|
return { kind: "nothing-prepared", portal, hint: "Nothing is being prepared for this app, so nothing is waiting for an answer." };
|
|
24857
24857
|
case "no-application":
|
|
24858
|
-
throw new PublisherError("NOT_FOUND", "this repository has no application in your
|
|
24858
|
+
throw new PublisherError("NOT_FOUND", "this repository has no application in your workspace yet; publish it first");
|
|
24859
24859
|
case "moved-on":
|
|
24860
24860
|
throw new PublisherError("UNAVAILABLE", "the preparation moved on before the answer arrived; run publisher question again", { isRetryable: true });
|
|
24861
24861
|
case "unauthorized":
|
|
@@ -24944,11 +24944,7 @@ async function creatorTool(p, endpoint, tool, args, opts = {}) {
|
|
|
24944
24944
|
case "unauthorized":
|
|
24945
24945
|
throw new PublisherError("UNAUTHORIZED", "the portal did not accept this sign-in; run publisher login");
|
|
24946
24946
|
case "forbidden":
|
|
24947
|
-
throw new PublisherError(
|
|
24948
|
-
"FORBIDDEN",
|
|
24949
|
-
result.say ?? "the portal will not let this sign-in do that in this organization",
|
|
24950
|
-
result.limit === null ? {} : { details: result.limit }
|
|
24951
|
-
);
|
|
24947
|
+
throw new PublisherError("FORBIDDEN", result.say ?? "the portal will not let this sign-in do that in this workspace", result.limit === null ? {} : { details: result.limit });
|
|
24952
24948
|
case "unavailable":
|
|
24953
24949
|
throw new PublisherError("UNAVAILABLE", `the portal could not be asked: ${result.detail}`, { isRetryable: true });
|
|
24954
24950
|
case "malformed":
|
|
@@ -25149,7 +25145,7 @@ function syncHint(state, conflicts, marked) {
|
|
|
25149
25145
|
}
|
|
25150
25146
|
}
|
|
25151
25147
|
|
|
25152
|
-
// src/commands/
|
|
25148
|
+
// src/commands/checkout.ts
|
|
25153
25149
|
var fetch2 = {
|
|
25154
25150
|
git: true,
|
|
25155
25151
|
async run(inv) {
|
|
@@ -25171,16 +25167,16 @@ var checkout = {
|
|
|
25171
25167
|
const { p } = await inv.client();
|
|
25172
25168
|
const branch = inv.str("branch");
|
|
25173
25169
|
const m = await p.checkout({ directory: dir, repoId, ...branch ? { branch } : {} }, { onProgress: inv.progress });
|
|
25174
|
-
inv.out({ ok: true,
|
|
25170
|
+
inv.out({ ok: true, checkout: m });
|
|
25175
25171
|
return 0;
|
|
25176
25172
|
}
|
|
25177
25173
|
};
|
|
25178
|
-
var
|
|
25174
|
+
var checkoutStatus = {
|
|
25179
25175
|
git: true,
|
|
25180
25176
|
async run(inv) {
|
|
25181
25177
|
const dir = inv.dirArg(1);
|
|
25182
25178
|
const { p } = await inv.client(dir);
|
|
25183
|
-
const s = await p.
|
|
25179
|
+
const s = await p.checkoutStatus(dir, { onProgress: inv.progress });
|
|
25184
25180
|
inv.out(s);
|
|
25185
25181
|
return s.state === "conflict" ? 2 : 0;
|
|
25186
25182
|
}
|
|
@@ -25220,13 +25216,13 @@ var EXIT_CODE = {
|
|
|
25220
25216
|
NOT_FOUND: 1,
|
|
25221
25217
|
METHOD_NOT_ALLOWED: 1,
|
|
25222
25218
|
REF_FORBIDDEN: 1,
|
|
25223
|
-
|
|
25219
|
+
WORKSPACE_REQUIRED: 1,
|
|
25224
25220
|
OWNER_REQUIRED: 1,
|
|
25225
25221
|
REPOSITORY_NOT_FOUND: 1,
|
|
25226
25222
|
REPOSITORY_CONFLICT: 1,
|
|
25227
25223
|
REPOSITORY_ARCHIVED: 1,
|
|
25228
25224
|
REPOSITORY_MOVED: 1,
|
|
25229
|
-
|
|
25225
|
+
REPOSITORY_NOT_IN_WORKSPACE: 1,
|
|
25230
25226
|
ACCESS_CONFLICT: 1,
|
|
25231
25227
|
MISSING_IF_MATCH: 1,
|
|
25232
25228
|
PUBLICATION_NOT_FOUND: 1,
|
|
@@ -25393,15 +25389,15 @@ Usage:
|
|
|
25393
25389
|
publisher init [dir] [--name <name>] [--repo <id>] [--cell <cell>]
|
|
25394
25390
|
create (or attach to) a repository, associate this folder; --cell names
|
|
25395
25391
|
where a new app runs
|
|
25396
|
-
and record it as a
|
|
25392
|
+
and record it as a checkout (so sync works here)
|
|
25397
25393
|
publisher publish [dir] [--ref <ref>]... [--force] [--no-wait] publish commits as they are; to save and publish
|
|
25398
25394
|
a change, use sync
|
|
25399
25395
|
publisher status [dir] [--publication <id>] resolve pending/interrupted publications
|
|
25400
25396
|
publisher fetch [dir]
|
|
25401
25397
|
publisher list [--archived] [--after <next>] the apps you published, newest first, each with the
|
|
25402
25398
|
checkout command that brings it into a new folder
|
|
25403
|
-
publisher checkout <dir> --repo <id> [--branch <name>] create a NEW editable
|
|
25404
|
-
publisher
|
|
25399
|
+
publisher checkout <dir> --repo <id> [--branch <name>] create a NEW editable checkout (never overlays a folder)
|
|
25400
|
+
publisher checkout-status [dir] offline mapping + where the checkout stands (real three-way check)
|
|
25405
25401
|
publisher sync [dir] [--message <text>] [--name <app>] THE way to publish: a folder linked to nothing first gets its
|
|
25406
25402
|
application and repository (what init does); then it records the
|
|
25407
25403
|
changes (never .env, keys or node_modules), brings in what
|
|
@@ -25443,7 +25439,7 @@ Usage:
|
|
|
25443
25439
|
turn it on for that app (an app you made, or any app as the
|
|
25444
25440
|
owner or an admin); only you, the owner and the admins can use
|
|
25445
25441
|
new data until a grant gives access
|
|
25446
|
-
publisher data remove <id> --app <app> that app stops using that data; the
|
|
25442
|
+
publisher data remove <id> --app <app> that app stops using that data; the workspace keeps it
|
|
25447
25443
|
publisher merge-check [dir] --ours <ref> --theirs <ref> [--apply]
|
|
25448
25444
|
publisher info [dir] repository state as seen by the server
|
|
25449
25445
|
publisher doctor environment check (node, git, credentials, association)
|
|
@@ -25480,7 +25476,7 @@ var COMMANDS = /* @__PURE__ */ new Map([
|
|
|
25480
25476
|
["fetch", fetch2],
|
|
25481
25477
|
["list", list],
|
|
25482
25478
|
["checkout", checkout],
|
|
25483
|
-
["
|
|
25479
|
+
["checkout-status", checkoutStatus],
|
|
25484
25480
|
["sync", sync],
|
|
25485
25481
|
["follow", follow],
|
|
25486
25482
|
["question", question],
|