@storm-software/untyped 0.3.0 → 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.
@@ -0,0 +1,46 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+
28
+ // src/utilities.ts
29
+ var _correctpaths = require('@storm-software/config-tools/utilities/correct-paths');
30
+ var getOutputFile = /* @__PURE__ */ __name((file, extension) => {
31
+ let fileName = file.name.slice(0, file.name.lastIndexOf(".")).replace(".untyped", "").replace("untyped", "").replace(".schema", "").replace("schema", "");
32
+ if (!fileName) {
33
+ fileName = "schema";
34
+ }
35
+ if (fileName !== "schema") {
36
+ fileName = `${fileName}.schema`;
37
+ }
38
+ return _correctpaths.joinPaths.call(void 0, file.parentPath, `${fileName}.${extension}`);
39
+ }, "getOutputFile");
40
+
41
+
42
+
43
+
44
+
45
+
46
+ exports.__name = __name; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.getOutputFile = getOutputFile;
@@ -1,21 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkYMCYTSDOjs = require('./chunk-YMCYTSDO.js');
5
-
6
-
7
-
8
- var _chunkZP3OD7IOjs = require('./chunk-ZP3OD7IO.js');
4
+ var _chunkNYKCIVTCjs = require('./chunk-NYKCIVTC.js');
9
5
 
10
6
  // src/generators/json-schema.ts
7
+ var _console = require('@storm-software/config-tools/logger/console');
11
8
  var _promises = require('fs/promises');
