jiek 2.3.2 → 2.3.4
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/.internal/.chunks/{filterSupport.4rM7f6jB.cjs → getWD.Bdo2NGCR.cjs} +30 -30
- package/dist/.internal/.chunks/{filterSupport.BXWpLBpT.js → getWD.DGvwAHMY.js} +29 -29
- package/dist/.internal/.chunks/{loadConfig.OOKddvHF.cjs → loadConfig.8xhNFEJe.cjs} +30 -12
- package/dist/.internal/.chunks/{loadConfig.CFfzkm_p.js → loadConfig.BjzxLOdC.js} +26 -9
- package/dist/.internal/bin/common.cjs +92 -97
- package/dist/.internal/bin/common.d.cts +2 -0
- package/dist/.internal/bin/common.d.ts +2 -0
- package/dist/.internal/bin/common.js +93 -98
- package/dist/.internal/bin/parseArgv.cjs +2 -2
- package/dist/.internal/bin/parseArgv.js +2 -2
- package/dist/.internal/commands/utils/createAreaManagement.cjs +108 -0
- package/dist/.internal/commands/utils/createAreaManagement.d.cts +18 -0
- package/dist/.internal/commands/utils/createAreaManagement.d.ts +18 -0
- package/dist/.internal/commands/utils/createAreaManagement.js +106 -0
- package/dist/.internal/polyfill.cjs +13 -0
- package/dist/.internal/polyfill.d.cts +1 -0
- package/dist/.internal/polyfill.d.ts +1 -0
- package/dist/.internal/polyfill.js +11 -0
- package/dist/.internal/rollup/base.d.cts +27 -4
- package/dist/.internal/rollup/base.d.ts +27 -4
- package/dist/.internal/utils/filterSupport.cjs +1 -1
- package/dist/.internal/utils/filterSupport.js +2 -2
- package/dist/.internal/utils/loadConfig.cjs +3 -3
- package/dist/.internal/utils/loadConfig.d.cts +1 -0
- package/dist/.internal/utils/loadConfig.d.ts +1 -0
- package/dist/.internal/utils/loadConfig.js +4 -4
- package/dist/.internal/utils/pascalCase.cjs +5 -0
- package/dist/.internal/utils/pascalCase.d.cts +3 -0
- package/dist/.internal/utils/pascalCase.d.ts +3 -0
- package/dist/.internal/utils/pascalCase.js +3 -0
- package/dist/.internal/utils/reveal.cjs +9 -0
- package/dist/.internal/utils/reveal.d.cts +3 -0
- package/dist/.internal/utils/reveal.d.ts +3 -0
- package/dist/.internal/utils/reveal.js +7 -0
- package/dist/bin/index.cjs +101 -43
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/rollup/index.cjs +91 -31
- package/dist/rollup/index.js +90 -30
- package/package.json +6 -2
- package/src/bin/build.cts +0 -5
- package/src/bin/common.ts +0 -3
- package/src/bin/index.cts +0 -7
- package/src/bin/parseArgv.ts +0 -26
- package/src/bridge.ts +0 -46
- package/src/commands/base.ts +0 -18
- package/src/commands/build/analyzer.ts +0 -122
- package/src/commands/build/client/analyzer.tsx +0 -121
- package/src/commands/build/client/index.ts +0 -26
- package/src/commands/build.ts +0 -544
- package/src/commands/descriptions.ts +0 -17
- package/src/commands/meta.ts +0 -5
- package/src/commands/publish.ts +0 -628
- package/src/commands/utils/optionParser.ts +0 -4
- package/src/index.ts +0 -12
- package/src/inner.ts +0 -11
- package/src/rollup/base.ts +0 -151
- package/src/rollup/bundle-analyzer.ts +0 -62
- package/src/rollup/index.ts +0 -892
- package/src/rollup/plugins/create-require.ts +0 -23
- package/src/rollup/plugins/progress.ts +0 -26
- package/src/rollup/plugins/replace.ts +0 -96
- package/src/rollup/plugins/skip.ts +0 -21
- package/src/rollup/plugins/with-external.ts +0 -23
- package/src/rollup/utils/commonOptions.ts +0 -9
- package/src/rollup/utils/externalResolver.ts +0 -47
- package/src/rollup/utils/globalResolver.ts +0 -13
- package/src/rollup/utils/withMinify.ts +0 -18
- package/src/rollup-plugin-utils.ts +0 -32
- package/src/server.ts +0 -30
- package/src/utils/checkDependency.ts +0 -26
- package/src/utils/filterSupport.ts +0 -90
- package/src/utils/getInternalModuleName.ts +0 -5
- package/src/utils/getRoot.ts +0 -14
- package/src/utils/getWD.ts +0 -31
- package/src/utils/intersection.ts +0 -1
- package/src/utils/loadConfig.ts +0 -108
- package/src/utils/recursiveListFiles.ts +0 -13
- package/src/utils/resolveExports.ts +0 -165
- package/src/utils/ts.ts +0 -94
- package/src/utils/tsRegister.ts +0 -22
package/src/rollup/base.ts
DELETED
@@ -1,151 +0,0 @@
|
|
1
|
-
import type { InputPluginOption, OutputOptions } from 'rollup'
|
2
|
-
import { Replacements } from './plugins/replace'
|
3
|
-
|
4
|
-
export type Mapping2ROO<K extends keyof OutputOptions> = OutputOptions[K] | {
|
5
|
-
js?: OutputOptions[K]
|
6
|
-
dts?: OutputOptions[K]
|
7
|
-
}
|
8
|
-
|
9
|
-
export interface ConfigGenerateContext {
|
10
|
-
path: string
|
11
|
-
name: string
|
12
|
-
input: string
|
13
|
-
output: string
|
14
|
-
external: (string | RegExp)[]
|
15
|
-
pkgIsModule: boolean
|
16
|
-
conditionals: string[]
|
17
|
-
}
|
18
|
-
|
19
|
-
export type OutputControl = boolean | ((context: ConfigGenerateContext) => boolean)
|
20
|
-
|
21
|
-
export const BUILDER_TYPES = ['esbuild', 'swc'] as const
|
22
|
-
|
23
|
-
export const BUILDER_TYPE_PACKAGE_NAME_MAP = {
|
24
|
-
esbuild: 'rollup-plugin-esbuild',
|
25
|
-
swc: 'rollup-plugin-swc3'
|
26
|
-
}
|
27
|
-
|
28
|
-
export interface TemplateOptions {
|
29
|
-
/**
|
30
|
-
* When the user configures type: module, the generated output from entry points that don't
|
31
|
-
* have cts as a suffix will automatically include the CJS version.
|
32
|
-
* if it is not configured, and the generated output from entry points that do not have mts
|
33
|
-
* as a suffix will automatically include the ESM version.
|
34
|
-
*
|
35
|
-
* @default true
|
36
|
-
*/
|
37
|
-
crossModuleConvertor?: boolean
|
38
|
-
/**
|
39
|
-
* Auto-detect the builder from the installed dependencies.
|
40
|
-
* If the builder is not installed, it will prompt the user to install it.
|
41
|
-
* If exists multiple builders, it will fall back to the 'esbuild'.
|
42
|
-
*
|
43
|
-
* @default 'esbuild'
|
44
|
-
*/
|
45
|
-
builder?:
|
46
|
-
| typeof BUILDER_TYPES[number]
|
47
|
-
| ({
|
48
|
-
type: 'esbuild'
|
49
|
-
} & import('rollup-plugin-esbuild').Options)
|
50
|
-
| ({
|
51
|
-
type: 'swc'
|
52
|
-
} & import('rollup-plugin-swc3').PluginOptions)
|
53
|
-
features?: {
|
54
|
-
/**
|
55
|
-
* When use esbuild type builder, it will inject `supported.import-attributes` option.
|
56
|
-
* When use swc type builder, it will inject `jsc.experimental.keepImportAttributes` option.
|
57
|
-
*
|
58
|
-
* And it will auto set the rollup output `externalImportAttributes` and `importAttributesKey` options.
|
59
|
-
*
|
60
|
-
* @default false
|
61
|
-
*/
|
62
|
-
keepImportAttributes?: boolean | 'assert'
|
63
|
-
}
|
64
|
-
output?: {
|
65
|
-
/**
|
66
|
-
* @default true
|
67
|
-
*
|
68
|
-
* When minify is set to true, the output will with minified files.
|
69
|
-
* When minify is set to 'only-minify', the output will direct output minified files.
|
70
|
-
*/
|
71
|
-
minify?: boolean | 'only-minify'
|
72
|
-
minifyOptions?:
|
73
|
-
| typeof BUILDER_TYPES[number]
|
74
|
-
| 'terser'
|
75
|
-
| (
|
76
|
-
{
|
77
|
-
type: 'terser'
|
78
|
-
} & import('@rollup/plugin-terser').Options
|
79
|
-
)
|
80
|
-
| (
|
81
|
-
{
|
82
|
-
type: 'esbuild'
|
83
|
-
} & Parameters<typeof import('rollup-plugin-esbuild').minify>[0]
|
84
|
-
)
|
85
|
-
| (
|
86
|
-
{
|
87
|
-
type: 'swc'
|
88
|
-
} & Parameters<typeof import('rollup-plugin-swc3').minify>[0]
|
89
|
-
)
|
90
|
-
/**
|
91
|
-
* @default 'dist'
|
92
|
-
*/
|
93
|
-
dir?: Mapping2ROO<'dir'>
|
94
|
-
sourcemap?: Mapping2ROO<'sourcemap'>
|
95
|
-
strict?: Mapping2ROO<'strict'>
|
96
|
-
js?: OutputControl
|
97
|
-
dts?: OutputControl
|
98
|
-
}
|
99
|
-
/**
|
100
|
-
* Set the external dependencies of the package.
|
101
|
-
*/
|
102
|
-
external?: (string | RegExp)[]
|
103
|
-
plugins?:
|
104
|
-
| InputPluginOption
|
105
|
-
| ((type: 'js' | 'dts', context: ConfigGenerateContext) => InputPluginOption)
|
106
|
-
| {
|
107
|
-
js: InputPluginOption
|
108
|
-
dts?: InputPluginOption
|
109
|
-
}
|
110
|
-
| {
|
111
|
-
js?: InputPluginOption
|
112
|
-
dts: InputPluginOption
|
113
|
-
}
|
114
|
-
/**
|
115
|
-
* https://www.npmjs.com/package/@rollup/plugin-inject#usage
|
116
|
-
*
|
117
|
-
* @example
|
118
|
-
* ```js
|
119
|
-
* {
|
120
|
-
* // import { Promise } from 'es6-promise'
|
121
|
-
* Promise: [ 'es6-promise', 'Promise' ],
|
122
|
-
*
|
123
|
-
* // import { Promise as P } from 'es6-promise'
|
124
|
-
* P: [ 'es6-promise', 'Promise' ],
|
125
|
-
*
|
126
|
-
* // import $ from 'jquery'
|
127
|
-
* $: 'jquery',
|
128
|
-
*
|
129
|
-
* // import * as fs from 'fs'
|
130
|
-
* fs: [ 'fs', '*' ],
|
131
|
-
*
|
132
|
-
* // use a local module instead of a third-party one
|
133
|
-
* 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ),
|
134
|
-
* }
|
135
|
-
* ```
|
136
|
-
*/
|
137
|
-
injects?: Record<string, string | [string, string]>
|
138
|
-
/**
|
139
|
-
* Replace the specified content in the code.
|
140
|
-
*
|
141
|
-
* @example
|
142
|
-
* ```js
|
143
|
-
* {
|
144
|
-
* 'process.env.DEBUG': 'false',
|
145
|
-
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
146
|
-
* 'process.env.BUILD_PATH': ctx => JSON.stringify(ctx.id)
|
147
|
-
* }
|
148
|
-
* ```
|
149
|
-
*/
|
150
|
-
replacements?: Replacements
|
151
|
-
}
|
@@ -1,62 +0,0 @@
|
|
1
|
-
import process from 'node:process'
|
2
|
-
|
3
|
-
import type { InputPluginOption, OutputPlugin, Plugin } from 'rollup'
|
4
|
-
import type { AnalyzerPluginInternalAPI } from 'vite-bundle-analyzer'
|
5
|
-
|
6
|
-
export type Module = ReturnType<AnalyzerPluginInternalAPI['processModule']>[number]
|
7
|
-
|
8
|
-
const {
|
9
|
-
JIEK_ANALYZER
|
10
|
-
} = process.env
|
11
|
-
|
12
|
-
const ANALYZER = (JIEK_ANALYZER != null) && JSON.parse(JIEK_ANALYZER) as {
|
13
|
-
dir?: string
|
14
|
-
mode?: string
|
15
|
-
size?: string
|
16
|
-
port?: number
|
17
|
-
open?: boolean
|
18
|
-
}
|
19
|
-
|
20
|
-
export function bundleAnalyzer(modulesResolved: (modules: Module[]) => void) {
|
21
|
-
// eslint-disable-next-line ts/strict-boolean-expressions
|
22
|
-
if (!ANALYZER) {
|
23
|
-
return []
|
24
|
-
}
|
25
|
-
|
26
|
-
const defaultSizes = ({
|
27
|
-
parsed: 'parsed',
|
28
|
-
stat: 'stat',
|
29
|
-
gzip: 'gzip'
|
30
|
-
} as const)[ANALYZER.size ?? 'stat'] ?? 'parsed'
|
31
|
-
|
32
|
-
let module: typeof import('vite-bundle-analyzer') | undefined
|
33
|
-
let ana: Plugin | undefined
|
34
|
-
async function initAna() {
|
35
|
-
const { adapter, analyzer } = module ?? await import('vite-bundle-analyzer')
|
36
|
-
ana = ana ?? adapter(analyzer({
|
37
|
-
defaultSizes,
|
38
|
-
analyzerMode: modulesResolved
|
39
|
-
}))
|
40
|
-
}
|
41
|
-
|
42
|
-
return [
|
43
|
-
(async () => {
|
44
|
-
await initAna()
|
45
|
-
return {
|
46
|
-
name: 'jiek:bundle-analyzer',
|
47
|
-
async closeBundle(...args) {
|
48
|
-
if (typeof ana!.closeBundle !== 'function') return
|
49
|
-
|
50
|
-
return ana!.closeBundle?.call(this, ...args)
|
51
|
-
}
|
52
|
-
} satisfies InputPluginOption
|
53
|
-
})(),
|
54
|
-
(async () => {
|
55
|
-
await initAna()
|
56
|
-
return {
|
57
|
-
...ana,
|
58
|
-
name: 'jiek:bundle-analyzer-output'
|
59
|
-
} satisfies OutputPlugin
|
60
|
-
})()
|
61
|
-
] as const
|
62
|
-
}
|