@k8ts/instruments 0.2.1 → 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.
Files changed (161) hide show
  1. package/dist/_embedder/base.js +3 -2
  2. package/dist/_embedder/index.js +0 -1
  3. package/dist/_string/index.js +0 -1
  4. package/dist/_string/markers.d.ts +2 -2
  5. package/dist/_string/markers.d.ts.map +1 -1
  6. package/dist/_string/markers.js +26 -11
  7. package/dist/_string/post-processor.js +1 -4
  8. package/dist/_string/pretty-objects.js +51 -50
  9. package/dist/_string/pretty-print.js +0 -1
  10. package/dist/_string/super-script.js +0 -1
  11. package/dist/api-kind/index.js +3 -1
  12. package/dist/cmd/cli-command.js +3 -1
  13. package/dist/cmd/cli-term.js +5 -1
  14. package/dist/cmd/index.js +0 -1
  15. package/dist/cmd/types.js +0 -1
  16. package/dist/data-sources/index.d.ts +37 -0
  17. package/dist/data-sources/index.d.ts.map +1 -0
  18. package/dist/data-sources/index.js +104 -0
  19. package/dist/displayers/displayers.js +2 -5
  20. package/dist/displayers/index.js +0 -1
  21. package/dist/env/env.js +1 -1
  22. package/dist/env/index.js +0 -1
  23. package/dist/env/types.js +0 -1
  24. package/dist/env/validate-name.js +0 -1
  25. package/dist/error.js +0 -1
  26. package/dist/forward-exports/delayed-exports.js +12 -18
  27. package/dist/forward-exports/index.js +0 -1
  28. package/dist/graph/base-node.d.ts +6 -4
  29. package/dist/graph/base-node.d.ts.map +1 -1
  30. package/dist/graph/base-node.js +60 -51
  31. package/dist/graph/base-origin-entity.js +15 -30
  32. package/dist/graph/dependencies.d.ts +2 -2
  33. package/dist/graph/dependencies.d.ts.map +1 -1
  34. package/dist/graph/dependencies.js +16 -19
  35. package/dist/graph/index.js +0 -1
  36. package/dist/graph/origin-node.d.ts +1 -1
  37. package/dist/graph/origin-node.d.ts.map +1 -1
  38. package/dist/graph/origin-node.js +33 -34
  39. package/dist/graph/relations.d.ts +2 -2
  40. package/dist/graph/relations.d.ts.map +1 -1
  41. package/dist/graph/relations.js +1 -4
  42. package/dist/graph/resource-node.d.ts +1 -1
  43. package/dist/graph/resource-node.d.ts.map +1 -1
  44. package/dist/graph/resource-node.js +16 -18
  45. package/dist/image/family.d.ts +10 -6
  46. package/dist/image/family.d.ts.map +1 -1
  47. package/dist/image/family.js +160 -44
  48. package/dist/image/index.js +0 -1
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/kind-map/index.js +2 -1
  53. package/dist/manifest/index.js +0 -1
  54. package/dist/manifest/manifest-builder.d.ts +7 -11
  55. package/dist/manifest/manifest-builder.d.ts.map +1 -1
  56. package/dist/manifest/manifest-builder.js +3 -6
  57. package/dist/ports/error.js +1 -2
  58. package/dist/ports/index.js +0 -1
  59. package/dist/ports/map.js +1 -1
  60. package/dist/ports/set.d.ts +2 -2
  61. package/dist/ports/set.d.ts.map +1 -1
  62. package/dist/ports/set.js +16 -2
  63. package/dist/ports/tools/entry.js +0 -1
  64. package/dist/ports/tools/parse.js +0 -1
  65. package/dist/ports/types.d.ts +2 -2
  66. package/dist/ports/types.d.ts.map +1 -1
  67. package/dist/ports/types.js +0 -1
  68. package/dist/producer/index.js +0 -1
  69. package/dist/producer/producer.js +0 -1
  70. package/dist/ref-key/index.js +0 -1
  71. package/dist/ref-key/ref-key.js +2 -1
  72. package/dist/reference/forward-ref.js +13 -27
  73. package/dist/reference/index.js +0 -1
  74. package/dist/reference/refable.js +0 -1
  75. package/dist/resources/index.js +0 -1
  76. package/dist/resources/objects.js +4 -1
  77. package/dist/resources/parser.js +0 -1
  78. package/dist/resources/types.js +0 -1
  79. package/dist/src.tsbuildinfo +1 -1
  80. package/dist/tracing/git.js +1 -1
  81. package/dist/tracing/index.js +0 -1
  82. package/dist/tracing/trace.js +1 -1
  83. package/dist/tracing/traced.js +0 -1
  84. package/dist/units/index.js +0 -1
  85. package/dist/units/unit-parser.js +16 -11
  86. package/dist/units/units.js +0 -1
  87. package/package.json +3 -3
  88. package/src/_embedder/base.ts +1 -1
  89. package/src/_string/markers.ts +28 -9
  90. package/src/data-sources/index.ts +126 -0
  91. package/src/graph/base-node.ts +20 -10
  92. package/src/graph/dependencies.ts +2 -2
  93. package/src/graph/origin-node.ts +5 -5
  94. package/src/graph/relations.ts +2 -2
  95. package/src/graph/resource-node.ts +3 -3
  96. package/src/image/family.ts +45 -29
  97. package/src/index.ts +1 -0
  98. package/src/manifest/manifest-builder.ts +6 -5
  99. package/src/ports/set.ts +17 -3
  100. package/src/ports/types.ts +5 -3
  101. package/src/tsconfig.json +5 -0
  102. package/dist/_embedder/base.js.map +0 -1
  103. package/dist/_embedder/index.js.map +0 -1
  104. package/dist/_string/index.js.map +0 -1
  105. package/dist/_string/markers.js.map +0 -1
  106. package/dist/_string/post-processor.js.map +0 -1
  107. package/dist/_string/pretty-objects.js.map +0 -1
  108. package/dist/_string/pretty-print.js.map +0 -1
  109. package/dist/_string/super-script.js.map +0 -1
  110. package/dist/api-kind/index.js.map +0 -1
  111. package/dist/cmd/cli-command.js.map +0 -1
  112. package/dist/cmd/cli-term.js.map +0 -1
  113. package/dist/cmd/index.js.map +0 -1
  114. package/dist/cmd/types.js.map +0 -1
  115. package/dist/displayers/displayers.js.map +0 -1
  116. package/dist/displayers/index.js.map +0 -1
  117. package/dist/env/env.js.map +0 -1
  118. package/dist/env/index.js.map +0 -1
  119. package/dist/env/types.js.map +0 -1
  120. package/dist/env/validate-name.js.map +0 -1
  121. package/dist/error.js.map +0 -1
  122. package/dist/forward-exports/delayed-exports.js.map +0 -1
  123. package/dist/forward-exports/index.js.map +0 -1
  124. package/dist/graph/base-node.js.map +0 -1
  125. package/dist/graph/base-origin-entity.js.map +0 -1
  126. package/dist/graph/dependencies.js.map +0 -1
  127. package/dist/graph/index.js.map +0 -1
  128. package/dist/graph/origin-node.js.map +0 -1
  129. package/dist/graph/relations.js.map +0 -1
  130. package/dist/graph/resource-node.js.map +0 -1
  131. package/dist/image/family.js.map +0 -1
  132. package/dist/image/index.js.map +0 -1
  133. package/dist/index.js.map +0 -1
  134. package/dist/kind-map/index.js.map +0 -1
  135. package/dist/manifest/index.js.map +0 -1
  136. package/dist/manifest/manifest-builder.js.map +0 -1
  137. package/dist/ports/error.js.map +0 -1
  138. package/dist/ports/index.js.map +0 -1
  139. package/dist/ports/map.js.map +0 -1
  140. package/dist/ports/set.js.map +0 -1
  141. package/dist/ports/tools/entry.js.map +0 -1
  142. package/dist/ports/tools/parse.js.map +0 -1
  143. package/dist/ports/types.js.map +0 -1
  144. package/dist/producer/index.js.map +0 -1
  145. package/dist/producer/producer.js.map +0 -1
  146. package/dist/ref-key/index.js.map +0 -1
  147. package/dist/ref-key/ref-key.js.map +0 -1
  148. package/dist/reference/forward-ref.js.map +0 -1
  149. package/dist/reference/index.js.map +0 -1
  150. package/dist/reference/refable.js.map +0 -1
  151. package/dist/resources/index.js.map +0 -1
  152. package/dist/resources/objects.js.map +0 -1
  153. package/dist/resources/parser.js.map +0 -1
  154. package/dist/resources/types.js.map +0 -1
  155. package/dist/tracing/git.js.map +0 -1
  156. package/dist/tracing/index.js.map +0 -1
  157. package/dist/tracing/trace.js.map +0 -1
  158. package/dist/tracing/traced.js.map +0 -1
  159. package/dist/units/index.js.map +0 -1
  160. package/dist/units/unit-parser.js.map +0 -1
  161. package/dist/units/units.js.map +0 -1
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Embedder = void 0;
4
4
  class Embedder {
5
+ name;
6
+ _symbol;
5
7
  constructor(name) {
6
8
  this.name = name;
7
9
  this._symbol = Symbol.for(`build.k8ts.org/${name}`);
@@ -30,10 +32,9 @@ class Embedder {
30
32
  get(target) {
31
33
  const input = this.tryGet(target);
32
34
  if (!input) {
33
- throw new Error(`Target of type ${target.constructor.name} doesn't have any embedded data for ${this.name}!`);
35
+ throw new Error(`Target of type ${target} doesn't have any embedded data for ${this.name}!`);
34
36
  }
35
37
  return input;
36
38
  }
37
39
  }
38
40
  exports.Embedder = Embedder;
39
- //# sourceMappingURL=base.js.map
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./base"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -19,4 +19,3 @@ __exportStar(require("./post-processor"), exports);
19
19
  __exportStar(require("./pretty-objects"), exports);
20
20
  __exportStar(require("./pretty-print"), exports);
21
21
  __exportStar(require("./super-script"), exports);
22
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- export declare function getMarkerForIndex(index: number, alias: string): string;
2
- export declare const external = "\u2203";
1
+ export declare function getMarkerForIndex(index: number): string;
2
+ export declare function getMarkerForExternal(): string;
3
3
  //# sourceMappingURL=markers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/_string/markers.ts"],"names":[],"mappings":"AAoCA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAQ7D;AAED,eAAO,MAAM,QAAQ,WAAM,CAAA"}
1
+ {"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/_string/markers.ts"],"names":[],"mappings":"AAqDA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,UAO9C;AAED,wBAAgB,oBAAoB,WAGnC"}
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.external = void 0;
7
6
  exports.getMarkerForIndex = getMarkerForIndex;
7
+ exports.getMarkerForExternal = getMarkerForExternal;
8
8
  const chalk_1 = __importDefault(require("chalk"));
9
9
  const interchangeable = {
10
10
  diamond: "◆",
@@ -33,16 +33,31 @@ const interchangeable = {
33
33
  plus_filled: "✚",
34
34
  mac_char: "⌘ "
35
35
  };
36
- const colors = [chalk_1.default.red, chalk_1.default.green, chalk_1.default.yellow, chalk_1.default.blue, chalk_1.default.magenta, chalk_1.default.cyan];
36
+ const colors = [
37
+ chalk_1.default.redBright,
38
+ chalk_1.default.yellowBright,
39
+ chalk_1.default.blue,
40
+ chalk_1.default.magenta,
41
+ chalk_1.default.cyan,
42
+ chalk_1.default.blueBright
43
+ ];
37
44
  const numbered = Object.values(interchangeable);
38
- function getMarkerForIndex(index, alias) {
39
- const clamedIndex = index % numbered.length;
45
+ // We want to have symbols be as distinct as possible
46
+ // that means we use each symbol with a different color
47
+ // Instead of using all symbols of a single color, then all symbols of another color
48
+ // We mix it up, so we only get repeat colors after all symbols have been used
49
+ // we can get combinations of color + symbol like this:
50
+ // symbol = i % symbols.length
51
+ // color = (Math.floor(i / colors.length) + i)
52
+ function getMarkerForIndex(index) {
53
+ const clampedIndex = index % numbered.length;
40
54
  const multiplier = Math.floor(index / numbered.length);
41
- const char = numbered[clamedIndex];
42
- const color = colors[multiplier % colors.length];
43
- const marker = [char, alias].join(" ");
44
- const colored = color(marker);
45
- return colored;
55
+ const char = numbered[clampedIndex];
56
+ const color = colors[(multiplier + clampedIndex) % colors.length];
57
+ const colored = color(char);
58
+ return `${colored} `;
59
+ }
60
+ function getMarkerForExternal() {
61
+ const external = "∃";
62
+ return chalk_1.default.yellowBright(external);
46
63
  }
47
- exports.external = "∃";
48
- //# sourceMappingURL=markers.js.map
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TextPostProcessor = void 0;
4
4
  class TextPostProcessor {
5
- constructor() {
6
- this.tokens = new Map();
7
- }
5
+ tokens = new Map();
8
6
  _genToken() {
9
7
  const randomKey = Math.random().toString(36).slice(2, 8);
10
8
  const token = `K8TS_TOK_${randomKey}`;
@@ -27,4 +25,3 @@ class TextPostProcessor {
27
25
  }
28
26
  }
29
27
  exports.TextPostProcessor = TextPostProcessor;
30
- //# sourceMappingURL=post-processor.js.map
@@ -33,10 +33,6 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
33
  }
34
34
  return useValue ? value : void 0;
35
35
  };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
41
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
42
38
  };
@@ -57,19 +53,20 @@ let Attr = (() => {
57
53
  let _classDescriptor;
58
54
  let _classExtraInitializers = [];
59
55
  let _classThis;
60
- var Attr = _classThis = class {
56
+ var Attr = class {
57
+ static { _classThis = this; }
58
+ static {
59
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
60
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
61
+ Attr = _classThis = _classDescriptor.value;
62
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
63
+ __runInitializers(_classThis, _classExtraInitializers);
64
+ }
65
+ text;
61
66
  constructor(text) {
62
67
  this.text = text;
63
68
  }
64
69
  };
65
- __setFunctionName(_classThis, "Attr");
66
- (() => {
67
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
68
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
69
- Attr = _classThis = _classDescriptor.value;
70
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
71
- __runInitializers(_classThis, _classExtraInitializers);
72
- })();
73
70
  return Attr = _classThis;
74
71
  })();
75
72
  exports.Attr = Attr;
@@ -81,19 +78,20 @@ let Verb = (() => {
81
78
  let _classDescriptor;
82
79
  let _classExtraInitializers = [];
83
80
  let _classThis;
84
- var Verb = _classThis = class {
81
+ var Verb = class {
82
+ static { _classThis = this; }
83
+ static {
84
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
85
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
86
+ Verb = _classThis = _classDescriptor.value;
87
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
88
+ __runInitializers(_classThis, _classExtraInitializers);
89
+ }
90
+ text;
85
91
  constructor(text) {
86
92
  this.text = text;
87
93
  }
88
94
  };
89
- __setFunctionName(_classThis, "Verb");
90
- (() => {
91
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
92
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
93
- Verb = _classThis = _classDescriptor.value;
94
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
95
- __runInitializers(_classThis, _classExtraInitializers);
96
- })();
97
95
  return Verb = _classThis;
98
96
  })();
99
97
  exports.Verb = Verb;
@@ -109,20 +107,22 @@ let Quantity = (() => {
109
107
  let _classDescriptor;
110
108
  let _classExtraInitializers = [];
111
109
  let _classThis;
112
- var Quantity = _classThis = class {
110
+ var Quantity = class {
111
+ static { _classThis = this; }
112
+ static {
113
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
114
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
115
+ Quantity = _classThis = _classDescriptor.value;
116
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
117
+ __runInitializers(_classThis, _classExtraInitializers);
118
+ }
119
+ num;
120
+ noun;
113
121
  constructor(num, noun) {
114
122
  this.num = num;
115
123
  this.noun = noun;
116
124
  }
117
125
  };
118
- __setFunctionName(_classThis, "Quantity");
119
- (() => {
120
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
121
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
122
- Quantity = _classThis = _classDescriptor.value;
123
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
124
- __runInitializers(_classThis, _classExtraInitializers);
125
- })();
126
126
  return Quantity = _classThis;
127
127
  })();
128
128
  exports.Quantity = Quantity;
@@ -134,19 +134,20 @@ let RefName = (() => {
134
134
  let _classDescriptor;
135
135
  let _classExtraInitializers = [];
136
136
  let _classThis;
137
- var RefName = _classThis = class {
137
+ var RefName = class {
138
+ static { _classThis = this; }
139
+ static {
140
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
141
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
142
+ RefName = _classThis = _classDescriptor.value;
143
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
144
+ __runInitializers(_classThis, _classExtraInitializers);
145
+ }
146
+ name;
138
147
  constructor(name) {
139
148
  this.name = name;
140
149
  }
141
150
  };
142
- __setFunctionName(_classThis, "RefName");
143
- (() => {
144
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
145
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
146
- RefName = _classThis = _classDescriptor.value;
147
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
148
- __runInitializers(_classThis, _classExtraInitializers);
149
- })();
150
151
  return RefName = _classThis;
151
152
  })();
152
153
  exports.RefName = RefName;
@@ -158,19 +159,20 @@ let Dest = (() => {
158
159
  let _classDescriptor;
159
160
  let _classExtraInitializers = [];
160
161
  let _classThis;
161
- var Dest = _classThis = class {
162
+ var Dest = class {
163
+ static { _classThis = this; }
164
+ static {
165
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
166
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
167
+ Dest = _classThis = _classDescriptor.value;
168
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
169
+ __runInitializers(_classThis, _classExtraInitializers);
170
+ }
171
+ text;
162
172
  constructor(text) {
163
173
  this.text = text;
164
174
  }
165
175
  };
166
- __setFunctionName(_classThis, "Dest");
167
- (() => {
168
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
169
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
170
- Dest = _classThis = _classDescriptor.value;
171
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
172
- __runInitializers(_classThis, _classExtraInitializers);
173
- })();
174
176
  return Dest = _classThis;
175
177
  })();
176
178
  exports.Dest = Dest;
@@ -189,4 +191,3 @@ function dest(text) {
189
191
  function ref(name) {
190
192
  return new RefName(name);
191
193
  }
192
- //# sourceMappingURL=pretty-objects.js.map
@@ -24,4 +24,3 @@ function pretty(templateArgs, ...args) {
24
24
  const result = splat.join("");
25
25
  return result;
26
26
  }
27
- //# sourceMappingURL=pretty-print.js.map
@@ -17,4 +17,3 @@ function toSuperScript(n) {
17
17
  }
18
18
  return num.join("");
19
19
  }
20
- //# sourceMappingURL=super-script.js.map
@@ -7,6 +7,8 @@ const error_1 = require("../error");
7
7
  var Kind;
8
8
  (function (Kind_1) {
9
9
  class Identifier {
10
+ name;
11
+ parent;
10
12
  constructor(name, parent) {
11
13
  this.name = name;
12
14
  this.parent = parent;
@@ -30,6 +32,7 @@ var Kind;
30
32
  }
31
33
  Kind_1.Identifier = Identifier;
32
34
  class Group extends Identifier {
35
+ name;
33
36
  constructor(name) {
34
37
  super(name, null);
35
38
  this.name = name;
@@ -99,4 +102,3 @@ function kinded(kind) {
99
102
  return ctor;
100
103
  };
101
104
  }
102
- //# sourceMappingURL=index.js.map
@@ -6,6 +6,9 @@ const immutable_1 = require("immutable");
6
6
  const lodash_1 = require("lodash");
7
7
  const cli_term_1 = require("./cli-term");
8
8
  class CmdBuilder {
9
+ executable;
10
+ _terms;
11
+ _options;
9
12
  constructor(executable, _terms, _options) {
10
13
  this.executable = executable;
11
14
  this._terms = _terms;
@@ -70,4 +73,3 @@ function Cmd(executable, options) {
70
73
  options = (0, lodash_1.defaultsDeep)({}, options, defaultOptions);
71
74
  return CmdBuilder.make(executable, options);
72
75
  }
73
- //# sourceMappingURL=cli-command.js.map
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VerbatimTerm = exports.CliOptionValue = exports.CliFlag = void 0;
4
4
  const error_1 = require("../error");
5
5
  class CliFlag {
6
+ key;
6
7
  constructor(key) {
7
8
  this.key = key;
8
9
  }
@@ -15,6 +16,9 @@ class CliFlag {
15
16
  }
16
17
  exports.CliFlag = CliFlag;
17
18
  class CliOptionValue {
19
+ key;
20
+ overrideTermJoiner;
21
+ value;
18
22
  constructor(key, overrideTermJoiner, value) {
19
23
  this.key = key;
20
24
  this.overrideTermJoiner = overrideTermJoiner;
@@ -41,6 +45,7 @@ class CliOptionValue {
41
45
  }
42
46
  exports.CliOptionValue = CliOptionValue;
43
47
  class VerbatimTerm {
48
+ value;
44
49
  constructor(value) {
45
50
  this.value = value;
46
51
  }
@@ -52,4 +57,3 @@ class VerbatimTerm {
52
57
  }
53
58
  }
54
59
  exports.VerbatimTerm = VerbatimTerm;
55
- //# sourceMappingURL=cli-term.js.map
package/dist/cmd/index.js CHANGED
@@ -4,4 +4,3 @@ exports.CmdBuilder = exports.Cmd = void 0;
4
4
  var cli_command_1 = require("./cli-command");
5
5
  Object.defineProperty(exports, "Cmd", { enumerable: true, get: function () { return cli_command_1.Cmd; } });
6
6
  Object.defineProperty(exports, "CmdBuilder", { enumerable: true, get: function () { return cli_command_1.CmdBuilder; } });
7
- //# sourceMappingURL=index.js.map
package/dist/cmd/types.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -0,0 +1,37 @@
1
+ import { DoddleAsync } from "doddle";
2
+ import { Map } from "immutable";
3
+ import StackTracey from "stacktracey";
4
+ export type LocalFileMode = "text" | "binary";
5
+ export interface LocalFileSourceProps<Mode extends LocalFileMode = "text"> {
6
+ pointOfCall: StackTracey;
7
+ path: string;
8
+ cwd?: string;
9
+ mode?: Mode;
10
+ }
11
+ export declare class LocalFileSource<Mode extends LocalFileMode = "text"> {
12
+ private readonly _props;
13
+ constructor(_props: LocalFileSourceProps<Mode>);
14
+ get cwd(): string;
15
+ get path(): string;
16
+ contents: DoddleAsync<Mode extends "text" ? string : Uint8Array>;
17
+ }
18
+ export declare function localFile<Mode extends LocalFileMode = "text">(path: string, props?: Pick<LocalFileSourceProps<Mode>, "cwd" | "mode">): LocalFileSource<Mode>;
19
+ export declare function localFile(args: TemplateStringsArray, ...params: any[]): LocalFileSource<"text">;
20
+ export interface TypedArrayLike {
21
+ buffer: ArrayBuffer;
22
+ byteLength: number;
23
+ }
24
+ export type DataSource_Text = LocalFileSource<"text"> | string;
25
+ export type DataSource_Binary = LocalFileSource<"binary"> | TypedArrayLike | ArrayBuffer;
26
+ export type DataSourceRecord_Text = Record<string, DataSource_Text>;
27
+ export type DataSourceRecord_Binary = Record<string, DataSource_Binary>;
28
+ export type DataSourceRecord = DataSourceRecord_Text | DataSourceRecord_Binary;
29
+ export declare function isTypedArray(data: DataSource_Binary): data is TypedArrayLike;
30
+ export declare function isArrayBuffer(data: DataSource_Binary): data is ArrayBuffer;
31
+ export interface DataSourceResolvedRecord {
32
+ data: Record<string, string>;
33
+ binaryData: Record<string, Uint8Array>;
34
+ }
35
+ export declare function resolveText(record: DataSourceRecord_Text): Promise<Map<string, string>>;
36
+ export declare function resolveBinary(record: DataSourceRecord_Binary): Promise<Map<string, Uint8Array<ArrayBuffer>>>;
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data-sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAE,MAAM,QAAQ,CAAA;AAE5C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAE/B,OAAO,WAAW,MAAM,aAAa,CAAA;AAErC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE7C,MAAM,WAAW,oBAAoB,CAAC,IAAI,SAAS,aAAa,GAAG,MAAM;IACrE,WAAW,EAAE,WAAW,CAAA;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,IAAI,CAAA;CACd;AACD,qBAAa,eAAe,CAAC,IAAI,SAAS,aAAa,GAAG,MAAM;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC;IAE/D,IAAI,GAAG,WAMN;IAED,IAAI,IAAI,WAIP;IAED,QAAQ,EAOF,WAAW,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,CAAA;CAC/D;AAED,wBAAgB,SAAS,CAAC,IAAI,SAAS,aAAa,GAAG,MAAM,EACzD,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,GACzD,eAAe,CAAC,IAAI,CAAC,CAAA;AACxB,wBAAgB,SAAS,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;AAiBhG,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,WAAW,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACrB;AACD,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;AAC9D,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAG,cAAc,GAAG,WAAW,CAAA;AACxF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;AACnE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;AACvE,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,uBAAuB,CAAA;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,cAAc,CAO5E;AACD,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,WAAW,CAE1E;AACD,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CACzC;AAOD,wBAAsB,WAAW,CAAC,MAAM,EAAE,qBAAqB,gCAc9D;AACD,wBAAsB,aAAa,CAAC,MAAM,EAAE,uBAAuB,iDAkBlE"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LocalFileSource = void 0;
7
+ exports.localFile = localFile;
8
+ exports.isTypedArray = isTypedArray;
9
+ exports.isArrayBuffer = isArrayBuffer;
10
+ exports.resolveText = resolveText;
11
+ exports.resolveBinary = resolveBinary;
12
+ const doddle_1 = require("doddle");
13
+ const promises_1 = require("fs/promises");
14
+ const immutable_1 = require("immutable");
15
+ const path_1 = require("path");
16
+ const stacktracey_1 = __importDefault(require("stacktracey"));
17
+ const error_1 = require("../error");
18
+ class LocalFileSource {
19
+ _props;
20
+ constructor(_props) {
21
+ this._props = _props;
22
+ }
23
+ get cwd() {
24
+ if (this._props.cwd) {
25
+ return this._props.cwd;
26
+ }
27
+ const where = this._props.pointOfCall.at(0);
28
+ return (0, path_1.dirname)(where.file);
29
+ }
30
+ get path() {
31
+ const where = this._props.pointOfCall.at(0);
32
+ const joined = (0, path_1.join)((0, path_1.dirname)(where.file), this._props.path);
33
+ return (0, path_1.resolve)(joined);
34
+ }
35
+ contents = (0, doddle_1.doddle)(async () => {
36
+ const mode = this._props.mode ?? "text";
37
+ if (mode === "binary") {
38
+ const data = await (0, promises_1.readFile)(this.path, null);
39
+ return data;
40
+ }
41
+ return (0, promises_1.readFile)(this.path, "utf-8");
42
+ });
43
+ }
44
+ exports.LocalFileSource = LocalFileSource;
45
+ function localFile(args, ...params) {
46
+ if (typeof args === "string") {
47
+ const options = params[0] ?? {};
48
+ return new LocalFileSource({
49
+ pointOfCall: new stacktracey_1.default().slice(1),
50
+ path: args,
51
+ ...(options ?? {})
52
+ });
53
+ }
54
+ const path = String.raw(args, ...params);
55
+ return new LocalFileSource({
56
+ pointOfCall: new stacktracey_1.default().slice(1),
57
+ path
58
+ });
59
+ }
60
+ function isTypedArray(data) {
61
+ return (typeof data === "object" &&
62
+ "buffer" in data &&
63
+ "byteSize" in data &&
64
+ typeof data.byteSize === "number");
65
+ }
66
+ function isArrayBuffer(data) {
67
+ return data instanceof ArrayBuffer;
68
+ }
69
+ async function promiseAllMap(m) {
70
+ const promises = m.toArray().map(async (x) => [x[0], await x[1]]);
71
+ const res = await Promise.all(promises);
72
+ return (0, immutable_1.Map)(res);
73
+ }
74
+ async function resolveText(record) {
75
+ const mp = (0, immutable_1.Map)(record).map(async (v, k) => {
76
+ let resolved = v;
77
+ if (v instanceof LocalFileSource) {
78
+ resolved = await v.contents.pull();
79
+ }
80
+ if (typeof resolved !== "string") {
81
+ throw new error_1.InstrumentsError(`Got an invalid data value ${v} for key ${k}. Must be a string.`);
82
+ }
83
+ return resolved;
84
+ });
85
+ return promiseAllMap(mp);
86
+ }
87
+ async function resolveBinary(record) {
88
+ const mp = (0, immutable_1.Map)(record).map(async (v, k) => {
89
+ let resolved = v;
90
+ if (v instanceof LocalFileSource) {
91
+ resolved = await v.contents.pull();
92
+ }
93
+ if (isTypedArray(resolved)) {
94
+ return new Uint8Array(resolved.buffer);
95
+ }
96
+ else if (isArrayBuffer(resolved)) {
97
+ return new Uint8Array(resolved);
98
+ }
99
+ else {
100
+ throw new error_1.InstrumentsError(`Got an invalid data value ${v} for key ${k}. Must be binary data.`);
101
+ }
102
+ });
103
+ return promiseAllMap(mp);
104
+ }
@@ -10,10 +10,8 @@ const chalkNoColor = new chalk_1.default.Instance({
10
10
  level: 0
11
11
  });
12
12
  class DisplayerDecorator {
13
- constructor() {
14
- this._system = new _embedder_1.Embedder("displayers");
15
- this._lastMode = "simple";
16
- }
13
+ _system = new _embedder_1.Embedder("displayers");
14
+ _lastMode = "simple";
17
15
  _withLastMode(mode, fn) {
18
16
  return (...args) => {
19
17
  const oldMode = this._lastMode;
@@ -126,4 +124,3 @@ class DisplayerDecorator {
126
124
  }
127
125
  exports.Displayers = new DisplayerDecorator();
128
126
  exports.displayers = exports.Displayers.decorator;
129
- //# sourceMappingURL=displayers.js.map
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./displayers"), exports);
18
- //# sourceMappingURL=index.js.map
package/dist/env/env.js CHANGED
@@ -6,6 +6,7 @@ const immutable_1 = require("immutable");
6
6
  const error_1 = require("../error");
7
7
  const validate_name_1 = require("./validate-name");
8
8
  class EnvBuilder {
9
+ _env;
9
10
  constructor(_env) {
10
11
  this._env = _env;
11
12
  for (const key of _env.keys()) {
@@ -65,4 +66,3 @@ exports.EnvBuilder = EnvBuilder;
65
66
  function Env(env) {
66
67
  return EnvBuilder.make(env);
67
68
  }
68
- //# sourceMappingURL=env.js.map
package/dist/env/index.js CHANGED
@@ -4,4 +4,3 @@ exports.EnvBuilder = exports.Env = void 0;
4
4
  var env_1 = require("./env");
5
5
  Object.defineProperty(exports, "Env", { enumerable: true, get: function () { return env_1.Env; } });
6
6
  Object.defineProperty(exports, "EnvBuilder", { enumerable: true, get: function () { return env_1.EnvBuilder; } });
7
- //# sourceMappingURL=index.js.map
package/dist/env/types.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -9,4 +9,3 @@ const pEnvVarName = pEnvVarStartChar.pipe((0, combinators_1.then)(pEnvVarChar.pi
9
9
  function isValidEnvVarName(x) {
10
10
  return pEnvVarName.parse(x).isOk;
11
11
  }
12
- //# sourceMappingURL=validate-name.js.map
package/dist/error.js CHANGED
@@ -17,4 +17,3 @@ class ProxyOperationError extends InstrumentsError {
17
17
  }
18
18
  }
19
19
  exports.ProxyOperationError = ProxyOperationError;
20
- //# sourceMappingURL=error.js.map