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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE;;;EAoBzF"}
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
- // Trigger CLI to write file
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":";;AAGA,gDAoBC;AAvBD,iDAAqC;AACrC,uEAAkE;AAElE,SAAgB,kBAAkB,CAAC,IAAY,EAAE,IAAS,EAAE,OAA8B;IACxF,MAAM,UAAU,GAAG,IAAA,sCAAiB,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IAEzD,4BAA4B;IAC5B,MAAM,IAAI,GAAG;QACX,UAAU;QACV,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,yBAAyB;QACzD,UAAU,EAAE,SAAS;KACtB,CAAA;IACD,MAAM,GAAG,GAAG,IAAA,qBAAK,EAAC,KAAK,EAAE,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;IAC3E,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QACvB,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAA;;YAC3D,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,UAAU;KACjB,CAAA;AACH,CAAC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-type",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Automatically generates TypeScript interfaces and types from JSON data, with enum detection.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",