Skip to content

Commit 64aa5d0

Browse files
committed
🩹 Add dontTransform list to type_config.json
A list of files to keep, but not transform.
1 parent 0efdacb commit 64aa5d0

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎scripts/generate_types.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,18 @@ function isExcluded(path: string) {
119119
return config.exclude.some(excluded => normalizePath(base).endsWith(excluded))
120120
}
121121

122+
function dontTransform(path: string) {
123+
const base = path.replace(/(.d)?.ts$/, '')
124+
return config.dontTransform.some(excluded => normalizePath(base).endsWith(excluded))
125+
}
126+
122127
async function processFile(path: string) {
123128
if (isExcluded(path)) {
124129
await unlink(path)
125130
deletedFileCount++
126131
return
127132
}
133+
if (dontTransform(path)) return
128134

129135
const fileContent = await readFile(path, { encoding: 'utf-8' })
130136
const processedContent = transformFileContents(fileContent, path)

‎types/type_config.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,8 @@
4343
"lib/lzutf8",
4444
"lib/VuePrismEditor",
4545
"lib/VuePrismEditor.min"
46+
],
47+
"dontTransform": [
48+
"io/model_loader"
4649
]
4750
}

0 commit comments

Comments
 (0)