@ttoss/cloudformation 0.2.0 → 0.2.2
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/esm/index.js +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +7 -2
- package/package.json +7 -4
- package/src/index.ts +5 -0
- package/src/readObjectFile.ts +3 -7
package/dist/esm/index.js
CHANGED
|
@@ -172,6 +172,9 @@ var readObjectFile = ({ path: path3 }) => {
|
|
|
172
172
|
if (extension === "ts") {
|
|
173
173
|
__require("ts-node").register({
|
|
174
174
|
compilerOptions: { module: "commonjs" },
|
|
175
|
+
moduleTypes: {
|
|
176
|
+
"carlin.*": "cjs"
|
|
177
|
+
},
|
|
175
178
|
transpileOnly: true
|
|
176
179
|
});
|
|
177
180
|
const tsObj = __require(path3);
|
|
@@ -217,5 +220,6 @@ var findAndReadCloudFormationTemplate = ({
|
|
|
217
220
|
return readObjectFile({ path: fullPath });
|
|
218
221
|
};
|
|
219
222
|
export {
|
|
220
|
-
findAndReadCloudFormationTemplate
|
|
223
|
+
findAndReadCloudFormationTemplate,
|
|
224
|
+
readObjectFile as unstable_readObjectFile
|
|
221
225
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -40,4 +40,8 @@ declare const findAndReadCloudFormationTemplate: ({ templatePath: defaultTemplat
|
|
|
40
40
|
templatePath?: string;
|
|
41
41
|
}) => CloudFormationTemplate;
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
declare const readObjectFile: ({ path }: {
|
|
44
|
+
path: string;
|
|
45
|
+
}) => any;
|
|
46
|
+
|
|
47
|
+
export { findAndReadCloudFormationTemplate, readObjectFile as unstable_readObjectFile };
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
27
27
|
// src/index.ts
|
|
28
28
|
var src_exports = {};
|
|
29
29
|
__export(src_exports, {
|
|
30
|
-
findAndReadCloudFormationTemplate: () => findAndReadCloudFormationTemplate
|
|
30
|
+
findAndReadCloudFormationTemplate: () => findAndReadCloudFormationTemplate,
|
|
31
|
+
unstable_readObjectFile: () => readObjectFile
|
|
31
32
|
});
|
|
32
33
|
module.exports = __toCommonJS(src_exports);
|
|
33
34
|
|
|
@@ -196,6 +197,9 @@ var readObjectFile = ({ path: path3 }) => {
|
|
|
196
197
|
if (extension === "ts") {
|
|
197
198
|
require("ts-node").register({
|
|
198
199
|
compilerOptions: { module: "commonjs" },
|
|
200
|
+
moduleTypes: {
|
|
201
|
+
"carlin.*": "cjs"
|
|
202
|
+
},
|
|
199
203
|
transpileOnly: true
|
|
200
204
|
});
|
|
201
205
|
const tsObj = require(path3);
|
|
@@ -242,5 +246,6 @@ var findAndReadCloudFormationTemplate = ({
|
|
|
242
246
|
};
|
|
243
247
|
// Annotate the CommonJS export names for ESM import in node:
|
|
244
248
|
0 && (module.exports = {
|
|
245
|
-
findAndReadCloudFormationTemplate
|
|
249
|
+
findAndReadCloudFormationTemplate,
|
|
250
|
+
unstable_readObjectFile
|
|
246
251
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/cloudformation",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "CloudFormation utils.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "tsup",
|
|
18
|
-
"test": "
|
|
18
|
+
"test": "jest"
|
|
19
19
|
},
|
|
20
20
|
"typings": "dist/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
@@ -23,11 +23,14 @@
|
|
|
23
23
|
"ts-node": "^10.9.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@ttoss/config": "^1.
|
|
26
|
+
"@ttoss/config": "^1.26.0",
|
|
27
|
+
"@ttoss/test-utils": "^1.20.0",
|
|
28
|
+
"@types/jest": "^29.2.4",
|
|
29
|
+
"jest": "^29.3.1"
|
|
27
30
|
},
|
|
28
31
|
"keywords": [],
|
|
29
32
|
"publishConfig": {
|
|
30
33
|
"access": "public"
|
|
31
34
|
},
|
|
32
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "f3b33b88d475925960f557619d710f11f831c144"
|
|
33
36
|
}
|
package/src/index.ts
CHANGED
package/src/readObjectFile.ts
CHANGED
|
@@ -7,13 +7,6 @@ export const readYaml = ({ path }: { path: string }) => {
|
|
|
7
7
|
return yaml.load(template);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* If your file is `.ts`, you must you must export the final object
|
|
12
|
-
* `export default { ... }`. If your file is `.js`, you must you must export
|
|
13
|
-
* the final object `module.exports = { ... }`. `.json` and `.yml/yaml` must
|
|
14
|
-
* define the resources in [JSON](https://www.json.org/json-en.html) and
|
|
15
|
-
* [YAML](https://yaml.org/) format respectively.
|
|
16
|
-
*/
|
|
17
10
|
export const readObjectFile = ({ path }: { path: string }) => {
|
|
18
11
|
if (!fs.existsSync(path)) {
|
|
19
12
|
return {};
|
|
@@ -24,6 +17,9 @@ export const readObjectFile = ({ path }: { path: string }) => {
|
|
|
24
17
|
if (extension === 'ts') {
|
|
25
18
|
require('ts-node').register({
|
|
26
19
|
compilerOptions: { module: 'commonjs' },
|
|
20
|
+
moduleTypes: {
|
|
21
|
+
'carlin.*': 'cjs',
|
|
22
|
+
},
|
|
27
23
|
transpileOnly: true,
|
|
28
24
|
});
|
|
29
25
|
const tsObj = require(path);
|