@rexeus/typeweaver-aws-cdk 0.3.2 → 0.4.1
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/index.cjs +21 -53
- package/dist/index.js +9 -13
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/package.json +6 -5
package/dist/index.cjs
CHANGED
|
@@ -1,56 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
3
|
+
var path = require('node:path');
|
|
4
|
+
var node_url = require('node:url');
|
|
5
|
+
var typeweaverGen = require('@rexeus/typeweaver-gen');
|
|
6
|
+
var Case = require('case');
|
|
36
7
|
|
|
37
|
-
|
|
38
|
-
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
39
|
-
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
40
9
|
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
var import_node_url2 = require("node:url");
|
|
44
|
-
var import_typeweaver_gen = require("@rexeus/typeweaver-gen");
|
|
10
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
11
|
+
var Case__default = /*#__PURE__*/_interopDefault(Case);
|
|
45
12
|
|
|
46
|
-
//
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var moduleDir = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
13
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js
|
|
14
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
15
|
+
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
16
|
+
var moduleDir = path__default.default.dirname(node_url.fileURLToPath(importMetaUrl));
|
|
51
17
|
var HttpApiRouterGenerator = class {
|
|
52
18
|
static generate(context) {
|
|
53
|
-
const templateFile =
|
|
19
|
+
const templateFile = path__default.default.join(moduleDir, "templates", "HttpApiRouter.ejs");
|
|
54
20
|
for (const [entityName, entityResource] of Object.entries(
|
|
55
21
|
context.resources.entityResources
|
|
56
22
|
)) {
|
|
@@ -64,9 +30,9 @@ var HttpApiRouterGenerator = class {
|
|
|
64
30
|
}
|
|
65
31
|
static writeHttpApiRoutes(entityName, templateFile, operationResources, context) {
|
|
66
32
|
const routes = {};
|
|
67
|
-
const pascalCaseEntityName =
|
|
33
|
+
const pascalCaseEntityName = Case__default.default.pascal(entityName);
|
|
68
34
|
const outputDir = operationResources[0].outputDir;
|
|
69
|
-
const outputFile =
|
|
35
|
+
const outputFile = path__default.default.join(
|
|
70
36
|
outputDir,
|
|
71
37
|
`${pascalCaseEntityName}HttpApiRoutes.ts`
|
|
72
38
|
);
|
|
@@ -83,7 +49,7 @@ var HttpApiRouterGenerator = class {
|
|
|
83
49
|
routes,
|
|
84
50
|
coreDir: context.coreDir
|
|
85
51
|
});
|
|
86
|
-
const relativePath =
|
|
52
|
+
const relativePath = path__default.default.relative(context.outputDir, outputFile);
|
|
87
53
|
context.writeFile(relativePath, content);
|
|
88
54
|
}
|
|
89
55
|
static createRoutePath(path3) {
|
|
@@ -98,12 +64,14 @@ var HttpApiRouterGenerator = class {
|
|
|
98
64
|
};
|
|
99
65
|
|
|
100
66
|
// src/index.ts
|
|
101
|
-
var moduleDir2 =
|
|
102
|
-
var AwsCdkPlugin = class extends
|
|
67
|
+
var moduleDir2 = path__default.default.dirname(node_url.fileURLToPath(importMetaUrl));
|
|
68
|
+
var AwsCdkPlugin = class extends typeweaverGen.BasePlugin {
|
|
103
69
|
name = "aws-cdk";
|
|
104
70
|
generate(context) {
|
|
105
|
-
const libDir =
|
|
71
|
+
const libDir = path__default.default.join(moduleDir2, "lib");
|
|
106
72
|
this.copyLibFiles(context, libDir, "aws-cdk");
|
|
107
73
|
HttpApiRouterGenerator.generate(context);
|
|
108
74
|
}
|
|
109
75
|
};
|
|
76
|
+
|
|
77
|
+
module.exports = AwsCdkPlugin;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { BasePlugin } from '@rexeus/typeweaver-gen';
|
|
4
|
+
import Case from 'case';
|
|
5
5
|
|
|
6
|
-
// src/
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
import { fileURLToPath } from "node:url";
|
|
9
|
-
import Case from "case";
|
|
6
|
+
// src/index.ts
|
|
10
7
|
var moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
11
8
|
var HttpApiRouterGenerator = class {
|
|
12
9
|
static generate(context) {
|
|
@@ -58,15 +55,14 @@ var HttpApiRouterGenerator = class {
|
|
|
58
55
|
};
|
|
59
56
|
|
|
60
57
|
// src/index.ts
|
|
61
|
-
var moduleDir2 =
|
|
58
|
+
var moduleDir2 = path.dirname(fileURLToPath(import.meta.url));
|
|
62
59
|
var AwsCdkPlugin = class extends BasePlugin {
|
|
63
60
|
name = "aws-cdk";
|
|
64
61
|
generate(context) {
|
|
65
|
-
const libDir =
|
|
62
|
+
const libDir = path.join(moduleDir2, "lib");
|
|
66
63
|
this.copyLibFiles(context, libDir, "aws-cdk");
|
|
67
64
|
HttpApiRouterGenerator.generate(context);
|
|
68
65
|
}
|
|
69
66
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
67
|
+
|
|
68
|
+
export { AwsCdkPlugin as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js":{"bytes":569,"imports":[],"format":"esm"},"src/HttpApiRouterGenerator.ts":{"bytes":1966,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"case","kind":"import-statement","external":true},{"path":"/home/runner/work/typeweaver/typeweaver/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":689,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"@rexeus/typeweaver-gen","kind":"import-statement","external":true},{"path":"src/HttpApiRouterGenerator.ts","kind":"import-statement","original":"./HttpApiRouterGenerator"},{"path":"/home/runner/work/typeweaver/typeweaver/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.cjs":{"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"@rexeus/typeweaver-gen","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"case","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/index.ts","inputs":{"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js":{"bytesInOutput":314},"src/index.ts":{"bytesInOutput":449},"src/HttpApiRouterGenerator.ts":{"bytesInOutput":1635}},"bytes":2634}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js":{"bytes":322,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true}],"format":"esm"},"src/HttpApiRouterGenerator.ts":{"bytes":1966,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"case","kind":"import-statement","external":true},{"path":"/home/runner/work/typeweaver/typeweaver/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":689,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"@rexeus/typeweaver-gen","kind":"import-statement","external":true},{"path":"src/HttpApiRouterGenerator.ts","kind":"import-statement","original":"./HttpApiRouterGenerator"},{"path":"/home/runner/work/typeweaver/typeweaver/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"@rexeus/typeweaver-gen","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"case","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":451},"src/HttpApiRouterGenerator.ts":{"bytesInOutput":1637}},"bytes":2193}}}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rexeus/typeweaver-aws-cdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Generates AWS CDK helpers to provision the infrastructure your APIs need. Powered by Typeweaver 🧵✨",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"main": "dist/index.cjs",
|
|
7
8
|
"module": "dist/index.js",
|
|
8
9
|
"types": "dist/index.d.ts",
|
|
@@ -46,12 +47,12 @@
|
|
|
46
47
|
},
|
|
47
48
|
"homepage": "https://github.com/rexeus/typeweaver#readme",
|
|
48
49
|
"peerDependencies": {
|
|
49
|
-
"@rexeus/typeweaver-core": "^0.
|
|
50
|
-
"@rexeus/typeweaver-gen": "^0.
|
|
50
|
+
"@rexeus/typeweaver-core": "^0.4.1",
|
|
51
|
+
"@rexeus/typeweaver-gen": "^0.4.1"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"@rexeus/typeweaver-core": "^0.
|
|
54
|
-
"@rexeus/typeweaver-gen": "^0.
|
|
54
|
+
"@rexeus/typeweaver-core": "^0.4.1",
|
|
55
|
+
"@rexeus/typeweaver-gen": "^0.4.1"
|
|
55
56
|
},
|
|
56
57
|
"dependencies": {
|
|
57
58
|
"case": "^1.6.3"
|