@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.
@@ -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
- const camelName = a.name.charAt(0).toLowerCase() + a.name.slice(1);
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.cfnType}`;
191
+ const ptCfnType = `${cfnType}.${pt.specType}`;
204
192
  propertyEntries.push({ tsName: ptName, resourceType: ptCfnType });
205
193
 
206
194
  if (ptAliases) {
@@ -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";
@@ -62,14 +62,14 @@ function samFunction(): SchemaParseResult {
62
62
  propertyTypes: [
63
63
  {
64
64
  name: "Function_Environment",
65
- cfnType: "Environment",
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
- cfnType: "VpcConfig",
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
- cfnType: "DeadLetterQueue",
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
- cfnType: "DeploymentPreference",
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
- cfnType: "EventSource",
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
- cfnType: "S3Location",
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
- cfnType: "Auth",
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
- cfnType: "CorsConfiguration",
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
- cfnType: "CorsConfiguration",
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
- cfnType: "PrimaryKey",
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
- cfnType: "S3Location",
302
+ specType: "S3Location",
303
303
  properties: [
304
304
  { name: "Bucket", tsType: "string", required: true, constraints: {} },
305
305
  { name: "Key", tsType: "string", required: true, constraints: {} },
@@ -6,7 +6,7 @@ describe("typecheckDTS", () => {
6
6
  const content = `
7
7
  export declare class Bucket {
8
8
  readonly type: string;
9
- readonly bucketName?: string;
9
+ readonly BucketName?: string;
10
10
  }
11
11
  `;
12
12
  const result = await typecheckDTS(content);