@skmtc/core 0.0.312 → 0.0.314

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.
Files changed (51) hide show
  1. package/esm/context/CoreContext.d.ts +6 -5
  2. package/esm/context/CoreContext.d.ts.map +1 -1
  3. package/esm/context/CoreContext.js +51 -51
  4. package/esm/context/GenerateContext.d.ts +5 -4
  5. package/esm/context/GenerateContext.d.ts.map +1 -1
  6. package/esm/context/GenerateContext.js +25 -23
  7. package/esm/context/ParseContext.d.ts +5 -4
  8. package/esm/context/ParseContext.d.ts.map +1 -1
  9. package/esm/context/ParseContext.js +22 -30
  10. package/esm/context/RenderContext.d.ts +5 -5
  11. package/esm/context/RenderContext.d.ts.map +1 -1
  12. package/esm/context/RenderContext.js +28 -35
  13. package/esm/context/ResultsHandler.d.ts +1 -1
  14. package/esm/context/ResultsHandler.d.ts.map +1 -1
  15. package/esm/context/ResultsHandler.js +3 -4
  16. package/esm/context/StackTrail.js +1 -1
  17. package/esm/generate/generate.d.ts.map +1 -1
  18. package/esm/generate/generate.js +3 -2
  19. package/esm/helpers/tracer.d.ts +3 -3
  20. package/esm/helpers/tracer.d.ts.map +1 -1
  21. package/esm/helpers/tracer.js +3 -3
  22. package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
  23. package/esm/oas/parameter/toParameterV3.js +0 -1
  24. package/esm/server/createServer.js +2 -2
  25. package/esm/types/GeneratorKeys.js +6 -6
  26. package/package.json +1 -1
  27. package/script/context/CoreContext.d.ts +6 -5
  28. package/script/context/CoreContext.d.ts.map +1 -1
  29. package/script/context/CoreContext.js +51 -51
  30. package/script/context/GenerateContext.d.ts +5 -4
  31. package/script/context/GenerateContext.d.ts.map +1 -1
  32. package/script/context/GenerateContext.js +25 -23
  33. package/script/context/ParseContext.d.ts +5 -4
  34. package/script/context/ParseContext.d.ts.map +1 -1
  35. package/script/context/ParseContext.js +22 -30
  36. package/script/context/RenderContext.d.ts +5 -5
  37. package/script/context/RenderContext.d.ts.map +1 -1
  38. package/script/context/RenderContext.js +28 -35
  39. package/script/context/ResultsHandler.d.ts +1 -1
  40. package/script/context/ResultsHandler.d.ts.map +1 -1
  41. package/script/context/ResultsHandler.js +3 -4
  42. package/script/context/StackTrail.js +1 -1
  43. package/script/generate/generate.d.ts.map +1 -1
  44. package/script/generate/generate.js +3 -2
  45. package/script/helpers/tracer.d.ts +3 -3
  46. package/script/helpers/tracer.d.ts.map +1 -1
  47. package/script/helpers/tracer.js +3 -3
  48. package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
  49. package/script/oas/parameter/toParameterV3.js +0 -1
  50. package/script/server/createServer.js +2 -2
  51. package/script/types/GeneratorKeys.js +6 -6
@@ -1,23 +1,11 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _RenderContext_stackTrail;
13
1
  import * as Sentry from '@sentry/deno';
14
2
  import { Import } from '../dsl/Import.js';
15
3
  import invariant from 'tiny-invariant';
16
4
  import { normalize } from '../deps/jsr.io/@std/path/1.0.0/mod.js';
17
5
  import { toResolvedArtifactPath } from '../helpers/toResolvedArtifactPath.js';
