@powerlines/deepkit 0.5.133 → 0.6.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,48 @@
1
+ import { transpile } from './chunk-EJIBYA23.js';
2
+ import { __name } from './chunk-SHUYVCID.js';
3
+ import { findFileExtension } from '@stryke/path';
4
+ import { isString } from '@stryke/type-checks';
5
+ import { DiagnosticCategory } from 'typescript';
6
+
7
+ var rolldownPlugin = /* @__PURE__ */ __name((context, filter = {}) => {
8
+ return {
9
+ name: "powerlines:deepkit",
10
+ load: {
11
+ filter: {
12
+ id: /\.(m|c)?tsx?$/,
13
+ ...filter
14
+ },
15
+ async handler(id) {
16
+ const path = await context.resolve(id);
17
+ if (!path?.id) {
18
+ return null;
19
+ }
20
+ const contents = await context.fs.read(path.id);
21
+ if (!contents) {
22
+ return null;
23
+ }
24
+ const result = transpile(context, contents, path.id);
25
+ if (result.diagnostics && result.diagnostics.length > 0) {
26
+ if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Error)) {
27
+ const errorMessage = `Deepkit Type reflection transpilation errors: ${id}
28
+ ${result.diagnostics.filter((d) => d.category === DiagnosticCategory.Error).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`;
29
+ context.error(errorMessage);
30
+ throw new Error(errorMessage);
31
+ } else if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Warning)) {
32
+ context.warn(`Deepkit Type reflection transpilation warnings: ${id}
33
+ ${result.diagnostics.filter((d) => d.category === DiagnosticCategory.Warning).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
34
+ } else {
35
+ context.debug(`Deepkit Type reflection transpilation diagnostics: ${id}
36
+ ${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
37
+ }
38
+ }
39
+ return {
40
+ code: result.outputText,
41
+ moduleType: findFileExtension(path.id)
42
+ };
43
+ }
44
+ }
45
+ };
46
+ }, "rolldownPlugin");
47
+
48
+ export { rolldownPlugin };
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ var chunkYAEE7DDW_cjs = require('./chunk-YAEE7DDW.cjs');
4
+ var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
5
+ var path = require('@stryke/path');
6
+ var typeChecks = require('@stryke/type-checks');
7
+ var typescript = require('typescript');
8
+
9
+ var rolldownPlugin = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((context, filter = {}) => {
10
+ return {
11
+ name: "powerlines:deepkit",
12
+ load: {
13
+ filter: {
14
+ id: /\.(m|c)?tsx?$/,
15
+ ...filter
16
+ },
17
+ async handler(id) {
18
+ const path$1 = await context.resolve(id);
19
+ if (!path$1?.id) {
20
+ return null;
21
+ }
22
+ const contents = await context.fs.read(path$1.id);
23
+ if (!contents) {
24
+ return null;
25
+ }
26
+ const result = chunkYAEE7DDW_cjs.transpile(context, contents, path$1.id);
27
+ if (result.diagnostics && result.diagnostics.length > 0) {
28
+ if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Error)) {
29
+ const errorMessage = `Deepkit Type reflection transpilation errors: ${id}
30
+ ${result.diagnostics.filter((d) => d.category === typescript.DiagnosticCategory.Error).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${typeChecks.isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`;
31
+ context.error(errorMessage);
32
+ throw new Error(errorMessage);
33
+ } else if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Warning)) {
34
+ context.warn(`Deepkit Type reflection transpilation warnings: ${id}
35
+ ${result.diagnostics.filter((d) => d.category === typescript.DiagnosticCategory.Warning).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${typeChecks.isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
36
+ } else {
37
+ context.debug(`Deepkit Type reflection transpilation diagnostics: ${id}
38
+ ${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${typeChecks.isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
39
+ }
40
+ }
41
+ return {
42
+ code: result.outputText,
43
+ moduleType: path.findFileExtension(path$1.id)
44
+ };
45
+ }
46
+ }
47
+ };
48
+ }, "rolldownPlugin");
49
+
50
+ exports.rolldownPlugin = rolldownPlugin;
package/dist/index.cjs CHANGED
@@ -1,14 +1,15 @@
1
1
  'use strict';
2
2
 
3
+ require('./chunk-ORA4UQMU.cjs');
3
4
  var chunkR462A2GR_cjs = require('./chunk-R462A2GR.cjs');
4
5
  var chunk7FXYDYVQ_cjs = require('./chunk-7FXYDYVQ.cjs');
5
6
  var chunkKGCRCOJQ_cjs = require('./chunk-KGCRCOJQ.cjs');
6
7
  var chunkCJMS4ES3_cjs = require('./chunk-CJMS4ES3.cjs');
7
8
  var chunk7QZGCBH7_cjs = require('./chunk-7QZGCBH7.cjs');
