@fjall/deploy-core 2.1.1 → 2.3.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
- 116 files minified at 2026-05-24T01:08:13.045Z
1
+ 116 files minified at 2026-05-25T21:30:56.032Z
@@ -1 +1 @@
1
- import{success as k,failure as w}from"@fjall/generator";import{logger as y}from"@fjall/util/logger";import{getApplicationDestroyOrder as b,getApplicationStepName as h,getApplicationStepId as S}from"../types/operations.js";import{stubCallerIdentity as N}from"../types/deployment/index.js";import{deriveResourcesFromManifestStacks as x}from"../types/patternDetection.js";import{CdkContextBuilder as D}from"../services/supporting/CdkContextBuilder.js";import{buildParamsContext as R}from"./contextHelpers.js";import{deleteStateFile as I,readStateFile as O}from"../types/FjallState.js";async function H(n,c,r){const{callbacks:o}=n,P=Date.now(),f=c.frameworkRegistry.resolve({appPath:r.path})?.detection.pattern??null;let p;try{const e=await O(r.path);if(e!==null){const t=Object.keys(e.templateHashes);t.length>0&&(p=x(t))}}catch(e){y.debug("applicationDestroy","Could not read state file for resource detection",{error:e instanceof Error?e.message:String(e)}),o.onLog?.("Could not read state file for resource detection \u2014 falling back to pattern detection","warn")}const C=D.buildDeploymentContext({deployType:"application",target:r.appName,path:r.path,region:c.awsProvider.getRegion(),callerIdentity:N(c.awsProvider.getAccountId()),...R({orgConfig:n.orgConfig,identity:n.identity})},{verbose:n.options?.verbose},n.orgConfig),d=b({pattern:f,resources:p}),s=d.length;o.onLog?.(`Destroying ${r.appName} (${s} stacks, ${f??"standard"} pattern)`,"info");const g=[],u=[],m=await c.stackService.destroyAllStacks(C,{onOutput:e=>{o.onOutput?.(e)},onResourceProgress:(e,t)=>{o.onResourceProgress?.(e),t&&o.onParallelStackResourceProgress?.(t,e)},onStackStart:(e,t)=>{const a=S(e,"destroy"),l=h(e,"destroy"),i=d.indexOf(e);o.onStepStart?.(a,l,i,s)},onStackComplete:async(e,t)=>{const a=S(e,"destroy"),l=h(e,"destroy"),i=d.indexOf(e);t.success?t.data?.skipped?(u.push(t.data.stackName||e),o.onStepComplete?.(a,l,"skipped",i,s)):(g.push(t.data?.stackName||e),o.onStepComplete?.(a,l,"completed",i,s)):(o.onStepComplete?.(a,l,"error",i,s),o.onError?.(t.error))},onParallelPhaseStart:(e,t)=>{o.onLog?.(`Parallel phase: ${t}`,"info"),o.onParallelPhaseStart?.(e,t)},onParallelPhaseComplete:e=>{const t=e.filter(a=>!a.success);t.length>0&&o.onLog?.(`Parallel phase completed with ${t.length} failure(s)`,"warn"),o.onParallelPhaseComplete?.(e)}},p);if(!m.success)return o.onError?.(m.error),w(m.error);try{await I(r.path)}catch(e){y.debug("applicationDestroy","Failed to delete state file (non-critical)",{error:e instanceof Error?e.message:String(e)}),o.onLog?.("Failed to delete state file (non-critical)","warn")}return k({target:r.appName,deploymentType:"application",stacksDestroyed:g,skippedStacks:u,durationMs:Date.now()-P})}export{H as destroyApplication};
1
+ import{success as w,failure as b}from"@fjall/generator";import{getErrorMessage as y}from"@fjall/util";import{logger as h}from"@fjall/util/logger";import{getApplicationDestroyOrder as N,getApplicationStepName as S,getApplicationStepId as P}from"../types/operations.js";import{stubCallerIdentity as x}from"../types/deployment/index.js";import{deriveResourcesFromManifestStacks as D}from"../types/patternDetection.js";import{CdkContextBuilder as R}from"../services/supporting/CdkContextBuilder.js";import{buildParamsContext as I}from"./contextHelpers.js";import{deleteStateFile as O,readStateFile as A}from"../types/FjallState.js";async function q(s,c,r){const{callbacks:o}=s,C=Date.now(),f=c.frameworkRegistry.resolve({appPath:r.path})?.detection.pattern??null;let p;try{const e=await A(r.path);if(e!==null){const t=Object.keys(e.templateHashes);t.length>0&&(p=D(t))}}catch(e){h.debug("applicationDestroy","Could not read state file for resource detection",{error:y(e)}),o.onLog?.("Could not read state file for resource detection \u2014 falling back to pattern detection","warn")}const k=R.buildDeploymentContext({deployType:"application",target:r.appName,path:r.path,region:c.awsProvider.getRegion(),callerIdentity:x(c.awsProvider.getAccountId()),...I({orgConfig:s.orgConfig,identity:s.identity})},{verbose:s.options?.verbose},s.orgConfig),d=N({pattern:f,resources:p}),n=d.length;o.onLog?.(`Destroying ${r.appName} (${n} stacks, ${f??"standard"} pattern)`,"info");const g=[],u=[],m=await c.stackService.destroyAllStacks(k,{onOutput:e=>{o.onOutput?.(e)},onResourceProgress:(e,t)=>{o.onResourceProgress?.(e),t&&o.onParallelStackResourceProgress?.(t,e)},onStackStart:(e,t)=>{const a=P(e,"destroy"),l=S(e,"destroy"),i=d.indexOf(e);o.onStepStart?.(a,l,i,n)},onStackComplete:async(e,t)=>{const a=P(e,"destroy"),l=S(e,"destroy"),i=d.indexOf(e);t.success?t.data?.skipped?(u.push(t.data.stackName||e),o.onStepComplete?.(a,l,"skipped",i,n)):(g.push(t.data?.stackName||e),o.onStepComplete?.(a,l,"completed",i,n)):(o.onStepComplete?.(a,l,"error",i,n),o.onError?.(t.error))},onParallelPhaseStart:(e,t)=>{o.onLog?.(`Parallel phase: ${t}`,"info"),o.onParallelPhaseStart?.(e,t)},onParallelPhaseComplete:e=>{const t=e.filter(a=>!a.success);t.length>0&&o.onLog?.(`Parallel phase completed with ${t.length} failure(s)`,"warn"),o.onParallelPhaseComplete?.(e)}},p);if(!m.success)return o.onError?.(m.error),b(m.error);try{await O(r.path)}catch(e){h.debug("applicationDestroy","Failed to delete state file (non-critical)",{error:y(e)}),o.onLog?.("Failed to delete state file (non-critical)","warn")}return w({target:r.appName,deploymentType:"application",stacksDestroyed:g,skippedStacks:u,durationMs:Date.now()-C})}export{q as destroyApplication};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/deploy-core",
3
- "version": "2.1.1",
3
+ "version": "2.3.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",
@@ -73,7 +73,7 @@
73
73
  "@aws-sdk/client-s3": "^3.1038.0",
74
74
  "@aws-sdk/client-sso-admin": "^3.1038.0",
75
75
  "@aws-sdk/client-sts": "^3.1038.0",
76
- "@fjall/generator": "^2.1.1",
76
+ "@fjall/generator": "^2.3.0",
77
77
  "@fjall/util": "^0.100.0",
78
78
  "@smithy/node-http-handler": "^4.6.1",
79
79
  "zod": "^4.4.3"
@@ -82,5 +82,5 @@
82
82
  "@types/node": "^25.6.0",
83
83
  "vitest": "^4.1.5"
84
84
  },
85
- "gitHead": "971d9ed50c6a21d24e67c9c83b9c471a632bf284"
85
+ "gitHead": "ddb5678e345fe2e480ab2573c2bc0f52c2b2eb16"
86
86
  }