@kubb/core 1.1.11 → 1.1.13
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.cjs +25 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +25 -2
- package/dist/index.js.map +1 -0
- package/package.json +3 -4
- package/src/build.ts +0 -106
- package/src/config.ts +0 -15
- package/src/generators/Generator.ts +0 -23
- package/src/generators/SchemaGenerator.ts +0 -8
- package/src/generators/index.ts +0 -2
- package/src/index.ts +0 -12
- package/src/managers/fileManager/FileManager.ts +0 -127
- package/src/managers/fileManager/index.ts +0 -3
- package/src/managers/fileManager/types.ts +0 -40
- package/src/managers/fileManager/utils.ts +0 -167
- package/src/managers/index.ts +0 -2
- package/src/managers/pluginManager/ParallelPluginError.ts +0 -15
- package/src/managers/pluginManager/PluginError.ts +0 -11
- package/src/managers/pluginManager/PluginManager.ts +0 -474
- package/src/managers/pluginManager/index.ts +0 -5
- package/src/managers/pluginManager/types.ts +0 -29
- package/src/managers/pluginManager/validate.ts +0 -21
- package/src/plugin.ts +0 -111
- package/src/types.ts +0 -253
- package/src/utils/Queue.ts +0 -46
- package/src/utils/TreeNode.ts +0 -122
- package/src/utils/cache.ts +0 -33
- package/src/utils/clean.ts +0 -5
- package/src/utils/getEncodedText.ts +0 -3
- package/src/utils/getStackTrace.ts +0 -20
- package/src/utils/getUniqueName.ts +0 -9
- package/src/utils/index.ts +0 -19
- package/src/utils/isPromise.ts +0 -5
- package/src/utils/isURL.ts +0 -11
- package/src/utils/jsdoc.ts +0 -13
- package/src/utils/nameSorter.ts +0 -9
- package/src/utils/objectToParameters.ts +0 -28
- package/src/utils/read.ts +0 -45
- package/src/utils/renderTemplate.ts +0 -11
- package/src/utils/throttle.ts +0 -30
- package/src/utils/timeout.ts +0 -7
- package/src/utils/transformReservedWord.ts +0 -97
- package/src/utils/uniqueId.ts +0 -5
- package/src/utils/write.ts +0 -25
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @link https://github.com/jonschlinkert/reserved/blob/master/index.js
|
|
3
|
-
*/
|
|
4
|
-
const reservedWords = [
|
|
5
|
-
'abstract',
|
|
6
|
-
'arguments',
|
|
7
|
-
'boolean',
|
|
8
|
-
'break',
|
|
9
|
-
'byte',
|
|
10
|
-
'case',
|
|
11
|
-
'catch',
|
|
12
|
-
'char',
|
|
13
|
-
'class',
|
|
14
|
-
'const',
|
|
15
|
-
'continue',
|
|
16
|
-
'debugger',
|
|
17
|
-
'default',
|
|
18
|
-
'delete',
|
|
19
|
-
'do',
|
|
20
|
-
'double',
|
|
21
|
-
'else',
|
|
22
|
-
'enum',
|
|
23
|
-
'eval',
|
|
24
|
-
'export',
|
|
25
|
-
'extends',
|
|
26
|
-
'false',
|
|
27
|
-
'final',
|
|
28
|
-
'finally',
|
|
29
|
-
'float',
|
|
30
|
-
'for',
|
|
31
|
-
'function',
|
|
32
|
-
'goto',
|
|
33
|
-
'if',
|
|
34
|
-
'implements',
|
|
35
|
-
'import',
|
|
36
|
-
'in',
|
|
37
|
-
'instanceof',
|
|
38
|
-
'int',
|
|
39
|
-
'interface',
|
|
40
|
-
'let',
|
|
41
|
-
'long',
|
|
42
|
-
'native',
|
|
43
|
-
'new',
|
|
44
|
-
'null',
|
|
45
|
-
'package',
|
|
46
|
-
'private',
|
|
47
|
-
'protected',
|
|
48
|
-
'public',
|
|
49
|
-
'return',
|
|
50
|
-
'short',
|
|
51
|
-
'static',
|
|
52
|
-
'super',
|
|
53
|
-
'switch',
|
|
54
|
-
'synchronized',
|
|
55
|
-
'this',
|
|
56
|
-
'throw',
|
|
57
|
-
'throws',
|
|
58
|
-
'transient',
|
|
59
|
-
'true',
|
|
60
|
-
'try',
|
|
61
|
-
'typeof',
|
|
62
|
-
'var',
|
|
63
|
-
'void',
|
|
64
|
-
'volatile',
|
|
65
|
-
'while',
|
|
66
|
-
'with',
|
|
67
|
-
'yield',
|
|
68
|
-
|
|
69
|
-
'Array',
|
|
70
|
-
'Date',
|
|
71
|
-
'eval',
|
|
72
|
-
'function',
|
|
73
|
-
'hasOwnProperty',
|
|
74
|
-
'Infinity',
|
|
75
|
-
'isFinite',
|
|
76
|
-
'isNaN',
|
|
77
|
-
'isPrototypeOf',
|
|
78
|
-
'length',
|
|
79
|
-
'Math',
|
|
80
|
-
'name',
|
|
81
|
-
'NaN',
|
|
82
|
-
'Number',
|
|
83
|
-
'Object',
|
|
84
|
-
'prototype',
|
|
85
|
-
'String',
|
|
86
|
-
'toString',
|
|
87
|
-
'undefined',
|
|
88
|
-
'valueOf',
|
|
89
|
-
]
|
|
90
|
-
|
|
91
|
-
export function transformReservedWord(word?: string | null) {
|
|
92
|
-
if (word && reservedWords.includes(word)) {
|
|
93
|
-
return `_${word}`
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return word
|
|
97
|
-
}
|
package/src/utils/uniqueId.ts
DELETED
package/src/utils/write.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import fs from 'fs-extra'
|
|
2
|
-
import pathParser from 'node:path'
|
|
3
|
-
|
|
4
|
-
async function safeWriteFileToPath(path: string, data: string) {
|
|
5
|
-
// resolve the full path and get just the directory, ignoring the file and extension
|
|
6
|
-
const passedPath = pathParser.dirname(pathParser.resolve(path))
|
|
7
|
-
// make the directory, recursively. Theoretically, if every directory in the path exists, this won't do anything.
|
|
8
|
-
await fs.mkdir(passedPath, { recursive: true })
|
|
9
|
-
// write the file to the newly created directory
|
|
10
|
-
return fs.writeFile(pathParser.resolve(path), data, { encoding: 'utf-8' })
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export async function write(data: string, path: string) {
|
|
14
|
-
try {
|
|
15
|
-
await fs.stat(path)
|
|
16
|
-
const oldContent = await fs.readFile(path, { encoding: 'utf-8' })
|
|
17
|
-
if (oldContent?.toString() === data) {
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
} catch (_err) {
|
|
21
|
-
return safeWriteFileToPath(path, data)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return safeWriteFileToPath(path, data)
|
|
25
|
-
}
|