forge-type 1.0.4 → 1.0.5
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.d.ts.map +1 -1
- package/dist/index.js +3 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EACT,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE;;;EAS/B"}
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createTypeFromData = createTypeFromData;
|
|
4
|
-
const child_process_1 = require("child_process");
|
|
5
4
|
const interfaceGenerator_1 = require("./generator/interfaceGenerator");
|
|
6
|
-
function createTypeFromData(name, data, options
|
|
5
|
+
function createTypeFromData(name, data, options // pass { modify: true } to update existing interface
|
|
6
|
+
) {
|
|
7
7
|
const typeString = (0, interfaceGenerator_1.generateInterface)(name, data, options);
|
|
8
|
-
//
|
|
9
|
-
const args = [
|
|
10
|
-
'generate',
|
|
11
|
-
'--model', name,
|
|
12
|
-
'--data', JSON.stringify(data), // or path to a temp file
|
|
13
|
-
'--output', './types',
|
|
14
|
-
];
|
|
15
|
-
const cli = (0, child_process_1.spawn)('npx', ['forge-type-cli', ...args], { stdio: 'inherit' });
|
|
16
|
-
cli.on('close', (code) => {
|
|
17
|
-
if (code === 0)
|
|
18
|
-
console.log('File created successfully via CLI');
|
|
19
|
-
else
|
|
20
|
-
console.error('CLI process failed');
|
|
21
|
-
});
|
|
8
|
+
// const filePath = saveTypeFile(name, typeString)
|
|
22
9
|
return {
|
|
23
10
|
name,
|
|
24
11
|
type: typeString,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA,gDAYC;AAdD,uEAAkE;AAElE,SAAgB,kBAAkB,CAChC,IAAY,EACZ,IAAS,EACT,OAA8B,CAAC,qDAAqD;;IAEpF,MAAM,UAAU,GAAG,IAAA,sCAAiB,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IACzD,kDAAkD;IAElD,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,UAAU;KACjB,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED