jiek 2.1.11 → 2.1.13-alpha.1
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 +36 -0
- package/bin-helper.js +3 -0
- package/dist/cli-only-build.cjs +345 -149
- package/dist/cli-only-build.js +340 -146
- package/dist/cli.cjs +70 -26
- package/dist/cli.js +66 -23
- package/dist/rollup/index.cjs +147 -55
- package/dist/rollup/index.js +146 -57
- package/package.json +57 -53
- package/src/bin/build.ts +0 -0
- package/src/bridge.ts +46 -0
- package/src/cli-only-build.ts +5 -3
- package/src/cli.ts +2 -2
- package/src/commands/base.ts +1 -0
- package/src/commands/build.ts +286 -102
- package/src/commands/publish.ts +50 -18
- package/src/parseArgv.ts +26 -0
- package/src/rollup/base.ts +0 -35
- package/src/rollup/bundle-analyzer.ts +62 -0
- package/src/rollup/index.ts +70 -55
- package/src/rollup/plugins/create-require.ts +74 -0
- package/src/server.ts +22 -0
- package/rollup/package.json +0 -1
package/bin-helper.cjs
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
const process = require('node:process')
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @type {string | undefined}
|
5
|
+
*/
|
6
|
+
let binFilePath
|
7
|
+
|
8
|
+
try {
|
9
|
+
// eslint-disable-next-line unicorn/error-message
|
10
|
+
throw new Error()
|
11
|
+
} catch (e) {
|
12
|
+
const { stack } = e
|
13
|
+
const lines = stack.split('\n')
|
14
|
+
const caller = lines[lines.length - 1]
|
15
|
+
const match = caller.match(/\(([^)]+)\)$/)
|
16
|
+
if (match) {
|
17
|
+
binFilePath = match[1].replace(/:\d+:\d+$/, '')
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
binFilePath = binFilePath ?? process.env.JIEK_BIN__FILEPATH
|
22
|
+
|
23
|
+
const {
|
24
|
+
basename,
|
25
|
+
dirname
|
26
|
+
} = require('node:path')
|
27
|
+
|
28
|
+
const packageDir = dirname(dirname(binFilePath))
|
29
|
+
const binFilename = basename(binFilePath).replace(/(\.[cm]?)js$/, '$1ts')
|
30
|
+
|
31
|
+
process.env.JIEK_PACKAGE_DIR = packageDir
|
32
|
+
process.env.JIEK_BIN__FILENAME = binFilename
|
33
|
+
process.env.JIEK_BIN__FILEPATH = binFilePath
|
34
|
+
|
35
|
+
require('esbuild-register')
|
36
|
+
require(`${packageDir}/src/bin/${binFilename}`)
|
package/bin-helper.js
ADDED