@intentius/chant-lexicon-aws 0.0.5 → 0.0.8
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/README.md +9 -425
- package/dist/integrity.json +7 -7
- package/dist/manifest.json +1 -1
- package/dist/meta.json +3767 -3706
- package/dist/rules/ext001.ts +2 -4
- package/dist/rules/s3-encryption.ts +2 -3
- package/dist/skills/chant-aws.md +72 -0
- package/dist/types/index.d.ts +57174 -57070
- package/package.json +2 -2
- package/src/codegen/__snapshots__/snapshot.test.ts.snap +18 -18
- package/src/codegen/docs.ts +104 -349
- package/src/codegen/generate.ts +2 -14
- package/src/codegen/package.ts +2 -0
- package/src/codegen/sam.ts +11 -11
- package/src/codegen/typecheck.test.ts +1 -1
- package/src/generated/index.d.ts +57174 -57070
- package/src/generated/index.ts +1356 -1351
- package/src/generated/lexicon-aws.json +3767 -3706
- package/src/import/generator.test.ts +5 -5
- package/src/import/generator.ts +4 -4
- package/src/import/roundtrip-fixtures.test.ts +8 -28
- package/src/import/roundtrip.test.ts +5 -5
- package/src/integration.test.ts +21 -21
- package/src/lint/post-synth/ext001.ts +2 -4
- package/src/lint/rules/rules.test.ts +8 -8
- package/src/lint/rules/s3-encryption.ts +2 -3
- package/src/lsp/completions.ts +2 -0
- package/src/lsp/hover.ts +2 -0
- package/src/nested-stack.ts +1 -1
- package/src/plugin.test.ts +13 -15
- package/src/plugin.ts +126 -149
- package/src/serializer.test.ts +42 -43
- package/src/serializer.ts +7 -16
- package/src/spec/parse.ts +2 -2
- package/dist/skills/aws-cloudformation.md +0 -41
- package/src/codegen/rollback.test.ts +0 -80
- package/src/codegen/rollback.ts +0 -20
package/src/codegen/generate.ts
CHANGED
|
@@ -152,17 +152,6 @@ export function writeGeneratedFiles(result: GenerateResult, baseDir: string): vo
|
|
|
152
152
|
"",
|
|
153
153
|
].join("\n"),
|
|
154
154
|
},
|
|
155
|
-
snapshot: (generatedDir) => {
|
|
156
|
-
const { snapshotArtifacts, saveSnapshot } = require("./rollback");
|
|
157
|
-
const lexiconPath = join(generatedDir, "lexicon-aws.json");
|
|
158
|
-
if (existsSync(lexiconPath)) {
|
|
159
|
-
const snapshot = snapshotArtifacts(generatedDir);
|
|
160
|
-
if (Object.keys(snapshot.files).length > 0) {
|
|
161
|
-
const snapshotsDir = join(baseDir, ".snapshots");
|
|
162
|
-
saveSnapshot(snapshot, snapshotsDir);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
155
|
});
|
|
167
156
|
}
|
|
168
157
|
|
|
@@ -184,8 +173,7 @@ function generateRuntimeIndex(
|
|
|
184
173
|
// Build attrs map
|
|
185
174
|
const attrs: Record<string, string> = {};
|
|
186
175
|
for (const a of r.resource.attributes) {
|
|
187
|
-
|
|
188
|
-
attrs[camelName] = a.name;
|
|
176
|
+
attrs[a.name] = a.name;
|
|
189
177
|
}
|
|
190
178
|
|
|
191
179
|
resourceEntries.push({ tsName, resourceType: cfnType, attrs });
|
|
@@ -200,7 +188,7 @@ function generateRuntimeIndex(
|
|
|
200
188
|
for (const pt of r.propertyTypes) {
|
|
201
189
|
const defName = extractDefName(pt.name, shortName);
|
|
202
190
|
const ptName = propertyTypeName(tsName, defName);
|
|
203
|
-
const ptCfnType = `${cfnType}.${pt.
|
|
191
|
+
const ptCfnType = `${cfnType}.${pt.specType}`;
|
|
204
192
|
propertyEntries.push({ tsName: ptName, resourceType: ptCfnType });
|
|
205
193
|
|
|
206
194
|
if (ptAliases) {
|
package/src/codegen/package.ts
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* with AWS-specific manifest building and skill collection.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { createRequire } from "module";
|
|
6
7
|
import { readFileSync } from "fs";
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
7
9
|
import { join, dirname } from "path";
|
|
8
10
|
import { fileURLToPath } from "url";
|
|
9
11
|
import type { IntrinsicDef } from "@intentius/chant/lexicon";
|
package/src/codegen/sam.ts
CHANGED
|
@@ -62,14 +62,14 @@ function samFunction(): SchemaParseResult {
|
|
|
62
62
|
propertyTypes: [
|
|
63
63
|
{
|
|
64
64
|
name: "Function_Environment",
|
|
65
|
-
|
|
65
|
+
specType: "Environment",
|
|
66
66
|
properties: [
|
|
67
67
|
{ name: "Variables", tsType: "Record<string, any>", required: false, constraints: {} },
|
|
68
68
|
],
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: "Function_VpcConfig",
|
|
72
|
-
|
|
72
|
+
specType: "VpcConfig",
|
|
73
73
|
properties: [
|
|
74
74
|
{ name: "SecurityGroupIds", tsType: "string[]", required: true, constraints: {} },
|
|
75
75
|
{ name: "SubnetIds", tsType: "string[]", required: true, constraints: {} },
|
|
@@ -77,7 +77,7 @@ function samFunction(): SchemaParseResult {
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
name: "Function_DeadLetterQueue",
|
|
80
|
-
|
|
80
|
+
specType: "DeadLetterQueue",
|
|
81
81
|
properties: [
|
|
82
82
|
{ name: "Type", tsType: "string", required: true, constraints: {} },
|
|
83
83
|
{ name: "TargetArn", tsType: "string", required: true, constraints: {} },
|
|
@@ -85,7 +85,7 @@ function samFunction(): SchemaParseResult {
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
name: "Function_DeploymentPreference",
|
|
88
|
-
|
|
88
|
+
specType: "DeploymentPreference",
|
|
89
89
|
properties: [
|
|
90
90
|
{ name: "Type", tsType: "string", required: true, constraints: {} },
|
|
91
91
|
{ name: "Enabled", tsType: "boolean", required: false, constraints: {} },
|
|
@@ -95,7 +95,7 @@ function samFunction(): SchemaParseResult {
|
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
name: "Function_EventSource",
|
|
98
|
-
|
|
98
|
+
specType: "EventSource",
|
|
99
99
|
properties: [
|
|
100
100
|
{ name: "Type", tsType: "string", required: true, constraints: {} },
|
|
101
101
|
{ name: "Properties", tsType: "any", required: false, constraints: {} },
|
|
@@ -103,7 +103,7 @@ function samFunction(): SchemaParseResult {
|
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
name: "Function_S3Location",
|
|
106
|
-
|
|
106
|
+
specType: "S3Location",
|
|
107
107
|
properties: [
|
|
108
108
|
{ name: "Bucket", tsType: "string", required: true, constraints: {} },
|
|
109
109
|
{ name: "Key", tsType: "string", required: true, constraints: {} },
|
|
@@ -148,7 +148,7 @@ function samApi(): SchemaParseResult {
|
|
|
148
148
|
propertyTypes: [
|
|
149
149
|
{
|
|
150
150
|
name: "Api_Auth",
|
|
151
|
-
|
|
151
|
+
specType: "Auth",
|
|
152
152
|
properties: [
|
|
153
153
|
{ name: "DefaultAuthorizer", tsType: "string", required: false, constraints: {} },
|
|
154
154
|
{ name: "Authorizers", tsType: "Record<string, any>", required: false, constraints: {} },
|
|
@@ -158,7 +158,7 @@ function samApi(): SchemaParseResult {
|
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
name: "Api_CorsConfiguration",
|
|
161
|
-
|
|
161
|
+
specType: "CorsConfiguration",
|
|
162
162
|
properties: [
|
|
163
163
|
{ name: "AllowOrigin", tsType: "string", required: true, constraints: {} },
|
|
164
164
|
{ name: "AllowHeaders", tsType: "string", required: false, constraints: {} },
|
|
@@ -199,7 +199,7 @@ function samHttpApi(): SchemaParseResult {
|
|
|
199
199
|
propertyTypes: [
|
|
200
200
|
{
|
|
201
201
|
name: "HttpApi_CorsConfiguration",
|
|
202
|
-
|
|
202
|
+
specType: "CorsConfiguration",
|
|
203
203
|
properties: [
|
|
204
204
|
{ name: "AllowOrigins", tsType: "string[]", required: false, constraints: {} },
|
|
205
205
|
{ name: "AllowHeaders", tsType: "string[]", required: false, constraints: {} },
|
|
@@ -233,7 +233,7 @@ function samSimpleTable(): SchemaParseResult {
|
|
|
233
233
|
propertyTypes: [
|
|
234
234
|
{
|
|
235
235
|
name: "SimpleTable_PrimaryKey",
|
|
236
|
-
|
|
236
|
+
specType: "PrimaryKey",
|
|
237
237
|
properties: [
|
|
238
238
|
{ name: "Name", tsType: "string", required: true, constraints: {} },
|
|
239
239
|
{ name: "Type", tsType: "string", required: true, constraints: {} },
|
|
@@ -299,7 +299,7 @@ function samStateMachine(): SchemaParseResult {
|
|
|
299
299
|
propertyTypes: [
|
|
300
300
|
{
|
|
301
301
|
name: "StateMachine_S3Location",
|
|
302
|
-
|
|
302
|
+
specType: "S3Location",
|
|
303
303
|
properties: [
|
|
304
304
|
{ name: "Bucket", tsType: "string", required: true, constraints: {} },
|
|
305
305
|
{ name: "Key", tsType: "string", required: true, constraints: {} },
|