-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix ts schema generation import issue
Changing tsconfig resolution caused generation to generate new (bad?) import lines. Replacing with regex from YousefED/typescript-json-schema#582 returned ref/definitions to normal
- Loading branch information
Showing
6 changed files
with
2,164 additions
and
2,138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/node_modules/typescript-json-schema/dist/typescript-json-schema.js b/node_modules/typescript-json-schema/dist/typescript-json-schema.js | ||
index 23cc6d1..221adc2 100644 | ||
--- a/node_modules/typescript-json-schema/dist/typescript-json-schema.js | ||
+++ b/node_modules/typescript-json-schema/dist/typescript-json-schema.js | ||
@@ -55,7 +55,7 @@ var crypto_1 = require("crypto"); | ||
var ts = require("typescript"); | ||
var path_equal_1 = require("path-equal"); | ||
var vm = require("vm"); | ||
-var REGEX_FILE_NAME_OR_SPACE = /(\bimport\(".*?"\)|".*?")\.| /g; | ||
+var REGEX_FILE_NAME_OR_SPACE = /(\bimport\(".*?"(, \{ assert: \{ "resolution-mode": "(import|require)" \} \})?\)|".*?")\.| /g;// /(\bimport\(".*?"\)|".*?")\.| /g; | ||
var REGEX_TSCONFIG_NAME = /^.*\.json$/; | ||
var REGEX_TJS_JSDOC = /^-([\w]+)\s+(\S|\S[\s\S]*\S)\s*$/g; | ||
var REGEX_GROUP_JSDOC = /^[.]?([\w]+)\s+(\S|\S[\s\S]*\S)\s*$/g; | ||
diff --git a/node_modules/typescript-json-schema/typescript-json-schema.ts b/node_modules/typescript-json-schema/typescript-json-schema.ts | ||
index 5908567..c188383 100644 | ||
--- a/node_modules/typescript-json-schema/typescript-json-schema.ts | ||
+++ b/node_modules/typescript-json-schema/typescript-json-schema.ts | ||
@@ -9,7 +9,7 @@ export { Program, CompilerOptions, Symbol } from "typescript"; | ||
|
||
const vm = require("vm"); | ||
|
||
-const REGEX_FILE_NAME_OR_SPACE = /(\bimport\(".*?"\)|".*?")\.| /g; | ||
+const REGEX_FILE_NAME_OR_SPACE = /(\bimport\(".*?"(, \{ assert: \{ "resolution-mode": "(import|require)" \} \})?\)|".*?")\.| /g;// /(\bimport\(".*?"\)|".*?")\.| /g; | ||
const REGEX_TSCONFIG_NAME = /^.*\.json$/; | ||
const REGEX_TJS_JSDOC = /^-([\w]+)\s+(\S|\S[\s\S]*\S)\s*$/g; | ||
const REGEX_GROUP_JSDOC = /^[.]?([\w]+)\s+(\S|\S[\s\S]*\S)\s*$/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.