@webergency-utils/typechecker 0.1.1 → 0.1.3
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/engine/generators.d.ts +1 -1
- package/dist/engine/generators.js +1 -1
- package/dist/engine/hoister.d.ts +1 -1
- package/dist/engine/hoister.js +1 -1
- package/dist/engine/resolver.d.ts +1 -1
- package/dist/engine/resolver.js +1 -1
- package/dist/transformer.d.ts +1 -1
- package/dist/transformer.js +1 -1
- package/dist/ts.d.ts +3 -0
- package/dist/ts.js +13 -0
- package/package.json +4 -3
package/dist/engine/hoister.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ts from '
|
|
1
|
+
import ts from '../ts.js';
|
|
2
2
|
export declare function hoistRegistrations(sourceFile: ts.SourceFile, cache: Map<string, ts.Expression>, requiredUtils: Set<string>, schemasMap?: Map<string, ts.Expression>): ts.SourceFile;
|
package/dist/engine/hoister.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from '
|
|
1
|
+
import ts from '../ts.js';
|
|
2
2
|
export declare function buildValidator(type: ts.Type, checker: ts.TypeChecker, validatorsMap: Map<string, ts.Expression>, requiredUtils: Set<string>): ts.Expression;
|
|
3
3
|
export declare function generateHash(type: ts.Type, checker: ts.TypeChecker): string;
|
|
4
4
|
export declare function objectToAst(val: any): ts.Expression;
|
package/dist/engine/resolver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from '
|
|
1
|
+
import ts from '../ts.js';
|
|
2
2
|
import { createPrimitiveCheck, createLiteralCheck, createArrayCheck, createUnionCheck, createObjectCheck, createDateCheck, createNullCheck, createUndefinedCheck, createIntersectionCheck, createTupleCheck, createRecordCheck, createRegExpCheck, createTemplateLiteralCheck, createConstrainedPrimitiveCheck, createSetCheck, createMapCheck } from './generators.js';
|
|
3
3
|
import { createHash } from 'crypto';
|
|
4
4
|
function getStringLiteralValue(type) {
|
package/dist/transformer.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ts from '
|
|
1
|
+
import ts from './ts.js';
|
|
2
2
|
export { buildValidator, generateHash, buildJsonSchema } from './engine/resolver.js';
|
|
3
3
|
export default function transformer(program: ts.Program): (context: ts.TransformationContext) => (sourceFile: ts.SourceFile) => ts.SourceFile;
|
package/dist/transformer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from '
|
|
1
|
+
import ts from './ts.js';
|
|
2
2
|
import { buildValidator, generateHash, buildJsonSchema, objectToAst } from './engine/resolver.js';
|
|
3
3
|
export { buildValidator, generateHash, buildJsonSchema } from './engine/resolver.js';
|
|
4
4
|
import { hoistRegistrations } from './engine/hoister.js';
|
package/dist/ts.d.ts
ADDED
package/dist/ts.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as tsModule from 'typescript';
|
|
2
|
+
let tsInstance = tsModule;
|
|
3
|
+
if (!tsInstance.createProgram) {
|
|
4
|
+
try {
|
|
5
|
+
const ts6 = await import('@typescript/typescript6');
|
|
6
|
+
tsInstance = ts6.default || ts6;
|
|
7
|
+
}
|
|
8
|
+
catch (e) {
|
|
9
|
+
// Ignore
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const ts = tsInstance;
|
|
13
|
+
export default ts;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webergency-utils/typechecker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript compiler plugin for runtime validation",
|
|
6
6
|
"author": "radixxko",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"lint": "eslint .",
|
|
34
34
|
"clean": "rm -rf ./dist/* node_modules package-lock.json && npm i",
|
|
35
35
|
"commit": "node -e \"const version = require('./package.json').version.trim(); require('child_process').execSync('git add . && git commit -m \\\"Version ' + version + '\\\"');\"",
|
|
36
|
-
"build": "npm run clean && tsc",
|
|
36
|
+
"build": "npm run clean && tsc && node update_imports.js",
|
|
37
37
|
"test": "vitest run",
|
|
38
38
|
"test:coverage": "vitest run --coverage",
|
|
39
39
|
"version": "npm run build && npm publish --access public && npm run commit && git push"
|
|
@@ -53,9 +53,10 @@
|
|
|
53
53
|
"@eslint/js": "^10.0.1",
|
|
54
54
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
55
55
|
"@types/node": "^24.10.1",
|
|
56
|
+
"@typescript/typescript6": "^6.0.2",
|
|
56
57
|
"@vitest/coverage-v8": "^4.1.6",
|
|
57
58
|
"eslint": "^10.4.1",
|
|
58
|
-
"typescript": "^6.0.3",
|
|
59
|
+
"typescript": "^6.0.3 || ^7.0.0",
|
|
59
60
|
"typescript-eslint": "^8.60.0",
|
|
60
61
|
"vitest": "^4.1.6"
|
|
61
62
|
}
|