12
9
  function generateJsonSchemaFile(schema, file, config) {
13
10
  try {
14
- const jsonSchema = _chunkZP3OD7IOjs.getOutputFile.call(void 0, file, "json");
15
- _chunkYMCYTSDOjs.writeTrace.call(void 0, `Writing JSON schema file ${jsonSchema}`, config);
11
+ const jsonSchema = _chunkNYKCIVTCjs.getOutputFile.call(void 0, file, "json");
12
+ _console.writeTrace.call(void 0, `Writing JSON schema file ${jsonSchema}`, config);
16
13
  return _promises.writeFile.call(void 0, jsonSchema, JSON.stringify(schema, null, 2));
17
14
  } catch (error) {
18
- _chunkYMCYTSDOjs.writeError.call(void 0, `Error writing JSON schema file for ${file.name}
15
+ _console.writeError.call(void 0, `Error writing JSON schema file for ${file.name}
19
16
 
20
17
  Error:
21
18
  ${_optionalChain([error, 'optionalAccess', _ => _.message]) ? error.message : JSON.stringify(error)}${_optionalChain([error, 'optionalAccess', _2 => _2.stack]) ? `
@@ -27,7 +24,7 @@ ${JSON.stringify(schema)}
27
24
  throw error;
28
25
  }
29
26
  }
30
- _chunkZP3OD7IOjs.__name.call(void 0, generateJsonSchemaFile, "generateJsonSchemaFile");
27
+ _chunkNYKCIVTCjs.__name.call(void 0, generateJsonSchemaFile, "generateJsonSchemaFile");
31
28
 
32
29
 
33
30
 
@@ -1,13 +1,10 @@
1
- import {
2
- writeError,
3
- writeTrace
4
- } from "./chunk-7OPTVFZK.mjs";
5
1
  import {
6
2
  __name,
7
3
  getOutputFile
8
- } from "./chunk-DH2WY7QT.mjs";
4
+ } from "./chunk-GWEQOXW6.mjs";
9
5
 
10
6
  // src/generators/markdown.ts
7
+ import { writeError, writeTrace } from "@storm-software/config-tools/logger/console";
11
8
  import { writeFile } from "node:fs/promises";
12
9
  function generateMarkdown(schema) {
13
10
  return `
@@ -1,10 +1,9 @@
1
- import { S as StormConfig } from './types-DkqO6Ujr.mjs';
1
+ import { S as StormConfig } from './types-CIJRaFHD.mjs';
2
2
  import 'zod';
3
3
 
4
4
  declare const getGenerateAction: (config: StormConfig) => (options: {
5
- entry: string | string[];
6
- outputPath: string;
7
- jsonSchema: string;
5
+ entry?: string | string[];
6
+ outputPath?: string;
8
7
  }) => Promise<void>;
9
8
 
10
9
  export { getGenerateAction };
@@ -1,10 +1,9 @@
1
- import { S as StormConfig } from './types-DkqO6Ujr.js';
1
+ import { S as StormConfig } from './types-CIJRaFHD.js';
2
2
  import 'zod';
3
3
 
4
4
  declare const getGenerateAction: (config: StormConfig) => (options: {
5
- entry: string | string[];
6
- outputPath: string;
7
- jsonSchema: string;
5
+ entry?: string | string[];
6
+ outputPath?: string;
8
7
  }) => Promise<void>;
9
8
 
10
9
  export { getGenerateAction };
package/dist/generate.js CHANGED
@@ -1,11 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkHBHOVTK2js = require('./chunk-HBHOVTK2.js');
4
- require('./chunk-I5HMFTDJ.js');
5
- require('./chunk-DV7PRVVQ.js');
6
- require('./chunk-JRYWLT6J.js');
7
- require('./chunk-YMCYTSDO.js');
8
- require('./chunk-ZP3OD7IO.js');
3
+ var _chunk6OB6EGVEjs = require('./chunk-6OB6EGVE.js');
4
+ require('./chunk-6HKRKQSU.js');
5
+ require('./chunk-TJLW3KPU.js');
6
+ require('./chunk-LWMIR3BQ.js');
7
+ require('./chunk-NYKCIVTC.js');
9
8
 
10
9
 
11
- exports.getGenerateAction = _chunkHBHOVTK2js.getGenerateAction;
10
+ exports.getGenerateAction = _chunk6OB6EGVEjs.getGenerateAction;
package/dist/generate.mjs CHANGED
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  getGenerateAction
3
- } from "./chunk-7LOMEJRK.mjs";
4
- import "./chunk-XAGWZ3JW.mjs";
5
- import "./chunk-ZHHYXAVP.mjs";
6
- import "./chunk-OLRKE2WB.mjs";
7
- import "./chunk-7OPTVFZK.mjs";
8
- import "./chunk-DH2WY7QT.mjs";
3
+ } from "./chunk-MNW76QG7.mjs";
4
+ import "./chunk-EBIRRCGB.mjs";
5
+ import "./chunk-HSIBHFJE.mjs";
6
+ import "./chunk-XSW3ZXMK.mjs";
7
+ import "./chunk-GWEQOXW6.mjs";
9
8
  export {
10
9
  getGenerateAction
11
10
  };
package/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ export { generateDeclaration, generateDeclarationFile } from './generators/dts.m
3
3
  export { generateJsonSchemaFile } from './generators/json-schema.mjs';
4
4
  export { generateMarkdown, generateMarkdownFile } from './generators/markdown.mjs';
5
5
  export { getOutputFile } from './utilities.mjs';
6
- import './types-DkqO6Ujr.mjs';
6
+ import './types-CIJRaFHD.mjs';
7
7
  import 'zod';
8
8
  import 'glob';
9
9
  import 'untyped';
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { generateDeclaration, generateDeclarationFile } from './generators/dts.j
3
3
  export { generateJsonSchemaFile } from './generators/json-schema.js';
4
4
  export { generateMarkdown, generateMarkdownFile } from './generators/markdown.js';
5
5
  export { getOutputFile } from './utilities.js';
6
- import './types-DkqO6Ujr.js';
6
+ import './types-CIJRaFHD.js';
7
7
  import 'zod';
8
8
  import 'glob';
9
9
  import 'untyped';
package/dist/index.js CHANGED
@@ -1,22 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkHBHOVTK2js = require('./chunk-HBHOVTK2.js');
3
+ var _chunk6OB6EGVEjs = require('./chunk-6OB6EGVE.js');
4
4
  require('./chunk-U4YLQDJK.js');
5
5
 
6
6
 
7
7
 
8
- var _chunkI5HMFTDJjs = require('./chunk-I5HMFTDJ.js');
8
+ var _chunk6HKRKQSUjs = require('./chunk-6HKRKQSU.js');
9
9
 
10
10
 
11
- var _chunkDV7PRVVQjs = require('./chunk-DV7PRVVQ.js');
11
+ var _chunkTJLW3KPUjs = require('./chunk-TJLW3KPU.js');
12
12
 
13
13
 
14
14
 
15
- var _chunkJRYWLT6Jjs = require('./chunk-JRYWLT6J.js');
16
- require('./chunk-YMCYTSDO.js');
15
+ var _chunkLWMIR3BQjs = require('./chunk-LWMIR3BQ.js');
17
16
 
18
17
 
19
- var _chunkZP3OD7IOjs = require('./chunk-ZP3OD7IO.js');
18
+ var _chunkNYKCIVTCjs = require('./chunk-NYKCIVTC.js');
20
19
 
21
20
 
22
21
 
@@ -25,4 +24,4 @@ var _chunkZP3OD7IOjs = require('./chunk-ZP3OD7IO.js');
25
24
 
26
25
 
27
26
 
28
- exports.generateDeclaration = _chunkI5HMFTDJjs.generateDeclaration; exports.generateDeclarationFile = _chunkI5HMFTDJjs.generateDeclarationFile; exports.generateJsonSchemaFile = _chunkDV7PRVVQjs.generateJsonSchemaFile; exports.generateMarkdown = _chunkJRYWLT6Jjs.generateMarkdown; exports.generateMarkdownFile = _chunkJRYWLT6Jjs.generateMarkdownFile; exports.getGenerateAction = _chunkHBHOVTK2js.getGenerateAction; exports.getOutputFile = _chunkZP3OD7IOjs.getOutputFile;
27
+ exports.generateDeclaration = _chunk6HKRKQSUjs.generateDeclaration; exports.generateDeclarationFile = _chunk6HKRKQSUjs.generateDeclarationFile; exports.generateJsonSchemaFile = _chunkTJLW3KPUjs.generateJsonSchemaFile; exports.generateMarkdown = _chunkLWMIR3BQjs.generateMarkdown; exports.generateMarkdownFile = _chunkLWMIR3BQjs.generateMarkdownFile; exports.getGenerateAction = _chunk6OB6EGVEjs.getGenerateAction; exports.getOutputFile = _chunkNYKCIVTCjs.getOutputFile;
package/dist/index.mjs CHANGED
@@ -1,22 +1,21 @@
1
1
  import {
2
2
  getGenerateAction
3
- } from "./chunk-7LOMEJRK.mjs";
3
+ } from "./chunk-MNW76QG7.mjs";
4
4
  import "./chunk-ZHPKHX4S.mjs";
5
5
  import {
6
6
  generateDeclaration,
7
7
  generateDeclarationFile
8
- } from "./chunk-XAGWZ3JW.mjs";
8
+ } from "./chunk-EBIRRCGB.mjs";
9
9
  import {
10
10
  generateJsonSchemaFile
11
- } from "./chunk-ZHHYXAVP.mjs";
11
+ } from "./chunk-HSIBHFJE.mjs";
12
12
  import {
13
13
  generateMarkdown,
14
14
  generateMarkdownFile
15
- } from "./chunk-OLRKE2WB.mjs";
16
- import "./chunk-7OPTVFZK.mjs";
15
+ } from "./chunk-XSW3ZXMK.mjs";
17
16
  import {
18
17
  getOutputFile
19
- } from "./chunk-DH2WY7QT.mjs";
18
+ } from "./chunk-GWEQOXW6.mjs";
20
19
  export {
21
20
  generateDeclaration,
22
21
  generateDeclarationFile,