@rexeus/typeweaver-aws-cdk 0.0.2 → 0.0.3
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.js +1 -178
- package/package.json +9 -5
package/dist/index.js
CHANGED
|
@@ -1,185 +1,8 @@
|
|
|
1
1
|
import { BasePlugin } from '@rexeus/typeweaver-gen';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import Case from 'case';
|
|
3
4
|
import { fileURLToPath } from 'url';
|
|
4
5
|
|
|
5
|
-
function getDefaultExportFromCjs (x) {
|
|
6
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
var Case$2 = {exports: {}};
|
|
10
|
-
|
|
11
|
-
var Case$1 = Case$2.exports;
|
|
12
|
-
|
|
13
|
-
var hasRequiredCase;
|
|
14
|
-
|
|
15
|
-
function requireCase () {
|
|
16
|
-
if (hasRequiredCase) return Case$2.exports;
|
|
17
|
-
hasRequiredCase = 1;
|
|
18
|
-
(function (module) {
|
|
19
|
-
/*! Case - v1.6.2 - 2020-03-24
|
|
20
|
-
* Copyright (c) 2020 Nathan Bubna; Licensed MIT, GPL */
|
|
21
|
-
(function() {
|
|
22
|
-
var unicodes = function(s, prefix) {
|
|
23
|
-
prefix = prefix || "";
|
|
24
|
-
return s.replace(/(^|-)/g, "$1\\u" + prefix).replace(/,/g, "\\u" + prefix);
|
|
25
|
-
}, basicSymbols = unicodes("20-26,28-2F,3A-40,5B-60,7B-7E,A0-BF,D7,F7", "00"), baseLowerCase = "a-z" + unicodes("DF-F6,F8-FF", "00"), baseUpperCase = "A-Z" + unicodes("C0-D6,D8-DE", "00"), improperInTitle = "A|An|And|As|At|But|By|En|For|If|In|Of|On|Or|The|To|Vs?\\.?|Via", regexps = function(symbols, lowers, uppers, impropers) {
|
|
26
|
-
symbols = symbols || basicSymbols;
|
|
27
|
-
lowers = lowers || baseLowerCase;
|
|
28
|
-
uppers = uppers || baseUpperCase;
|
|
29
|
-
impropers = impropers || improperInTitle;
|
|
30
|
-
return {
|
|
31
|
-
capitalize: new RegExp("(^|[" + symbols + "])([" + lowers + "])", "g"),
|
|
32
|
-
pascal: new RegExp("(^|[" + symbols + "])+([" + lowers + uppers + "])", "g"),
|
|
33
|
-
fill: new RegExp("[" + symbols + "]+(.|$)", "g"),
|
|
34
|
-
sentence: new RegExp('(^\\s*|[\\?\\!\\.]+"?\\s+"?|,\\s+")([' + lowers + "])", "g"),
|
|
35
|
-
improper: new RegExp("\\b(" + impropers + ")\\b", "g"),
|
|
36
|
-
relax: new RegExp("([^" + uppers + "])([" + uppers + "]*)([" + uppers + "])(?=[^" + uppers + "]|$)", "g"),
|
|
37
|
-
upper: new RegExp("^[^" + lowers + "]+$"),
|
|
38
|
-
hole: /[^\s]\s[^\s]/,
|
|
39
|
-
apostrophe: /'/g,
|
|
40
|
-
room: new RegExp("[" + symbols + "]")
|
|
41
|
-
};
|
|
42
|
-
}, re = regexps(), _ = {
|
|
43
|
-
re,
|
|
44
|
-
unicodes,
|
|
45
|
-
regexps,
|
|
46
|
-
types: [],
|
|
47
|
-
up: String.prototype.toUpperCase,
|
|
48
|
-
low: String.prototype.toLowerCase,
|
|
49
|
-
cap: function(s) {
|
|
50
|
-
return _.up.call(s.charAt(0)) + s.slice(1);
|
|
51
|
-
},
|
|
52
|
-
decap: function(s) {
|
|
53
|
-
return _.low.call(s.charAt(0)) + s.slice(1);
|
|
54
|
-
},
|
|
55
|
-
deapostrophe: function(s) {
|
|
56
|
-
return s.replace(re.apostrophe, "");
|
|
57
|
-
},
|
|
58
|
-
fill: function(s, fill, deapostrophe) {
|
|
59
|
-
if (fill != null) {
|
|
60
|
-
s = s.replace(re.fill, function(m, next) {
|
|
61
|
-
return next ? fill + next : "";
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (deapostrophe) {
|
|
65
|
-
s = _.deapostrophe(s);
|
|
66
|
-
}
|
|
67
|
-
return s;
|
|
68
|
-
},
|
|
69
|
-
prep: function(s, fill, pascal, upper) {
|
|
70
|
-
s = s == null ? "" : s + "";
|
|
71
|
-
if (!upper && re.upper.test(s)) {
|
|
72
|
-
s = _.low.call(s);
|
|
73
|
-
}
|
|
74
|
-
if (!fill && !re.hole.test(s)) {
|
|
75
|
-
var holey = _.fill(s, " ");
|
|
76
|
-
if (re.hole.test(holey)) {
|
|
77
|
-
s = holey;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (!pascal && !re.room.test(s)) {
|
|
81
|
-
s = s.replace(re.relax, _.relax);
|
|
82
|
-
}
|
|
83
|
-
return s;
|
|
84
|
-
},
|
|
85
|
-
relax: function(m, before, acronym, caps) {
|
|
86
|
-
return before + " " + (acronym ? acronym + " " : "") + caps;
|
|
87
|
-
}
|
|
88
|
-
}, Case = {
|
|
89
|
-
_,
|
|
90
|
-
of: function(s) {
|
|
91
|
-
for (var i = 0, m = _.types.length; i < m; i++) {
|
|
92
|
-
if (Case[_.types[i]].apply(Case, arguments) === s) {
|
|
93
|
-
return _.types[i];
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
flip: function(s) {
|
|
98
|
-
return s.replace(/\w/g, function(l) {
|
|
99
|
-
return (l == _.up.call(l) ? _.low : _.up).call(l);
|
|
100
|
-
});
|
|
101
|
-
},
|
|
102
|
-
random: function(s) {
|
|
103
|
-
return s.replace(/\w/g, function(l) {
|
|
104
|
-
return (Math.round(Math.random()) ? _.up : _.low).call(l);
|
|
105
|
-
});
|
|
106
|
-
},
|
|
107
|
-
type: function(type2, fn) {
|
|
108
|
-
Case[type2] = fn;
|
|
109
|
-
_.types.push(type2);
|
|
110
|
-
}
|
|
111
|
-
}, types = {
|
|
112
|
-
lower: function(s, fill, deapostrophe) {
|
|
113
|
-
return _.fill(_.low.call(_.prep(s, fill)), fill, deapostrophe);
|
|
114
|
-
},
|
|
115
|
-
snake: function(s) {
|
|
116
|
-
return Case.lower(s, "_", true);
|
|
117
|
-
},
|
|
118
|
-
constant: function(s) {
|
|
119
|
-
return Case.upper(s, "_", true);
|
|
120
|
-
},
|
|
121
|
-
camel: function(s) {
|
|
122
|
-
return _.decap(Case.pascal(s));
|
|
123
|
-
},
|
|
124
|
-
kebab: function(s) {
|
|
125
|
-
return Case.lower(s, "-", true);
|
|
126
|
-
},
|
|
127
|
-
upper: function(s, fill, deapostrophe) {
|
|
128
|
-
return _.fill(_.up.call(_.prep(s, fill, false, true)), fill, deapostrophe);
|
|
129
|
-
},
|
|
130
|
-
capital: function(s, fill, deapostrophe) {
|
|
131
|
-
return _.fill(_.prep(s).replace(re.capitalize, function(m, border, letter) {
|
|
132
|
-
return border + _.up.call(letter);
|
|
133
|
-
}), fill, deapostrophe);
|
|
134
|
-
},
|
|
135
|
-
header: function(s) {
|
|
136
|
-
return Case.capital(s, "-", true);
|
|
137
|
-
},
|
|
138
|
-
pascal: function(s) {
|
|
139
|
-
return _.fill(_.prep(s, false, true).replace(re.pascal, function(m, border, letter) {
|
|
140
|
-
return _.up.call(letter);
|
|
141
|
-
}), "", true);
|
|
142
|
-
},
|
|
143
|
-
title: function(s) {
|
|
144
|
-
return Case.capital(s).replace(re.improper, function(small, p, i, s2) {
|
|
145
|
-
return i > 0 && i < s2.lastIndexOf(" ") ? _.low.call(small) : small;
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
sentence: function(s, names, abbreviations) {
|
|
149
|
-
s = Case.lower(s).replace(re.sentence, function(m, prelude, letter) {
|
|
150
|
-
return prelude + _.up.call(letter);
|
|
151
|
-
});
|
|
152
|
-
if (names) {
|
|
153
|
-
names.forEach(function(name) {
|
|
154
|
-
s = s.replace(new RegExp("\\b" + Case.lower(name) + "\\b", "g"), _.cap);
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
if (abbreviations) {
|
|
158
|
-
abbreviations.forEach(function(abbr) {
|
|
159
|
-
s = s.replace(new RegExp("(\\b" + Case.lower(abbr) + "\\. +)(\\w)"), function(m, abbrAndSpace, letter) {
|
|
160
|
-
return abbrAndSpace + _.low.call(letter);
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
return s;
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
types.squish = types.pascal;
|
|
168
|
-
Case.default = Case;
|
|
169
|
-
for (var type in types) {
|
|
170
|
-
Case.type(type, types[type]);
|
|
171
|
-
}
|
|
172
|
-
var define = typeof define === "function" ? define : function() {
|
|
173
|
-
};
|
|
174
|
-
define(module.exports ? module.exports = Case : this.Case = Case);
|
|
175
|
-
}).call(Case$1);
|
|
176
|
-
} (Case$2));
|
|
177
|
-
return Case$2.exports;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
var CaseExports = requireCase();
|
|
181
|
-
var Case = /*@__PURE__*/getDefaultExportFromCjs(CaseExports);
|
|
182
|
-
|
|
183
6
|
const __dirname$1 = path.dirname(fileURLToPath(import.meta.url));
|
|
184
7
|
class HttpApiRouterGenerator {
|
|
185
8
|
static generate(context) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rexeus/typeweaver-aws-cdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "AWS CDK constructs and deployment utilities for TypeWeaver APIs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"import": "./dist/index.js",
|
|
@@ -36,12 +37,15 @@
|
|
|
36
37
|
},
|
|
37
38
|
"homepage": "https://github.com/rexeus/typeweaver#readme",
|
|
38
39
|
"peerDependencies": {
|
|
39
|
-
"@rexeus/typeweaver-core": "^0.0.
|
|
40
|
-
"@rexeus/typeweaver-gen": "^0.0.
|
|
40
|
+
"@rexeus/typeweaver-core": "^0.0.3",
|
|
41
|
+
"@rexeus/typeweaver-gen": "^0.0.3"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@rexeus/typeweaver-core": "^0.0.
|
|
44
|
-
"@rexeus/typeweaver-gen": "^0.0.
|
|
44
|
+
"@rexeus/typeweaver-core": "^0.0.3",
|
|
45
|
+
"@rexeus/typeweaver-gen": "^0.0.3"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"case": "^1.6.3"
|
|
45
49
|
},
|
|
46
50
|
"scripts": {
|
|
47
51
|
"typecheck": "tsc --noEmit",
|