@intentius/chant-lexicon-aws 0.19.0 → 0.20.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/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/package.d.ts.map +1 -1
- package/dist/generated/index.d.ts +150 -19
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/integrity.json +4 -4
- package/dist/manifest.json +1 -1
- package/dist/meta.json +3221 -253
- package/dist/types/index.d.ts +2636 -222
- package/package.json +2 -2
- package/src/codegen/docs.ts +20 -6
- package/src/codegen/package.ts +5 -1
- package/src/generated/index.d.ts +2636 -222
- package/src/generated/index.ts +152 -21
- package/src/generated/lexicon-aws.json +3221 -253
- package/src/plugin.ts +9 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-aws",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "AWS CloudFormation lexicon for chant — declarative IaC in TypeScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"typescript": "^5.9.3"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@intentius/chant": "^0.
|
|
83
|
+
"@intentius/chant": "^0.20.0",
|
|
84
84
|
"typescript": "^5.9.3"
|
|
85
85
|
}
|
|
86
86
|
}
|
package/src/codegen/docs.ts
CHANGED
|
@@ -102,7 +102,15 @@ export async function generateDocs(options?: { verbose?: boolean }): Promise<voi
|
|
|
102
102
|
overview,
|
|
103
103
|
outputFormat,
|
|
104
104
|
serviceFromType,
|
|
105
|
-
|
|
105
|
+
// "intrinsics" is no longer suppressed (chant #1067) — the reference
|
|
106
|
+
// table at that slug is now generated from the plugin's own
|
|
107
|
+
// `intrinsics()` registration (docsPipeline's generateIntrinsics, same
|
|
108
|
+
// mechanism azure/helm already use), so its "Folds?" column can never
|
|
109
|
+
// drift from the registration the way #1062's foldability matrix
|
|
110
|
+
// depends on. The hand-written usage guide with full worked examples
|
|
111
|
+
// moves to a separate "intrinsics-guide" page below — content
|
|
112
|
+
// unchanged, just no longer sharing a slug with generated data.
|
|
113
|
+
suppressPages: ["pseudo-parameters", "rules"],
|
|
106
114
|
examplesDir: join(pkgDir, "examples"),
|
|
107
115
|
extraPages: [
|
|
108
116
|
{
|
|
@@ -210,7 +218,7 @@ Runtime context values available in every template, accessed via the \`AWS\` nam
|
|
|
210
218
|
|
|
211
219
|
## Intrinsic functions
|
|
212
220
|
|
|
213
|
-
The lexicon provides 9 intrinsic functions (\`Sub\`, \`Ref\`, \`GetAtt\`, \`If\`, \`Join\`, \`Select\`, \`Split\`, \`Base64\`, \`GetAZs\`) that map directly to CloudFormation \`Fn::\` calls. See [Intrinsic Functions](../intrinsics/) for full usage examples.
|
|
221
|
+
The lexicon provides 9 intrinsic functions (\`Sub\`, \`Ref\`, \`GetAtt\`, \`If\`, \`Join\`, \`Select\`, \`Split\`, \`Base64\`, \`GetAZs\`) that map directly to CloudFormation \`Fn::\` calls. See [Intrinsic Functions](../intrinsics/) for the reference table or the [Intrinsics Guide](../intrinsics-guide/) for full usage examples.
|
|
214
222
|
|
|
215
223
|
## Dependencies
|
|
216
224
|
|
|
@@ -319,10 +327,14 @@ No other changes needed — all taggable resources in the project get these tags
|
|
|
319
327
|
Tag values support strings, \`Parameter\` references, and intrinsic functions (\`Sub\`, \`Ref\`, etc.).`,
|
|
320
328
|
},
|
|
321
329
|
{
|
|
322
|
-
slug: "intrinsics",
|
|
323
|
-
title: "
|
|
324
|
-
description: "CloudFormation intrinsic
|
|
325
|
-
content: `
|
|
330
|
+
slug: "intrinsics-guide",
|
|
331
|
+
title: "Intrinsics Guide",
|
|
332
|
+
description: "Worked examples for every CloudFormation intrinsic function and their chant syntax",
|
|
333
|
+
content: `See [Intrinsic Functions](../intrinsics/) for the generated reference table (name, description, output key, whether it's a tagged template, whether \`chant build --fold\` can fold it). This page is the worked-example companion — one \`Fn::\` intrinsic function per section, with real usage.
|
|
334
|
+
|
|
335
|
+
CloudFormation intrinsic functions are available as imports from the lexicon. They produce the corresponding \`Fn::\` calls in the serialized template.
|
|
336
|
+
|
|
337
|
+
Only \`Sub\` is a tagged template — the others below are plain function calls. That distinction matters for [\`chant build --fold\`](/chant/concepts/typescript-as-data/#folded-vs-run): a registered intrinsic tagged template is one of the shapes the static folder can reduce with no module execution. A plain function call is not, today — \`chant build --fold\` has no case for a bare call used as a value yet ([#1044](https://github.com/INTENTIUS/chant/issues/1044) tracks changing that, per intrinsic). Using \`Ref\`, \`GetAtt\`, \`If\`, \`Join\`, \`Select\`, \`Split\`, \`Base64\`, or \`GetAZs\` anywhere in a resource's props forces that file back to the normal run path under \`--fold\` for now.
|
|
326
338
|
|
|
327
339
|
Here is a complete example using all intrinsic functions:
|
|
328
340
|
|
|
@@ -400,6 +412,8 @@ Instantiate and export:
|
|
|
400
412
|
|
|
401
413
|
During build, composites expand to flat CloudFormation resources: \`healthApiRole\`, \`healthApiFunc\`, \`healthApiPermission\`.
|
|
402
414
|
|
|
415
|
+
A top-level composite call assigned directly to an export — like \`healthApi\` above — is one of the patterns [\`chant build --fold\`](/chant/concepts/typescript-as-data/#folded-vs-run) can reduce with no module execution (chant #1023). Defining a composite (the \`Composite(...)\` call inside \`lambda-api.ts\` itself) doesn't fold — its factory callback is a function, which is outside the fold subset — and neither does a composite call embedded as a nested value inside another resource's own properties; only a composite call that is itself a file's top-level export (or destructured/re-exported from one) is eligible.
|
|
416
|
+
|
|
403
417
|
## Built-in composites
|
|
404
418
|
|
|
405
419
|
The AWS lexicon ships ready-to-use composites for common patterns. Import them from \`@intentius/chant-lexicon-aws\`:
|
package/src/codegen/package.ts
CHANGED
|
@@ -42,12 +42,16 @@ export async function packageLexicon(opts: PackageOptions = {}): Promise<Package
|
|
|
42
42
|
|
|
43
43
|
buildManifest: (_genResult) => {
|
|
44
44
|
// Lazy-import to avoid circular dependency
|
|
45
|
+
// Trust the plugin's own `isTag` registration (chant #1067) — this
|
|
46
|
+
// used to recompute `isTag: i.name === "Sub"` independently of
|
|
47
|
+
// ../plugin.ts, a second source of truth that could silently drift
|
|
48
|
+
// from the real registration (the exact shape of bug #1039 found).
|
|
45
49
|
const intrinsics: IntrinsicDef[] = (awsPlugin.intrinsics?.() ?? []).map(
|
|
46
50
|
(i: IntrinsicDef) => ({
|
|
47
51
|
name: i.name,
|
|
48
52
|
description: i.description,
|
|
49
53
|
outputKey: intrinsicOutputKey(i.name),
|
|
50
|
-
isTag: i.
|
|
54
|
+
isTag: i.isTag,
|
|
51
55
|
}),
|
|
52
56
|
);
|
|
53
57
|
|