@elliots/typical-tsc-plugin 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/index.mjs +11 -5
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -33,7 +33,7 @@ function encodeRequest(method, payload) {
|
|
|
33
33
|
}
|
|
34
34
|
function decodeResponse(data) {
|
|
35
35
|
let offset = 0;
|
|
36
|
-
if (data[offset++] !== MessagePackTypeFixedArray3) throw new Error(`Expected 0x93, got 0x${data[0].toString(16)}`);
|
|
36
|
+
if (data[offset++] !== MessagePackTypeFixedArray3) throw new Error(`Expected 0x93, got 0x${data[0].toString(16)}: first 200 of data: ${data.subarray(0, 200).toString("utf8")}`);
|
|
37
37
|
if (data[offset++] !== MessagePackTypeU8) throw new Error(`Expected 0xCC for message type`);
|
|
38
38
|
const messageType = data[offset++];
|
|
39
39
|
const { value: methodBuf, newOffset: offset2 } = readBin(data, offset);
|
|
@@ -161,11 +161,13 @@ var TypicalCompiler = class {
|
|
|
161
161
|
async loadProject(configFileName) {
|
|
162
162
|
return this.request("loadProject", { configFileName });
|
|
163
163
|
}
|
|
164
|
-
async transformFile(project, fileName) {
|
|
164
|
+
async transformFile(project, fileName, ignoreTypes, maxGeneratedFunctions) {
|
|
165
165
|
const projectId = typeof project === "string" ? project : project.id;
|
|
166
166
|
return this.request("transformFile", {
|
|
167
167
|
project: projectId,
|
|
168
|
-
fileName
|
|
168
|
+
fileName,
|
|
169
|
+
ignoreTypes,
|
|
170
|
+
maxGeneratedFunctions
|
|
169
171
|
});
|
|
170
172
|
}
|
|
171
173
|
async release(handle) {
|
|
@@ -178,12 +180,16 @@ var TypicalCompiler = class {
|
|
|
178
180
|
*
|
|
179
181
|
* @param fileName - Virtual filename for error messages (e.g., "test.ts")
|
|
180
182
|
* @param source - TypeScript source code
|
|
183
|
+
* @param ignoreTypes - Glob patterns for types to skip validation (e.g., ["FieldConfig", "React.*"])
|
|
184
|
+
* @param maxGeneratedFunctions - Max helper functions before error (0 = default 50)
|
|
181
185
|
* @returns Transformed code with validation
|
|
182
186
|
*/
|
|
183
|
-
async transformSource(fileName, source) {
|
|
187
|
+
async transformSource(fileName, source, ignoreTypes, maxGeneratedFunctions) {
|
|
184
188
|
return this.request("transformSource", {
|
|
185
189
|
fileName,
|
|
186
|
-
source
|
|
190
|
+
source,
|
|
191
|
+
ignoreTypes,
|
|
192
|
+
maxGeneratedFunctions
|
|
187
193
|
});
|
|
188
194
|
}
|
|
189
195
|
async request(method, payload) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliots/typical-tsc-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "TSC plugin for typical - runtime safe TypeScript transformer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"runtime",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@elliots/typical": "0.2.
|
|
45
|
+
"@elliots/typical": "0.2.1",
|
|
46
46
|
"deasync": "0.1.30",
|
|
47
47
|
"strip-json-comments": "5.0.3"
|
|
48
48
|
},
|