@fjall/deploy-core 2.18.2 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/.minified CHANGED
@@ -1 +1 @@
1
- 152 files minified at 2026-06-19T09:16:02.745Z
1
+ 152 files minified at 2026-06-19T23:40:41.418Z
@@ -1 +1 @@
1
- import{join as c,relative as b}from"path";import{readdir as g}from"fs/promises";import{success as u,failure as i}from"@fjall/generator";import{logger as t}from"@fjall/util/logger";import{ORGANISATION_TYPES as p}from"../types/operations.js";import{fileExists as l}from"@fjall/util/fsHelpers";const w=new Set(Object.values(p));function x(e){return w.has(e)}const f=/^[a-z][a-z0-9-]*$/;async function y(e,a){t.debug("resolveOperation","called",{target:e,workingDirectory:a});const E=await l(a);t.debug("resolveOperation","workingDirectory exists",{exists:E});const d=c(a,"fjall"),h=await l(d);if(t.debug("resolveOperation","fjall/ dir check",{fjallDir:d,exists:h}),h&&t.isDebugEnabled())try{const r=await g(d);t.debug("resolveOperation","fjall/ contents",{entries:r})}catch(r){t.debug("resolveOperation","fjall/ readdir failed",{error:String(r)})}const o=e.toLowerCase();if(x(o)){const r=c(a,"fjall",o),s=await l(r);return t.debug("resolveOperation","org type match",{normalisedTarget:o,orgPath:r,exists:s}),s?u({kind:"organisation",type:o,target:e,path:r}):i(new Error(`Organisation target "${e}" resolved to fjall/${o}/ but directory not found`))}if(o.startsWith("account-")){const r=o.slice(8);if(!f.test(r))return i(new Error(`Invalid account target "${e}": suffix must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens`));const s=c(a,"fjall",p.ACCOUNT),m=await l(s);return t.debug("resolveOperation","account-prefixed target",{suffix:r,orgPath:s,exists:m}),m?u({kind:"organisation",type:p.ACCOUNT,target:e,path:s}):i(new Error(`Organisation target "${e}" resolved to fjall/${p.ACCOUNT}/ but directory not found`))}if(!f.test(e))return t.debug("resolveOperation","target failed pattern validation",{target:e,pattern:f.source}),i(new Error(`Invalid target "${e}": must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens`));const n=c(a,"fjall",e),v=b(a,n);if(v.startsWith(".."))return i(new Error(`Invalid target "${e}": resolved path escapes working directory`));const O=await l(n);return t.debug("resolveOperation","app path check",{appPath:n,exists:O,relative:v}),O?(t.debug("resolveOperation","resolved as application",{appName:e,path:n}),u({kind:"application",appName:e,path:n})):(t.debug("resolveOperation","FAILED \u2014 no match",{target:e,workingDirectory:a,checkedPath:n}),i(new Error(`Target "${e}" is not a recognised organisation type and no directory found at fjall/${e}`)))}export{y as resolveOperation};
1
+ import{join as s,relative as g}from"path";import{readdir as b}from"fs/promises";import{success as h,failure as l,VALIDATION_PATTERNS as w}from"@fjall/generator";import{logger as a}from"@fjall/util/logger";import{ORGANISATION_TYPES as m}from"../types/operations.js";import{fileExists as p}from"@fjall/util/fsHelpers";import{INFRASTRUCTURE_FILENAME as N}from"../types/constants.js";const x=new Set(Object.values(m));function A(e){return x.has(e)}const E=w.NEW_APP_NAME;async function T(e,i){const u=s(e,"fjall"),c=await b(u,{withFileTypes:!0}).catch(n=>{a.debug("resolveOperation","existing-app readdir failed",{fjallDir:u,error:String(n)})});if(c===void 0)return;const f=i.toLowerCase(),r=[];for(const n of c){if(!n.isDirectory()||n.name.toLowerCase()!==f)continue;const o=s(u,n.name);g(e,o).startsWith("..")||!(await p(s(o,N))||await p(s(o,"cdk.json")))||r.push({appName:n.name,path:o})}if(r.length!==0)return r.length>1?"ambiguous":r[0]}async function R(e,i){a.debug("resolveOperation","called",{target:e,workingDirectory:i});const u=await p(i);a.debug("resolveOperation","workingDirectory exists",{exists:u});const c=s(i,"fjall"),f=await p(c);if(a.debug("resolveOperation","fjall/ dir check",{fjallDir:c,exists:f}),f&&a.isDebugEnabled())try{const t=await b(c);a.debug("resolveOperation","fjall/ contents",{entries:t})}catch(t){a.debug("resolveOperation","fjall/ readdir failed",{error:String(t)})}const r=e.toLowerCase();if(A(r)){const t=s(i,"fjall",r),d=await p(t);return a.debug("resolveOperation","org type match",{normalisedTarget:r,orgPath:t,exists:d}),d?h({kind:"organisation",type:r,target:e,path:t}):l(new Error(`Organisation target "${e}" resolved to fjall/${r}/ but directory not found`))}if(r.startsWith("account-")){const t=r.slice(8);if(!E.test(t))return l(new Error(`Invalid account target "${e}": suffix must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens`));const d=s(i,"fjall",m.ACCOUNT),O=await p(d);return a.debug("resolveOperation","account-prefixed target",{suffix:t,orgPath:d,exists:O}),O?h({kind:"organisation",type:m.ACCOUNT,target:e,path:d}):l(new Error(`Organisation target "${e}" resolved to fjall/${m.ACCOUNT}/ but directory not found`))}if(!E.test(e)){const t=await T(i,e);return t==="ambiguous"?l(new Error(`Ambiguous target "${e}": multiple fjall/ folders match case-insensitively \u2014 rename so exactly one matches`)):t!==void 0?(a.debug("resolveOperation","resolved existing non-standard app",{target:e,appName:t.appName,path:t.path}),h({kind:"application",appName:t.appName,path:t.path})):(a.debug("resolveOperation","target failed pattern validation",{target:e,pattern:E.source}),l(new Error(`Invalid target "${e}": must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens`)))}const n=s(i,"fjall",e),o=g(i,n);if(o.startsWith(".."))return l(new Error(`Invalid target "${e}": resolved path escapes working directory`));const v=await p(n);return a.debug("resolveOperation","app path check",{appPath:n,exists:v,relative:o}),v?(a.debug("resolveOperation","resolved as application",{appName:e,path:n}),h({kind:"application",appName:e,path:n})):(a.debug("resolveOperation","FAILED \u2014 no match",{target:e,workingDirectory:i,checkedPath:n}),l(new Error(`Target "${e}" is not a recognised organisation type and no directory found at fjall/${e}`)))}export{R as resolveOperation};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/deploy-core",
3
- "version": "2.18.2",
3
+ "version": "2.19.0",
4
4
  "description": "Shared deployment engine for Fjall — used by CLI and webapp worker",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -78,8 +78,8 @@
78
78
  "@aws-sdk/client-sqs": "^3.1067.0",
79
79
  "@aws-sdk/client-sso-admin": "^3.1038.0",
80
80
  "@aws-sdk/client-sts": "^3.1038.0",
81
- "@fjall/generator": "^2.18.2",
82
- "@fjall/util": "^2.18.2",
81
+ "@fjall/generator": "^2.19.0",
82
+ "@fjall/util": "^2.19.0",
83
83
  "@smithy/node-http-handler": "^4.6.1",
84
84
  "tsx": "^4.21.0",
85
85
  "zod": "^4.4.3"
@@ -88,5 +88,5 @@
88
88
  "@types/node": "^25.6.0",
89
89
  "vitest": "^4.1.5"
90
90
  },
91
- "gitHead": "df431968c2a4d24259a939da902592ea058b5ba4"
91
+ "gitHead": "f76888fbf22b7f4ac972fcd12f392c519bd612c2"
92
92
  }