jiek 2.2.7-alpha.1 → 2.2.7-alpha.3
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/index.cjs +1 -1
- package/dist/.internal/{getWD-Cmxzjf-f.js → .chunks/getWD.D6wq8Qc2.js} +2 -2
- package/dist/.internal/{getWD-BRJ3PK1S.js → .chunks/getWD.ZF0avqDB.cjs} +2 -2
- package/dist/.internal/{+/commands → commands}/build/analyzer.cjs +2 -2
- package/dist/.internal/{+/commands → commands}/build/analyzer.js +2 -2
- package/dist/.internal/{+/commands → commands}/meta.cjs +2 -2
- package/dist/.internal/{+/commands → commands}/meta.js +2 -2
- package/dist/.internal/{+/utils → utils}/checkDependency.cjs +2 -2
- package/dist/.internal/{+/utils → utils}/checkDependency.js +2 -2
- package/dist/.internal/{+/utils → utils}/filterSupport.cjs +2 -2
- package/dist/.internal/{+/utils → utils}/filterSupport.js +2 -2
- package/dist/.internal/{+/utils → utils}/getWD.cjs +2 -2
- package/dist/.internal/{+/utils → utils}/getWD.js +2 -2
- package/dist/.internal/{+/utils → utils}/loadConfig.cjs +2 -2
- package/dist/.internal/{+/utils → utils}/loadConfig.js +2 -2
- package/dist/.internal/{+/utils → utils}/resolveExports.cjs +1 -1
- package/dist/.internal/{+/utils → utils}/resolveExports.js +1 -1
- package/dist/.internal/{+/utils → utils}/ts.cjs +1 -1
- package/dist/.internal/{+/utils → utils}/ts.js +1 -1
- package/dist/.internal/{+/utils → utils}/tsRegister.cjs +1 -1
- package/dist/.internal/{+/utils → utils}/tsRegister.js +1 -1
- package/dist/bin/build.cjs +27 -17
- package/dist/bin/index.cjs +51 -42
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/rollup/index.cjs +25 -31
- package/dist/rollup/index.js +25 -31
- package/package.json +12 -15
- package/src/commands/build.ts +9 -3
- package/src/commands/publish.ts +57 -39
- package/src/index.ts +6 -1
- package/src/rollup/index.ts +36 -33
- package/dist/.internal/package.json +0 -10
- /package/dist/.internal/{index-B6RQz1DZ.js → .chunks/index.B6RQz1DZ.js} +0 -0
- /package/dist/.internal/{index-DlHFuTjM.js → .chunks/index.DlHFuTjM.cjs} +0 -0
- /package/dist/.internal/{jiek_create-require-CWFWNQHj.js → .chunks/jiek_create-require.CWFWNQHj.cjs} +0 -0
- /package/dist/.internal/{jiek_create-require-CxSGbkTB.js → .chunks/jiek_create-require.CxSGbkTB.js} +0 -0
- /package/dist/.internal/{+/bin → bin}/parseArgv.cjs +0 -0
- /package/dist/.internal/{+/bin → bin}/parseArgv.d.cts +0 -0
- /package/dist/.internal/{+/bin → bin}/parseArgv.d.ts +0 -0
- /package/dist/.internal/{+/bin → bin}/parseArgv.js +0 -0
- /package/dist/.internal/{+/bridge.cjs → bridge.cjs} +0 -0
- /package/dist/.internal/{+/bridge.d.cts → bridge.d.cts} +0 -0
- /package/dist/.internal/{+/bridge.d.ts → bridge.d.ts} +0 -0
- /package/dist/.internal/{+/bridge.js → bridge.js} +0 -0
- /package/dist/.internal/{+/commands → commands}/build/analyzer.d.cts +0 -0
- /package/dist/.internal/{+/commands → commands}/build/analyzer.d.ts +0 -0
- /package/dist/.internal/{+/commands → commands}/descriptions.cjs +0 -0
- /package/dist/.internal/{+/commands → commands}/descriptions.d.cts +0 -0
- /package/dist/.internal/{+/commands → commands}/descriptions.d.ts +0 -0
- /package/dist/.internal/{+/commands → commands}/descriptions.js +0 -0
- /package/dist/.internal/{+/commands → commands}/meta.d.cts +0 -0
- /package/dist/.internal/{+/commands → commands}/meta.d.ts +0 -0
- /package/dist/.internal/{+/commands → commands}/utils/optionParser.cjs +0 -0
- /package/dist/.internal/{+/commands → commands}/utils/optionParser.d.cts +0 -0
- /package/dist/.internal/{+/commands → commands}/utils/optionParser.d.ts +0 -0
- /package/dist/.internal/{+/commands → commands}/utils/optionParser.js +0 -0
- /package/dist/.internal/{+/rollup → rollup}/base.cjs +0 -0
- /package/dist/.internal/{+/rollup → rollup}/base.d.cts +0 -0
- /package/dist/.internal/{+/rollup → rollup}/base.d.ts +0 -0
- /package/dist/.internal/{+/rollup → rollup}/base.js +0 -0
- /package/dist/.internal/{+/rollup → rollup}/bundle-analyzer.cjs +0 -0
- /package/dist/.internal/{+/rollup → rollup}/bundle-analyzer.d.cts +0 -0
- /package/dist/.internal/{+/rollup → rollup}/bundle-analyzer.d.ts +0 -0
- /package/dist/.internal/{+/rollup → rollup}/bundle-analyzer.js +0 -0
- /package/dist/.internal/{+/server.cjs → server.cjs} +0 -0
- /package/dist/.internal/{+/server.d.cts → server.d.cts} +0 -0
- /package/dist/.internal/{+/server.d.ts → server.d.ts} +0 -0
- /package/dist/.internal/{+/server.js → server.js} +0 -0
- /package/dist/.internal/{+/utils → utils}/checkDependency.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/checkDependency.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/filterSupport.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/filterSupport.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/getInternalModuleName.cjs +0 -0
- /package/dist/.internal/{+/utils → utils}/getInternalModuleName.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/getInternalModuleName.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/getInternalModuleName.js +0 -0
- /package/dist/.internal/{+/utils → utils}/getRoot.cjs +0 -0
- /package/dist/.internal/{+/utils → utils}/getRoot.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/getRoot.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/getRoot.js +0 -0
- /package/dist/.internal/{+/utils → utils}/getWD.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/getWD.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/intersection.cjs +0 -0
- /package/dist/.internal/{+/utils → utils}/intersection.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/intersection.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/intersection.js +0 -0
- /package/dist/.internal/{+/utils → utils}/loadConfig.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/loadConfig.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/recursiveListFiles.cjs +0 -0
- /package/dist/.internal/{+/utils → utils}/recursiveListFiles.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/recursiveListFiles.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/recursiveListFiles.js +0 -0
- /package/dist/.internal/{+/utils → utils}/resolveExports.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/resolveExports.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/ts.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/ts.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/tsRegister.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/tsRegister.d.ts +0 -0
package/src/rollup/index.ts
CHANGED
@@ -105,7 +105,7 @@ const MINIFY_OPTIONS = {
|
|
105
105
|
const config = loadConfig({
|
106
106
|
root: WORKSPACE_ROOT
|
107
107
|
}) ?? {}
|
108
|
-
const { build = {} } = config
|
108
|
+
const { experimental, build = {} } = config
|
109
109
|
const { js: jsOutdir, dts: dtsOutdir } = getOutDirs({
|
110
110
|
config,
|
111
111
|
pkgName: JIEK_NAME
|
@@ -120,7 +120,7 @@ const STYLE_REGEXP = /\.(css|s[ac]ss|less|styl)$/
|
|
120
120
|
|
121
121
|
const CWD_FILES = recursiveListFiles(process.cwd())
|
122
122
|
.filter(p => /(?<!\.d)\.[cm]?tsx?$/.test(p))
|
123
|
-
.map(p => relative(process.cwd(), p))
|
123
|
+
.map(p => `./${relative(process.cwd(), p)}`)
|
124
124
|
|
125
125
|
const resolveBuildPlugins = (context: ConfigGenerateContext, plugins: TemplateOptions['plugins']): {
|
126
126
|
js: InputPluginOption
|
@@ -253,6 +253,12 @@ const withMinify = (
|
|
253
253
|
: (() => {
|
254
254
|
throw new Error('entryFileNames must be a function')
|
255
255
|
})(),
|
256
|
+
chunkFileNames: chunkInfo =>
|
257
|
+
typeof output.chunkFileNames === 'function'
|
258
|
+
? output.chunkFileNames(chunkInfo).replace(/(\.[cm]?js)$/, '.min$1')
|
259
|
+
: (() => {
|
260
|
+
throw new Error('chunkFileNames must be a function')
|
261
|
+
})(),
|
256
262
|
file: output.file?.replace(/(\.[cm]?js)$/, '.min$1'),
|
257
263
|
plugins: [
|
258
264
|
...notOnlyOncePlugins,
|
@@ -380,7 +386,7 @@ const generateConfigs = (
|
|
380
386
|
'input should not include "**", please read the [documentation](https://nodejs.org/api/packages.html#subpath-patterns).'
|
381
387
|
)
|
382
388
|
}
|
383
|
-
const reg = new RegExp(
|
389
|
+
const reg = new RegExp(`^\./${
|
384
390
|
input
|
385
391
|
.slice(2)
|
386
392
|
.replace(/\./g, '\\.')
|
@@ -390,14 +396,14 @@ const generateConfigs = (
|
|
390
396
|
? input
|
391
397
|
: CWD_FILES.filter(p => reg.test(p))
|
392
398
|
const globCommonDir = input.includes('*')
|
393
|
-
? input.split('*')[0]
|
399
|
+
? input.split('*')[0]
|
394
400
|
: ''
|
395
|
-
const
|
396
|
-
?
|
401
|
+
const outputCommonDir = output.includes('*')
|
402
|
+
? output.split('*')[0]
|
397
403
|
: ''
|
398
404
|
if (
|
399
|
-
(globCommonDir.length > 0 &&
|
400
|
-
|| (globCommonDir.length === 0 &&
|
405
|
+
(globCommonDir.length > 0 && outputCommonDir.length === 0)
|
406
|
+
|| (globCommonDir.length === 0 && outputCommonDir.length > 0)
|
401
407
|
) {
|
402
408
|
throw new Error('input and path should both include "*" or not include "*"')
|
403
409
|
}
|
@@ -429,11 +435,13 @@ const generateConfigs = (
|
|
429
435
|
if (!resolved || !('id' in resolved)) {
|
430
436
|
throw new Error('nodeResolvePluginInstance.resolveId.handler did not return a resolved object')
|
431
437
|
}
|
432
|
-
internalModuleCollect?.(relative(process.cwd(), resolved.id))
|
438
|
+
internalModuleCollect?.(`./${relative(process.cwd(), resolved.id)}`)
|
433
439
|
return {
|
434
|
-
id:
|
435
|
-
|
436
|
-
|
440
|
+
id: experimental?.importsDowngrade
|
441
|
+
? source
|
442
|
+
.replaceAll('#', `${INTERNAL_MODULE_NAME}/`)
|
443
|
+
.replaceAll('~', '+')
|
444
|
+
: source,
|
437
445
|
external: true
|
438
446
|
}
|
439
447
|
}
|
@@ -526,10 +534,15 @@ const generateConfigs = (
|
|
526
534
|
entryFileNames: (chunkInfo) => {
|
527
535
|
return Array.isArray(inputObj)
|
528
536
|
? chunkInfo.facadeModuleId!
|
529
|
-
.replace(`${process.cwd()}/`, '')
|
530
|
-
.replace(globCommonDir,
|
537
|
+
.replace(`${process.cwd()}/`, './')
|
538
|
+
.replace(globCommonDir, outputCommonDir)
|
531
539
|
.replace(/(\.[cm]?)ts$/, jsOutputSuffix)
|
532
|
-
|
540
|
+
.replace(`${jsOutdir}/`, '')
|
541
|
+
: output
|
542
|
+
.replace(`${jsOutdir}/`, '')
|
543
|
+
},
|
544
|
+
chunkFileNames: (chunkInfo) => {
|
545
|
+
return `.internal/.chunks/${chunkInfo.name}.[hash]${jsOutputSuffix}`
|
533
546
|
},
|
534
547
|
sourcemap,
|
535
548
|
format,
|
@@ -589,12 +602,14 @@ const generateConfigs = (
|
|
589
602
|
sourcemap,
|
590
603
|
entryFileNames: (chunkInfo) => (
|
591
604
|
Array.isArray(inputObj)
|
592
|
-
? chunkInfo.facadeModuleId
|
593
|
-
.replace(
|
605
|
+
? chunkInfo.facadeModuleId!
|
606
|
+
.replace(`${process.cwd()}/`, './')
|
607
|
+
.replace(globCommonDir, outputCommonDir)
|
594
608
|
.replace(/(\.[cm]?)ts$/, tsOutputSuffix)
|
595
|
-
: output
|
596
609
|
.replace(`${jsOutdir}/`, '')
|
610
|
+
: output
|
597
611
|
.replace(/(\.[cm]?)js$/, tsOutputSuffix)
|
612
|
+
.replace(`${jsOutdir}/`, '')
|
598
613
|
),
|
599
614
|
strict: typeof buildOptions?.output?.strict === 'object'
|
600
615
|
? buildOptions.output.strict.dts
|
@@ -772,24 +787,12 @@ export function template(packageJSON: PackageJSON): RollupOptions[] {
|
|
772
787
|
async options(inputOptions) {
|
773
788
|
await collected.promise
|
774
789
|
inputOptions.input = [...intersection(
|
775
|
-
inputOptions.input
|
790
|
+
Array.isArray(inputOptions.input)
|
791
|
+
? inputOptions.input
|
792
|
+
: [inputOptions.input as string],
|
776
793
|
internalModules
|
777
794
|
)]
|
778
795
|
return inputOptions
|
779
|
-
},
|
780
|
-
outputOptions(outputOptions) {
|
781
|
-
outputOptions.dir = `${outputOptions.dir}/.internal`
|
782
|
-
const oldEntryFileNames = outputOptions.entryFileNames
|
783
|
-
outputOptions.entryFileNames = (chunkInfo) => {
|
784
|
-
if (typeof oldEntryFileNames !== 'function') {
|
785
|
-
throw new TypeError('entryFileNames must be a function')
|
786
|
-
}
|
787
|
-
const oldFileName = oldEntryFileNames(chunkInfo)
|
788
|
-
return oldFileName
|
789
|
-
.replaceAll('#', '')
|
790
|
-
.replaceAll('~', '+')
|
791
|
-
}
|
792
|
-
return outputOptions
|
793
796
|
}
|
794
797
|
}
|
795
798
|
],
|
File without changes
|
File without changes
|
/package/dist/.internal/{jiek_create-require-CWFWNQHj.js → .chunks/jiek_create-require.CWFWNQHj.cjs}
RENAMED
File without changes
|
/package/dist/.internal/{jiek_create-require-CxSGbkTB.js → .chunks/jiek_create-require.CxSGbkTB.js}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|