@fjall/generator 27.1.0 → 28.0.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/.build-source-hash
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"package.json",
|
|
10
10
|
"tsconfig.json"
|
|
11
11
|
],
|
|
12
|
-
"hash": "
|
|
12
|
+
"hash": "ca2cf76e220074ba819975b14103a651c26b0917f8c1a35be6365636d8244d68",
|
|
13
13
|
"files": {
|
|
14
14
|
"src/ast/astTestHelpers.ts": "026cac849eb88bdb",
|
|
15
15
|
"src/ast/domain/astDomainParser.ts": "12107a9864c6670c",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"src/generation/database.ts": "c28a0dbabf91b6a3",
|
|
130
130
|
"src/generation/generatePatternCode.ts": "342a227d461804c0",
|
|
131
131
|
"src/generation/index.ts": "915500e352c2bab6",
|
|
132
|
-
"src/generation/infrastructure.ts": "
|
|
132
|
+
"src/generation/infrastructure.ts": "42d85bb5049192e9",
|
|
133
133
|
"src/generation/messagingConnections.ts": "09e70af97e055712",
|
|
134
134
|
"src/generation/statementInvocation.ts": "52ecd948f60e00cb",
|
|
135
135
|
"src/generation/storage.ts": "8b66549277a97279",
|
|
@@ -181,11 +181,11 @@
|
|
|
181
181
|
"src/validation/patterns.ts": "f9629eafdad7ac3e",
|
|
182
182
|
"src/validation/validationMessages.ts": "b03413b3953c3e79",
|
|
183
183
|
"src/validation/validationPatterns.ts": "865f3d688975b7c8",
|
|
184
|
-
"src/version.ts": "
|
|
184
|
+
"src/version.ts": "dabb0dbdeabcea01",
|
|
185
185
|
"../scripts/minify-dist.mjs": "6b2e4b0df8aec601",
|
|
186
|
-
"package.json": "
|
|
186
|
+
"package.json": "bb36a0471acb4e68",
|
|
187
187
|
"tsconfig.json": "1929cf3f99fe9b1e"
|
|
188
188
|
},
|
|
189
|
-
"outputHash": "
|
|
189
|
+
"outputHash": "42447a526cfc3602dfa10af87dd47c723733a4050a9615ea90e5843cfd5e4e22",
|
|
190
190
|
"outputFileCount": 343
|
|
191
191
|
}
|
package/dist/.minified
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
171 files minified at 2026-08-
|
|
1
|
+
171 files minified at 2026-08-31T22:01:29.265Z
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import type { ApplicationResourcePlan } from "../schemas/resourceSchemas.js";
|
|
8
8
|
export { OPENNEXT_DEFAULTS, generatePatternCodeWithComments, } from "./generatePatternCode.js";
|
|
9
9
|
export declare const COST_ALLOCATION_TAG: "fjall:costAllocation:owner";
|
|
10
|
-
export declare const DEFAULT_COST_ALLOCATION_OWNER: "engineering";
|
|
11
10
|
/**
|
|
12
11
|
* Generate network infrastructure code for additional networks
|
|
13
12
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var y=Object.defineProperty;var r=(e,t)=>y(e,"name",{value:t,configurable:!0});import{toVariableName as
|
|
1
|
+
var y=Object.defineProperty;var r=(e,t)=>y(e,"name",{value:t,configurable:!0});import{DEFAULT_COST_ALLOCATION_OWNER as N}from"@fjall/util/aws";import{toVariableName as T,formatValue as f,resolveResourceVariable as p,emitExtraProperties as b}from"./common.js";import{COMPUTE_TYPE as g}from"../schemas/constants.js";import{scalingTypeBinding as $}from"../projection/compute.js";import{projectLambdaProps as A}from"./compute/lambda.js";import{collectProjectedPropImports as O}from"./structuredSource.js";import{CDN_INVOCATION as s,COMPUTE_INVOCATION as C,DATABASE_INVOCATION as d,MESSAGING_INVOCATION as I,NETWORK_INVOCATION as u,PATTERN_INVOCATION as w,STORAGE_INVOCATION as P}from"./statementInvocation.js";import{OPENNEXT_DEFAULTS as Y,generatePatternCodeWithComments as K}from"./generatePatternCode.js";const h="fjall:costAllocation:owner";function k(e){return typeof e=="object"&&e!==null&&Object.keys(e).length===0}r(k,"isEmptyObject");function l(e){const t={...e};return k(t.flowLogs)&&delete t.flowLogs,t}r(l,"cleanNetworkConfig");function D(e){if(!e.additionalNetworks||e.additionalNetworks.length===0)return"";let t="";for(const n of e.additionalNetworks){const i=T(n.name),o={};n.maxAzs!==void 0&&(o.maxAzs=n.maxAzs),n.natGateways!==void 0&&(o.natGateways=n.natGateways),n.flowLogs!==void 0&&(o.flowLogs=n.flowLogs),n.vpcEndpoints!==void 0&&(o.vpcEndpoints=n.vpcEndpoints);const c=l(o);t+=`const ${i} = app.${u.appMethod}(
|
|
2
2
|
${u.factory}.build("${n.name}", ${f(c," ")})
|
|
3
3
|
);
|
|
4
4
|
|
|
5
|
-
`}return t}r(
|
|
5
|
+
`}return t}r(D,"generateNetworkCode");function M(e){const t={};return e.tags&&Object.keys(e.tags).length>0&&Object.assign(t,e.tags),t[h]||(t[h]=e.owner||N),`app.addTags({
|
|
6
6
|
${Object.entries(t).map(([i,o])=>` "${i}": "${o}"`).join(`,
|
|
7
7
|
`)}
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
`}r(
|
|
10
|
+
`}r(M,"generateTags");function H(e){let t=`
|
|
11
11
|
const appName = "${e.appName}";
|
|
12
12
|
`;const n=e.backup&&typeof e.backup=="object"?e.backup:void 0,i=e.tunnel&&typeof e.tunnel=="object"?e.tunnel:void 0,o=i?i.instanceType?`tunnel: { instanceType: "${i.instanceType}" }`:"tunnel: true":void 0;if(e.vpcId)t+=`const app = App.getApp(appName, {
|
|
13
13
|
network: { useExisting: "${e.vpcId}" }`,n&&(t+=`,
|
|
@@ -21,11 +21,11 @@ const appName = "${e.appName}";
|
|
|
21
21
|
});
|
|
22
22
|
`}else t+="const app = App.getApp(appName, { network: false",n&&(t+=`, backup: { tier: "${n.tier}" }`),o&&(t+=`, ${o}`),t+=` });
|
|
23
23
|
`;return t+=`
|
|
24
|
-
`,t}r(
|
|
24
|
+
`,t}r(H,"generateAppInit");function j(e){const t=[],n=r(i=>{for(const o of i)t.includes(o)||t.push(o)},"add");for(const i of e.compute)if(i.type===g.LAMBDA&&n(O(A(i))),i.type===g.ECS)for(const o of i.services??[])typeof o.scaling=="object"&&o.scaling.scalingType&&n($(o.scaling.scalingType)?.imports??[]);return t}r(j,"collectComputeImports");function B(e){const t=[];if(e.patternConfig)t.push(w.factory);else{e.database.length>0&&t.push(d.factory),e.s3.length>0&&t.push(P.factory),e.compute.length>0&&t.push(C.factory),(e.compute.length>0||e.database.length>0||e.sqs!==void 0&&e.sqs.length>0)&&t.push("getConfig"),e.dynamodb&&e.dynamodb.length>0&&e.database.length===0&&t.push(d.factory),e.clickhouse&&e.clickhouse.length>0&&e.database.length===0&&!(e.dynamodb&&e.dynamodb.length>0)&&t.push(d.factory),e.sqs&&e.sqs.length>0&&t.push(I.factory),e.cdn&&t.push(s.factory);for(const o of j(e))t.includes(o)||t.push(o)}if(e.additionalNetworks&&e.additionalNetworks.length>0&&t.push(u.factory),e.additionalManagedImports){for(const o of e.additionalManagedImports)if(o.moduleSpecifier==="@fjall/components-infrastructure"||o.moduleSpecifier==="@fjall/infrastructure")for(const c of o.namedImports)t.includes(c)||t.push(c)}let i=`#!/usr/bin/env node
|
|
25
25
|
|
|
26
26
|
import { App${t.length>0?`, ${t.join(", ")}`:""} } from "@fjall/components-infrastructure";
|
|
27
27
|
`;if(e.additionalManagedImports)for(const o of e.additionalManagedImports){if(o.moduleSpecifier==="@fjall/components-infrastructure"||o.moduleSpecifier==="@fjall/infrastructure")continue;const c=o.namedImports.length>0?`{ ${o.namedImports.join(", ")} }`:"",m=[o.defaultImport??"",c].filter(Boolean).join(", ");m&&(i+=`import ${m} from "${o.moduleSpecifier}";
|
|
28
|
-
`)}return i}r(
|
|
28
|
+
`)}return i}r(B,"generateImports");function E(e){if(!e.cdn)return!1;const t=e.compute.find(o=>o.name===e.cdn?.defaultOriginRef);if(t===void 0||t.type!=="ecs")return!1;const n=t.cluster;return n?.domain!==void 0?!1:!(n?.extraProperties??[]).some(o=>o.key==="domainConfig")}r(E,"cdnDefaultOriginNeedsAlbLane");function q(e){if(!e.cdn)return"";const t=p(e,e.cdn.defaultOriginRef);let n=E(e)?`
|
|
29
29
|
app.${s.appMethod}(
|
|
30
30
|
${s.factory}.build("${e.cdn.name}", {
|
|
31
31
|
// Plain-HTTP origin fetch: the compute has no domain, so no TLS-valid
|
|
@@ -51,7 +51,7 @@ app.${s.appMethod}(
|
|
|
51
51
|
certificateArn: "${e.cdn.certificateArn}"`),e.cdn.originHostname&&(n+=`,
|
|
52
52
|
originHostname: "${e.cdn.originHostname}"`),e.cdn.accessGate!==void 0&&(e.cdn.accessGate===!1?n+=`,
|
|
53
53
|
accessGate: false`:n+=`,
|
|
54
|
-
accessGate: ${f(e.cdn.accessGate," ")}`),n+=
|
|
54
|
+
accessGate: ${f(e.cdn.accessGate," ")}`),n+=b(e.cdn.extraProperties),n+=`
|
|
55
55
|
})
|
|
56
56
|
);
|
|
57
|
-
`,n}r(
|
|
57
|
+
`,n}r(q,"generateCDNCode");function U(e){const t=new Set;if(e.cdn&&(e.cdn.defaultOriginRef&&t.add(e.cdn.defaultOriginRef),e.cdn.behaviours))for(const n of e.cdn.behaviours)t.add(n.originRef);return t}r(U,"collectCdnReferencedResources");function z(e){return e.patternConfig!==void 0}r(z,"usesPatternApproach");export{h as COST_ALLOCATION_TAG,Y as OPENNEXT_DEFAULTS,E as cdnDefaultOriginNeedsAlbLane,U as collectCdnReferencedResources,H as generateAppInit,q as generateCDNCode,B as generateImports,D as generateNetworkCode,K as generatePatternCodeWithComments,M as generateTags,z as usesPatternApproach};
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GENERATOR_VERSION = "
|
|
1
|
+
export declare const GENERATOR_VERSION = "28.0.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="
|
|
1
|
+
const E="28.0.0";export{E as GENERATOR_VERSION};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/generator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "28.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/fjall-tech/fjall.git",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"license": "SEE LICENSE IN LICENSE",
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@babel/parser": "^7.29.8",
|
|
61
|
-
"@fjall/util": "^
|
|
61
|
+
"@fjall/util": "^28.0.0",
|
|
62
62
|
"ast-types": "^0.16.1",
|
|
63
63
|
"recast": "^0.23.12",
|
|
64
64
|
"ts-morph": "^28.0.0",
|