@elliots/typical-compiler 0.2.0-beta.1 → 0.2.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.
package/dist/client.d.ts CHANGED
@@ -16,7 +16,7 @@ export declare class TypicalCompiler {
16
16
  start(): Promise<void>;
17
17
  close(): Promise<void>;
18
18
  loadProject(configFileName: string): Promise<ProjectHandle>;
19
- transformFile(project: ProjectHandle | string, fileName: string): Promise<TransformResult>;
19
+ transformFile(project: ProjectHandle | string, fileName: string, ignoreTypes?: string[], maxGeneratedFunctions?: number): Promise<TransformResult>;
20
20
  release(handle: ProjectHandle | string): Promise<void>;
21
21
  /**
22
22
  * Transform a standalone TypeScript source string.
@@ -24,9 +24,11 @@ export declare class TypicalCompiler {
24
24
  *
25
25
  * @param fileName - Virtual filename for error messages (e.g., "test.ts")
26
26
  * @param source - TypeScript source code
27
+ * @param ignoreTypes - Glob patterns for types to skip validation (e.g., ["FieldConfig", "React.*"])
28
+ * @param maxGeneratedFunctions - Max helper functions before error (0 = default 50)
27
29
  * @returns Transformed code with validation
28
30
  */
29
- transformSource(fileName: string, source: string): Promise<TransformResult>;
31
+ transformSource(fileName: string, source: string, ignoreTypes?: string[], maxGeneratedFunctions?: number): Promise<TransformResult>;
30
32
  private request;
31
33
  private handleData;
32
34
  }
package/dist/client.js CHANGED
@@ -80,11 +80,13 @@ export class TypicalCompiler {
80
80
  async loadProject(configFileName) {
81
81
  return this.request('loadProject', { configFileName });
82
82
  }
83
- async transformFile(project, fileName) {
83
+ async transformFile(project, fileName, ignoreTypes, maxGeneratedFunctions) {
84
84
  const projectId = typeof project === 'string' ? project : project.id;
85
85
  return this.request('transformFile', {
86
86
  project: projectId,
87
87
  fileName,
88
+ ignoreTypes,
89
+ maxGeneratedFunctions,
88
90
  });
89
91
  }
90
92
  async release(handle) {
@@ -97,12 +99,16 @@ export class TypicalCompiler {
97
99
  *
98
100
  * @param fileName - Virtual filename for error messages (e.g., "test.ts")
99
101
  * @param source - TypeScript source code
102
+ * @param ignoreTypes - Glob patterns for types to skip validation (e.g., ["FieldConfig", "React.*"])
103
+ * @param maxGeneratedFunctions - Max helper functions before error (0 = default 50)
100
104
  * @returns Transformed code with validation
101
105
  */
102
- async transformSource(fileName, source) {
106
+ async transformSource(fileName, source, ignoreTypes, maxGeneratedFunctions) {
103
107
  return this.request('transformSource', {
104
108
  fileName,
105
109
  source,
110
+ ignoreTypes,
111
+ maxGeneratedFunctions,
106
112
  });
107
113
  }
108
114
  async request(method, payload) {
package/dist/protocol.js CHANGED
@@ -36,7 +36,7 @@ export function decodeResponse(data) {
36
36
  let offset = 0;
37
37
  // Check array marker
38
38
  if (data[offset++] !== MessagePackTypeFixedArray3) {
39
- throw new Error(`Expected 0x93, got 0x${data[0].toString(16)}`);
39
+ throw new Error(`Expected 0x93, got 0x${data[0].toString(16)}: first 200 of data: ${data.subarray(0, 200).toString('utf8')}`);
40
40
  }
41
41
  // Read message type
42
42
  if (data[offset++] !== MessagePackTypeU8) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliots/typical-compiler",
3
- "version": "0.2.0-beta.1",
3
+ "version": "0.2.1",
4
4
  "description": "TypeScript compiler powered by tsgo for typical validation",
5
5
  "keywords": [
6
6
  "compiler",
@@ -26,12 +26,12 @@
26
26
  "typescript": "^5.7.0"
27
27
  },
28
28
  "optionalDependencies": {
29
- "@elliots/typical-compiler-darwin-arm64": "0.2.0-beta.1",
30
- "@elliots/typical-compiler-darwin-x64": "0.2.0-beta.1",
31
- "@elliots/typical-compiler-linux-arm64": "0.2.0-beta.1",
32
- "@elliots/typical-compiler-linux-x64": "0.2.0-beta.1",
33
- "@elliots/typical-compiler-win32-arm64": "0.2.0-beta.1",
34
- "@elliots/typical-compiler-win32-x64": "0.2.0-beta.1"
29
+ "@elliots/typical-compiler-darwin-arm64": "0.2.1",
30
+ "@elliots/typical-compiler-darwin-x64": "0.2.1",
31
+ "@elliots/typical-compiler-linux-arm64": "0.2.1",
32
+ "@elliots/typical-compiler-linux-x64": "0.2.1",
33
+ "@elliots/typical-compiler-win32-arm64": "0.2.1",
34
+ "@elliots/typical-compiler-win32-x64": "0.2.1"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsc",