gitroll 0.1.0 → 0.1.2
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/CHANGELOG.md +11 -0
- package/README.md +20 -5
- package/dist/gitroll.mjs +22 -3
- package/dist/web/app.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to GitRoll are documented here. GitRoll follows [semantic versioning](https://semver.org). The Roll file format has its own version, documented in [SPEC.md](SPEC.md).
|
|
4
4
|
|
|
5
|
+
## 0.1.2 (2026-09-15)
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Release publishing:** npm now receives each release with provenance (0.1.1 wasn't published to npm), and the Scoop bucket is updated automatically. No changes to the app.
|
|
9
|
+
|
|
10
|
+
## 0.1.1 (2026-09-15)
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Scoop (Windows):** `scoop bucket add gitroll https://github.com/jimhoyd-com/scoop-bucket`, then `scoop install gitroll/gitroll`. Every release installs the manifest with Scoop on Windows before publishing. `gitroll version`, `upgrade` and `uninstall` recognize Scoop installs.
|
|
14
|
+
- **npm:** `npm install --global gitroll`, published by the release workflow with provenance through npm trusted publishing (no stored npm token).
|
|
15
|
+
|
|
5
16
|
## 0.1.0 (2026-09-15)
|
|
6
17
|
|
|
7
18
|
First public release.
|
package/README.md
CHANGED
|
@@ -12,7 +12,13 @@ Your logbook, called a **Roll**, is a folder of plain files on your computer tha
|
|
|
12
12
|
|
|
13
13
|
GitRoll needs [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org) 20 or newer.
|
|
14
14
|
|
|
15
|
-
**Mac or Linux:**
|
|
15
|
+
**Homebrew (Mac or Linux):**
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
brew install jimhoyd-com/tap/gitroll
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Mac or Linux without Homebrew:** download and run the installer. It fetches the latest release, verifies its SHA-256 checksum, and installs it.
|
|
16
22
|
|
|
17
23
|
```bash
|
|
18
24
|
curl -fsSL https://raw.githubusercontent.com/jimhoyd-com/gitroll/main/scripts/install.sh -o install.sh
|
|
@@ -22,13 +28,20 @@ curl -fsSL https://raw.githubusercontent.com/jimhoyd-com/gitroll/main/scripts/in
|
|
|
22
28
|
sh install.sh
|
|
23
29
|
```
|
|
24
30
|
|
|
25
|
-
**Windows
|
|
31
|
+
**Windows, with [Scoop](https://scoop.sh):**
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
scoop bucket add gitroll https://github.com/jimhoyd-com/scoop-bucket
|
|
35
|
+
scoop install gitroll/gitroll
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Any system with Node.js, from npm:** published with [provenance](https://docs.npmjs.com/generating-provenance-statements), so you can check it was built by this repository's release workflow.
|
|
26
39
|
|
|
27
40
|
```bash
|
|
28
|
-
npm install
|
|
41
|
+
npm install --global gitroll
|
|
29
42
|
```
|
|
30
43
|
|
|
31
|
-
Every release is tested by installing it on clean Linux, macOS and Windows machines before it's published.
|
|
44
|
+
Every release is tested by installing it on clean Linux, macOS and Windows machines, with Homebrew and with Scoop, before it's published. Each release also has the package and `SHA256SUMS` on the [releases page](https://github.com/jimhoyd-com/gitroll/releases/latest) if you'd rather download and check it yourself.
|
|
32
45
|
|
|
33
46
|
For one-command backup and sharing, also install the [GitHub CLI](https://cli.github.com) and run `gh auth login`. It's optional.
|
|
34
47
|
|
|
@@ -66,7 +79,8 @@ Your Rolls contain no app code, so upgrading never changes them: new versions re
|
|
|
66
79
|
| How you installed | Upgrade with |
|
|
67
80
|
| --- | --- |
|
|
68
81
|
| Homebrew | `brew upgrade gitroll` (or `gitroll upgrade`) |
|
|
69
|
-
|
|
|
82
|
+
| Scoop (Windows) | `scoop update gitroll` (or `gitroll upgrade`) |
|
|
83
|
+
| The installer, or npm | `gitroll upgrade`. It downloads the latest release, checks it against `SHA256SUMS`, and installs it. Running the installer again, or `npm install --global gitroll@latest`, also works. |
|
|
70
84
|
| From source | `git pull && npm ci && npm run build` |
|
|
71
85
|
|
|
72
86
|
Not sure? `gitroll version` shows the version and how it was installed. `gitroll upgrade --dry-run` shows what would happen without changing anything.
|
|
@@ -86,6 +100,7 @@ If the `gitroll` command no longer works, remove it directly:
|
|
|
86
100
|
| How you installed | Uninstall with |
|
|
87
101
|
| --- | --- |
|
|
88
102
|
| Homebrew | `brew uninstall gitroll` |
|
|
103
|
+
| Scoop (Windows) | `scoop uninstall gitroll` |
|
|
89
104
|
| The installer, or npm (Mac, Linux, Windows) | `npm uninstall --global gitroll` |
|
|
90
105
|
| Mac or Linux, any method | [`scripts/uninstall.sh`](scripts/uninstall.sh): download it, read it, then run `sh uninstall.sh` (add `--remove-settings` to also remove settings) |
|
|
91
106
|
|
package/dist/gitroll.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! GitRoll 0.1.
|
|
2
|
+
/*! GitRoll 0.1.2 · MIT License · Includes third-party software; see THIRD_PARTY_NOTICES.txt */
|
|
3
3
|
import { createRequire as __gitrollRequire } from "node:module"; const require = __gitrollRequire(import.meta.url);
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -9535,19 +9535,22 @@ function detectInstall(entry = fileURLToPath2(import.meta.url)) {
|
|
|
9535
9535
|
}
|
|
9536
9536
|
}
|
|
9537
9537
|
function methodFor(root) {
|
|
9538
|
-
const p = root.
|
|
9538
|
+
const p = root.replace(/\\/g, "/");
|
|
9539
9539
|
if (/\/Cellar\/gitroll\/|\/homebrew\/.*\/gitroll(\/|$)|\/linuxbrew\//.test(p)) return "homebrew";
|
|
9540
|
+
if (/\/scoop\/apps\/gitroll(\/|$)/i.test(p)) return "scoop";
|
|
9540
9541
|
if (/\/node_modules\/gitroll$/.test(p)) return "npm";
|
|
9541
9542
|
return "source";
|
|
9542
9543
|
}
|
|
9543
9544
|
var commands = {
|
|
9544
9545
|
upgrade: {
|
|
9545
9546
|
homebrew: "brew upgrade gitroll",
|
|
9547
|
+
scoop: "scoop update gitroll",
|
|
9546
9548
|
npm: "gitroll upgrade",
|
|
9547
9549
|
source: "git pull && npm ci && npm run build"
|
|
9548
9550
|
},
|
|
9549
9551
|
uninstall: {
|
|
9550
9552
|
homebrew: "brew uninstall gitroll",
|
|
9553
|
+
scoop: "scoop uninstall gitroll",
|
|
9551
9554
|
npm: "npm uninstall --global gitroll",
|
|
9552
9555
|
source: "Delete the source folder"
|
|
9553
9556
|
}
|
|
@@ -10732,7 +10735,16 @@ function need(value, usage) {
|
|
|
10732
10735
|
return value.trim();
|
|
10733
10736
|
}
|
|
10734
10737
|
function describeInstall(install) {
|
|
10735
|
-
|
|
10738
|
+
switch (install.method) {
|
|
10739
|
+
case "homebrew":
|
|
10740
|
+
return "installed with Homebrew";
|
|
10741
|
+
case "scoop":
|
|
10742
|
+
return "installed with Scoop";
|
|
10743
|
+
case "npm":
|
|
10744
|
+
return "installed with the installer or npm";
|
|
10745
|
+
default:
|
|
10746
|
+
return `running from source in ${install.root}`;
|
|
10747
|
+
}
|
|
10736
10748
|
}
|
|
10737
10749
|
async function upgrade(yes, dryRun) {
|
|
10738
10750
|
const install = detectInstall();
|
|
@@ -10744,6 +10756,12 @@ async function upgrade(yes, dryRun) {
|
|
|
10744
10756
|
run2("brew", ["upgrade", "gitroll"]);
|
|
10745
10757
|
return console.log(green2("Done. Your Rolls didn't need any changes."));
|
|
10746
10758
|
}
|
|
10759
|
+
if (install.method === "scoop") {
|
|
10760
|
+
if (dryRun) return console.log(`Would run: ${commands.upgrade.scoop}`);
|
|
10761
|
+
if (!await confirm("Upgrade with Scoop now?", yes)) return;
|
|
10762
|
+
run2("scoop", ["update", "gitroll"]);
|
|
10763
|
+
return console.log(green2("Done. Your Rolls didn't need any changes."));
|
|
10764
|
+
}
|
|
10747
10765
|
const latest = await latestVersion();
|
|
10748
10766
|
if (!newer(latest, install.version)) return console.log(green2(`You have the latest version (${install.version}).`));
|
|
10749
10767
|
console.log(`GitRoll ${latest} is available. See what's new: https://github.com/jimhoyd-com/gitroll/releases/tag/v${latest}`);
|
|
@@ -10781,6 +10799,7 @@ async function uninstall(yes, dryRun, removeSettings) {
|
|
|
10781
10799
|
console.log(green2("Removed GitRoll's settings."));
|
|
10782
10800
|
}
|
|
10783
10801
|
if (install.method === "homebrew") run2("brew", ["uninstall", "gitroll"]);
|
|
10802
|
+
else if (install.method === "scoop") run2("scoop", ["uninstall", "gitroll"]);
|
|
10784
10803
|
else if (install.method === "npm") run2("npm", ["uninstall", "--global", "gitroll"]);
|
|
10785
10804
|
console.log(green2(install.method === "source" ? "Done." : "GitRoll was uninstalled."));
|
|
10786
10805
|
console.log("Your Rolls are untouched. To use them again, reinstall GitRoll and run gitroll inside a Roll folder.");
|
package/dist/web/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! GitRoll 0.1.
|
|
1
|
+
/*! GitRoll 0.1.2 · MIT License · Includes third-party software; see THIRD_PARTY_NOTICES.txt */
|
|
2
2
|
var xe=class extends Error{};var ce=t=>String(Math.abs(t)).padStart(2,"0");function yt(t=new Date){let e=-t.getTimezoneOffset(),n=e>=0?"+":"-";return`${t.getFullYear()}-${ce(t.getMonth()+1)}-${ce(t.getDate())}T${ce(t.getHours())}:${ce(t.getMinutes())}:${ce(t.getSeconds())}${n}${ce(Math.floor(Math.abs(e)/60))}:${ce(Math.abs(e)%60)}`}function Yt(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64).replace(/-+$/,"")}var Hn={$:"USD","€":"EUR","£":"GBP","¥":"JPY"};function Vt(t){let e=/^\s*([$€£¥])?\s*(-?[\d,]*\.?\d+)\s*([a-z]{3})?\s*$/i.exec(t);if(!e)return null;let n=Number(e[2].replace(/,/g,""));return Number.isFinite(n)?{value:n,currency:(e[3]??(e[1]?Hn[e[1]]:"USD")).toUpperCase()}:null}function Jt(t){let e="";for(let n=0;n<t.length;n+=32768)e+=String.fromCharCode(...t.subarray(n,n+32768));return btoa(e)}var Z=class extends Error{},ee=class extends Error{};async function fe(t,e,n){let s;try{s=await fetch(`api/${e}`,{method:t,headers:{"Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n),cache:"no-store"})}catch{throw new Z("GitRoll has stopped. Start it again from your terminal with: gitroll")}let i=await s.json().catch(()=>null);if(s.status===401)throw new ee(i?.error??"Open GitRoll from the link shown in your terminal.");if(!s.ok||i===null)throw new xe(i?.error??`Something went wrong (${s.status}).`);return i}var Ue=class t{#e;#t="";static async connect(){let e=new t;try{return await e.refresh(),{store:e}}catch(n){return{error:n instanceof ee?"signed-out":"stopped"}}}info=()=>this.#e.info;version=()=>this.#t;entries=()=>this.#e.entries;projects=()=>this.#e.projects;types=()=>this.#e.types;async refresh(){let e;try{e=await fetch("api/state",{cache:"no-store"})}catch{throw new Z("GitRoll has stopped.")}if(e.status===401)throw new ee("Open GitRoll from the link shown in your terminal.");if(!e.ok||!(e.headers.get("content-type")??"").includes("application/json"))throw new Z("GitRoll has stopped.");let n=await e.text();n!==this.#t&&(this.#e=JSON.parse(n),this.#t=n)}async#n(e){let n=this.#e.info.maxAttachmentBytes,s=e.find(i=>i.size>n);if(s)throw new xe(`${s.name} is too large. Files can be up to ${Math.round(n/1048576)} MB.`);return Promise.all(e.map(async i=>({name:i.name,type:i.type,data:Jt(new Uint8Array(await i.arrayBuffer()))})))}async addEntry(e,n){let s=await fe("POST","entries",{...e,files:await this.#n(n)});return await this.refresh(),s}async updateEntry(e,n,s){let i=await fe("PATCH",`entries/${encodeURIComponent(e)}`,{...n,files:await this.#n(s)});return await this.refresh(),i}async deleteEntry(e){await fe("DELETE",`entries/${encodeURIComponent(e)}`),await this.refresh()}async createProject(e){let{project:n}=await fe("POST","projects",{name:e});return await this.refresh(),n}async history(e){return(await fe("GET",`entries/${encodeURIComponent(e)}/history`)).history}attachmentUrl(e){return`attachments/${encodeURIComponent(e.hash)}`}async sync(){let e=await fe("POST","sync",{});return await this.refresh(),e}ask(e){return fe("POST","ask",{question:e})}};var qe=Symbol.for("yaml.alias"),Gt=Symbol.for("yaml.document"),H=Symbol.for("yaml.map"),bt=Symbol.for("yaml.pair"),ke=Symbol.for("yaml.scalar"),te=Symbol.for("yaml.seq"),_=Symbol.for("yaml.node.type"),K=t=>!!t&&typeof t=="object"&&t[_]===qe,Y=t=>!!t&&typeof t=="object"&&t[_]===Gt,W=t=>!!t&&typeof t=="object"&&t[_]===H,k=t=>!!t&&typeof t=="object"&&t[_]===bt,S=t=>!!t&&typeof t=="object"&&t[_]===ke,V=t=>!!t&&typeof t=="object"&&t[_]===te;function L(t){if(t&&typeof t=="object")switch(t[_]){case H:case te:return!0}return!1}function v(t){if(t&&typeof t=="object")switch(t[_]){case qe:case H:case ke:case te:return!0}return!1}var He=t=>(S(t)||L(t))&&!!t.anchor;var D=Symbol("break visit"),Wt=Symbol("skip children"),J=Symbol("remove node");function z(t,e){let n=zt(e);Y(t)?ve(null,t.contents,n,Object.freeze([t]))===J&&(t.contents=null):ve(null,t,n,Object.freeze([]))}z.BREAK=D;z.SKIP=Wt;z.REMOVE=J;function ve(t,e,n,s){let i=Qt(t,e,n,s);if(v(i)||k(i))return Xt(t,s,i),ve(t,i,n,s);if(typeof i!="symbol"){if(L(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=ve(r,e.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===J&&(e.items.splice(r,1),r-=1)}}}else if(k(e)){s=Object.freeze(s.concat(e));let r=ve("key",e.key,n,s);if(r===D)return D;r===J&&(e.key=null);let o=ve("value",e.value,n,s);if(o===D)return D;o===J&&(e.value=null)}}return i}async function Ye(t,e){let n=zt(e);Y(t)?await Te(null,t.contents,n,Object.freeze([t]))===J&&(t.contents=null):await Te(null,t,n,Object.freeze([]))}Ye.BREAK=D;Ye.SKIP=Wt;Ye.REMOVE=J;async function Te(t,e,n,s){let i=await Qt(t,e,n,s);if(v(i)||k(i))return Xt(t,s,i),Te(t,i,n,s);if(typeof i!="symbol"){if(L(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=await Te(r,e.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===D)return D;o===J&&(e.items.splice(r,1),r-=1)}}}else if(k(e)){s=Object.freeze(s.concat(e));let r=await Te("key",e.key,n,s);if(r===D)return D;r===J&&(e.key=null);let o=await Te("value",e.value,n,s);if(o===D)return D;o===J&&(e.value=null)}}return i}function zt(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Qt(t,e,n,s){if(typeof n=="function")return n(t,e,s);if(W(e))return n.Map?.(t,e,s);if(V(e))return n.Seq?.(t,e,s);if(k(e))return n.Pair?.(t,e,s);if(S(e))return n.Scalar?.(t,e,s);if(K(e))return n.Alias?.(t,e,s)}function Xt(t,e,n){let s=e[e.length-1];if(L(s))s.items[t]=n;else if(k(s))t==="key"?s.key=n:s.value=n;else if(Y(s))s.contents=n;else{let i=K(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}var Yn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Vn=t=>t.replace(/[!,[\]{}]/g,e=>Yn[e]),$e=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+Vn(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),i;if(e&&s.length>0&&v(e.contents)){let r={};z(e.contents,(o,c)=>{v(c)&&c.tag&&(r[c.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(c=>c.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
|
|
3
3
|
`)}};$e.defaultYaml={explicit:!1,version:"1.2"};$e.defaultTags={"!!":"tag:yaml.org,2002:"};function Ve(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function ue(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){let o=s[i],c=ue(t,s,String(i),o);c===void 0?delete s[i]:c!==o&&(s[i]=c)}else if(s instanceof Map)for(let i of Array.from(s.keys())){let r=s.get(i),o=ue(t,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(let i of Array.from(s)){let r=ue(t,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(let[i,r]of Object.entries(s)){let o=ue(t,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return t.call(e,n,s)}function C(t,e,n){if(Array.isArray(t))return t.map((s,i)=>C(s,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!He(t))return t.toJSON(e,n);let s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=r=>{s.res=r,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}var ne=class{constructor(e){Object.defineProperty(this,_,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!Y(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=C(this,"",o);if(typeof i=="function")for(let{count:a,res:l}of o.anchors.values())i(l,a);return typeof r=="function"?ue(r,{"":c},"",c):c}};var pe=class extends ne{constructor(e){super(qe),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],z(e,{Node:(r,o)=>{(K(o)||He(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let i;for(let r of s){if(r===this)break;r.anchor===this.source&&(i=r)}if(i&&n){let{anchors:r,doc:o,maxAliasCount:c}=n,a=r.get(i);if(a||(C(i,null,n),a=r.get(i)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(c>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Je(o,i,r)),a.count*a.aliasCount>c)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return i}toJSON(e,n){if(!n)return{source:this.source};let s=this.resolve(n.doc,n);if(!s){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return n.anchors.get(s).res}toString(e,n,s){let i=`*${this.source}`;if(e){if(Ve(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function Je(t,e,n){if(K(e)){let s=e.resolve(t),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(L(e)){let s=0;for(let i of e.items){let r=Je(t,i,n);r>s&&(s=r)}return s}else if(k(e)){let s=Je(t,e.key,n),i=Je(t,e.value,n);return Math.max(s,i)}return 1}var Ge=t=>!t||typeof t!="function"&&typeof t!="object",w=class extends ne{constructor(e){super(ke),this.value=e}toJSON(e,n){return n?.keep?this.value:C(this.value,e,n)}toString(){return String(this.value)}};w.BLOCK_FOLDED="BLOCK_FOLDED";w.BLOCK_LITERAL="BLOCK_LITERAL";w.PLAIN="PLAIN";w.QUOTE_DOUBLE="QUOTE_DOUBLE";w.QUOTE_SINGLE="QUOTE_SINGLE";var Jn="tag:yaml.org,2002:";function Gn(t,e,n){if(e){let s=n.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(s=>s.identify?.(t)&&!s.format)}function se(t,e,n){if(Y(t)&&(t=t.contents),v(t))return t;if(k(t)){let f=n.schema[H].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:c}=n,a;if(s&&t&&typeof t=="object"){if(a=c.get(t),a)return a.anchor??(a.anchor=i(t)),new pe(a.anchor);a={anchor:null,node:null},c.set(t,a)}e?.startsWith("!!")&&(e=Jn+e.slice(2));let l=Gn(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new w(t);return a&&(a.node=f),f}l=t instanceof Map?o[H]:Symbol.iterator in Object(t)?o[te]:o[H]}r&&(r(l),delete n.onTagObj);let m=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new w(t);return e?m.tag=e:l.default||(m.tag=l.tag),a&&(a.node=m),m}function wt(t,e,n){let s=n;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return se(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Zt=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Ee=class extends ne{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>v(s)||k(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Zt(e))this.add(n);else{let[s,...i]=e,r=this.get(s,!0);if(L(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,wt(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){let[n,...s]=e;if(s.length===0)return this.delete(n);let i=this.get(n,!0);if(L(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){let[s,...i]=e,r=this.get(s,!0);return i.length===0?!n&&S(r)?r.value:r:L(r)?r.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!k(n))return!1;let s=n.value;return s==null||e&&S(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[n,...s]=e;if(s.length===0)return this.has(n);let i=this.get(n,!0);return L(i)?i.hasIn(s):!1}setIn(e,n){let[s,...i]=e;if(i.length===0)this.set(s,n);else{let r=this.get(s,!0);if(L(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,wt(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};var en=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ie(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Q=(t,e,n)=>t.endsWith(`
|
|
4
4
|
`)?ie(n,e):n.includes(`
|