18
- import { StackTrail } from './StackTrail.js';
6
+ import { tracer } from '../helpers/tracer.js';
19
7
  export class RenderContext {
20
- constructor({ files, prettier, basePath, pinnableGenerators }) {
8
+ constructor({ files, prettier, basePath, pinnableGenerators, appendToStackTrail, removeFromStackTrail }) {
21
9
  Object.defineProperty(this, "files", {
22
10
  enumerable: true,
23
11
  configurable: true,
@@ -48,22 +36,25 @@ export class RenderContext {
48
36
  writable: true,
49
37
  value: void 0
50
38
  });
51
- _RenderContext_stackTrail.set(this, void 0);
52
- __classPrivateFieldSet(this, _RenderContext_stackTrail, new StackTrail(), "f");
39
+ Object.defineProperty(this, "appendToStackTrail", {
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true,
43
+ value: void 0
44
+ });
45
+ Object.defineProperty(this, "removeFromStackTrail", {
46
+ enumerable: true,
47
+ configurable: true,
48
+ writable: true,
49
+ value: void 0
50
+ });
53
51
  this.currentDestinationPath = 'PRE_RENDER';
54
52
  this.files = files;
55
53
  this.prettier = prettier;
56
54
  this.basePath = basePath;
57
55
  this.pinnableGenerators = pinnableGenerators;
58
- }
59
- appendStackTrailChunk(chunk) {
60
- __classPrivateFieldGet(this, _RenderContext_stackTrail, "f").append(chunk);
61
- }
62
- removeStackTrailChunk(chunk) {
63
- __classPrivateFieldGet(this, _RenderContext_stackTrail, "f").remove(chunk);
64
- }
65
- get stackTrail() {
66
- return __classPrivateFieldGet(this, _RenderContext_stackTrail, "f").toString();
56
+ this.appendToStackTrail = appendToStackTrail;
57
+ this.removeFromStackTrail = removeFromStackTrail;
67
58
  }
68
59
  render() {
69
60
  return Sentry.startSpan({ name: 'Render artifacts' }, () => {
@@ -87,15 +78,18 @@ export class RenderContext {
87
78
  collate() {
88
79
  const fileEntries = Array.from(this.files.entries());
89
80
  const fileObjects = fileEntries.map(([destinationPath, file]) => {
90
- // Set the current destination path to be used by
91
- // addGeneratorKey method to apply generator keys
92
- // to Correct file
93
- this.currentDestinationPath = destinationPath;
94
- return renderFile({
95
- file,
96
- destinationPath,
97
- basePath: this.basePath,
98
- prettier: this.prettier
81
+ return tracer(this, destinationPath, () => {
82
+ // Set the current destination path to be used by
83
+ // addGeneratorKey method to apply generator keys
84
+ // to Correct file
85
+ // @TODO: Could this be combined with the tracer call above?
86
+ this.currentDestinationPath = destinationPath;
87
+ return renderFile({
88
+ file,
89
+ destinationPath,
90
+ basePath: this.basePath,
91
+ prettier: this.prettier
92
+ });
99
93
  });
100
94
  });
101
95
  this.currentDestinationPath = 'POST_RENDER';
@@ -144,7 +138,6 @@ export class RenderContext {
144
138
  return this.getFile(exportPath).definitions.get(name);
145
139
  }
146
140
  }
147
- _RenderContext_stackTrail = new WeakMap();
148
141
  const renderFile = ({ file, destinationPath, basePath }) => {
149
142
  const imports = Array.from(file.imports.entries()).map(([module, importItems]) => new Import({ module, importNames: Array.from(importItems) }));
150
143
  const definitions = Array.from(file.definitions.values());
@@ -12,7 +12,7 @@ export declare class ResultsHandler extends BaseHandler {
12
12
  constructor(levelName: LevelName, options: ResultsHandlerOptions);
13
13
  setup(): void;
14
14
  handle(logRecord: LogRecord): void;
15
- log(msg: string): void;
15
+ log(levelName: string): void;
16
16
  flush(): void;
17
17
  destroy(): void;
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ResultsHandler.d.ts","sourceRoot":"","sources":["../../src/context/ResultsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,2CAA2C,CAAA;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAA;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,OAAO,EAAE,WAAW,CAAA;CACrB;AAED,qBAAa,cAAe,SAAQ,WAAW;;IAC7C,OAAO,EAAE,WAAW,CAAA;gBAMR,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,qBAAqB;IAMvD,KAAK;IAML,MAAM,CAAC,SAAS,EAAE,SAAS;IASpC,GAAG,CAAC,GAAG,EAAE,MAAM;IAaf,KAAK;IAMI,OAAO;CAKjB"}
1
+ {"version":3,"file":"ResultsHandler.d.ts","sourceRoot":"","sources":["../../src/context/ResultsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,2CAA2C,CAAA;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAA;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,OAAO,EAAE,WAAW,CAAA;CACrB;AAED,qBAAa,cAAe,SAAQ,WAAW;;IAC7C,OAAO,EAAE,WAAW,CAAA;gBAMR,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,qBAAqB;IAMvD,KAAK;IAML,MAAM,CAAC,SAAS,EAAE,SAAS;IASpC,GAAG,CAAC,SAAS,EAAE,MAAM;IAWrB,KAAK;IAMI,OAAO;CAKjB"}
@@ -33,13 +33,12 @@ export class ResultsHandler extends BaseHandler {
33
33
  this.flush();
34
34
  }
35
35
  }
36
- log(msg) {
37
- const { level } = JSON.parse(msg);
38
- this.context.captureCurrentResult(match(level)
36
+ log(levelName) {
37
+ this.context.captureCurrentResult(match(levelName)
39
38
  .with('WARN', () => 'warning')
40
39
  .with('ERROR', () => 'error')
41
40
  .otherwise(() => {
42
- throw new Error(`Unexpected result: ${level}`);
41
+ throw new Error(`Unexpected log level name: ${levelName}`);
43
42
  }));
44
43
  }
45
44
  flush() {
@@ -50,7 +50,7 @@ export class StackTrail {
50
50
  static parse(value) {
51
51
  const stack = value.split(':').map(item => {
52
52
  if (!item) {
53
- throw new Error(`Empty stack trail chunk in: ${value}`);
53
+ throw new Error(`Empty stack trail token in: ${value}`);
54
54
  }
55
55
  return item.replaceAll('%3A', ':');
56
56
  });
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/generate/generate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,cAAc,CAAC,CAAA;IAClE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,QAAQ,4EAQlB,YAAY;;;CAsBd,CAAA"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/generate/generate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,cAAc,CAAC,CAAA;IAClE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,QAAQ,4EAQlB,YAAY;;;CAuBd,CAAA"}
@@ -1,11 +1,12 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { CoreContext } from '../context/CoreContext.js';
3
3
  export const generate = ({ traceId, spanId, schema, settings, prettier, generatorsMap, startAt }) => {
4
- const context = new CoreContext({ spanId, schema });
4
+ const context = new CoreContext({ spanId });
5
5
  const { artifacts, files, pinnable, results } = context.transform({
6
6
  settings,
7
7
  generatorsMap,
8
- prettier
8
+ prettier,
9
+ schema
9
10
  });
10
11
  const manifest = {
11
12
  files,
@@ -1,7 +1,7 @@
1
1
  type StackTrailHandler = {
2
- appendStackTrailChunk: (chunk: string | string[]) => void;
3
- removeStackTrailChunk: (chunk: string | string[]) => void;
2
+ appendToStackTrail: (token: string | string[]) => void;
3
+ removeFromStackTrail: (token: string | string[]) => void;
4
4
  };
5
- export declare const tracer: <T>(context: StackTrailHandler, chunk: string | string[], fn: () => T) => T;
5
+ export declare const tracer: <T>(context: StackTrailHandler, token: string | string[], fn: () => T) => T;
6
6
  export {};
7
7
  //# sourceMappingURL=tracer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../src/helpers/tracer.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACzD,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;CAC1D,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,CAAC,WACb,iBAAiB,SACnB,MAAM,GAAG,MAAM,EAAE,MACpB,MAAM,CAAC,MASZ,CAAA"}
1
+ {"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../src/helpers/tracer.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACtD,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;CACzD,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,CAAC,WACb,iBAAiB,SACnB,MAAM,GAAG,MAAM,EAAE,MACpB,MAAM,CAAC,MASZ,CAAA"}
@@ -1,6 +1,6 @@
1
- export const tracer = (context, chunk, fn) => {
2
- context.appendStackTrailChunk(chunk);
1
+ export const tracer = (context, token, fn) => {
2
+ context.appendToStackTrail(token);
3
3
  const result = fn();
4
- context.removeStackTrailChunk(chunk);
4
+ context.removeFromStackTrail(token);
5
5
  return result;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"toParameterV3.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/toParameterV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAQjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAK9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAI3C,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EACN,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,EAAE,GACzD,SAAS,CAAA;IACb,OAAO,EAAE,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G3B,qBAAqB,KACpB,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GACtC,SAUH,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,MAAM,CAChB,MAAM,EACN,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CACtD,CAAA;IACD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,4BAGxB,kBAAkB,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CASxE,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,UAAU,EACN,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GACrE,SAAS,CAAA;IACb,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,sBAAsB,4BAGhC,0BAA0B,KACzB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAClD,SAMH,CAAA"}
@@ -12,7 +12,6 @@ export const toParameterListV3 = ({ parameters, context }) => {
12
12
  return undefined;
13
13
  }
14
14
  return parameters.map((parameter, index) => {
15
- console.log('parameter index', index);
16
15
  return tracer(context, `${index}`, () => toParameterV3({ parameter, context }));
17
16
  });
18
17
  };
@@ -104,6 +104,6 @@ const toOperations = ({ generator, oasDocument, operationsSettings }) => {
104
104
  }, {});
105
105
  };
106
106
  const toOasDocument = ({ schema, spanId }) => {
107
- const context = new CoreContext({ spanId, schema });
108
- return context.parse();
107
+ const context = new CoreContext({ spanId });
108
+ return context.parse(schema);
109
109
  };
@@ -22,11 +22,11 @@ export const isOperationGeneratorKey = (arg) => {
22
22
  if (typeof arg !== 'string') {
23
23
  return false;
24
24
  }
25
- const keyChunks = arg.split('|');
26
- if (keyChunks.length !== 3) {
25
+ const keyTokens = arg.split('|');
26
+ if (keyTokens.length !== 3) {
27
27
  return false;
28
28
  }
29
- const [generatorId, path, method] = keyChunks;
29
+ const [generatorId, path, method] = keyTokens;
30
30
  if (typeof generatorId !== 'string' || !generatorId.length) {
31
31
  return false;
32
32
  }
@@ -42,11 +42,11 @@ export const isModelGeneratorKey = (arg) => {
42
42
  if (typeof arg !== 'string') {
43
43
  return false;
44
44
  }
45
- const keyChunks = arg.split('|');
46
- if (keyChunks.length !== 2) {
45
+ const keyTokens = arg.split('|');
46
+ if (keyTokens.length !== 2) {
47
47
  return false;
48
48
  }
49
- const [generatorId, refName] = keyChunks;
49
+ const [generatorId, refName] = keyTokens;
50
50
  if (typeof generatorId !== 'string' || !generatorId.length) {
51
51
  return false;
52
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skmtc/core",
3
- "version": "0.0.312",
3
+ "version": "0.0.314",
4
4
  "main": "./script/mod.js",
5
5
  "module": "./esm/mod.js",
6
6
  "exports": {
@@ -8,9 +8,9 @@ import * as log from '../deps/jsr.io/@std/log/0.224.6/mod.js';
8
8
  import type { GeneratorKey } from '../types/GeneratorKeys.js';
9
9
  type CoreContextArgs = {
10
10
  spanId: string;
11
- schema: string;
12
11
  };
13
12
  type TransformArgs = {
13
+ schema: string;
14
14
  settings: ClientSettings | undefined;
15
15
  generatorsMap: Record<string, OperationGenerator | ModelGenerator>;
16
16
  prettier?: PrettierConfigType;
@@ -18,16 +18,17 @@ type TransformArgs = {
18
18
  export declare class CoreContext {
19
19
  #private;
20
20
  logger: log.Logger;
21
- constructor({ schema, spanId }: CoreContextArgs);
22
- parse(): OasDocument;
23
- transform({ settings, generatorsMap, prettier }: TransformArgs): {
21
+ constructor({ spanId }: CoreContextArgs);
22
+ parse(schema: string): OasDocument;
23
+ appendToStackTrail(token: string | string[]): void;
24
+ removeFromStackTrail(token: string | string[]): void;
25
+ transform({ schema, settings, generatorsMap, prettier }: TransformArgs): {
24
26
  results: Record<string, SuccessWarningError>;
25
27
  files: Record<string, import("../types/Manifest.js").ManifestEntry>;
26
28
  pinnable: Partial<Record<GeneratorKey, string>>;
27
29
  artifacts: Record<string, string>;
28
30
  };
29
31
  captureCurrentResult(result: SuccessWarningError): void;
30
- get phaseType(): 'parse' | 'generate' | 'render';
31
32
  }
32
33
  export type JsonFormatterArgs = {
33
34
  logRecord: log.LogRecord;
@@ -1 +1 @@
1
- {"version":3,"file":"CoreContext.d.ts","sourceRoot":"","sources":["../../src/context/CoreContext.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AA0B7D,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AASD,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,cAAc,CAAC,CAAA;IAClE,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B,CAAA;AAED,qBAAa,WAAW;;IACtB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;gBAKN,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,eAAe;IA+C/C,KAAK,IAAI,WAAW;IAQpB,SAAS,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,E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AM,CAAA;gBAKN,EAAE,MAAM,EAAE,EAAE,eAAe;IAmCvC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAMlC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAIlD,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAIpD,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,aAAa;;;;;;IA4EtE,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;CA8BxD;AAkBD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,GAAG,CAAC,SAAS,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,UAAU,EACX,EAAE,iBAAiB,GAAG,MAAM,CAQ5B"}
@@ -33,19 +33,19 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
33
33
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
34
34
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
35
35
  };
36
- var _CoreContext_instances, _CoreContext_phase, _CoreContext_results, _CoreContext_stackTrail, _CoreContext_setupLogger, _CoreContext_getStackTrailString, _CoreContext_setupParsePhase, _CoreContext_setupGeneratePhase, _CoreContext_setupRenderPhase;
36
+ var _CoreContext_instances, _CoreContext_phase, _CoreContext_results, _CoreContext_stackTrail, _CoreContext_setupLogger, _CoreContext_setupParsePhase, _CoreContext_setupGeneratePhase, _CoreContext_setupRenderPhase;
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  exports.CoreContext = void 0;
39
39
  exports.skmtcFormatter = skmtcFormatter;
40
40
  const GenerateContext_js_1 = require("./GenerateContext.js");
41
- const ts_pattern_1 = require("ts-pattern");
42
41
  const RenderContext_js_1 = require("./RenderContext.js");
43
42
  const ParseContext_js_1 = require("./ParseContext.js");
44
43
  const log = __importStar(require("../deps/jsr.io/@std/log/0.224.6/mod.js"));
45
44
  const ResultsHandler_js_1 = require("./ResultsHandler.js");
46
45
  const StackTrail_js_1 = require("./StackTrail.js");
46
+ const tracer_js_1 = require("../helpers/tracer.js");
47
47
  class CoreContext {
48
- constructor({ schema, spanId }) {
48
+ constructor({ spanId }) {
49
49
  _CoreContext_instances.add(this);
50
50
  Object.defineProperty(this, "logger", {
51
51
  enumerable: true,
@@ -59,49 +59,55 @@ class CoreContext {
59
59
  __classPrivateFieldSet(this, _CoreContext_stackTrail, new StackTrail_js_1.StackTrail([spanId]), "f");
60
60
  __classPrivateFieldSet(this, _CoreContext_results, {}, "f");
61
61
  this.logger = __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupLogger).call(this, spanId);
62
- __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupParsePhase).call(this, schema), "f");
63
62
  }
64
- parse() {
65
- if (__classPrivateFieldGet(this, _CoreContext_phase, "f").type !== 'parse') {
66
- throw new Error(`Expected 'parse' phase, got '${__classPrivateFieldGet(this, _CoreContext_phase, "f").type}'`);
67
- }
63
+ parse(schema) {
64
+ __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupParsePhase).call(this, schema), "f");
68
65
  return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.parse();
69
66
  }
70
- transform({ settings, generatorsMap, prettier }) {
71
- if (__classPrivateFieldGet(this, _CoreContext_phase, "f").type !== 'parse') {
72
- throw new Error(`Expected 'parse' phase, got '${__classPrivateFieldGet(this, _CoreContext_phase, "f").type}'`);
73
- }
67
+ appendToStackTrail(token) {
68
+ __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").append(token);
69
+ }
70
+ removeFromStackTrail(token) {
71
+ __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").remove(token);
72
+ }
73
+ transform({ schema, settings, generatorsMap, prettier }) {
74
74
  const callback = (generatorKey) => {
75
- if (__classPrivateFieldGet(this, _CoreContext_phase, "f").type === 'render') {
75
+ if (__classPrivateFieldGet(this, _CoreContext_phase, "f")?.type === 'render') {
76
76
  __classPrivateFieldGet(this, _CoreContext_phase, "f").context.addGeneratorKey({ generatorKey });
77
77
  }
78
78
  };
79
- const schemaModel = __classPrivateFieldGet(this, _CoreContext_phase, "f").context.parse();
80
- __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupGeneratePhase).call(this, {
81
- schemaModel,
82
- settings,
83
- generatorsMap,
84
- callback
85
- }), "f");
86
- const files = __classPrivateFieldGet(this, _CoreContext_phase, "f").context.generate(generatorsMap);
79
+ const schemaModel = (0, tracer_js_1.tracer)(this, 'parse', () => {
80
+ __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupParsePhase).call(this, schema), "f");
81
+ return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.parse();
82
+ });
83
+ const files = (0, tracer_js_1.tracer)(this, 'generate', () => {
84
+ __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupGeneratePhase).call(this, {
85
+ schemaModel,
86
+ settings,
87
+ generatorsMap,
88
+ callback
89
+ }), "f");
90
+ return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.generate(generatorsMap);
91
+ });
87
92
  this.logger.debug(`${files.size} files generated`);
88
- __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupRenderPhase).call(this, {
89
- files,
90
- pinnableGenerators: Object.values(generatorsMap)
91
- .map(({ id, pinnable }) => (pinnable ? id : null))
92
- .filter(generatorId => generatorId !== null),
93
- prettier,
94
- basePath: settings?.basePath
95
- }), "f");
96
- const renderOutput = __classPrivateFieldGet(this, _CoreContext_phase, "f").context.render();
97
- __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").remove('render');
93
+ const renderOutput = (0, tracer_js_1.tracer)(this, 'render', () => {
94
+ __classPrivateFieldSet(this, _CoreContext_phase, __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupRenderPhase).call(this, {
95
+ files,
96
+ pinnableGenerators: Object.values(generatorsMap)
97
+ .map(({ id, pinnable }) => (pinnable ? id : null))
98
+ .filter(generatorId => generatorId !== null),
99
+ prettier,
100
+ basePath: settings?.basePath
101
+ }), "f");
102
+ return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.render();
103
+ });
98
104
  return {
99
105
  ...renderOutput,
100
106
  results: __classPrivateFieldGet(this, _CoreContext_results, "f")
101
107
  };
102
108
  }
103
109
  captureCurrentResult(result) {
104
- const stackTrail = __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_getStackTrailString).call(this);
110
+ const stackTrail = __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").toString();
105
111
  if (incomingResultIsWorse({
106
112
  current: __classPrivateFieldGet(this, _CoreContext_results, "f")[stackTrail],
107
113
  incoming: result
@@ -109,9 +115,6 @@ class CoreContext {
109
115
  __classPrivateFieldGet(this, _CoreContext_results, "f")[stackTrail] = result;
110
116
  }
111
117
  }
112
- get phaseType() {
113
- return __classPrivateFieldGet(this, _CoreContext_phase, "f").type;
114
- }
115
118
  }
116
119
  exports.CoreContext = CoreContext;
117
120
  _CoreContext_phase = new WeakMap(), _CoreContext_results = new WeakMap(), _CoreContext_stackTrail = new WeakMap(), _CoreContext_instances = new WeakSet(), _CoreContext_setupLogger = function _CoreContext_setupLogger(spanId) {
@@ -120,7 +123,7 @@ _CoreContext_phase = new WeakMap(), _CoreContext_results = new WeakMap(), _CoreC
120
123
  [`${spanId}-logs`]: new log.ConsoleHandler('DEBUG', {
121
124
  formatter: logRecord => skmtcFormatter({
122
125
  logRecord,
123
- stackTrail: __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_getStackTrailString).call(this)
126
+ stackTrail: __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").toString()
124
127
  }),
125
128
  useColors: false
126
129
  }),
@@ -137,37 +140,34 @@ _CoreContext_phase = new WeakMap(), _CoreContext_results = new WeakMap(), _CoreC
137
140
  }
138
141
  });
139
142
  return log.getLogger(spanId);
140
- }, _CoreContext_getStackTrailString = function _CoreContext_getStackTrailString() {
141
- const substack = (0, ts_pattern_1.match)(__classPrivateFieldGet(this, _CoreContext_phase, "f"))
142
- .with({ type: 'parse' }, ({ context }) => context.stackTrail)
143
- .with({ type: 'generate' }, ({ context }) => context.stackTrail)
144
- .with({ type: 'render' }, ({ context }) => context.stackTrail)
145
- .exhaustive();
146
- return StackTrail_js_1.StackTrail.join(__classPrivateFieldGet(this, _CoreContext_stackTrail, "f"), substack);
147
143
  }, _CoreContext_setupParsePhase = function _CoreContext_setupParsePhase(schema) {
148
- __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").append('parse');
149
- const parseContext = new ParseContext_js_1.ParseContext({ schema, logger: this.logger });
144
+ const parseContext = new ParseContext_js_1.ParseContext({
145
+ schema,
146
+ logger: this.logger,
147
+ appendToStackTrail: this.appendToStackTrail.bind(this),
148
+ removeFromStackTrail: this.appendToStackTrail.bind(this)
149
+ });
150
150
  return { type: 'parse', context: parseContext };
151
151
  }, _CoreContext_setupGeneratePhase = function _CoreContext_setupGeneratePhase({ schemaModel, settings, generatorsMap, callback }) {
152
- __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").remove('parse');
153
- __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").append('generate');
154
152
  const generateContext = new GenerateContext_js_1.GenerateContext({
155
153
  schemaModel,
156
154
  settings,
157
155
  generatorsMap,
158
156
  logger: this.logger,
159
157
  callback,
160
- captureCurrentResult: this.captureCurrentResult.bind(this)
158
+ captureCurrentResult: this.captureCurrentResult.bind(this),
159
+ appendToStackTrail: this.appendToStackTrail.bind(this),
160
+ removeFromStackTrail: this.removeFromStackTrail.bind(this)
161
161
  });
162
162
  return { type: 'generate', context: generateContext };
163
163
  }, _CoreContext_setupRenderPhase = function _CoreContext_setupRenderPhase({ files, prettier, basePath, pinnableGenerators }) {
164
- __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").remove('generate');
165
- __classPrivateFieldGet(this, _CoreContext_stackTrail, "f").append('render');
166
164
  const renderContext = new RenderContext_js_1.RenderContext({
167
165
  files,
168
166
  prettier,
169
167
  basePath,
170
- pinnableGenerators
168
+ pinnableGenerators,
169
+ appendToStackTrail: this.appendToStackTrail.bind(this),
170
+ removeFromStackTrail: this.removeFromStackTrail.bind(this)
171
171
  });
172
172
  return { type: 'render', context: renderContext };
173
173
  };
@@ -22,6 +22,8 @@ type ConstructorArgs = {
22
22
  logger: log.Logger;
23
23
  callback: (generatorKey: GeneratorKey) => void;
24
24
  captureCurrentResult: (result: SuccessWarningError) => void;
25
+ appendToStackTrail: (token: string | string[]) => void;
26
+ removeFromStackTrail: (token: string | string[]) => void;
25
27
  };
26
28
  export type PickArgs = {
27
29
  name: string;
@@ -68,11 +70,10 @@ export declare class GenerateContext {
68
70
  logger: log.Logger;
69
71
  callback: (generatorKey: GeneratorKey) => void;
70
72
  captureCurrentResult: (result: SuccessWarningError) => void;
71
- constructor({ schemaModel, settings, logger, callback, captureCurrentResult }: ConstructorArgs);
73
+ appendToStackTrail: (token: string | string[]) => void;
74
+ removeFromStackTrail: (token: string | string[]) => void;
75
+ constructor({ schemaModel, settings, logger, callback, captureCurrentResult, appendToStackTrail, removeFromStackTrail }: ConstructorArgs);
72
76
  generate(generatorsMap: Record<string, OperationGenerator | ModelGenerator>): Map<string, FileContents>;
73
- appendStackTrailChunk(chunk: string | string[]): void;
74
- removeStackTrailChunk(chunk: string | string[]): void;
75
- get stackTrail(): string;
76
77
  getFile(filePath: string, { throwIfNotFound }?: GetFileOptions): FileContents;
77
78
  register({ imports, definitions, destinationPath }: RegisterArgs): void;
78
79
  insert<V extends GeneratedValue, T extends GenerationType>({ generation, destinationPath, ...rest }: InsertArgs<V, T>): InsertReturn<V, T>;
@@ -1 +1 @@
1
- {"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEf,MAAM,2BAA2B,CAAA;AAGlC,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACf,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM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