9
+ var chunkMSAES6UX_cjs = require('./chunk-MSAES6UX.cjs');
8
10
  var chunkYAEE7DDW_cjs = require('./chunk-YAEE7DDW.cjs');
9
11
  var chunkBLLXF42T_cjs = require('./chunk-BLLXF42T.cjs');
10
12
  require('./chunk-USNT2KNT.cjs');
11
- require('./chunk-ORA4UQMU.cjs');
12
13
 
13
14
 
14
15
 
@@ -232,6 +233,10 @@ Object.defineProperty(exports, "getReflectionsPath", {
232
233
  enumerable: true,
233
234
  get: function () { return chunk7QZGCBH7_cjs.getReflectionsPath; }
234
235
  });
236
+ Object.defineProperty(exports, "rolldownPlugin", {
237
+ enumerable: true,
238
+ get: function () { return chunkMSAES6UX_cjs.rolldownPlugin; }
239
+ });
235
240
  Object.defineProperty(exports, "transpile", {
236
241
  enumerable: true,
237
242
  get: function () { return chunkYAEE7DDW_cjs.transpile; }
package/dist/index.d.cts CHANGED
@@ -2,6 +2,7 @@ export { WithIndexAccessOrigin, WithTagsReflection, __ΩWithIndexAccessOrigin, _
2
2
  export { esbuildPlugin } from './esbuild-plugin.cjs';
3
3
  export { reflectType } from './reflect-type.cjs';
4
4
  export { getReflectionsPath } from './resolve-reflections.cjs';
5
+ export { rolldownPlugin } from './rolldown-plugin.cjs';
5
6
  export { createDeclarationTransformer, createTransformer } from './transformer.cjs';
6
7
  export { transpile } from './transpile.cjs';
7
8
  export { ContextReflectionRecord, Reflection, ReflectionRecord, __ΩContextReflectionRecord, __ΩReflection, __ΩReflectionRecord } from './types.cjs';
@@ -13,5 +14,6 @@ import 'esbuild';
13
14
  import 'powerlines/types/context';
14
15
  import '@stryke/types/configuration';
15
16
  import 'powerlines/types/build';
17
+ import 'rolldown';
16
18
  import '@deepkit/type-compiler/config';
17
19
  import 'typescript';
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { WithIndexAccessOrigin, WithTagsReflection, __ΩWithIndexAccessOrigin, _
2
2
  export { esbuildPlugin } from './esbuild-plugin.js';
3
3
  export { reflectType } from './reflect-type.js';
4
4
  export { getReflectionsPath } from './resolve-reflections.js';
5
+ export { rolldownPlugin } from './rolldown-plugin.js';
5
6
  export { createDeclarationTransformer, createTransformer } from './transformer.js';
6
7
  export { transpile } from './transpile.js';
7
8
  export { ContextReflectionRecord, Reflection, ReflectionRecord, __ΩContextReflectionRecord, __ΩReflection, __ΩReflectionRecord } from './types.js';
@@ -13,5 +14,6 @@ import 'esbuild';
13
14
  import 'powerlines/types/context';
14
15
  import '@stryke/types/configuration';
15
16
  import 'powerlines/types/build';
17
+ import 'rolldown';
16
18
  import '@deepkit/type-compiler/config';
17
19
  import 'typescript';
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import './chunk-OULCUN6I.js';
1
2
  export { getEnumReflectionType, getUnionTypes, isStringUnion, kindToName, stringifyDefaultValue, stringifyStringValue, stringifyValue } from './chunk-EL4VZPWJ.js';
2
3
  export { convertFromCapnp, convertFromCapnpArray, convertFromCapnpBase, convertFromCapnpClassType, convertFromCapnpDefault, convertFromCapnpEnum, convertFromCapnpFunction, convertFromCapnpIndexAccessOrigin, convertFromCapnpInfer, convertFromCapnpIntersection, convertFromCapnpLiteral, convertFromCapnpMethodSignature, convertFromCapnpObjectLiteral, convertFromCapnpOther, convertFromCapnpParameter, convertFromCapnpProperty, convertFromCapnpPropertySignature, convertFromCapnpSimple, convertFromCapnpTagsReflection, convertFromCapnpTuple, convertFromCapnpTupleMember, convertFromCapnpUnion, convertToCapnp, convertToCapnpArray, convertToCapnpBase, convertToCapnpClassType, convertToCapnpDefault, convertToCapnpEnum, convertToCapnpFunction, convertToCapnpIndexAccessOrigin, convertToCapnpInfer, convertToCapnpIntersection, convertToCapnpLiteral, convertToCapnpMethod, convertToCapnpMethodSignature, convertToCapnpObjectLiteral, convertToCapnpOther, convertToCapnpParameter, convertToCapnpProperty, convertToCapnpPropertySignature, convertToCapnpSimple, convertToCapnpTagsReflection, convertToCapnpTuple, convertToCapnpTupleMember, convertToCapnpUnion } from './chunk-TDYIUJGY.js';
3
4
  export { reflectType } from './chunk-XHSSGKUT.js';
4
5
  export { esbuildPlugin } from './chunk-JE36RI7U.js';
5
6
  export { getReflectionsPath } from './chunk-ALM6UMVU.js';
7
+ export { rolldownPlugin } from './chunk-GM2JSAMQ.js';
6
8
  export { transpile } from './chunk-EJIBYA23.js';
7
9
  export { createDeclarationTransformer, createTransformer } from './chunk-23YNDVRG.js';
8
10
  import './chunk-SHUYVCID.js';
9
- import './chunk-OULCUN6I.js';
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var chunkMSAES6UX_cjs = require('./chunk-MSAES6UX.cjs');
4
+ require('./chunk-YAEE7DDW.cjs');
5
+ require('./chunk-BLLXF42T.cjs');
6
+ require('./chunk-USNT2KNT.cjs');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "rolldownPlugin", {
11
+ enumerable: true,
12
+ get: function () { return chunkMSAES6UX_cjs.rolldownPlugin; }
13
+ });
@@ -0,0 +1,13 @@
1
+ import { Context } from 'powerlines/types/context';
2
+ import { HookFilter, Plugin } from 'rolldown';
3
+
4
+ /**
5
+ * Rolldown plugin for Deepkit Type reflections.
6
+ *
7
+ * @param context - The Powerlines context.
8
+ * @param filter - Optional filter to limit which files are processed.
9
+ * @returns A Rolldown plugin instance.
10
+ */
11
+ declare const rolldownPlugin: (context: Context, filter?: Partial<Pick<HookFilter, "id">>) => Plugin;
12
+
13
+ export { rolldownPlugin };
@@ -0,0 +1,13 @@
1
+ import { Context } from 'powerlines/types/context';
2
+ import { HookFilter, Plugin } from 'rolldown';
3
+
4
+ /**
5
+ * Rolldown plugin for Deepkit Type reflections.
6
+ *
7
+ * @param context - The Powerlines context.
8
+ * @param filter - Optional filter to limit which files are processed.
9
+ * @returns A Rolldown plugin instance.
10
+ */
11
+ declare const rolldownPlugin: (context: Context, filter?: Partial<Pick<HookFilter, "id">>) => Plugin;
12
+
13
+ export { rolldownPlugin };
@@ -0,0 +1,4 @@
1
+ export { rolldownPlugin } from './chunk-GM2JSAMQ.js';
2
+ import './chunk-EJIBYA23.js';
3
+ import './chunk-23YNDVRG.js';
4
+ import './chunk-SHUYVCID.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/deepkit",
3
- "version": "0.5.133",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -113,8 +113,13 @@
113
113
  }
114
114
  },
115
115
  "typings": "dist/index.d.ts",
116
- "files": ["dist/**/*", "bin/*", "schemas/*"],
116
+ "files": ["bin/*", "dist/**/*", "schemas/*"],
117
117
  "keywords": ["deepkit", "powerlines", "storm-software"],
118
+ "peerDependencies": { "esbuild": "*", "rolldown": "*" },
119
+ "peerDependenciesMeta": {
120
+ "esbuild": { "optional": true },
121
+ "rolldown": { "optional": true }
122
+ },
118
123
  "dependencies": {
119
124
  "@storm-software/config-tools": "^1.189.0",
120
125
  "@stryke/capnp": "^0.12.61",
@@ -123,9 +128,8 @@
123
128
  "@stryke/type-checks": "^0.5.20",
124
129
  "@stryke/types": "^0.10.34",
125
130
  "defu": "^6.1.4",
126
- "esbuild": "^0.25.12",
127
131
  "jiti": "^2.6.1",
128
- "powerlines": "^0.37.89",
132
+ "powerlines": "^0.37.91",
129
133
  "typescript": "^5.9.3"
130
134
  },
131
135
  "devDependencies": {
@@ -135,8 +139,10 @@
135
139
  "@deepkit/type-spec": "1.0.1",
136
140
  "@types/node": "^24.10.9",
137
141
  "dts-bundle-generator": "^9.5.1",
142
+ "esbuild": "^0.25.12",
143
+ "rolldown": "1.0.0-beta.53",
138
144
  "tsup": "8.4.0"
139
145
  },
140
146
  "publishConfig": { "access": "public" },
141
- "gitHead": "fb3079ccb0361ffe89bb357f7a526b6281f8bf71"
147
+ "gitHead": "7e6d0b942c670cdb4ad8ae8984a183702e8d87d8"
142
148
  }