@north-light/crouter 0.3.335 → 0.3.337
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var R=Object.defineProperty;var u=(t,n)=>R(t,"name",{value:n,configurable:!0});import{listInstalledPluginsInRoot as b}from"../resolver.js";import{projectScopeRoots as w,userScopeRoot as C}from"../scope.js";import{validatePluginHookArtifact as j}from"./artifact.js";function O(t){return t.manifest.hooks!==void 0||t.manifest.hookExecutable!==void 0}u(O,"hasHookDeclaration");function x(t){const n=new Set,s=[];for(const a of t){const p=b(a.scope,a.root).sort((c,r)=>c.name<r.name?-1:c.name>r.name?1:0);for(const c of p)n.has(c.name)||(n.add(c.name),c.enabled&&O(c)&&s.push(c))}return s}u(x,"orderedPluginsInScopes");function v(t=process.cwd(),n){return[...w(t,n).map(s=>({scope:"project",root:s})),{scope:"user",root:C()}]}u(v,"hookDiscoveryScopes");function z(t=process.cwd(),n){return x(v(t,n))}u(z,"effectiveHookPlugins");function I(t,n=process.cwd(),s){const a=new Set,p=[];for(const c of v(n,s)){const r=t.filter(e=>e.plugin.scope===c.scope&&e.scopeRoot===c.root),i=new Set(r.map(e=>e.plugin.name)),o=[...b(c.scope,c.root).filter(e=>!i.has(e.name)),...r.map(e=>e.plugin)];o.sort((e,l)=>e.name<l.name?-1:e.name>l.name?1:0);for(const e of o)a.has(e.name)||(a.add(e.name),e.enabled&&O(e)&&p.push(e))}return p}u(I,"effectiveHookPluginsWithCandidates");function h(t,n){return{...n,plugin:t.name,scope:t.scope}}u(h,"issue");function k(t,n){return n.map(s=>h(t,s))}u(k,"artifactIssues");function H(t,n,s){const a=[];return n.forEach((p,c)=>{s.has(p.target)||a.push(h(t,{code:"command_hook_target_invalid",path:`hooks[${c}].target`,message:`hook target "${p.target}" is not an eligible core returned-object leaf`,received:p.target,expected:"an exact eligible core leaf path",next:"Choose a current returned-object core leaf; pkg plugin, sys doctor, JSONL, passthrough, and UI/void surfaces are unavailable."}))}),a}u(H,"targetIssues");function g(t,n){const s=[],a=[],p=[];let c=0;for(const o of n){const e=j(o.root,o.manifest),l=k(o,e.issues);let f=[];if(l.length===0&&e.manifest!==void 0&&e.executablePath!==void 0){const d=H(o,e.manifest.hooks,t);l.push(...d),l.length===0&&(f=e.manifest.hooks.map((m,y)=>Object.freeze({executable:e.executablePath,plugin:Object.freeze({name:o.name,scope:o.scope,root:o.root}),target:m.target,phase:m.phase,op:m.op,description:m.description,effects:Object.freeze([...m.effects]),declarationIndex:y,order:c++})),a.push(...f))}s.push(Object.freeze({plugin:o,...e.manifestPath===void 0?{}:{manifestPath:e.manifestPath},...e.executablePath===void 0?{}:{executablePath:e.executablePath},...e.manifest===void 0?{}:{manifest:e.manifest},lifecycleCandidates:Object.freeze([...e.lifecycleCandidates]),hooks:Object.freeze(f),issues:Object.freeze(l)})),p.push(...l)}const r=new Map;for(const o of a){const e=r.get(o.target);e===void 0?r.set(o.target,[o]):e.push(o)}const i=new Map;for(const[o,e]of r){const l=e.filter(f=>f.phase==="replace");if(l.length>1)for(const f of l)p.push(h(f.plugin,{code:"command_hook_collision",path:`hooks[${f.declarationIndex}]`,message:`multiple replacements target "${o}"`,received:l.map(d=>`${d.plugin.name}:${d.op}`).join(", "),expected:"exactly one replacement for this core leaf",next:"Remove or change one replace declaration; before and after hooks may coexist with one replacement."}));i.set(o,Object.freeze({target:o,before:Object.freeze(e.filter(f=>f.phase==="before")),after:Object.freeze(e.filter(f=>f.phase==="after").reverse()),replacements:Object.freeze(l)}))}return Object.freeze({catalog:t,hooks:Object.freeze(a),plans:i,validations:Object.freeze(s),issues:Object.freeze(p),valid:p.length===0})}u(g,"compileHookRegistry");function P(t){const n=[],s=[],a=[];let p=0;for(const r of t){const i=j(r.root,r.manifest),o=k(r,i.issues);let e=[];o.length===0&&i.manifest!==void 0&&i.executablePath!==void 0&&(e=(i.manifest.schemaVersion===2?i.manifest.lifecycle:[]).map((f,d)=>Object.freeze({executable:i.executablePath,plugin:Object.freeze({name:r.name,scope:r.scope,root:r.root}),event:f.event,phase:f.phase,op:f.op,description:f.description,effects:Object.freeze([...f.effects]),declarationIndex:d,order:p++})),s.push(...e)),n.push(Object.freeze({plugin:r,...i.manifestPath===void 0?{}:{manifestPath:i.manifestPath},...i.executablePath===void 0?{}:{executablePath:i.executablePath},...i.manifest===void 0?{}:{manifest:i.manifest},lifecycleCandidates:Object.freeze([...i.lifecycleCandidates]),hooks:Object.freeze([]),issues:Object.freeze(o)})),a.push(...o)}const c=new Map;for(const r of s){const i=c.get(r.event)??[];c.set(r.event,Object.freeze([...i,r]))}return Object.freeze({hooks:Object.freeze(s),plans:c,validations:Object.freeze(n),issues:Object.freeze(a),valid:a.length===0})}u(P,"compileLifecycleHookRegistry");function T(t,n){return process.env.CRTR_TEST_DISABLE_LIFECYCLE_HOOK_DISCOVERY==="1"?P([]):P(z(t,n))}u(T,"discoverLifecycleHookRegistry");function D(t,n=process.cwd(),s){return g(t,z(n,s))}u(D,"discoverHookRegistry");function M(t,n,s,a=process.cwd(),p){return S(t,[{plugin:n,scopeRoot:s}],a,p)}u(M,"discoverCandidateHookRegistry");function S(t,n,s=process.cwd(),a){return g(t,I(n,s,a))}u(S,"discoverCandidateHookRegistryForCandidates");function A(t,n){return g(t,x(n))}u(A,"discoverHookRegistryInScopes");export{g as compileHookRegistry,P as compileLifecycleHookRegistry,M as discoverCandidateHookRegistry,S as discoverCandidateHookRegistryForCandidates,D as discoverHookRegistry,A as discoverHookRegistryInScopes,T as discoverLifecycleHookRegistry,z as effectiveHookPlugins,v as hookDiscoveryScopes};
|
package/package.json
CHANGED
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.337",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/crouter",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.337",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "GPL-3.0-only",
|
|
12
12
|
"workspaces": [
|
|
@@ -10859,28 +10859,28 @@
|
|
|
10859
10859
|
},
|
|
10860
10860
|
"packages/crouter-api": {
|
|
10861
10861
|
"name": "@north-light/crouter-api",
|
|
10862
|
-
"version": "0.3.
|
|
10862
|
+
"version": "0.3.337",
|
|
10863
10863
|
"license": "GPL-3.0-only"
|
|
10864
10864
|
},
|
|
10865
10865
|
"packages/crouter-env-docker": {
|
|
10866
10866
|
"name": "@north-light/crouter-env-docker",
|
|
10867
|
-
"version": "0.3.
|
|
10867
|
+
"version": "0.3.337",
|
|
10868
10868
|
"license": "GPL-3.0-only"
|
|
10869
10869
|
},
|
|
10870
10870
|
"packages/crouter-plugin": {
|
|
10871
10871
|
"name": "@north-light/crouter-plugin",
|
|
10872
|
-
"version": "0.3.
|
|
10872
|
+
"version": "0.3.337",
|
|
10873
10873
|
"license": "GPL-3.0-only",
|
|
10874
10874
|
"dependencies": {
|
|
10875
|
-
"@north-light/crouter-api": "^0.3.
|
|
10875
|
+
"@north-light/crouter-api": "^0.3.337"
|
|
10876
10876
|
}
|
|
10877
10877
|
},
|
|
10878
10878
|
"packages/crouter-sdk": {
|
|
10879
10879
|
"name": "@north-light/crouter-sdk",
|
|
10880
|
-
"version": "0.3.
|
|
10880
|
+
"version": "0.3.337",
|
|
10881
10881
|
"license": "GPL-3.0-only",
|
|
10882
10882
|
"dependencies": {
|
|
10883
|
-
"@north-light/crouter-api": "^0.3.
|
|
10883
|
+
"@north-light/crouter-api": "^0.3.337"
|
|
10884
10884
|
}
|
|
10885
10885
|
}
|
|
10886
10886
|
}
|