From 2eca4e4ded2a8fabd4dd14f4e5f356571c816592 Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Sat, 24 Oct 2026 11:03:40 +0200 Subject: [PATCH 1/3] Qualify the developer journey end to end and fix the archives rooted at the package name [#316] --- docs/CHANGELOG.md | 7 ++ docs/PROJECT_STATUS.md | 28 +++++++- examples/life/ui/main.tsx | 2 +- js/developer/environment/archive.mjs | 8 ++- js/developer/environment/bundles.json | 6 +- js/developer/environment/packages.bundle.mjs | 2 +- test/cmake/PrepareJourney.cmake | 16 +++++ test/developer/specs/environment-specs.mjs | 15 +++++ test/fixtures/journey/tests/life.spec.js | 12 ++++ test/fixtures/journey/tools/denied.mjs | 2 + test/fixtures/journey/tsconfig.json | 12 ++++ test/web/CMakeLists.txt | 70 +++++++++++++++++++- test/web/registry-packages.json | 18 +++++ test/web/registry/fixture.mjs | 5 +- 14 files changed, 190 insertions(+), 13 deletions(-) create mode 100644 test/cmake/PrepareJourney.cmake create mode 100644 test/fixtures/journey/tests/life.spec.js create mode 100644 test/fixtures/journey/tools/denied.mjs create mode 100644 test/fixtures/journey/tsconfig.json diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 798f254b..8371d366 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,6 +9,9 @@ ### Fixed +- The installer of the developer environment reads npm archives rooted at any single directory, as npm does (#316): the archives of + `@types/*` are rooted at the package name and were refused as "Invalid npm tarball root". A mixed or escaping root is still refused. +- The Life starter type-checks under TypeScript `strict` (`useState`), which `wf check` now proves. - Script injection works before the page body exists, including a driver handshake completed during HTML parsing. - `wf test` supports WebKit engines without `AbortSignal.any()` (#335), preserving cancellation/deadline reports and @@ -25,6 +28,10 @@ ### Added +- Developer journey qualification (#316, epic #303): `Journey*` CTest cases run `wf create`, `init`, `install`, `check`, `test`, `build` + and `embed` on one project in an empty directory from the local registry, compile the generated header into the Life application + and run it from an empty directory, then check a script under denied permissions and an emptied cache offline and restored. The test + registry gains `@types/react`, `@types/react-dom` and `csstype`. - `third_party/` is removed (#319, epic #303): `fflate` 0.8.3, the last vendored source, is a locked package of the repository's `wf` project, imported by name from `js/developer/environment/embed.mjs`; its notice comes from the installed package. The environment archive stays byte for byte identical. The test registry downloads it at configure time, and diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index e0d27576..527589eb 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -38,13 +38,39 @@ site and refuses to change a published version; `pin.mjs` checks the pin against `archive-release.sh` do the host operations with `gh`. The `DeveloperDistribution.yml` jobs `wf-package` and `publish`, and the actions `wf-driver` and `remove-node`, run only on GitHub. +## Developer journey qualification (#316, epic #303) + +The whole journey of a developer is a chain of CTest cases (`Journey*`, label `web-integration`) on one project in an empty +directory, from the environment built from the sources and the local registry, without Node.js, npm or public network after configure +(the CEF job cuts it): + +| Step | Case | Proof | +| --- | --- | --- | +| `wf create life` | `JourneyCreate` | the pinned starter is verified and written to `ui/` | +| `wf init` | `JourneyInit` | the manifest | +| `wf install` | `JourneyInstall` | eight packages from the registry, among them `@types/react` (archive rooted at `react/`, not `package/`) | +| `wf check` | `JourneyCheck` | the real Life starter type-checks under TypeScript 5.9 strict | +| `wf test` | `JourneyTest` | two Jasmine specs in the real engine | +| `wf build`, `wf embed` | `JourneyBuild`, `JourneyEmbed` | the header `generated/LifeUI.hpp` | +| compile and run | `JourneyEmbeddedBuild`, `JourneyEmbeddedRun` | the header is compiled into the Life application, which runs from an empty directory | +| `wf preview`, `wf dev` | `DeveloperBrowserIntegration` | they need the page of the terminal: run in the same engine, with Ctrl+C and the cache | + +Error cases: wrong integrity, missing archive, unknown protocol or API version and watchdog (`WfDriverWrongIntegrity`, +`WfDriverMissingArchive`, `WfDriverIncompatibleProtocol`, `WfDriverIncompatibleApi`, `WfDriverTimeout`), a script outside its +permissions (`JourneyPermissionDenied`), an emptied cache checked offline then restored (`JourneyOfflineMissing`, `JourneyRestore`, +`JourneyOfflineVerified`), Ctrl+C on dev, scripts and native commands (`DeveloperBrowserIntegration`). + +The journey found two defects, now fixed with regression specs: the installer refused every archive whose root is not +`package/` (all of `@types/*`, whose root is the package name; `npm` strips the first component whatever it is), and the Life starter +did not type-check under `strict` with the current declarations (`useState`). + ## Tests, regeneration and CI without Node.js (#318, epic #303) No path of WebFront depends on a JavaScript runtime or package manager any more: configuring, building, testing, regenerating the embedded assets, building the environment, publishing it, and the CI. - **Provisioning.** With `ENABLE_TESTING=ON`, configure downloads the pinned bootstrap environment and the real packages of the - tests' npm registry (`test/web/registry-packages.json`: ten archives, verified against their SHA-512; a wrong digest stops + tests' npm registry (`test/web/registry-packages.json`: thirteen archives, verified against their SHA-512; a wrong digest stops the configure; `-DWEBFRONT_BOOTSTRAP_DIR` and `-DWEBFRONT_REGISTRY_DIR` replace the downloads offline). `WEBFRONT_DEVELOPER_FIXTURES` is gone: the CTest chain builds the registry (`TestRegistry`: `wf run test-registry`), installs the build dependencies from it, builds the environment from the current sources (`SelfBuild*`) and assembles the fixtures of the browser tests diff --git a/examples/life/ui/main.tsx b/examples/life/ui/main.tsx index 6955bd1b..3ac870cb 100644 --- a/examples/life/ui/main.tsx +++ b/examples/life/ui/main.tsx @@ -135,7 +135,7 @@ function usePlayback(playing: boolean, run: Flag, rate: Flag, s } function Life() { - const [cells, setCells] = useState(() => seed('Galaxy')); + const [cells, setCells] = useState(() => seed('Galaxy')); const [generation, setGeneration] = useState(0); const [playing, setPlaying] = useState(false); const [speed, setSpeed] = useState(8); diff --git a/js/developer/environment/archive.mjs b/js/developer/environment/archive.mjs index 75580d32..bf1dda65 100644 --- a/js/developer/environment/archive.mjs +++ b/js/developer/environment/archive.mjs @@ -7,9 +7,13 @@ const installScripts = ['preinstall', 'install', 'postinstall']; export async function readArchive(bytes) { const files = new Map(); + let root; for (const entry of readTar(await gunzip(bytes))) { - if (!entry.path.startsWith('package/')) throw new Error('Invalid npm tarball root'); - const path = safePackagePath(entry.path.slice(8)); + // npm strips the first path component, whatever its name: the archives of @types/* are rooted at the package name. + const slash = entry.path.indexOf('/'); + const top = entry.path.slice(0, slash); + if (slash < 1 || top === '.' || top === '..' || (root ??= top) !== top) throw new Error('Invalid npm tarball root'); + const path = safePackagePath(entry.path.slice(slash + 1)); if (files.has(path)) throw new Error(`Duplicate package path: ${path}`); files.set(path, entry.bytes); } diff --git a/js/developer/environment/bundles.json b/js/developer/environment/bundles.json index ff5d700f..b3027906 100644 --- a/js/developer/environment/bundles.json +++ b/js/developer/environment/bundles.json @@ -29,13 +29,13 @@ "js/developer/environment/io.mjs": "21af39f07c7eb863908c1df768e3c31de1c6eb8ff757c2a287c4a47c76855db6", "js/developer/environment/recipe.mjs": "5e7b80cb9090dce63fafafbb852879fce9f6ed2399ac364bbe5af1cf6f4c1758", "js/developer/environment/registry.mjs": "42baa605f0335622470aaf4b945c5e38486d56a0ac0ef6442e5348f160aa3f88", - "js/developer/environment/archive.mjs": "5a5b135dc935c3916fc0e8ccfc0e92485e0c6e201cbceab160de68fe89cb6bba", + "js/developer/environment/archive.mjs": "c73d52a8225743238e5da25877c8e738b59384149a9d1f723fc7b7a9eeda3741", "js/developer/environment/lock.mjs": "d69a3a877b92da52b21dcc78877345015ac31b7dec1c484ee1ff1f97f154d51f", "js/developer/environment/pins.mjs": "df07f6f01edaf86a1052d0e76f6c6745cb6e7a3309bbd256ac720ee8adc85297", "js/developer/environment/peers.mjs": "e1d999892138682fc0134ef1f4d4b19b9a9ad8d7fb16e37fc9c6c684bd853896", "js/developer/environment/resolve.mjs": "8b96b850af215be51f5cb85cc9c69e057afa04dfb8a57e572620c07059c17fa3", "js/developer/environment/embed.mjs": "3e6bc10200939fa30d5f60a96f01eb33ddf3da87661390ad433a18366bf52547", - "examples/life/ui/main.tsx": "ed11a82aad1639eb6997af8b0fca4d5c5ed4c36422c22a74ac49ae73078d0a91", + "examples/life/ui/main.tsx": "7b1ff285d2a6b8f897ef12df872886e61ef4b24e2358a9423b76b38ab75c85d3", "examples/life/ui/style.css": "9bb55eb0f0a3287e5b7dc78af9d69608b87ff42c4d9c8a653bc83a52fe293c44", "js/developer/tools/distribution.json": "a40253717a5a0f2107ad9b96ada3d0487ee35b27a382e19b3b8a2d20388573af", "js/developer/tools/archive.mjs": "bfe9feeb5e4d4e1b7c44c4dec4dcbeab4ae59c2bf16a1d2b32cd6910a2b84e7b", @@ -43,6 +43,6 @@ "js/developer/scripts/build.mjs": "9d9f2342e86019d7f7452bdd494667fed740b26a34115311494e8a0d29853776", "webfront.project.json": "24974ea48207b13fb5dac2e164fc433c6c348080f346605a1b132670438d802e", "js/core/bootstrap/bootstrap.bundle.mjs": "536831257f0fc92e31911841750e1e59247f7c64e756b0fcb878efd9860a741f", - "js/developer/environment/packages.bundle.mjs": "e36d1052285a313f7db67c1f58f8332da9e97446b1e2085422ebdae379288045", + "js/developer/environment/packages.bundle.mjs": "c9fa447749299849c70953c41118c44e961f00227d01cc2e4f662a0a6ebca7b3", "include/webfront/system/DeveloperReleaseData.hpp": "7aa74c8e31501fa8733b47767fd11cc4e316ba70634331d86d35d78bd5a4b91c" } diff --git a/js/developer/environment/packages.bundle.mjs b/js/developer/environment/packages.bundle.mjs index 150dfb3d..6cd1b7eb 100644 --- a/js/developer/environment/packages.bundle.mjs +++ b/js/developer/environment/packages.bundle.mjs @@ -1,4 +1,4 @@ -var Gn=Object.create;var mt=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Wn=Object.getOwnPropertyNames;var _n=Object.getPrototypeOf,Vn=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Wn(t))!Vn.call(e,s)&&s!==r&&mt(e,s,{get:()=>t[s],enumerable:!(n=Mn(t,s))||n.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Gn(_n(e)):{},Xn(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e));var V=w((Ea,xt)=>{"use strict";var Kn="2.0.0",Qn=Number.MAX_SAFE_INTEGER||9007199254740991,es=16,ts=250,rs=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:es,MAX_SAFE_BUILD_LENGTH:ts,MAX_SAFE_INTEGER:Qn,RELEASE_TYPES:rs,SEMVER_SPEC_VERSION:Kn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var X=w((ga,Rt)=>{"use strict";var ns=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Rt.exports=ns});var F=w((j,bt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Te,MAX_SAFE_BUILD_LENGTH:ss,MAX_LENGTH:os}=V(),is=X();j=bt.exports={};var cs=j.re=[],as=j.safeRe=[],p=j.src=[],ls=j.safeSrc=[],h=j.t={},us=0,je="[a-zA-Z0-9-]",fs=[["\\s",1],["\\d",os],[je,ss]],ps=e=>{for(let[t,r]of fs)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},E=(e,t,r)=>{let n=ps(t),s=us++;is(e,s,t),h[e]=s,p[s]=t,ls[s]=n,cs[s]=new RegExp(t,r?"g":void 0),as[s]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${je}*`);E("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${p[h.NONNUMERICIDENTIFIER]}|${p[h.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NONNUMERICIDENTIFIER]}|${p[h.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${je}+`);E("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`);E("FULL",`^${p[h.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`);E("LOOSE",`^${p[h.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`);E("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Te}})(?:\\.(\\d{1,${Te}}))?(?:\\.(\\d{1,${Te}}))?`);E("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",p[h.COERCE],!0);E("COERCERTLFULL",p[h.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0);j.tildeTrimReplace="$1~";E("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0);j.caretTrimReplace="$1^";E("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0);j.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ce=w(($a,Ot)=>{"use strict";var hs=Object.freeze({loose:!0}),ds=Object.freeze({}),ms=e=>e?typeof e!="object"?hs:e:ds;Ot.exports=ms});var Pe=w((ya,Nt)=>{"use strict";var vt=/^[0-9]+$/,It=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eIt(t,e);Nt.exports={compareIdentifiers:It,rcompareIdentifiers:ws}});var b=w((xa,kt)=>{"use strict";var ae=X(),{MAX_LENGTH:St,MAX_SAFE_INTEGER:le}=V(),{safeRe:ue,t:fe}=F(),Es=ce(),{compareIdentifiers:qe}=Pe(),Ce=class e{constructor(t,r){if(r=Es(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>St)throw new TypeError(`version is longer than ${St} characters`);ae("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?ue[fe.LOOSE]:ue[fe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>le||this.major<0)throw new TypeError("Invalid major version");if(this.minor>le||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>le||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let o=+s;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=t.prerelease[r];if(ae("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qe(n,s)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],s=t.build[r];if(ae("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qe(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?ue[fe.PRERELEASELOOSE]:ue[fe.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let o=[r,s];n===!1&&(o=[r]),qe(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};kt.exports=Ce});var q=w((Ra,At)=>{"use strict";var Lt=b(),gs=(e,t,r=!1)=>{if(e instanceof Lt)return e;try{return new Lt(e,t)}catch(n){if(!r)return null;throw n}};At.exports=gs});var jt=w((ba,Tt)=>{"use strict";var $s=q(),ys=(e,t)=>{let r=$s(e,t);return r?r.version:null};Tt.exports=ys});var qt=w((Oa,Pt)=>{"use strict";var xs=q(),Rs=(e,t)=>{let r=xs(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Pt.exports=Rs});var Ut=w((va,Dt)=>{"use strict";var Ct=b(),bs=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Ct(e instanceof Ct?e.version:e,r).inc(t,n,s).version}catch{return null}};Dt.exports=bs});var Gt=w((Ia,Ft)=>{"use strict";var zt=q(),Os=(e,t)=>{let r=zt(e,null,!0),n=zt(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};Ft.exports=Os});var Wt=w((Na,Mt)=>{"use strict";var vs=b(),Is=(e,t)=>new vs(e,t).major;Mt.exports=Is});var Vt=w((Sa,_t)=>{"use strict";var Ns=b(),Ss=(e,t)=>new Ns(e,t).minor;_t.exports=Ss});var Bt=w((ka,Xt)=>{"use strict";var ks=b(),Ls=(e,t)=>new ks(e,t).patch;Xt.exports=Ls});var Yt=w((La,Ht)=>{"use strict";var As=q(),Ts=(e,t)=>{let r=As(e,t);return r&&r.prerelease.length?r.prerelease:null};Ht.exports=Ts});var k=w((Aa,Zt)=>{"use strict";var Jt=b(),js=(e,t,r)=>new Jt(e,r).compare(new Jt(t,r));Zt.exports=js});var Qt=w((Ta,Kt)=>{"use strict";var Ps=k(),qs=(e,t,r)=>Ps(t,e,r);Kt.exports=qs});var tr=w((ja,er)=>{"use strict";var Cs=k(),Ds=(e,t)=>Cs(e,t,!0);er.exports=Ds});var pe=w((Pa,nr)=>{"use strict";var rr=b(),Us=(e,t,r)=>{let n=new rr(e,r),s=new rr(t,r);return n.compare(s)||n.compareBuild(s)};nr.exports=Us});var or=w((qa,sr)=>{"use strict";var zs=pe(),Fs=(e,t)=>e.sort((r,n)=>zs(r,n,t));sr.exports=Fs});var cr=w((Ca,ir)=>{"use strict";var Gs=pe(),Ms=(e,t)=>e.sort((r,n)=>Gs(n,r,t));ir.exports=Ms});var B=w((Da,ar)=>{"use strict";var Ws=k(),_s=(e,t,r)=>Ws(e,t,r)>0;ar.exports=_s});var he=w((Ua,lr)=>{"use strict";var Vs=k(),Xs=(e,t,r)=>Vs(e,t,r)<0;lr.exports=Xs});var De=w((za,ur)=>{"use strict";var Bs=k(),Hs=(e,t,r)=>Bs(e,t,r)===0;ur.exports=Hs});var Ue=w((Fa,fr)=>{"use strict";var Ys=k(),Js=(e,t,r)=>Ys(e,t,r)!==0;fr.exports=Js});var de=w((Ga,pr)=>{"use strict";var Zs=k(),Ks=(e,t,r)=>Zs(e,t,r)>=0;pr.exports=Ks});var me=w((Ma,hr)=>{"use strict";var Qs=k(),eo=(e,t,r)=>Qs(e,t,r)<=0;hr.exports=eo});var ze=w((Wa,dr)=>{"use strict";var to=De(),ro=Ue(),no=B(),so=de(),oo=he(),io=me(),co=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return to(e,r,n);case"!=":return ro(e,r,n);case">":return no(e,r,n);case">=":return so(e,r,n);case"<":return oo(e,r,n);case"<=":return io(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};dr.exports=co});var wr=w((_a,mr)=>{"use strict";var ao=b(),lo=q(),{safeRe:we,t:Ee}=F(),uo=(e,t)=>{if(e instanceof ao)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?we[Ee.COERCEFULL]:we[Ee.COERCE]);else{let c=t.includePrerelease?we[Ee.COERCERTLFULL]:we[Ee.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return lo(`${n}.${s}.${o}${i}${a}`,t)};mr.exports=uo});var gr=w((Va,Er)=>{"use strict";var Fe=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}};Er.exports=Fe});var L=w((Xa,Rr)=>{"use strict";var fo=/\s+/g,Ge=class e{constructor(t,r){if(r=ho(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Me)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(fo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!yr(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&xo(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&$o)|(this.options.loose&&yo))+":"+t,s=$r.get(n);if(s)return s;let o=this.options.loose,i=o?v[O.HYPHENRANGELOOSE]:v[O.HYPHENRANGE];t=t.replace(i,Ao(this.options.includePrerelease)),g("hyphen replace",t),t=t.replace(v[O.COMPARATORTRIM],wo),g("comparator trim",t),t=t.replace(v[O.TILDETRIM],Eo),g("tilde trim",t),t=t.replace(v[O.CARETTRIM],go),g("caret trim",t);let a=t.split(" ").map(f=>Ro(f,this.options)).join(" ").split(/\s+/).map(f=>Lo(f,this.options));o&&(a=a.filter(f=>(g("loose invalid filter",f,this.options),!!f.match(v[O.COMPARATORLOOSE])))),g("range list",a);let c=new Map,l=a.map(f=>new Me(f,this.options));for(let f of l){if(yr(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return $r.set(n,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>xr(n,r)&&t.set.some(s=>xr(s,r)&&n.every(o=>s.every(i=>o.intersects(i,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new mo(t,this.options)}catch{return!1}for(let r=0;re.value==="<0.0.0-0",xo=e=>e.value==="",xr=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();for(;r&&n.length;)r=n.every(o=>s.intersects(o,t)),s=n.pop();return r},Ro=(e,t)=>(e=e.replace(v[O.BUILD],""),g("comp",e,t),e=vo(e,t),g("caret",e),e=bo(e,t),g("tildes",e),e=No(e,t),g("xrange",e),e=ko(e,t),g("stars",e),e),I=e=>!e||e.toLowerCase()==="x"||e==="*",bo=(e,t)=>e.trim().split(/\s+/).map(r=>Oo(r,t)).join(" "),Oo=(e,t)=>{let r=t.loose?v[O.TILDELOOSE]:v[O.TILDE];return e.replace(r,(n,s,o,i,a)=>{g("tilde",e,n,s,o,i,a);let c;return I(s)?c="":I(o)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:I(i)?c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`:a?(g("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`):c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`,g("tilde return",c),c})},vo=(e,t)=>e.trim().split(/\s+/).map(r=>Io(r,t)).join(" "),Io=(e,t)=>{g("caret",e,t);let r=t.loose?v[O.CARETLOOSE]:v[O.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{g("caret",e,s,o,i,a,c);let l;return I(o)?l="":I(i)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:I(a)?o==="0"?l=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`:c?(g("replaceCaret pr",c),o==="0"?i==="0"?l=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`:l=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`):(g("no pr"),o==="0"?i==="0"?l=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`:l=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.${a} <${+o+1}.0.0-0`),g("caret return",l),l})},No=(e,t)=>(g("replaceXRanges",e,t),e.split(/\s+/).map(r=>So(r,t)).join(" ")),So=(e,t)=>{e=e.trim();let r=t.loose?v[O.XRANGELOOSE]:v[O.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{g("xRange",e,n,s,o,i,a,c);let l=I(o),u=l||I(i),f=u||I(a),m=f;return s==="="&&m&&(s=""),c=t.includePrerelease?"-0":"",l?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&m?(u&&(i=0),a=0,s===">"?(s=">=",u?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):s==="<="&&(s="<",u?o=+o+1:i=+i+1),s==="<"&&(c="-0"),n=`${s+o}.${i}.${a}${c}`):u?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`),g("xRange return",n),n})},ko=(e,t)=>(g("replaceStars",e,t),e.trim().replace(v[O.STAR],"")),Lo=(e,t)=>(g("replaceGTE0",e,t),e.trim().replace(v[t.includePrerelease?O.GTE0PRE:O.GTE0],"")),Ao=e=>(t,r,n,s,o,i,a,c,l,u,f,m)=>(I(n)?r="":I(s)?r=`>=${n}.0.0${e?"-0":""}`:I(o)?r=`>=${n}.${s}.0${e?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,I(l)?c="":I(u)?c=`<${+l+1}.0.0-0`:I(f)?c=`<${l}.${+u+1}.0-0`:m?c=`<=${l}.${u}.${f}-${m}`:e?c=`<${l}.${u}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),To=(e,t,r)=>{for(let n=0;n0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}});var H=w((Ba,Sr)=>{"use strict";var Y=Symbol("SemVer ANY"),Ve=class e{static get ANY(){return Y}constructor(t,r){if(r=br(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),_e("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Y?this.value="":this.value=this.operator+this.semver.version,_e("comp",this)}parse(t){let r=this.options.loose?Or[vr.COMPARATORLOOSE]:Or[vr.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Ir(n[2],this.options.loose):this.semver=Y}toString(){return this.value}test(t){if(_e("Comparator.test",t,this.options.loose),this.semver===Y||t===Y)return!0;if(typeof t=="string")try{t=new Ir(t,this.options)}catch{return!1}return We(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Nr(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new Nr(this.value,r).test(t.semver):(r=br(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||We(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||We(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Sr.exports=Ve;var br=ce(),{safeRe:Or,t:vr}=F(),We=ze(),_e=X(),Ir=b(),Nr=L()});var J=w((Ha,kr)=>{"use strict";var jo=L(),Po=(e,t,r)=>{try{t=new jo(t,r)}catch{return!1}return t.test(e)};kr.exports=Po});var Ar=w((Ya,Lr)=>{"use strict";var qo=L(),Co=(e,t)=>new qo(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Lr.exports=Co});var jr=w((Ja,Tr)=>{"use strict";var Do=b(),Uo=L(),zo=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Uo(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===-1)&&(n=i,s=new Do(n,r))}),n};Tr.exports=zo});var qr=w((Za,Pr)=>{"use strict";var Fo=b(),Go=L(),Mo=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Go(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===1)&&(n=i,s=new Fo(n,r))}),n};Pr.exports=Mo});var Ur=w((Ka,Dr)=>{"use strict";var Xe=b(),Wo=L(),Cr=B(),_o=(e,t)=>{e=new Wo(e,t);let r=new Xe("0.0.0");if(e.test(r)||(r=new Xe("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{let a=new Xe(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||Cr(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||Cr(r,o))&&(r=o)}return r&&e.test(r)?r:null};Dr.exports=_o});var Fr=w((Qa,zr)=>{"use strict";var Vo=L(),Xo=(e,t)=>{try{return new Vo(e,t).range||"*"}catch{return null}};zr.exports=Xo});var ge=w((el,_r)=>{"use strict";var Bo=b(),Wr=H(),{ANY:Ho}=Wr,Yo=L(),Jo=J(),Gr=B(),Mr=he(),Zo=me(),Ko=de(),Qo=(e,t,r,n)=>{e=new Bo(e,n),t=new Yo(t,n);let s,o,i,a,c;switch(r){case">":s=Gr,o=Zo,i=Mr,a=">",c=">=";break;case"<":s=Mr,o=Ko,i=Gr,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Jo(e,t,n))return!1;for(let l=0;l{d.semver===Ho&&(d=new Wr(">=0.0.0")),f=f||d,m=m||d,s(d.semver,f.semver,n)?f=d:i(d.semver,m.semver,n)&&(m=d)}),f.operator===a||f.operator===c||(!m.operator||m.operator===a)&&o(e,m.semver))return!1;if(m.operator===c&&i(e,m.semver))return!1}return!0};_r.exports=Qo});var Xr=w((tl,Vr)=>{"use strict";var ei=ge(),ti=(e,t,r)=>ei(e,t,">",r);Vr.exports=ti});var Hr=w((rl,Br)=>{"use strict";var ri=ge(),ni=(e,t,r)=>ri(e,t,"<",r);Br.exports=ni});var Zr=w((nl,Jr)=>{"use strict";var Yr=L(),si=(e,t,r)=>(e=new Yr(e,r),t=new Yr(t,r),e.intersects(t,r));Jr.exports=si});var Qr=w((sl,Kr)=>{"use strict";var oi=J(),ii=k();Kr.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((u,f)=>ii(u,f,r));for(let u of i)oi(u,t,r)?(o=u,s||(s=u)):(o&&n.push([s,o]),o=null,s=null);s&&n.push([s,null]);let a=[];for(let[u,f]of n)u===f?a.push(u):!f&&u===i[0]?a.push("*"):f?u===i[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var en=L(),He=H(),{ANY:Be}=He,Z=J(),Ye=k(),ci=(e,t,r={})=>{if(e===t)return!0;e=new en(e,r),t=new en(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=li(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},ai=[new He(">=0.0.0-0")],tn=[new He(">=0.0.0")],li=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Be){if(t.length===1&&t[0].semver===Be)return!0;r.includePrerelease?e=ai:e=tn}if(t.length===1&&t[0].semver===Be){if(r.includePrerelease)return!0;t=tn}let n=new Set,s,o;for(let d of e)d.operator===">"||d.operator===">="?s=rn(s,d,r):d.operator==="<"||d.operator==="<="?o=nn(o,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(s&&o){if(i=Ye(s.semver,o.semver,r),i>0)return null;if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(s&&!Z(d,String(s),r)||o&&!Z(d,String(o),r))return null;for(let T of t)if(!Z(d,String(T),r))return!1;return!0}let a,c,l,u,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of t){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",s){if(m&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===m.major&&d.semver.minor===m.minor&&d.semver.patch===m.patch&&(m=!1),d.operator===">"||d.operator===">="){if(a=rn(s,d,r),a===d&&a!==s)return!1}else if(s.operator===">="&&!Z(s.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(c=nn(o,d,r),c===d&&c!==o)return!1}else if(o.operator==="<="&&!Z(o.semver,String(d),r))return!1}if(!d.operator&&(o||s)&&i!==0)return!1}return!(s&&l&&!o&&i!==0||o&&u&&!s&&i!==0||m||f)},rn=(e,t,r)=>{if(!e)return t;let n=Ye(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},nn=(e,t,r)=>{if(!e)return t;let n=Ye(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};sn.exports=ci});var C=w((il,ln)=>{"use strict";var Je=F(),cn=V(),ui=b(),an=Pe(),fi=q(),pi=jt(),hi=qt(),di=Ut(),mi=Gt(),wi=Wt(),Ei=Vt(),gi=Bt(),$i=Yt(),yi=k(),xi=Qt(),Ri=tr(),bi=pe(),Oi=or(),vi=cr(),Ii=B(),Ni=he(),Si=De(),ki=Ue(),Li=de(),Ai=me(),Ti=ze(),ji=wr(),Pi=H(),qi=L(),Ci=J(),Di=Ar(),Ui=jr(),zi=qr(),Fi=Ur(),Gi=Fr(),Mi=ge(),Wi=Xr(),_i=Hr(),Vi=Zr(),Xi=Qr(),Bi=on();ln.exports={parse:fi,valid:pi,clean:hi,inc:di,diff:mi,major:wi,minor:Ei,patch:gi,prerelease:$i,compare:yi,rcompare:xi,compareLoose:Ri,compareBuild:bi,sort:Oi,rsort:vi,gt:Ii,lt:Ni,eq:Si,neq:ki,gte:Li,lte:Ai,cmp:Ti,coerce:ji,Comparator:Pi,Range:qi,satisfies:Ci,toComparators:Di,maxSatisfying:Ui,minSatisfying:zi,minVersion:Fi,validRange:Gi,outside:Mi,gtr:Wi,ltr:_i,intersects:Vi,simplifyRange:Xi,subset:Bi,SemVer:ui,re:Je.re,src:Je.src,tokens:Je.t,SEMVER_SPEC_VERSION:cn.SEMVER_SPEC_VERSION,RELEASE_TYPES:cn.RELEASE_TYPES,compareIdentifiers:an.compareIdentifiers,rcompareIdentifiers:an.rcompareIdentifiers}});var Ae=new TextDecoder;function ie(e){let t=e.indexOf("@",e.startsWith("@")?1:0);return t<0?{name:e,version:""}:{name:e.slice(0,t),version:e.slice(t+1)}}async function Et(e,t){let r=String(t??"").split(/\s+/).filter(o=>o.startsWith("sha512-")).map(o=>o.split("?")[0]);if(r.length===0)throw new Error("The package has no SHA-512 integrity");if(!globalThis.crypto?.subtle)throw new Error("Integrity checks need a secure context (https or localhost)");let n=new Uint8Array(await crypto.subtle.digest("SHA-512",e)),s="sha512-"+btoa(Array.from(n,o=>String.fromCharCode(o)).join(""));if(!r.includes(s))throw new Error(`Integrity check failed: expected ${r[0]}, got ${s}`);return s}async function gt(e,t=268435456){let r=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(),n=[],s=0;for(let o=await r.read();!o.done;o=await r.read()){if(s+=o.value.length,s>t)throw await r.cancel(),new Error(`The tarball unpacks to more than ${t} bytes`);n.push(o.value)}return new Uint8Array(await new Blob(n).arrayBuffer())}function _(e,t,r){let n=e.subarray(t,t+r),s=n.indexOf(0);return Ae.decode(s<0?n:n.subarray(0,s))}function $t(e,t,r){if(e[t]&128)return e.subarray(t+1,t+r).reduce((s,o)=>s*256+o,e[t]&127);let n=_(e,t,r).trim();if(!/^[0-7]*$/.test(n))throw new Error("Corrupt tar header");return n===""?0:parseInt(n,8)}function Bn(e){let t=0;for(let r=0;r<512;++r)t+=r>=148&&r<156?32:e[r];if($t(e,148,8)!==t)throw new Error("Corrupt tar header checksum")}function Hn(e){let t={},r=0;for(;r0)||r+s>e.length)throw new Error("Corrupt pax header");let o=Ae.decode(e.subarray(n+1,r+s-1)),i=o.indexOf("=");t[o.slice(0,i)]=o.slice(i+1),r+=s}return t}function Yn(e,t){let r=e.subarray(t,t+512);Bn(r);let n=$t(r,124,12),s=t+512;if(s+n>e.length)throw new Error("Truncated tar archive");return{header:r,type:r[156]===0?"0":String.fromCharCode(r[156]),data:e.subarray(s,s+n),next:s+Math.ceil(n/512)*512}}function Jn(e,t){return t+512>e.length||e.subarray(t,t+512).every(r=>r===0)}function Zn(e){let t=_(e,0,100),r=_(e,257,5)==="ustar"?_(e,345,155):"";return r?`${r}/${t}`:t}var wt={x:(e,t)=>({...e,pax:Hn(t).path}),L:(e,t)=>({...e,long:_(t,0,t.length)}),g:e=>e};function yt(e){let t=[],r={};for(let n=0;!Jn(e,n);){let{header:s,type:o,data:i,next:a}=Yn(e,n);if(n=a,Object.hasOwn(wt,o)){r=wt[o](r,i);continue}(o==="0"||o==="7")&&t.push({path:r.pax??r.long??Zn(s),bytes:i}),r={}}return t}var xe=z(C(),1);var x=(e,t,...r)=>e.cppFunction(`webfront.developer.${t}`)(...r);async function G(e,t){let r=[],n=0;for(;;){let s=await x(e,"read",t,n);if(r.push(s),n+=s.length,s.length<262144)break;if(n>256*1024*1024)throw new Error("Project file is too large")}return new Uint8Array(await new Blob(r).arrayBuffer())}async function K(e,{id:t,path:r,bytes:n},s){for(let o=0;o{}),a}}async function Hi(e,t){let r=[],n=0;for(;;){let{done:s,value:o}=await e.read();if(s)return r;if(n+=o.length,n>t)throw new Error("Compressed download exceeds its byte limit");r.push(o)}}async function Yi(e,t){try{return await Hi(e,t)}catch(r){throw await e.cancel().catch(()=>{}),r}finally{e.releaseLock()}}async function un(e,t=64*1024*1024){if(!e.ok)throw new Error(`Download: HTTP ${e.status}`);if(Number(e.headers.get("content-length"))>t)throw new Error("Compressed download exceeds its byte limit");return new Uint8Array(await new Blob(await Yi(e.body.getReader(),t)).arrayBuffer())}var M=".webfront/developer/packages",Ji=/[\\\0:*?"<>|]/,Zi=e=>e.split("/").some(t=>!t||t==="."||t==="..");function Ki(e){return typeof e!="string"||!e||Ji.test(e)?!0:Zi(e)}function A(e){if(Ki(e))throw new Error(`Unsafe package path: ${e}`);return e}var Qi=new TextDecoder,ec=["preinstall","install","postinstall"];async function fn(e){let t=new Map;for(let r of yt(await gt(e))){if(!r.path.startsWith("package/"))throw new Error("Invalid npm tarball root");let n=A(r.path.slice(8));if(t.has(n))throw new Error(`Duplicate package path: ${n}`);t.set(n,r.bytes)}return t}var tc=e=>ec.some(t=>e.scripts?.[t]),rc=e=>e.has("binding.gyp")||[...e.keys()].some(t=>t.endsWith(".node"));function nc(e,t){return tc(e)||e.gypfile?!0:rc(t)}function pn(e,t,r){let n=JSON.parse(Qi.decode(e.get("package.json")));if(n.name!==t||n.version!==r)throw new Error("npm archive identity mismatch");if(nc(n,e))throw new Error(`${t} needs an unsupported install script or native module`);return n}function W(e){return!e||typeof e!="object"?!1:!Array.isArray(e)}var R="webfront.project.json",S="webfront-packages.lock.json",ee=1,Ze=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,sc=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,oc=/^[0-9A-Za-z.+\-^~<>=*| ]{1,128}$/,hn=/^[A-Za-z0-9][A-Za-z0-9:_.-]{0,63}$/,Ke=/^[A-Za-z_][A-Za-z0-9_]*$/,dn=["format","name","version","dependencies","registry","scripts","entries","providers","test","permissions"],ic=["files","publish","fetch"],$=e=>{throw new Error(`${R}: ${e}`)};function P(e,t){return W(e)||$(`${t} must be an object`),e}function Qe(e,t,r){for(let n of Object.keys(e))t.includes(n)||$(`unknown key "${n}" in ${r}`)}function $e(e,t){typeof e!="string"&&$(`${t} must be a project path`);try{return A(e)}catch{return $(`${t} is not a safe project-relative path: ${e}`)}}function mn(e,t){return(!Array.isArray(e)||e.length>256)&&$(`${t} must be an array of at most 256 paths`),e.map((r,n)=>$e(r,`${t}[${n}]`))}function cc(e){let t=P(e,"dependencies");for(let[r,n]of Object.entries(t))Ze.test(r)||$(`invalid npm package name "${r}"`),(typeof n!="string"||!oc.test(n)||n!==n.trim())&&$(`invalid version range for "${r}"`);return t}var et=e=>e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\");function ac(e){if(typeof e!="string"&&$("registry must be a URL"),et(e))return e;let t;try{t=new URL(e)}catch{return $("registry must be an https URL or an absolute path")}return t.protocol!=="https:"&&$("registry must use https"),e}function lc(e){let t=P(e,"scripts");for(let[r,n]of Object.entries(t))(!hn.test(r)||typeof n!="string"||!n||n.length>1024)&&$(`invalid script "${r}"`);return t}function uc(e){let t=P(e,"entries");for(let[r,n]of Object.entries(t))hn.test(r)||$(`invalid entry name "${r}"`),$e(n,`entries.${r}`);return t}function fc(e,t){let r=P(e,"providers");for(let[n,s]of Object.entries(r))Ke.test(n)||$(`invalid provider name "${n}"`),P(s,`providers.${n}`),Qe(s,["entry","output"],`providers.${n}`),typeof s.entry!="string"&&$(`providers.${n}.entry must name an entry or a path`),Object.hasOwn(t,s.entry)||$e(s.entry,`providers.${n}.entry`),$e(s.output,`providers.${n}.output`).endsWith(".hpp")||$(`providers.${n}.output must be a .hpp file`);return r}function pc(e){let t=P(e,"test");return Qe(t,["specs"],"test"),t.specs!==void 0&&mn(t.specs,"test.specs"),t}function hc(e,t){let r;try{r=new URL(e)}catch{return $(`${t} must be an https origin`)}return(r.protocol!=="https:"||r.origin!==e)&&$(`${t} must be an https origin without a path`),e}function dc(e){let t=P(e,"permissions");for(let r of Object.keys(t))ic.includes(r)||$(`unknown permission "${r}"`);for(let r of["files","publish"])t[r]!==void 0&&mn(t[r],`permissions.${r}`);return t.fetch!==void 0&&((!Array.isArray(t.fetch)||t.fetch.length>64)&&$("permissions.fetch must be an array of origins"),t.fetch.forEach((r,n)=>hc(r,`permissions.fetch[${n}]`))),t}function mc(e){(typeof e.name!="string"||!Ze.test(e.name))&&$("name must be a lower-case npm package name"),(typeof e.version!="string"||!sc.test(e.version))&&$("version must be a semantic version")}function wc(e){e.format!==ee&&(Number.isInteger(e.format)&&e.format>ee&&$(`format ${e.format} is not supported by this environment (it reads format ${ee}); update the environment`),$(`format must be ${ee}`))}function te(e){P(e,"the manifest"),wc(e),Qe(e,dn,"the manifest"),mc(e);let t=e.entries===void 0?{}:uc(e.entries);return{...e,dependencies:e.dependencies===void 0?{}:cc(e.dependencies),entries:t,providers:e.providers===void 0?{}:fc(e.providers,t),...e.registry===void 0?{}:{registry:ac(e.registry)},...e.scripts===void 0?{}:{scripts:lc(e.scripts)},...e.test===void 0?{}:{test:pc(e.test)},...e.permissions===void 0?{}:{permissions:dc(e.permissions)}}}function tt(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{return $("not valid JSON")}return{source:t,manifest:te(t)}}function gl(e){return tt(e).manifest}function rt(e){let t={};for(let r of dn)e[r]!==void 0&&(t[r]=e[r]);return JSON.stringify(t,null,2)+` +var Gn=Object.create;var mt=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Wn=Object.getOwnPropertyNames;var _n=Object.getPrototypeOf,Vn=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Wn(t))!Vn.call(e,s)&&s!==r&&mt(e,s,{get:()=>t[s],enumerable:!(n=Mn(t,s))||n.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Gn(_n(e)):{},Xn(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e));var V=w((Ea,xt)=>{"use strict";var Kn="2.0.0",Qn=Number.MAX_SAFE_INTEGER||9007199254740991,es=16,ts=250,rs=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:es,MAX_SAFE_BUILD_LENGTH:ts,MAX_SAFE_INTEGER:Qn,RELEASE_TYPES:rs,SEMVER_SPEC_VERSION:Kn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var X=w((ga,Rt)=>{"use strict";var ns=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Rt.exports=ns});var F=w((j,bt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Te,MAX_SAFE_BUILD_LENGTH:ss,MAX_LENGTH:os}=V(),is=X();j=bt.exports={};var cs=j.re=[],as=j.safeRe=[],p=j.src=[],ls=j.safeSrc=[],h=j.t={},us=0,je="[a-zA-Z0-9-]",fs=[["\\s",1],["\\d",os],[je,ss]],ps=e=>{for(let[t,r]of fs)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},E=(e,t,r)=>{let n=ps(t),s=us++;is(e,s,t),h[e]=s,p[s]=t,ls[s]=n,cs[s]=new RegExp(t,r?"g":void 0),as[s]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${je}*`);E("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${p[h.NONNUMERICIDENTIFIER]}|${p[h.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NONNUMERICIDENTIFIER]}|${p[h.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${je}+`);E("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`);E("FULL",`^${p[h.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`);E("LOOSE",`^${p[h.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`);E("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Te}})(?:\\.(\\d{1,${Te}}))?(?:\\.(\\d{1,${Te}}))?`);E("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",p[h.COERCE],!0);E("COERCERTLFULL",p[h.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0);j.tildeTrimReplace="$1~";E("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0);j.caretTrimReplace="$1^";E("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0);j.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ce=w(($a,Ot)=>{"use strict";var hs=Object.freeze({loose:!0}),ds=Object.freeze({}),ms=e=>e?typeof e!="object"?hs:e:ds;Ot.exports=ms});var Pe=w((ya,Nt)=>{"use strict";var vt=/^[0-9]+$/,It=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eIt(t,e);Nt.exports={compareIdentifiers:It,rcompareIdentifiers:ws}});var b=w((xa,kt)=>{"use strict";var ae=X(),{MAX_LENGTH:St,MAX_SAFE_INTEGER:le}=V(),{safeRe:ue,t:fe}=F(),Es=ce(),{compareIdentifiers:qe}=Pe(),Ce=class e{constructor(t,r){if(r=Es(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>St)throw new TypeError(`version is longer than ${St} characters`);ae("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?ue[fe.LOOSE]:ue[fe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>le||this.major<0)throw new TypeError("Invalid major version");if(this.minor>le||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>le||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let o=+s;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=t.prerelease[r];if(ae("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qe(n,s)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],s=t.build[r];if(ae("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qe(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?ue[fe.PRERELEASELOOSE]:ue[fe.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let o=[r,s];n===!1&&(o=[r]),qe(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};kt.exports=Ce});var q=w((Ra,At)=>{"use strict";var Lt=b(),gs=(e,t,r=!1)=>{if(e instanceof Lt)return e;try{return new Lt(e,t)}catch(n){if(!r)return null;throw n}};At.exports=gs});var jt=w((ba,Tt)=>{"use strict";var $s=q(),ys=(e,t)=>{let r=$s(e,t);return r?r.version:null};Tt.exports=ys});var qt=w((Oa,Pt)=>{"use strict";var xs=q(),Rs=(e,t)=>{let r=xs(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Pt.exports=Rs});var Ut=w((va,Dt)=>{"use strict";var Ct=b(),bs=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Ct(e instanceof Ct?e.version:e,r).inc(t,n,s).version}catch{return null}};Dt.exports=bs});var Gt=w((Ia,Ft)=>{"use strict";var zt=q(),Os=(e,t)=>{let r=zt(e,null,!0),n=zt(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};Ft.exports=Os});var Wt=w((Na,Mt)=>{"use strict";var vs=b(),Is=(e,t)=>new vs(e,t).major;Mt.exports=Is});var Vt=w((Sa,_t)=>{"use strict";var Ns=b(),Ss=(e,t)=>new Ns(e,t).minor;_t.exports=Ss});var Bt=w((ka,Xt)=>{"use strict";var ks=b(),Ls=(e,t)=>new ks(e,t).patch;Xt.exports=Ls});var Yt=w((La,Ht)=>{"use strict";var As=q(),Ts=(e,t)=>{let r=As(e,t);return r&&r.prerelease.length?r.prerelease:null};Ht.exports=Ts});var k=w((Aa,Zt)=>{"use strict";var Jt=b(),js=(e,t,r)=>new Jt(e,r).compare(new Jt(t,r));Zt.exports=js});var Qt=w((Ta,Kt)=>{"use strict";var Ps=k(),qs=(e,t,r)=>Ps(t,e,r);Kt.exports=qs});var tr=w((ja,er)=>{"use strict";var Cs=k(),Ds=(e,t)=>Cs(e,t,!0);er.exports=Ds});var pe=w((Pa,nr)=>{"use strict";var rr=b(),Us=(e,t,r)=>{let n=new rr(e,r),s=new rr(t,r);return n.compare(s)||n.compareBuild(s)};nr.exports=Us});var or=w((qa,sr)=>{"use strict";var zs=pe(),Fs=(e,t)=>e.sort((r,n)=>zs(r,n,t));sr.exports=Fs});var cr=w((Ca,ir)=>{"use strict";var Gs=pe(),Ms=(e,t)=>e.sort((r,n)=>Gs(n,r,t));ir.exports=Ms});var B=w((Da,ar)=>{"use strict";var Ws=k(),_s=(e,t,r)=>Ws(e,t,r)>0;ar.exports=_s});var he=w((Ua,lr)=>{"use strict";var Vs=k(),Xs=(e,t,r)=>Vs(e,t,r)<0;lr.exports=Xs});var De=w((za,ur)=>{"use strict";var Bs=k(),Hs=(e,t,r)=>Bs(e,t,r)===0;ur.exports=Hs});var Ue=w((Fa,fr)=>{"use strict";var Ys=k(),Js=(e,t,r)=>Ys(e,t,r)!==0;fr.exports=Js});var de=w((Ga,pr)=>{"use strict";var Zs=k(),Ks=(e,t,r)=>Zs(e,t,r)>=0;pr.exports=Ks});var me=w((Ma,hr)=>{"use strict";var Qs=k(),eo=(e,t,r)=>Qs(e,t,r)<=0;hr.exports=eo});var ze=w((Wa,dr)=>{"use strict";var to=De(),ro=Ue(),no=B(),so=de(),oo=he(),io=me(),co=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return to(e,r,n);case"!=":return ro(e,r,n);case">":return no(e,r,n);case">=":return so(e,r,n);case"<":return oo(e,r,n);case"<=":return io(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};dr.exports=co});var wr=w((_a,mr)=>{"use strict";var ao=b(),lo=q(),{safeRe:we,t:Ee}=F(),uo=(e,t)=>{if(e instanceof ao)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?we[Ee.COERCEFULL]:we[Ee.COERCE]);else{let c=t.includePrerelease?we[Ee.COERCERTLFULL]:we[Ee.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return lo(`${n}.${s}.${o}${i}${a}`,t)};mr.exports=uo});var gr=w((Va,Er)=>{"use strict";var Fe=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}};Er.exports=Fe});var L=w((Xa,Rr)=>{"use strict";var fo=/\s+/g,Ge=class e{constructor(t,r){if(r=ho(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Me)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(fo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!yr(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&xo(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&$o)|(this.options.loose&&yo))+":"+t,s=$r.get(n);if(s)return s;let o=this.options.loose,i=o?v[O.HYPHENRANGELOOSE]:v[O.HYPHENRANGE];t=t.replace(i,Ao(this.options.includePrerelease)),g("hyphen replace",t),t=t.replace(v[O.COMPARATORTRIM],wo),g("comparator trim",t),t=t.replace(v[O.TILDETRIM],Eo),g("tilde trim",t),t=t.replace(v[O.CARETTRIM],go),g("caret trim",t);let a=t.split(" ").map(f=>Ro(f,this.options)).join(" ").split(/\s+/).map(f=>Lo(f,this.options));o&&(a=a.filter(f=>(g("loose invalid filter",f,this.options),!!f.match(v[O.COMPARATORLOOSE])))),g("range list",a);let c=new Map,l=a.map(f=>new Me(f,this.options));for(let f of l){if(yr(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return $r.set(n,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>xr(n,r)&&t.set.some(s=>xr(s,r)&&n.every(o=>s.every(i=>o.intersects(i,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new mo(t,this.options)}catch{return!1}for(let r=0;re.value==="<0.0.0-0",xo=e=>e.value==="",xr=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();for(;r&&n.length;)r=n.every(o=>s.intersects(o,t)),s=n.pop();return r},Ro=(e,t)=>(e=e.replace(v[O.BUILD],""),g("comp",e,t),e=vo(e,t),g("caret",e),e=bo(e,t),g("tildes",e),e=No(e,t),g("xrange",e),e=ko(e,t),g("stars",e),e),I=e=>!e||e.toLowerCase()==="x"||e==="*",bo=(e,t)=>e.trim().split(/\s+/).map(r=>Oo(r,t)).join(" "),Oo=(e,t)=>{let r=t.loose?v[O.TILDELOOSE]:v[O.TILDE];return e.replace(r,(n,s,o,i,a)=>{g("tilde",e,n,s,o,i,a);let c;return I(s)?c="":I(o)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:I(i)?c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`:a?(g("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`):c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`,g("tilde return",c),c})},vo=(e,t)=>e.trim().split(/\s+/).map(r=>Io(r,t)).join(" "),Io=(e,t)=>{g("caret",e,t);let r=t.loose?v[O.CARETLOOSE]:v[O.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{g("caret",e,s,o,i,a,c);let l;return I(o)?l="":I(i)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:I(a)?o==="0"?l=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`:c?(g("replaceCaret pr",c),o==="0"?i==="0"?l=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`:l=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`):(g("no pr"),o==="0"?i==="0"?l=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`:l=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.${a} <${+o+1}.0.0-0`),g("caret return",l),l})},No=(e,t)=>(g("replaceXRanges",e,t),e.split(/\s+/).map(r=>So(r,t)).join(" ")),So=(e,t)=>{e=e.trim();let r=t.loose?v[O.XRANGELOOSE]:v[O.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{g("xRange",e,n,s,o,i,a,c);let l=I(o),u=l||I(i),f=u||I(a),m=f;return s==="="&&m&&(s=""),c=t.includePrerelease?"-0":"",l?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&m?(u&&(i=0),a=0,s===">"?(s=">=",u?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):s==="<="&&(s="<",u?o=+o+1:i=+i+1),s==="<"&&(c="-0"),n=`${s+o}.${i}.${a}${c}`):u?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`),g("xRange return",n),n})},ko=(e,t)=>(g("replaceStars",e,t),e.trim().replace(v[O.STAR],"")),Lo=(e,t)=>(g("replaceGTE0",e,t),e.trim().replace(v[t.includePrerelease?O.GTE0PRE:O.GTE0],"")),Ao=e=>(t,r,n,s,o,i,a,c,l,u,f,m)=>(I(n)?r="":I(s)?r=`>=${n}.0.0${e?"-0":""}`:I(o)?r=`>=${n}.${s}.0${e?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,I(l)?c="":I(u)?c=`<${+l+1}.0.0-0`:I(f)?c=`<${l}.${+u+1}.0-0`:m?c=`<=${l}.${u}.${f}-${m}`:e?c=`<${l}.${u}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),To=(e,t,r)=>{for(let n=0;n0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}});var H=w((Ba,Sr)=>{"use strict";var Y=Symbol("SemVer ANY"),Ve=class e{static get ANY(){return Y}constructor(t,r){if(r=br(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),_e("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Y?this.value="":this.value=this.operator+this.semver.version,_e("comp",this)}parse(t){let r=this.options.loose?Or[vr.COMPARATORLOOSE]:Or[vr.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Ir(n[2],this.options.loose):this.semver=Y}toString(){return this.value}test(t){if(_e("Comparator.test",t,this.options.loose),this.semver===Y||t===Y)return!0;if(typeof t=="string")try{t=new Ir(t,this.options)}catch{return!1}return We(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Nr(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new Nr(this.value,r).test(t.semver):(r=br(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||We(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||We(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Sr.exports=Ve;var br=ce(),{safeRe:Or,t:vr}=F(),We=ze(),_e=X(),Ir=b(),Nr=L()});var J=w((Ha,kr)=>{"use strict";var jo=L(),Po=(e,t,r)=>{try{t=new jo(t,r)}catch{return!1}return t.test(e)};kr.exports=Po});var Ar=w((Ya,Lr)=>{"use strict";var qo=L(),Co=(e,t)=>new qo(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Lr.exports=Co});var jr=w((Ja,Tr)=>{"use strict";var Do=b(),Uo=L(),zo=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Uo(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===-1)&&(n=i,s=new Do(n,r))}),n};Tr.exports=zo});var qr=w((Za,Pr)=>{"use strict";var Fo=b(),Go=L(),Mo=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Go(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===1)&&(n=i,s=new Fo(n,r))}),n};Pr.exports=Mo});var Ur=w((Ka,Dr)=>{"use strict";var Xe=b(),Wo=L(),Cr=B(),_o=(e,t)=>{e=new Wo(e,t);let r=new Xe("0.0.0");if(e.test(r)||(r=new Xe("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{let a=new Xe(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||Cr(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||Cr(r,o))&&(r=o)}return r&&e.test(r)?r:null};Dr.exports=_o});var Fr=w((Qa,zr)=>{"use strict";var Vo=L(),Xo=(e,t)=>{try{return new Vo(e,t).range||"*"}catch{return null}};zr.exports=Xo});var ge=w((el,_r)=>{"use strict";var Bo=b(),Wr=H(),{ANY:Ho}=Wr,Yo=L(),Jo=J(),Gr=B(),Mr=he(),Zo=me(),Ko=de(),Qo=(e,t,r,n)=>{e=new Bo(e,n),t=new Yo(t,n);let s,o,i,a,c;switch(r){case">":s=Gr,o=Zo,i=Mr,a=">",c=">=";break;case"<":s=Mr,o=Ko,i=Gr,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Jo(e,t,n))return!1;for(let l=0;l{d.semver===Ho&&(d=new Wr(">=0.0.0")),f=f||d,m=m||d,s(d.semver,f.semver,n)?f=d:i(d.semver,m.semver,n)&&(m=d)}),f.operator===a||f.operator===c||(!m.operator||m.operator===a)&&o(e,m.semver))return!1;if(m.operator===c&&i(e,m.semver))return!1}return!0};_r.exports=Qo});var Xr=w((tl,Vr)=>{"use strict";var ei=ge(),ti=(e,t,r)=>ei(e,t,">",r);Vr.exports=ti});var Hr=w((rl,Br)=>{"use strict";var ri=ge(),ni=(e,t,r)=>ri(e,t,"<",r);Br.exports=ni});var Zr=w((nl,Jr)=>{"use strict";var Yr=L(),si=(e,t,r)=>(e=new Yr(e,r),t=new Yr(t,r),e.intersects(t,r));Jr.exports=si});var Qr=w((sl,Kr)=>{"use strict";var oi=J(),ii=k();Kr.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((u,f)=>ii(u,f,r));for(let u of i)oi(u,t,r)?(o=u,s||(s=u)):(o&&n.push([s,o]),o=null,s=null);s&&n.push([s,null]);let a=[];for(let[u,f]of n)u===f?a.push(u):!f&&u===i[0]?a.push("*"):f?u===i[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var en=L(),He=H(),{ANY:Be}=He,Z=J(),Ye=k(),ci=(e,t,r={})=>{if(e===t)return!0;e=new en(e,r),t=new en(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=li(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},ai=[new He(">=0.0.0-0")],tn=[new He(">=0.0.0")],li=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Be){if(t.length===1&&t[0].semver===Be)return!0;r.includePrerelease?e=ai:e=tn}if(t.length===1&&t[0].semver===Be){if(r.includePrerelease)return!0;t=tn}let n=new Set,s,o;for(let d of e)d.operator===">"||d.operator===">="?s=rn(s,d,r):d.operator==="<"||d.operator==="<="?o=nn(o,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(s&&o){if(i=Ye(s.semver,o.semver,r),i>0)return null;if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(s&&!Z(d,String(s),r)||o&&!Z(d,String(o),r))return null;for(let T of t)if(!Z(d,String(T),r))return!1;return!0}let a,c,l,u,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of t){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",s){if(m&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===m.major&&d.semver.minor===m.minor&&d.semver.patch===m.patch&&(m=!1),d.operator===">"||d.operator===">="){if(a=rn(s,d,r),a===d&&a!==s)return!1}else if(s.operator===">="&&!Z(s.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(c=nn(o,d,r),c===d&&c!==o)return!1}else if(o.operator==="<="&&!Z(o.semver,String(d),r))return!1}if(!d.operator&&(o||s)&&i!==0)return!1}return!(s&&l&&!o&&i!==0||o&&u&&!s&&i!==0||m||f)},rn=(e,t,r)=>{if(!e)return t;let n=Ye(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},nn=(e,t,r)=>{if(!e)return t;let n=Ye(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};sn.exports=ci});var C=w((il,ln)=>{"use strict";var Je=F(),cn=V(),ui=b(),an=Pe(),fi=q(),pi=jt(),hi=qt(),di=Ut(),mi=Gt(),wi=Wt(),Ei=Vt(),gi=Bt(),$i=Yt(),yi=k(),xi=Qt(),Ri=tr(),bi=pe(),Oi=or(),vi=cr(),Ii=B(),Ni=he(),Si=De(),ki=Ue(),Li=de(),Ai=me(),Ti=ze(),ji=wr(),Pi=H(),qi=L(),Ci=J(),Di=Ar(),Ui=jr(),zi=qr(),Fi=Ur(),Gi=Fr(),Mi=ge(),Wi=Xr(),_i=Hr(),Vi=Zr(),Xi=Qr(),Bi=on();ln.exports={parse:fi,valid:pi,clean:hi,inc:di,diff:mi,major:wi,minor:Ei,patch:gi,prerelease:$i,compare:yi,rcompare:xi,compareLoose:Ri,compareBuild:bi,sort:Oi,rsort:vi,gt:Ii,lt:Ni,eq:Si,neq:ki,gte:Li,lte:Ai,cmp:Ti,coerce:ji,Comparator:Pi,Range:qi,satisfies:Ci,toComparators:Di,maxSatisfying:Ui,minSatisfying:zi,minVersion:Fi,validRange:Gi,outside:Mi,gtr:Wi,ltr:_i,intersects:Vi,simplifyRange:Xi,subset:Bi,SemVer:ui,re:Je.re,src:Je.src,tokens:Je.t,SEMVER_SPEC_VERSION:cn.SEMVER_SPEC_VERSION,RELEASE_TYPES:cn.RELEASE_TYPES,compareIdentifiers:an.compareIdentifiers,rcompareIdentifiers:an.rcompareIdentifiers}});var Ae=new TextDecoder;function ie(e){let t=e.indexOf("@",e.startsWith("@")?1:0);return t<0?{name:e,version:""}:{name:e.slice(0,t),version:e.slice(t+1)}}async function Et(e,t){let r=String(t??"").split(/\s+/).filter(o=>o.startsWith("sha512-")).map(o=>o.split("?")[0]);if(r.length===0)throw new Error("The package has no SHA-512 integrity");if(!globalThis.crypto?.subtle)throw new Error("Integrity checks need a secure context (https or localhost)");let n=new Uint8Array(await crypto.subtle.digest("SHA-512",e)),s="sha512-"+btoa(Array.from(n,o=>String.fromCharCode(o)).join(""));if(!r.includes(s))throw new Error(`Integrity check failed: expected ${r[0]}, got ${s}`);return s}async function gt(e,t=268435456){let r=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(),n=[],s=0;for(let o=await r.read();!o.done;o=await r.read()){if(s+=o.value.length,s>t)throw await r.cancel(),new Error(`The tarball unpacks to more than ${t} bytes`);n.push(o.value)}return new Uint8Array(await new Blob(n).arrayBuffer())}function _(e,t,r){let n=e.subarray(t,t+r),s=n.indexOf(0);return Ae.decode(s<0?n:n.subarray(0,s))}function $t(e,t,r){if(e[t]&128)return e.subarray(t+1,t+r).reduce((s,o)=>s*256+o,e[t]&127);let n=_(e,t,r).trim();if(!/^[0-7]*$/.test(n))throw new Error("Corrupt tar header");return n===""?0:parseInt(n,8)}function Bn(e){let t=0;for(let r=0;r<512;++r)t+=r>=148&&r<156?32:e[r];if($t(e,148,8)!==t)throw new Error("Corrupt tar header checksum")}function Hn(e){let t={},r=0;for(;r0)||r+s>e.length)throw new Error("Corrupt pax header");let o=Ae.decode(e.subarray(n+1,r+s-1)),i=o.indexOf("=");t[o.slice(0,i)]=o.slice(i+1),r+=s}return t}function Yn(e,t){let r=e.subarray(t,t+512);Bn(r);let n=$t(r,124,12),s=t+512;if(s+n>e.length)throw new Error("Truncated tar archive");return{header:r,type:r[156]===0?"0":String.fromCharCode(r[156]),data:e.subarray(s,s+n),next:s+Math.ceil(n/512)*512}}function Jn(e,t){return t+512>e.length||e.subarray(t,t+512).every(r=>r===0)}function Zn(e){let t=_(e,0,100),r=_(e,257,5)==="ustar"?_(e,345,155):"";return r?`${r}/${t}`:t}var wt={x:(e,t)=>({...e,pax:Hn(t).path}),L:(e,t)=>({...e,long:_(t,0,t.length)}),g:e=>e};function yt(e){let t=[],r={};for(let n=0;!Jn(e,n);){let{header:s,type:o,data:i,next:a}=Yn(e,n);if(n=a,Object.hasOwn(wt,o)){r=wt[o](r,i);continue}(o==="0"||o==="7")&&t.push({path:r.pax??r.long??Zn(s),bytes:i}),r={}}return t}var xe=z(C(),1);var x=(e,t,...r)=>e.cppFunction(`webfront.developer.${t}`)(...r);async function G(e,t){let r=[],n=0;for(;;){let s=await x(e,"read",t,n);if(r.push(s),n+=s.length,s.length<262144)break;if(n>256*1024*1024)throw new Error("Project file is too large")}return new Uint8Array(await new Blob(r).arrayBuffer())}async function K(e,{id:t,path:r,bytes:n},s){for(let o=0;o{}),a}}async function Hi(e,t){let r=[],n=0;for(;;){let{done:s,value:o}=await e.read();if(s)return r;if(n+=o.length,n>t)throw new Error("Compressed download exceeds its byte limit");r.push(o)}}async function Yi(e,t){try{return await Hi(e,t)}catch(r){throw await e.cancel().catch(()=>{}),r}finally{e.releaseLock()}}async function un(e,t=64*1024*1024){if(!e.ok)throw new Error(`Download: HTTP ${e.status}`);if(Number(e.headers.get("content-length"))>t)throw new Error("Compressed download exceeds its byte limit");return new Uint8Array(await new Blob(await Yi(e.body.getReader(),t)).arrayBuffer())}var M=".webfront/developer/packages",Ji=/[\\\0:*?"<>|]/,Zi=e=>e.split("/").some(t=>!t||t==="."||t==="..");function Ki(e){return typeof e!="string"||!e||Ji.test(e)?!0:Zi(e)}function A(e){if(Ki(e))throw new Error(`Unsafe package path: ${e}`);return e}var Qi=new TextDecoder,ec=["preinstall","install","postinstall"];async function fn(e){let t=new Map,r;for(let n of yt(await gt(e))){let s=n.path.indexOf("/"),o=n.path.slice(0,s);if(s<1||o==="."||o===".."||(r??(r=o))!==o)throw new Error("Invalid npm tarball root");let i=A(n.path.slice(s+1));if(t.has(i))throw new Error(`Duplicate package path: ${i}`);t.set(i,n.bytes)}return t}var tc=e=>ec.some(t=>e.scripts?.[t]),rc=e=>e.has("binding.gyp")||[...e.keys()].some(t=>t.endsWith(".node"));function nc(e,t){return tc(e)||e.gypfile?!0:rc(t)}function pn(e,t,r){let n=JSON.parse(Qi.decode(e.get("package.json")));if(n.name!==t||n.version!==r)throw new Error("npm archive identity mismatch");if(nc(n,e))throw new Error(`${t} needs an unsupported install script or native module`);return n}function W(e){return!e||typeof e!="object"?!1:!Array.isArray(e)}var R="webfront.project.json",S="webfront-packages.lock.json",ee=1,Ze=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,sc=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,oc=/^[0-9A-Za-z.+\-^~<>=*| ]{1,128}$/,hn=/^[A-Za-z0-9][A-Za-z0-9:_.-]{0,63}$/,Ke=/^[A-Za-z_][A-Za-z0-9_]*$/,dn=["format","name","version","dependencies","registry","scripts","entries","providers","test","permissions"],ic=["files","publish","fetch"],$=e=>{throw new Error(`${R}: ${e}`)};function P(e,t){return W(e)||$(`${t} must be an object`),e}function Qe(e,t,r){for(let n of Object.keys(e))t.includes(n)||$(`unknown key "${n}" in ${r}`)}function $e(e,t){typeof e!="string"&&$(`${t} must be a project path`);try{return A(e)}catch{return $(`${t} is not a safe project-relative path: ${e}`)}}function mn(e,t){return(!Array.isArray(e)||e.length>256)&&$(`${t} must be an array of at most 256 paths`),e.map((r,n)=>$e(r,`${t}[${n}]`))}function cc(e){let t=P(e,"dependencies");for(let[r,n]of Object.entries(t))Ze.test(r)||$(`invalid npm package name "${r}"`),(typeof n!="string"||!oc.test(n)||n!==n.trim())&&$(`invalid version range for "${r}"`);return t}var et=e=>e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\");function ac(e){if(typeof e!="string"&&$("registry must be a URL"),et(e))return e;let t;try{t=new URL(e)}catch{return $("registry must be an https URL or an absolute path")}return t.protocol!=="https:"&&$("registry must use https"),e}function lc(e){let t=P(e,"scripts");for(let[r,n]of Object.entries(t))(!hn.test(r)||typeof n!="string"||!n||n.length>1024)&&$(`invalid script "${r}"`);return t}function uc(e){let t=P(e,"entries");for(let[r,n]of Object.entries(t))hn.test(r)||$(`invalid entry name "${r}"`),$e(n,`entries.${r}`);return t}function fc(e,t){let r=P(e,"providers");for(let[n,s]of Object.entries(r))Ke.test(n)||$(`invalid provider name "${n}"`),P(s,`providers.${n}`),Qe(s,["entry","output"],`providers.${n}`),typeof s.entry!="string"&&$(`providers.${n}.entry must name an entry or a path`),Object.hasOwn(t,s.entry)||$e(s.entry,`providers.${n}.entry`),$e(s.output,`providers.${n}.output`).endsWith(".hpp")||$(`providers.${n}.output must be a .hpp file`);return r}function pc(e){let t=P(e,"test");return Qe(t,["specs"],"test"),t.specs!==void 0&&mn(t.specs,"test.specs"),t}function hc(e,t){let r;try{r=new URL(e)}catch{return $(`${t} must be an https origin`)}return(r.protocol!=="https:"||r.origin!==e)&&$(`${t} must be an https origin without a path`),e}function dc(e){let t=P(e,"permissions");for(let r of Object.keys(t))ic.includes(r)||$(`unknown permission "${r}"`);for(let r of["files","publish"])t[r]!==void 0&&mn(t[r],`permissions.${r}`);return t.fetch!==void 0&&((!Array.isArray(t.fetch)||t.fetch.length>64)&&$("permissions.fetch must be an array of origins"),t.fetch.forEach((r,n)=>hc(r,`permissions.fetch[${n}]`))),t}function mc(e){(typeof e.name!="string"||!Ze.test(e.name))&&$("name must be a lower-case npm package name"),(typeof e.version!="string"||!sc.test(e.version))&&$("version must be a semantic version")}function wc(e){e.format!==ee&&(Number.isInteger(e.format)&&e.format>ee&&$(`format ${e.format} is not supported by this environment (it reads format ${ee}); update the environment`),$(`format must be ${ee}`))}function te(e){P(e,"the manifest"),wc(e),Qe(e,dn,"the manifest"),mc(e);let t=e.entries===void 0?{}:uc(e.entries);return{...e,dependencies:e.dependencies===void 0?{}:cc(e.dependencies),entries:t,providers:e.providers===void 0?{}:fc(e.providers,t),...e.registry===void 0?{}:{registry:ac(e.registry)},...e.scripts===void 0?{}:{scripts:lc(e.scripts)},...e.test===void 0?{}:{test:pc(e.test)},...e.permissions===void 0?{}:{permissions:dc(e.permissions)}}}function tt(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{return $("not valid JSON")}return{source:t,manifest:te(t)}}function gl(e){return tt(e).manifest}function rt(e){let t={};for(let r of dn)e[r]!==void 0&&(t[r]=e[r]);return JSON.stringify(t,null,2)+` `}function wn(e){return{format:ee,name:e,version:"0.1.0",dependencies:{}}}function En(e){let r=(String(e??"").split("/").filter(Boolean).pop()??"").toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"").replace(/-+$/,"");return Ze.test(r)?r:"webfront-app"}async function ye(e){let t=JSON.stringify(Object.entries(e).sort(([n],[s])=>ns?1:0)),r=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return[...new Uint8Array(r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var nt=e=>/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/.test(e),Re=(e,t)=>`${e.replace("/","+")}@${t}`,st=(e,t,r)=>`${Re(e,t)}-${r.slice(7).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}`;async function Ec(e,t,{fetchImpl:r,signal:n}){let s=await r(new URL(e.replace("/","%2f"),t),{signal:n});if(!s.ok)throw new Error(`Registry metadata for ${e}: HTTP ${s.status}`);return s.json()}function gc(e,t){let r=e["dist-tags"]?.[t];return r||(xe.default.valid(t)?t:xe.default.maxSatisfying(Object.keys(e.versions??{}),t))}function $c(e,t,r){let n=r||"latest",s=gc(e,n),o=e.versions?.[s];if(!o||!xe.default.valid(s))throw new Error(`Cannot resolve ${t}@${n}`);return{version:s,manifest:o}}async function yc(e,t,r,{fetchImpl:n,signal:s}){let o=new URL(t.dist?.tarball,r);if(o.protocol!=="https:"&&o.origin!==r.origin)throw new Error("Package tarballs must use HTTPS or the registry origin");let i=await n(o,{signal:s});if(!i.ok)throw new Error(`Package download for ${e}: HTTP ${i.status}`);let a=await un(i);return{bytes:a,integrity:await Et(a,t.dist.integrity)}}function ot(e){let t=new URL(e,globalThis.location?.href),r=t.origin===globalThis.location?.origin;if(e.startsWith("/")?!et(e)||!r:t.protocol!=="https:"&&!r)throw new Error(`The npm registry must use HTTPS or the application origin: ${e}`);return t.pathname.endsWith("/")||(t.pathname+="/"),t}async function D(e,t,{registry:r,fetchImpl:n=fetch,signal:s}){if(!nt(e))throw new Error(`Unsupported npm package name: ${e}`);let o=ot(r),i={fetchImpl:n,signal:s},{version:a,manifest:c}=$c(await Ec(e,o,i),e,t),{bytes:l,integrity:u}=await yc(e,c,o,i),f=await fn(l),m=pn(f,e,a);return{id:Re(e,a),key:st(e,a,u),manifest:m,integrity:u,files:f}}var be=z(C(),1);function xc(e,t,r){let n=e?.roots?.[t];return n?.requested===r&&e.packages[n.id]?e.packages[n.id]:be.default.validRange(r)?Object.values(e?.packages??{}).filter(o=>o.name===t&&be.default.satisfies(o.version,r)).sort((o,i)=>be.default.rcompare(o.version,i.version))[0]??null:null}function gn({registry:e="https://registry.npmjs.org/",fetchImpl:t=fetch,signal:r,download:n=D,previous:s}){let o=new Map;return async(i,a)=>{let c=`${i}@${a}`;if(o.has(c))return o.get(c);let l=xc(s,i,a),u=await n(i,l?.version??a,{registry:e,fetchImpl:t,signal:r});if(l&&u.integrity!==l.integrity)throw new Error(`${u.id} no longer matches the integrity recorded in the lock`);return o.set(c,u),u}}var $n=z(C(),1),yn=(e,t,r)=>new Error(`${e.name}@${e.version} requires peer ${t}@${r}; install a compatible root explicitly`);function Rc(e,t,r){if(e.manifest.peerDependenciesMeta?.[t]?.optional)return null;throw yn(e,t,r)}function bc(e,[t,r],{nodes:n,roots:s}){let o=s[t]?.id??e.dependencies[t];if(!o)return Rc(e,t,r);if(!$n.default.satisfies(n[o].version,r))throw yn(e,t,r);return o}function Oc(e,t){for(let r of Object.entries(e.manifest.peerDependencies??{})){let n=bc(e,r,t);n&&(e.dependencies[r[0]]=n)}}function xn(e,t){for(let r of Object.values(e))Oc(r,{nodes:e,roots:t})}var Rn=z(C(),1);function vc(e,t){return!nt(t.name)||!Rn.default.valid(t.version)?!1:e===Re(t.name,t.version)}function Ic(e){return e.integrity?.startsWith("sha512-")?e.key===st(e.name,e.version,e.integrity):!1}function Nc(e,t,r){if(!vc(t,r)||!Ic(r))throw new Error("Invalid locked package");for(let n of r.files)A(n);if(Object.values(r.dependencies).some(n=>!e.packages[n]))throw new Error("Dangling locked dependency")}function Sc(e){return e?.format!==1?!1:!!e.roots&&!!e.packages}function it(e){if(!Sc(e))throw new Error("Unsupported package lock");if(Object.keys(e.packages).length>512)throw new Error("The package lock exceeds 512 packages");for(let[t,r]of Object.entries(e.packages))Nc(e,t,r);if(Object.values(e.roots).some(t=>!e.packages[t.id]))throw new Error("Dangling locked root");return e}function kc(e,t,r){if(Object.keys(e.nodes).length>=512)throw new Error("Dependency graph exceeds 512 packages");for(let n of r.files.values())e.total+=n.length;if(e.total>256*1024*1024)throw new Error("Dependency graph exceeds 256 MiB");e.nodes[r.id]={name:t,version:r.manifest.version,integrity:r.integrity,key:r.key,manifest:r.manifest,files:[...r.files.keys()].sort(),dependencies:{}},e.downloads.set(r.id,r.files)}async function Lc(e,t){let r={};for(let n of e){let{name:s,version:o}=ie(n);r[s]={requested:o||"latest",id:await t(s,o||"latest")}}return r}async function bn(e,t={}){let r=gn(t),n={nodes:{},downloads:new Map,total:0},s=async(i,a)=>{t.signal?.throwIfAborted();let c=await r(i,a);if(n.nodes[c.id])return c.id;kc(n,i,c);for(let[l,u]of Object.entries(c.manifest.dependencies??{}).sort())n.nodes[c.id].dependencies[l]=await s(l,u);return c.id},o=await Lc(e,s);return xn(n.nodes,o),{lock:{format:1,registry:t.registry??"https://registry.npmjs.org/",roots:o,packages:n.nodes},downloads:n.downloads}}var ct=z(C(),1);var Ac=new TextDecoder,Tc=new TextEncoder,Oe="No webfront.project.json: run wf init",ve="The lock does not match the dependencies of webfront.project.json; run wf install --update to resolve them again";async function On(e,t){try{return await G(e,t)}catch(r){if(r.message.includes("Cannot read project file:"))return null;throw r}}function jc(e,t,r){return t?r===t.requested?!0:ct.default.validRange(r)!==null&&ct.default.satisfies(e.packages[t.id].version,r):!1}function Pc(e,t){let r=Object.keys(t);return r.length===Object.keys(e.roots).length&&r.every(n=>jc(e,e.roots[n],t[n]))}function qc(e,t,r){return e?t?t.manifestDigest===void 0?Pc(t,e.dependencies)?"legacy":"desynchronized":t.manifestDigest===r?"consistent":"desynchronized":"unlocked":"no-manifest"}async function re(e){let t=await x(e,"state",`${R} ${S}`),r=await On(e,R),n=await On(e,S),{source:s,manifest:o}=r?tt(r):{source:null,manifest:null},i=n?it(JSON.parse(Ac.decode(n))):null,a=o?await ye(o.dependencies):null;return{manifest:o,source:s,lock:i,token:t,status:qc(o,i,a),digest:a}}var In=e=>e.status==="desynchronized"?`Warning: ${ve}.\r `:"";async function Nn(e,t,r,{signal:n}={}){let s=[];try{for(let[o,i]of t){n?.throwIfAborted();let a=await x(e,"begin",o,!1);s.push(a),await K(e,{id:a,path:"output",bytes:i},n)}n?.throwIfAborted(),await x(e,"commitGroup",s.join(` diff --git a/test/cmake/PrepareJourney.cmake b/test/cmake/PrepareJourney.cmake new file mode 100644 index 00000000..34d7e3f8 --- /dev/null +++ b/test/cmake/PrepareJourney.cmake @@ -0,0 +1,16 @@ +# Completes the manifest that wf init and wf install wrote in the project of the developer journey (#316): the entries and +# the provider that wf build and wf embed use, the specs of wf test, a script under permissions; then copies the files +# the starter does not bring (tsconfig.json for wf check, a spec, the script). +# Usage: cmake -DSOURCE= -DPROJECT= -P PrepareJourney.cmake +set(manifest_path "${PROJECT}/webfront.project.json") +if(NOT EXISTS "${manifest_path}") + message(FATAL_ERROR "wf init has not created ${manifest_path}") +endif() +file(READ "${manifest_path}" manifest) +string(JSON manifest SET "${manifest}" entries "{\"main\": \"ui/main.tsx\"}") +string(JSON manifest SET "${manifest}" providers "{\"LifeUI\": {\"entry\": \"main\", \"output\": \"generated/LifeUI.hpp\"}}") +string(JSON manifest SET "${manifest}" test "{\"specs\": [\"tests/life.spec.js\"]}") +string(JSON manifest SET "${manifest}" scripts "{\"denied\": \"tools/denied.mjs\"}") +string(JSON manifest SET "${manifest}" permissions "{\"files\": [\"tools\"], \"publish\": [\"generated\"]}") +file(WRITE "${manifest_path}" "${manifest}\n") +file(COPY "${SOURCE}/" DESTINATION "${PROJECT}") diff --git a/test/developer/specs/environment-specs.mjs b/test/developer/specs/environment-specs.mjs index da1e8a26..ec43552e 100644 --- a/test/developer/specs/environment-specs.mjs +++ b/test/developer/specs/environment-specs.mjs @@ -92,6 +92,21 @@ describe('The environment', () => { await rejects(downloadPackage('pkg', '1.0.0', {registry: 'https://registry.test/', fetchImpl}), /Integrity check failed/); }); + it('reads the archives of DefinitelyTyped, rooted at the package name, and refuses any other mixed root (#316)', async () => { + // npm strips the first path component whatever it is: @types/* archives are rooted at "react/", not "package/". + const rooted = root => compress(tar(new Map([[`${root}/package.json`, encode({name: '@types/react', version: '19.3.0'})], [`${root}/index.d.ts`, encode('export {};')]]))); + const download = bytes => downloadPackage('@types/react', '19.3.0', {registry: 'https://registry.test/', fetchImpl: async url => + String(url).endsWith('.tgz') ? new Response(bytes) : Response.json({versions: {'19.3.0': {dist: {tarball: 'https://registry.test/types-react.tgz', integrity: await integrity(bytes)}}}})}); + for (const root of ['react', 'package']) { + const {files} = await download(rooted(root)); + expect([...files.keys()].sort()).toEqual(['index.d.ts', 'package.json']); + } + const mixed = compress(tar(new Map([['react/package.json', encode({name: '@types/react', version: '19.3.0'})], ['other/index.d.ts', encode('')]]))); + await rejects(download(mixed), /Invalid npm tarball root/); + await rejects(download(rooted('..')), /Invalid npm tarball root/); + await rejects(download(compress(tar(new Map([['package.json', encode({name: '@types/react', version: '19.3.0'})]])))), /Invalid npm tarball root/); + }); + it('resolves browser conditional exports and rejects private and Node imports', async () => { expect(packageEntry({exports: {'.': {browser: './browser.js', default: './node.js'}, './*': './src/*.mjs'}}, '')).toBe('browser.js'); expect(packageEntry({exports: {'./*': './src/*.mjs'}}, 'sub')).toBe('src/sub.mjs'); diff --git a/test/fixtures/journey/tests/life.spec.js b/test/fixtures/journey/tests/life.spec.js new file mode 100644 index 00000000..3f152a45 --- /dev/null +++ b/test/fixtures/journey/tests/life.spec.js @@ -0,0 +1,12 @@ +describe('the Life starter project', () => { + it('runs its specs in a real browser', () => { + const canvas = document.createElement('canvas'); + expect(canvas.getContext('2d')).not.toBeNull(); + }); + it('packs 32 by 32 cells into 128 bytes, least significant bit first', () => { + const cells = new Uint8Array(32 * 32 / 8); + for (const i of [330, 331, 332]) cells[i >> 3] |= 1 << (i & 7); + expect(cells.length).toBe(128); + expect(cells[41]).toBe(0b00011100); + }); +}); diff --git a/test/fixtures/journey/tools/denied.mjs b/test/fixtures/journey/tools/denied.mjs new file mode 100644 index 00000000..c18694ec --- /dev/null +++ b/test/fixtures/journey/tools/denied.mjs @@ -0,0 +1,2 @@ +// Writes outside the permissions of the manifest: the environment must refuse it. +export default async context => { await context.project.write('ui/main.tsx', 'replaced'); }; diff --git a/test/fixtures/journey/tsconfig.json b/test/fixtures/journey/tsconfig.json new file mode 100644 index 00000000..56a49f09 --- /dev/null +++ b/test/fixtures/journey/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "strict": true, + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "jsx": "react-jsx", + "lib": ["ES2022", "DOM"], + "noEmit": true + }, + "include": ["ui"] +} diff --git a/test/web/CMakeLists.txt b/test/web/CMakeLists.txt index 42c3a2ea..f4d2d33d 100644 --- a/test/web/CMakeLists.txt +++ b/test/web/CMakeLists.txt @@ -139,9 +139,9 @@ if(_browser_tests_available) # webfront_add_driver_test( # [OUTPUT ] [REPORT ] [EXPECT_FILE ] [DRIVER_TIMEOUT ] [FORGE :] - # [ENVIRONMENT INTEGRITY ] [FRESH_PROJECT ] [RENAME_ENTRY ] [PINNED] [SLEEP_ENVIRONMENT] [REQUIRES ] [PROVIDES ]) + # [ENVIRONMENT INTEGRITY ] [FRESH_PROJECT ] [PROJECT_DIR ] [RENAME_ENTRY ] [PINNED] [SLEEP_ENVIRONMENT] [REQUIRES ] [PROVIDES ]) function(webfront_add_driver_test name status command) - cmake_parse_arguments(ARG "PINNED;SLEEP_ENVIRONMENT" "OUTPUT;REPORT;EXPECT_FILE;DRIVER_TIMEOUT;FORGE;ENVIRONMENT;INTEGRITY;FRESH_PROJECT;RENAME_ENTRY;REQUIRES;PROVIDES" "" ${ARGN}) + cmake_parse_arguments(ARG "PINNED;SLEEP_ENVIRONMENT" "OUTPUT;REPORT;EXPECT_FILE;DRIVER_TIMEOUT;FORGE;ENVIRONMENT;INTEGRITY;FRESH_PROJECT;PROJECT_DIR;RENAME_ENTRY;REQUIRES;PROVIDES" "" ${ARGN}) set(options -DEXPECT_STATUS=${status} "-DCOMMAND=${command}" -DPROFILE=${CMAKE_CURRENT_BINARY_DIR}/wf-profiles/${name}) foreach(option OUTPUT REPORT) if(ARG_${option}) @@ -153,6 +153,10 @@ if(_browser_tests_available) list(APPEND options "-D${option}=${ARG_${option}}") endif() endforeach() + if(ARG_PROJECT_DIR) + # Appended after the default project of _wf_run, which it replaces. + list(APPEND options "-DPROJECT=${ARG_PROJECT_DIR}") + endif() if(ARG_SLEEP_ENVIRONMENT) list(APPEND options -DSLEEP_ENVIRONMENT=ON) endif() @@ -199,6 +203,66 @@ if(_browser_tests_available) set_tests_properties(WfDriverBadTimeout PROPERTIES PASS_REGULAR_EXPRESSION "--timeout expects whole seconds" LABELS "web-integration" TIMEOUT 30) set_tests_properties(WfDriverUsage PROPERTIES PASS_REGULAR_EXPRESSION "A wf command is required" LABELS "web-integration" TIMEOUT 30) + # The developer journey (#316), from the environment built from the sources and the local registry, on one project in an + # empty directory: wf create, init, install, check, test, build, embed; the embedded application is then compiled + # and run from an empty directory. wf preview and wf dev need the page of the terminal: DeveloperBrowserIntegration + # runs them, on the same engine. Each step is a case of its own, in the order of the fixtures. + set(_journey "${CMAKE_CURRENT_BINARY_DIR}/journey-project") + function(webfront_add_journey_step name status command) + cmake_parse_arguments(ARG "" "OUTPUT;REQUIRES;PROVIDES" "" ${ARGN}) + webfront_add_driver_test(${name} ${status} "${command}" PROJECT_DIR "${_journey}" OUTPUT "${ARG_OUTPUT}" + REQUIRES "${ARG_REQUIRES}" PROVIDES "${ARG_PROVIDES}") + endfunction() + # webfront_add_journey_files( ): the files the starter lacks. + function(webfront_add_journey_files name requires provides) + add_test(NAME ${name} COMMAND ${CMAKE_COMMAND} -DSOURCE=${PROJECT_SOURCE_DIR}/test/fixtures/journey + -DPROJECT=${_journey} -P ${PROJECT_SOURCE_DIR}/test/cmake/PrepareJourney.cmake) + set_tests_properties(${name} PROPERTIES FIXTURES_REQUIRED "${requires}" FIXTURES_SETUP "${provides}" + LABELS "web-integration" TIMEOUT 30) + endfunction() + webfront_add_driver_test(JourneyCreate 0 "create|life" OUTPUT "Created ui\\." FRESH_PROJECT "${_journey}" PROVIDES JourneyCreated) + webfront_add_journey_step(JourneyInit 0 "init" OUTPUT "Created webfront.project.json" REQUIRES JourneyCreated PROVIDES JourneyInitialized) + # The packages of the starter: the application, its types, the type checker and the specs' runner. @types archives are + # rooted at the package name, not at package/. + webfront_add_journey_step(JourneyInstall 0 + "install|react@19.3.1|react-dom@19.3.1|typescript@5.9.3|@types/react@19.3.0|@types/react-dom@19.3.0|jasmine-core@7.0.2" + OUTPUT "Installed 8 packages" REQUIRES JourneyInitialized PROVIDES JourneyInstalled) + webfront_add_journey_files(JourneyFiles JourneyInstalled JourneyConfigured) + webfront_add_journey_step(JourneyCheck 0 "check" OUTPUT "No type errors in 1 project file \\(TypeScript 5\\.9\\.3\\)" + REQUIRES JourneyConfigured PROVIDES JourneyChecked) + webfront_add_journey_step(JourneyTest 0 "test" OUTPUT "PASSED: 2 specs" REQUIRES JourneyChecked PROVIDES JourneyTested) + webfront_add_journey_step(JourneyBuild 0 "build" OUTPUT "Build ready" REQUIRES JourneyTested PROVIDES JourneyBuilt) + webfront_add_journey_step(JourneyEmbed 0 "embed|LifeUI" OUTPUT "Generated generated/LifeUI.hpp" REQUIRES JourneyBuilt PROVIDES JourneyEmbedded) + # Errors of the same project: a script outside its permissions, a cache that is not there, a lock that is out of date. + webfront_add_journey_step(JourneyPermissionDenied 1 "run|denied" OUTPUT "Permission denied: writing ui/main\\.tsx" REQUIRES JourneyEmbedded) + add_test(NAME JourneyEmptyCache COMMAND ${CMAKE_COMMAND} -E remove_directory "${_journey}/.webfront/developer/packages") + set_tests_properties(JourneyEmptyCache PROPERTIES FIXTURES_REQUIRED JourneyEmbedded FIXTURES_SETUP JourneyCacheEmptied + LABELS "web-integration" TIMEOUT 30) + webfront_add_journey_step(JourneyOfflineMissing 1 "restore|--offline" OUTPUT "react@19\\.3\\.1 \\(missing\\)" REQUIRES JourneyCacheEmptied PROVIDES JourneyCacheChecked) + webfront_add_journey_step(JourneyRestore 0 "restore" OUTPUT "Restored 8 of 8 packages" REQUIRES JourneyCacheChecked PROVIDES JourneyRestored) + webfront_add_journey_step(JourneyOfflineVerified 0 "restore|--offline" OUTPUT "Cache verified offline: 8 packages" REQUIRES JourneyRestored) + + # The application of the journey: the header that wf embed generated is compiled into the maintained Life application, + # which then runs from an empty directory, without a project root, a bootstrap or a network. + add_executable(life_journey EXCLUDE_FROM_ALL LifeEmbeddedTest.cpp) + target_link_libraries(life_journey PRIVATE WebFront_test_hardening WebFront WebFront_warnings WebFront_options) + target_compile_definitions(life_journey PRIVATE WEBFRONT_TEST_FRONTEND=${WEBFRONT_WEBTEST_FRONTEND_TYPE} + WEBFRONT_LIFE_ASSETS_HEADER="${_journey}/generated/LifeUI.hpp") + webfront_setup_frontends_for_target(life_journey) + add_test(NAME JourneyEmbeddedBuild COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}" + --config $ --target life_journey --parallel 2) + # The nested build excludes the other tests, like LifeEmbeddedBuild. + set_tests_properties(JourneyEmbeddedBuild PROPERTIES FIXTURES_REQUIRED JourneyEmbedded + FIXTURES_SETUP JourneyApplication LABELS "web-integration" TIMEOUT 180 RUN_SERIAL TRUE PROCESSORS 2) + set(_journey_command "$") + if(_developer_xvfb) + set(_journey_command "${_developer_xvfb}" -a ${_journey_command}) + endif() + add_test(NAME JourneyEmbeddedRun COMMAND ${_journey_command}) + webfront_set_browser_test_properties(JourneyEmbeddedRun "${CMAKE_CURRENT_SOURCE_DIR}" 60) + set_tests_properties(JourneyEmbeddedRun PROPERTIES FIXTURES_REQUIRED JourneyApplication) + set(_journey_targets life_journey) + # The Jasmine suite of webtest: a fresh copy of the project, its dependencies installed from the local registry, # then `wf test` (the WebFront*Integration case) in the pinned bootstrap environment. if(_webtest_runs) @@ -320,7 +384,7 @@ if(_browser_tests_available) set_tests_properties(LifeEmbeddedIntegration PROPERTIES FIXTURES_REQUIRED LifeEmbedded) if(WEBFRONT_WEBTEST_FRONTEND STREQUAL "WKWebView") get_filename_component(_developer_wk_plist "${PROJECT_SOURCE_DIR}/test/cmake/WKWebViewTestInfo.plist.in" ABSOLUTE) - foreach(target developer_integration life_embedded) + foreach(target developer_integration life_embedded ${_journey_targets}) string(REPLACE "_" "-" identifier "${target}") set_target_properties(${target} PROPERTIES MACOSX_BUNDLE TRUE diff --git a/test/web/registry-packages.json b/test/web/registry-packages.json index 7b2de1fd..6af7a2e3 100644 --- a/test/web/registry-packages.json +++ b/test/web/registry-packages.json @@ -1,6 +1,18 @@ { "comment": "The real packages of the local npm registry of the tests: downloaded at configure time, verified against their integrity, never committed.", "packages": [ + { + "name": "@types/react", + "version": "19.3.0", + "url": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==" + }, + { + "name": "@types/react-dom", + "version": "19.3.0", + "url": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==" + }, { "name": "@xterm/addon-fit", "version": "0.11.0", @@ -13,6 +25,12 @@ "url": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz", "integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==" }, + { + "name": "csstype", + "version": "3.2.3", + "url": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==" + }, { "name": "esbuild-wasm", "version": "0.28.2", diff --git a/test/web/registry/fixture.mjs b/test/web/registry/fixture.mjs index 6b145fb0..7d4cbdce 100644 --- a/test/web/registry/fixture.mjs +++ b/test/web/registry/fixture.mjs @@ -50,8 +50,9 @@ const newest = versions => versions.toSorted(compareVersions).at(-1); /** A real archive, kept byte for byte: its manifest is the package.json inside it. */ export async function realPackage(bytes) { - const entry = readTar(await gunzip(bytes)).find(file => file.path === 'package/package.json'); - if (!entry) throw new Error('An archive of the registry has no package/package.json'); + // The root is "package/" for npm, the package name for the archives of DefinitelyTyped. + const entry = readTar(await gunzip(bytes)).find(file => /^[^/]+\/package\.json$/.test(file.path)); + if (!entry) throw new Error('An archive of the registry has no /package.json'); return {manifest: JSON.parse(decoder.decode(entry.bytes)), bytes}; } From feae7b3b03dc399f3303aec42cee14cedbb6eb66 Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Sat, 24 Oct 2026 11:22:50 +0200 Subject: [PATCH 2/3] Keep the journey project path under MAX_PATH on Windows [#316] --- test/web/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/web/CMakeLists.txt b/test/web/CMakeLists.txt index f4d2d33d..3ebcd5ed 100644 --- a/test/web/CMakeLists.txt +++ b/test/web/CMakeLists.txt @@ -207,7 +207,8 @@ if(_browser_tests_available) # empty directory: wf create, init, install, check, test, build, embed; the embedded application is then compiled # and run from an empty directory. wf preview and wf dev need the page of the terminal: DeveloperBrowserIntegration # runs them, on the same engine. Each step is a case of its own, in the order of the fixtures. - set(_journey "${CMAKE_CURRENT_BINARY_DIR}/journey-project") + # Short: on Windows the cache of jasmine-core holds a path of 262 characters under test/web/journey-project, beyond MAX_PATH. + set(_journey "${CMAKE_BINARY_DIR}/jp") function(webfront_add_journey_step name status command) cmake_parse_arguments(ARG "" "OUTPUT;REQUIRES;PROVIDES" "" ${ARGN}) webfront_add_driver_test(${name} ${status} "${command}" PROJECT_DIR "${_journey}" OUTPUT "${ARG_OUTPUT}" From 5ae647bb22eeeac39bc09ee8e6e802cda19597a4 Mon Sep 17 00:00:00 2001 From: Ambroise Leclerc Date: Sat, 24 Oct 2026 11:38:54 +0200 Subject: [PATCH 3/3] Accept ADR-013, ADR-014 and ADR-015 on the cross-platform journey proofs and record the durations [#316] --- docs/CHANGELOG.md | 2 +- docs/PROJECT_STATUS.md | 5 +++++ docs/TEST_PERFORMANCE.md | 20 +++++++++++++++++++ ...-013-bootstrap-developpeur-a-la-demande.md | 9 +++------ ...construction-javascript-dans-le-browser.md | 8 +++----- ...015-ressources-generees-par-application.md | 8 +++----- docs/adr/ADR-016-bootstrap-comme-socle.md | 14 ++++++------- docs/adr/README.md | 8 ++++---- 8 files changed, 46 insertions(+), 28 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 8371d366..1c1fb0ff 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -31,7 +31,7 @@ - Developer journey qualification (#316, epic #303): `Journey*` CTest cases run `wf create`, `init`, `install`, `check`, `test`, `build` and `embed` on one project in an empty directory from the local registry, compile the generated header into the Life application and run it from an empty directory, then check a script under denied permissions and an emptied cache offline and restored. The test - registry gains `@types/react`, `@types/react-dom` and `csstype`. + registry gains `@types/react`, `@types/react-dom` and `csstype`. ADR-013, ADR-014 and ADR-015 are accepted. - `third_party/` is removed (#319, epic #303): `fflate` 0.8.3, the last vendored source, is a locked package of the repository's `wf` project, imported by name from `js/developer/environment/embed.mjs`; its notice comes from the installed package. The environment archive stays byte for byte identical. The test registry downloads it at configure time, and diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index 527589eb..c897573f 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -60,6 +60,11 @@ Error cases: wrong integrity, missing archive, unknown protocol or API version a permissions (`JourneyPermissionDenied`), an emptied cache checked offline then restored (`JourneyOfflineMissing`, `JourneyRestore`, `JourneyOfflineVerified`), Ctrl+C on dev, scripts and native commands (`DeveloperBrowserIntegration`). +Green on CEF (GCC and Clang, public network cut), WebKitGTK, WKWebView and WebView2 in the +[pull request run](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081726319) and the +[dispatch](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081723204); the durations are in `docs/TEST_PERFORMANCE.md`. +ADR-013, ADR-014 and ADR-015 are accepted on these proofs. Known limit: file reads fail beyond 260 characters on Windows (#349). + The journey found two defects, now fixed with regression specs: the installer refused every archive whose root is not `package/` (all of `@types/*`, whose root is the package name; `npm` strips the first component whatever it is), and the Life starter did not type-check under `strict` with the current declarations (`useState`). diff --git a/docs/TEST_PERFORMANCE.md b/docs/TEST_PERFORMANCE.md index be5c3091..4b571277 100644 --- a/docs/TEST_PERFORMANCE.md +++ b/docs/TEST_PERFORMANCE.md @@ -67,6 +67,25 @@ environment starts a sleeping command and publishes a readiness marker; the test exit status 71. Compiler startup is covered by the other real-script driver cases and does not consume this watchdog's budget. This case retains a real elapsed-time check rather than advancing a test clock. +## Developer journey (#316) + +The 15 `Journey*` cases (create, init, install, check, test, build, embed, build and run of the embedded application, and the +error cases) run one after the other on a single project. Their summed CTest durations in the +[pull request run](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081726319) and the +[CEF dispatch](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081723204), and the whole suite in the same run: + +| Job | Journey cases | Whole suite | +| --- | ---: | ---: | +| Linux GCC / WebKitGTK | 64.1 s | 248.7 s | +| macOS Clang / WKWebView | 60.8 s | 254.5 s | +| Windows MSVC / WebView2 | 73.3 s | 269.4 s | +| Linux GCC / CEF | 44.8 s | 172.7 s | +| Linux Clang / CEF | 44.9 s | 170.4 s | + +The cases run under the same lock as the other browser tests, so the added time is about one minute per job, of which the +compilation of the embedded application (`JourneyEmbeddedBuild`, serial like `LifeEmbeddedBuild`) is the largest part. The project of the +journey sits under `/jp`: on Windows the cache of `jasmine-core` holds a path beyond 260 characters in a longer root (#349). + ## Resource audit | Tests | Scheduling constraint | @@ -77,6 +96,7 @@ budget. This case retains a real elapsed-time check rather than advancing a test | Frontend selection | Its own `frontend-tests` directory; multi-config tests have a separate working directory. Each configure starts with a fresh fixture cache. | | CEF option scope | Its own `cef-testing-state` directory; each state still configures separately. | | Consumer | Separate `consumer-build` tree; no browser is opened. | +| Journey | One project directory (`/jp`) chained by CTest fixtures; the browser lock; the nested build is `RUN_SERIAL`. | | Browser integration and lifecycle | Keep `RESOURCE_LOCK webfront_port_9002`, including the shared CEF profile and generated browser resources. | | Life embedded build | Keep `FIXTURES_REQUIRED DeveloperGenerated`, then the build/run fixture dependencies. `RUN_SERIAL TRUE` excludes every other test while it runs, protecting running executables from regeneration/relinking. `PROCESSORS 2` records the nested build's two workers. | diff --git a/docs/adr/ADR-013-bootstrap-developpeur-a-la-demande.md b/docs/adr/ADR-013-bootstrap-developpeur-a-la-demande.md index 98277f4a..18ad9721 100644 --- a/docs/adr/ADR-013-bootstrap-developpeur-a-la-demande.md +++ b/docs/adr/ADR-013-bootstrap-developpeur-a-la-demande.md @@ -8,12 +8,11 @@ | 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) | | 0.3 | 2026-10-22 | Proposée | Ambroise Leclerc | Provisioning local des paquets (#306) : `wf restore [--offline]`, priorité du registre de l'application sur celui du manifeste. | À renseigner après intégration. | | 0.4 | 2026-10-24 | Proposée | Ambroise Leclerc | Retrait du starter PI ; Life reste le seul starter distribué, créé avec `wf create life`. | [8368f59](https://github.com/ambroise-leclerc/WebFront/commit/8368f595af1534ea6670ee6d5582f245f9edc1f2) | +| 1.0 | 2026-10-24 | Acceptée | Ambroise Leclerc | Qualification multiplateforme du parcours développeur (#316) : la proposition est acceptée. | [#348](https://github.com/ambroise-leclerc/WebFront/pull/348) | ## Statut et date -**Proposée le 2026-10-20.** L'implémentation expérimentale est soumise à validation ; la -distribution publique de l'environnement et la qualification des autres moteurs restent ouvertes. -La date est celle de la proposition, pas une origine historique reconstituée. +**Acceptée le 2026-10-24** (proposée le 2026-10-20). Preuves (#316) : le parcours `Journey*` (create, init, install, check, test, build, embed, compilation et exécution de l'application embarquée depuis un répertoire vide, permission refusée, cache hors ligne puis restauré) est vert sous CEF (GCC et Clang, réseau public coupé), WebKitGTK, WKWebView et WebView2 ([exécution de la PR](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081726319) et [dispatch](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081723204)) ; un échantillon de treize paquets npm réels (React, TypeScript, `@types/*`, jasmine-core…) est installé depuis le registre local ; la release 0.6.0 est publiée et vérifiée. ## Contexte @@ -50,9 +49,7 @@ publication npm ou propriété d'un scope. Le manifeste vérifié épingle aussi ## Alignement sur l'ADR-016 [ADR-016](ADR-016-bootstrap-comme-socle.md) retient cette proposition comme base de l'architecture. -Elle reste **Proposée** jusqu'aux preuves de #316 : parcours complet validé sous CEF, WebKitGTK, -WebView2 et WKWebView, compatibilité d'un échantillon de paquets npm, restauration hors ligne et -publication vérifiée d'une release. Les providers et composants historiques évoqués ici suivent la +Elle est **Acceptée** depuis les preuves de #316 (voir le statut). Les providers et composants historiques évoqués ici suivent la trajectoire de retrait de l'ADR-016. ## Alternatives et conséquences diff --git a/docs/adr/ADR-014-construction-javascript-dans-le-browser.md b/docs/adr/ADR-014-construction-javascript-dans-le-browser.md index d6459a08..77e29191 100644 --- a/docs/adr/ADR-014-construction-javascript-dans-le-browser.md +++ b/docs/adr/ADR-014-construction-javascript-dans-le-browser.md @@ -6,11 +6,11 @@ | --- | --- | --- | --- | --- | --- | | 0.1 | 2026-10-20 | Proposée | Ambroise Leclerc | Proposition et première implémentation du résolveur npm et du compilateur navigateur. | À renseigner après intégration. | | 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) | +| 1.0 | 2026-10-24 | Acceptée | Ambroise Leclerc | Qualification multiplateforme du parcours développeur (#316) : la proposition est acceptée. | [#348](https://github.com/ambroise-leclerc/WebFront/pull/348) | ## Statut et date -**Proposée le 2026-10-20.** Validation initiale avec React et WKWebView ; couverture multiplateforme -et étendue de compatibilité des paquets à poursuivre avant acceptation générale. +**Acceptée le 2026-10-24** (proposée le 2026-10-20). Preuves (#316) : le parcours `Journey*` (create, init, install, check, test, build, embed, compilation et exécution de l'application embarquée depuis un répertoire vide, permission refusée, cache hors ligne puis restauré) est vert sous CEF (GCC et Clang, réseau public coupé), WebKitGTK, WKWebView et WebView2 ([exécution de la PR](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081726319) et [dispatch](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081723204)) ; un échantillon de treize paquets npm réels (React, TypeScript, `@types/*`, jasmine-core…) est installé depuis le registre local ; la release 0.6.0 est publiée et vérifiée. ## Contexte @@ -44,9 +44,7 @@ processus C++ de compilation ou shell n'est lancé. La transformation TS n'effec ## Alignement sur l'ADR-016 [ADR-016](ADR-016-bootstrap-comme-socle.md) retient cette proposition comme base de l'architecture. -Elle reste **Proposée** jusqu'aux preuves de #316 : parcours complet validé sous CEF, WebKitGTK, -WebView2 et WKWebView, compatibilité d'un échantillon de paquets npm, restauration hors ligne et -publication vérifiée d'une release. Les providers et composants historiques évoqués ici suivent la +Elle est **Acceptée** depuis les preuves de #316 (voir le statut). Les providers et composants historiques évoqués ici suivent la trajectoire de retrait de l'ADR-016. ## Alternatives et conséquences diff --git a/docs/adr/ADR-015-ressources-generees-par-application.md b/docs/adr/ADR-015-ressources-generees-par-application.md index 137f07f1..06e5da85 100644 --- a/docs/adr/ADR-015-ressources-generees-par-application.md +++ b/docs/adr/ADR-015-ressources-generees-par-application.md @@ -7,11 +7,11 @@ | 0.1 | 2026-10-20 | Proposée | Ambroise Leclerc | Proposition et première implémentation de wf embed et du parcours hors ligne. | À renseigner après intégration. | | 0.2 | 2026-10-22 | Proposée | Ambroise Leclerc | Alignement sur ADR-016 : la proposition devient la base de l'architecture ; preuves multiplateformes manquantes listées. | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) | | 0.3 | 2026-10-24 | Proposée | Ambroise Leclerc | Vérification recentrée sur Life après le retrait de PI : interface React, générations via le bridge et exécution hors projet. | [8368f59](https://github.com/ambroise-leclerc/WebFront/commit/8368f595af1534ea6670ee6d5582f245f9edc1f2) | +| 1.0 | 2026-10-24 | Acceptée | Ambroise Leclerc | Qualification multiplateforme du parcours développeur (#316) : la proposition est acceptée. | [#348](https://github.com/ambroise-leclerc/WebFront/pull/348) | ## Statut et date -**Proposée le 2026-10-20.** Le parcours PI démontre une génération navigateur, sa compilation puis -l'exécution hors projet/cache avec WKWebView. Les autres moteurs nécessitent leur validation. +**Acceptée le 2026-10-24** (proposée le 2026-10-20). Preuves (#316) : le parcours `Journey*` (create, init, install, check, test, build, embed, compilation et exécution de l'application embarquée depuis un répertoire vide, permission refusée, cache hors ligne puis restauré) est vert sous CEF (GCC et Clang, réseau public coupé), WebKitGTK, WKWebView et WebView2 ([exécution de la PR](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081726319) et [dispatch](https://github.com/ambroise-leclerc/WebFront/actions/runs/40081723204)) ; un échantillon de treize paquets npm réels (React, TypeScript, `@types/*`, jasmine-core…) est installé depuis le registre local ; la release 0.6.0 est publiée et vérifiée. ## Contexte @@ -41,9 +41,7 @@ une conséquence automatique de cette proposition. ## Alignement sur l'ADR-016 [ADR-016](ADR-016-bootstrap-comme-socle.md) retient cette proposition comme base de l'architecture. -Elle reste **Proposée** jusqu'aux preuves de #316 : parcours complet validé sous CEF, WebKitGTK, -WebView2 et WKWebView, compatibilité d'un échantillon de paquets npm, restauration hors ligne et -publication vérifiée d'une release. Les providers et composants historiques évoqués ici suivent la +Elle est **Acceptée** depuis les preuves de #316 (voir le statut). Les providers et composants historiques évoqués ici suivent la trajectoire de retrait de l'ADR-016. ## Alternatives et conséquences diff --git a/docs/adr/ADR-016-bootstrap-comme-socle.md b/docs/adr/ADR-016-bootstrap-comme-socle.md index cc96566f..c978feed 100644 --- a/docs/adr/ADR-016-bootstrap-comme-socle.md +++ b/docs/adr/ADR-016-bootstrap-comme-socle.md @@ -8,13 +8,14 @@ | 1.1 | 2026-10-23 | Acceptée | Ambroise Leclerc | Garde-fou `MinimalCoreAssets` (#314) : la liste est vérifiée par CTest, budget de 150 Kio d'octets décodés ; le favicon devient `FaviconData`, généré par CMake pur depuis `js/core/favicon.ico`. | [c0ee031](https://github.com/ambroise-leclerc/WebFront/commit/c0ee03131d3104721f8a24224533e753a5f6ad13) | | 1.2 | 2026-10-23 | Acceptée | Ambroise Leclerc | Auto-hébergement (#315) : le dépôt est un projet `wf` dont les scripts construisent l'environnement, le site et la vérification du pin avec l'environnement d'amorçage épinglé ; octets identiques à la construction de l'époque, preuve de reconstruction du bundle bootstrap. | — | | 1.3 | 2026-10-24 | Acceptée | Ambroise Leclerc | Tests, régénération et CI sans Node.js ni npm (#318) : les en-têtes du cœur sont produits et vérifiés par un générateur CMake pur (`js/core/EmbedAsset.cmake`), qui remplace `wf run embed-core` et le générateur Node.js ; les paquets du registre de test sont téléchargés et vérifiés au configure ; les tests JavaScript deviennent des specs Jasmine exécutées par `wf test` ; garde-fou global `NoNodeDependency`. | — | +| 1.4 | 2026-10-24 | Acceptée | Ambroise Leclerc | Qualification du parcours (#316) : ADR-013, ADR-014 et ADR-015 passent à « Acceptée ». | [#348](https://github.com/ambroise-leclerc/WebFront/pull/348) | ## Statut et date **Acceptée le 2026-10-22** (épique #303, issue #304). Cette décision fixe la direction -architecturale et les règles que les issues suivantes de l'épique doivent respecter. Elle ne -déclare **pas** les mécanismes déjà proposés (ADR-013, ADR-014, ADR-015) comme acceptés : leur -passage à « Acceptée » attend les preuves multiplateformes de #316. Aucun code n'est modifié par +architecturale et les règles que les issues suivantes de l'épique doivent respecter. Les mécanismes +déjà proposés (ADR-013, ADR-014, ADR-015) sont passés à « Acceptée » le 2026-10-24 avec les preuves +multiplateformes de #316. Aucun code n'est modifié par cette décision ; les retraits qu'elle annonce sont réalisés par #311 à #319. ## Contexte @@ -138,10 +139,9 @@ développeur ni outillage. L'outillage de construction n'est jamais embarqué da abonnements UI multiples et l'injection du navigateur appelant restent des contrats du cœur. - **[ADR-013](ADR-013-bootstrap-developpeur-a-la-demande.md), [ADR-014](ADR-014-construction-javascript-dans-le-browser.md), - [ADR-015](ADR-015-ressources-generees-par-application.md)** restent **Proposées**. Preuves - manquantes avant acceptation : validation CEF, WebKitGTK, WebView2 et WKWebView du parcours - complet, compatibilité d'un échantillon de paquets npm, restauration hors ligne, publication - vérifiée d'une release (#316). + [ADR-015](ADR-015-ressources-generees-par-application.md)** sont **Acceptées** (#316, 2026-10-24) : + parcours complet validé sous CEF, WebKitGTK, WebView2 et WKWebView, échantillon de paquets npm, + restauration hors ligne et release publiée et vérifiée. ### Trajectoire de dépréciation diff --git a/docs/adr/README.md b/docs/adr/README.md index cd24c610..ba124988 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -52,10 +52,10 @@ verification evidence remain in [PROJECT_STATUS](../PROJECT_STATUS.md). | [ADR-010](ADR-010-composants-et-outils-optionnels.md) | Extending WebFront through optional components and development tools | Accepted | 2026-10-14 | 1.7 — 2026-10-23 | | [ADR-011](ADR-011-diagnostics-optionnels.md) | Confining mddlog behind an optional diagnostics façade | Accepted | 2026-10-01 | 1.2 — 2026-10-02 | | [ADR-012](ADR-012-preuves-et-tests.md) | Demonstrating contracts through deterministic tests and browser integration | Accepted | 2020-04-19 | 1.6 — 2026-10-19 | -| [ADR-013](ADR-013-bootstrap-developpeur-a-la-demande.md) | Bootstrapping a downloaded developer environment | Proposée | 2026-10-20 | 0.4 — 2026-10-24 | -| [ADR-014](ADR-014-construction-javascript-dans-le-browser.md) | Resolving npm dependencies and building inside the browser | Proposée | 2026-10-20 | 0.2 — 2026-10-22 | -| [ADR-015](ADR-015-ressources-generees-par-application.md) | Generating application-owned embedded resources | Proposée | 2026-10-20 | 0.3 — 2026-10-24 | -| [ADR-016](ADR-016-bootstrap-comme-socle.md) | The bootstrap environment as WebFront's foundation | Accepted | 2026-10-22 | 1.3 — 2026-10-24 | +| [ADR-013](ADR-013-bootstrap-developpeur-a-la-demande.md) | Bootstrapping a downloaded developer environment | Accepted | 2026-10-20 | 1.0 — 2026-10-24 | +| [ADR-014](ADR-014-construction-javascript-dans-le-browser.md) | Resolving npm dependencies and building inside the browser | Accepted | 2026-10-20 | 1.0 — 2026-10-24 | +| [ADR-015](ADR-015-ressources-generees-par-application.md) | Generating application-owned embedded resources | Accepted | 2026-10-20 | 1.0 — 2026-10-24 | +| [ADR-016](ADR-016-bootstrap-comme-socle.md) | The bootstrap environment as WebFront's foundation | Accepted | 2026-10-22 | 1.4 — 2026-10-24 | Numbering follows the reading topics; milestones and individual file histories provide the chronology, which does not follow the numerical order.