jiek 2.2.0 → 2.2.2
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/bin-helper.cjs +11 -4
- package/dist/cli-only-build.cjs +239 -127
- package/dist/cli-only-build.js +249 -137
- package/dist/rollup/index.cjs +22 -5
- package/dist/rollup/index.js +22 -5
- package/package.json +7 -3
- package/src/commands/build/analyzer.ts +122 -0
- package/src/commands/build/client/analyzer.tsx +121 -0
- package/src/commands/build/client/index.ts +28 -0
- package/src/commands/build.ts +25 -153
- package/src/commands/utils/optionParser.ts +4 -0
- package/src/rollup/index.ts +23 -4
- package/src/server.ts +9 -1
- package/src/utils/checkDependency.ts +22 -0
- package/src/utils/ts.ts +3 -3
package/src/utils/ts.ts
CHANGED
@@ -4,7 +4,7 @@ import { dirname, resolve } from 'node:path'
|
|
4
4
|
import { parse } from 'jsonc-parser'
|
5
5
|
import { isMatch } from 'micromatch'
|
6
6
|
|
7
|
-
|
7
|
+
interface TSConfig {
|
8
8
|
extends?: string | string[]
|
9
9
|
compilerOptions?: Record<string, unknown>
|
10
10
|
references?: { path: string }[]
|
@@ -16,7 +16,7 @@ type TSConfig = {
|
|
16
16
|
const getTSConfig = (p: string): TSConfig =>
|
17
17
|
!fs.existsSync(p) || !fs.statSync(p).isFile()
|
18
18
|
? {}
|
19
|
-
: parse(fs.readFileSync(p, 'utf-8'), [], { allowTrailingComma: true, allowEmptyContent: true })
|
19
|
+
: parse(fs.readFileSync(p, 'utf-8'), [], { allowTrailingComma: true, allowEmptyContent: true }) as TSConfig
|
20
20
|
|
21
21
|
const getExtendTSConfig = (tsconfigPath: string): TSConfig => {
|
22
22
|
tsconfigPath = resolve(tsconfigPath)
|
@@ -25,7 +25,7 @@ const getExtendTSConfig = (tsconfigPath: string): TSConfig => {
|
|
25
25
|
const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []
|
26
26
|
|
27
27
|
const extendsPaths = resolvePaths(
|
28
|
-
exts ? Array.isArray(exts) ? exts : [exts] : []
|
28
|
+
exts !== undefined ? Array.isArray(exts) ? exts : [exts] : []
|
29
29
|
)
|
30
30
|
if (extendsPaths.length === 0) return tsconfig
|
31
31
|
return extendsPaths
|