jiek 2.2.5 → 2.2.7-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.
Files changed (136) hide show
  1. package/bin/build.cjs +2 -0
  2. package/bin/index.cjs +2 -0
  3. package/bin-helper/index.cjs +31 -0
  4. package/bin-helper/index.d.cts +1 -0
  5. package/bin-helper/index.d.ts +1 -0
  6. package/bin-helper/package.json +5 -1
  7. package/dist/.internal/+/bin/parseArgv.cjs +33 -0
  8. package/dist/.internal/+/bin/parseArgv.d.cts +5 -0
  9. package/dist/.internal/+/bin/parseArgv.d.ts +5 -0
  10. package/dist/.internal/+/bin/parseArgv.js +27 -0
  11. package/dist/.internal/+/bridge.cjs +12 -0
  12. package/dist/.internal/+/bridge.d.cts +39 -0
  13. package/dist/.internal/+/bridge.d.ts +39 -0
  14. package/dist/.internal/+/bridge.js +9 -0
  15. package/dist/.internal/+/commands/build/analyzer.cjs +201 -0
  16. package/dist/.internal/+/commands/build/analyzer.d.cts +30 -0
  17. package/dist/.internal/+/commands/build/analyzer.d.ts +30 -0
  18. package/dist/.internal/+/commands/build/analyzer.js +195 -0
  19. package/dist/.internal/+/commands/descriptions.cjs +21 -0
  20. package/dist/.internal/+/commands/descriptions.d.cts +5 -0
  21. package/dist/.internal/+/commands/descriptions.d.ts +5 -0
  22. package/dist/.internal/+/commands/descriptions.js +17 -0
  23. package/dist/.internal/+/commands/meta.cjs +16 -0
  24. package/dist/.internal/+/commands/meta.d.cts +3 -0
  25. package/dist/.internal/+/commands/meta.d.ts +3 -0
  26. package/dist/.internal/+/commands/meta.js +15 -0
  27. package/dist/.internal/+/commands/utils/optionParser.cjs +8 -0
  28. package/dist/.internal/+/commands/utils/optionParser.d.cts +3 -0
  29. package/dist/.internal/+/commands/utils/optionParser.d.ts +3 -0
  30. package/dist/.internal/+/commands/utils/optionParser.js +6 -0
  31. package/dist/.internal/+/rollup/base.cjs +10 -0
  32. package/dist/{cli-only-build.d.cts → .internal/+/rollup/base.d.cts} +8 -15
  33. package/dist/{cli-only-build.d.ts → .internal/+/rollup/base.d.ts} +8 -15
  34. package/dist/.internal/+/rollup/base.js +7 -0
  35. package/dist/.internal/+/rollup/bundle-analyzer.cjs +51 -0
  36. package/dist/.internal/+/rollup/bundle-analyzer.d.cts +92 -0
  37. package/dist/.internal/+/rollup/bundle-analyzer.d.ts +92 -0
  38. package/dist/.internal/+/rollup/bundle-analyzer.js +45 -0
  39. package/dist/.internal/+/server.cjs +33 -0
  40. package/dist/.internal/+/server.d.cts +8 -0
  41. package/dist/.internal/+/server.d.ts +8 -0
  42. package/dist/.internal/+/server.js +27 -0
  43. package/dist/.internal/+/utils/checkDependency.cjs +39 -0
  44. package/dist/.internal/+/utils/checkDependency.d.cts +3 -0
  45. package/dist/.internal/+/utils/checkDependency.d.ts +3 -0
  46. package/dist/.internal/+/utils/checkDependency.js +34 -0
  47. package/dist/.internal/+/utils/filterSupport.cjs +20 -0
  48. package/dist/.internal/+/utils/filterSupport.d.cts +15 -0
  49. package/dist/.internal/+/utils/filterSupport.d.ts +15 -0
  50. package/dist/.internal/+/utils/filterSupport.js +10 -0
  51. package/dist/.internal/+/utils/getInternalModuleName.cjs +5 -0
  52. package/dist/.internal/+/utils/getInternalModuleName.d.cts +3 -0
  53. package/dist/.internal/+/utils/getInternalModuleName.d.ts +3 -0
  54. package/dist/.internal/+/utils/getInternalModuleName.js +3 -0
  55. package/dist/.internal/+/utils/getRoot.cjs +17 -0
  56. package/dist/.internal/+/utils/getRoot.d.cts +3 -0
  57. package/dist/.internal/+/utils/getRoot.d.ts +3 -0
  58. package/dist/.internal/+/utils/getRoot.js +11 -0
  59. package/dist/.internal/+/utils/getWD.cjs +15 -0
  60. package/dist/.internal/+/utils/getWD.d.cts +6 -0
  61. package/dist/.internal/+/utils/getWD.d.ts +6 -0
  62. package/dist/.internal/+/utils/getWD.js +10 -0
  63. package/dist/.internal/+/utils/intersection.cjs +5 -0
  64. package/dist/.internal/+/utils/intersection.d.cts +3 -0
  65. package/dist/.internal/+/utils/intersection.d.ts +3 -0
  66. package/dist/.internal/+/utils/intersection.js +3 -0
  67. package/dist/.internal/+/utils/loadConfig.cjs +100 -0
  68. package/dist/.internal/+/utils/loadConfig.d.cts +10 -0
  69. package/dist/.internal/+/utils/loadConfig.d.ts +10 -0
  70. package/dist/.internal/+/utils/loadConfig.js +94 -0
  71. package/dist/.internal/+/utils/recursiveListFiles.cjs +19 -0
  72. package/dist/.internal/+/utils/recursiveListFiles.d.cts +3 -0
  73. package/dist/.internal/+/utils/recursiveListFiles.d.ts +3 -0
  74. package/dist/.internal/+/utils/recursiveListFiles.js +13 -0
  75. package/dist/.internal/+/utils/resolveExports.cjs +118 -0
  76. package/dist/.internal/+/utils/resolveExports.d.cts +26 -0
  77. package/dist/.internal/+/utils/resolveExports.d.ts +26 -0
  78. package/dist/.internal/+/utils/resolveExports.js +111 -0
  79. package/dist/.internal/+/utils/ts.cjs +68 -0
  80. package/dist/.internal/+/utils/ts.d.cts +3 -0
  81. package/dist/.internal/+/utils/ts.d.ts +3 -0
  82. package/dist/.internal/+/utils/ts.js +62 -0
  83. package/dist/.internal/+/utils/tsRegister.cjs +25 -0
  84. package/dist/.internal/+/utils/tsRegister.d.cts +3 -0
  85. package/dist/.internal/+/utils/tsRegister.d.ts +3 -0
  86. package/dist/.internal/+/utils/tsRegister.js +26 -0
  87. package/dist/.internal/getWD-BRJ3PK1S.js +105 -0
  88. package/dist/.internal/getWD-Cmxzjf-f.js +95 -0
  89. package/dist/{cli.js → .internal/index-B6RQz1DZ.js} +1 -731
  90. package/dist/{cli.cjs → .internal/index-DlHFuTjM.js} +1 -753
  91. package/dist/.internal/jiek_create-require-CWFWNQHj.js +5 -0
  92. package/dist/.internal/jiek_create-require-CxSGbkTB.js +5 -0
  93. package/dist/.internal/package.json +10 -0
  94. package/dist/bin/build.cjs +505 -0
  95. package/dist/bin/index.cjs +488 -0
  96. package/dist/index.d.cts +1 -113
  97. package/dist/index.d.ts +1 -113
  98. package/dist/rollup/index.cjs +282 -4569
  99. package/dist/rollup/index.d.cts +7 -1
  100. package/dist/rollup/index.d.ts +7 -1
  101. package/dist/rollup/index.js +270 -4554
  102. package/package.json +25 -28
  103. package/src/bin/build.cts +11 -0
  104. package/src/bin/index.cts +6 -0
  105. package/src/bridge.ts +1 -1
  106. package/src/commands/base.ts +3 -3
  107. package/src/commands/build/analyzer.ts +5 -5
  108. package/src/commands/build/client/analyzer.tsx +1 -1
  109. package/src/commands/build/client/index.ts +5 -7
  110. package/src/commands/build.ts +218 -209
  111. package/src/commands/meta.ts +1 -1
  112. package/src/commands/publish.ts +101 -31
  113. package/src/rollup/base.ts +2 -2
  114. package/src/rollup/index.ts +309 -115
  115. package/src/rollup/plugins/with-external.ts +23 -0
  116. package/src/rollup/utils/externalResolver.ts +20 -8
  117. package/src/utils/checkDependency.ts +1 -1
  118. package/src/utils/filterSupport.ts +17 -16
  119. package/src/utils/getInternalModuleName.ts +5 -0
  120. package/src/utils/intersection.ts +1 -0
  121. package/src/utils/{recusiveListFiles.ts → recursiveListFiles.ts} +2 -2
  122. package/src/utils/{getExports.ts → resolveExports.ts} +16 -14
  123. package/bin/jiek-build.js +0 -16
  124. package/bin/jiek.js +0 -13
  125. package/bin-helper.cjs +0 -43
  126. package/cli/package.json +0 -1
  127. package/cli-only-build/package.json +0 -1
  128. package/dist/cli-only-build.cjs +0 -977
  129. package/dist/cli-only-build.js +0 -969
  130. package/dist/cli.d.cts +0 -14
  131. package/dist/cli.d.ts +0 -14
  132. package/src/bin/build.ts +0 -0
  133. package/src/cli-only-build.ts +0 -11
  134. package/src/cli.ts +0 -6
  135. /package/{bin-helper.js → bin-helper/index.js} +0 -0
  136. /package/src/{parseArgv.ts → bin/parseArgv.ts} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jiek",
3
3
  "type": "module",
4
- "version": "2.2.5",
4
+ "version": "2.2.7-alpha.1",
5
5
  "description": "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.",
6
6
  "author": "YiJie <yijie4188@gmail.com>",
7
7
  "homepage": "https://github.com/NWYLZW/jiek/tree/master/packages/jiek#readme",
@@ -28,18 +28,8 @@
28
28
  "default": "./dist/index.js"
29
29
  },
30
30
  "./bin-helper": {
31
- "require": "./bin-helper.cjs",
32
- "default": "./bin-helper.js"
33
- },
34
- "./cli": {
35
- "jiek/__source__": "./src/cli.ts",
36
- "require": "./dist/cli.cjs",
37
- "default": "./dist/cli.js"
38
- },
39
- "./cli-only-build": {
40
- "jiek/__source__": "./src/cli-only-build.ts",
41
- "require": "./dist/cli-only-build.cjs",
42
- "default": "./dist/cli-only-build.js"
31
+ "require": "./bin-helper/index.cjs",
32
+ "default": "./bin-helper/index.js"
43
33
  },
44
34
  "./rollup": {
45
35
  "jiek/__source__": "./src/rollup/index.ts",
@@ -47,18 +37,11 @@
47
37
  "default": "./dist/rollup/index.js"
48
38
  }
49
39
  },
50
- "imports": {
51
- "#~/*": [
52
- "./src/*",
53
- "./src/*/index.ts",
54
- "./src/*/index.tsx"
55
- ]
56
- },
57
40
  "bin": {
58
- "jiek": "bin/jiek.js",
59
- "jk": "bin/jiek.js",
60
- "jiek-build": "bin/jiek-build.js",
61
- "jb": "bin/jiek-build.js"
41
+ "jiek": "bin/index.cjs",
42
+ "jk": "bin/index.cjs",
43
+ "jiek-build": "bin/build.cjs",
44
+ "jb": "bin/build.cjs"
62
45
  },
63
46
  "peerDependencies": {
64
47
  "@pnpm/filter-workspace-packages": "^7.2.13||^8.0.0||^9.0.0||^10.0.0||>=1000.0.0",
@@ -69,11 +52,11 @@
69
52
  "rollup-plugin-postcss": "^4.0.2",
70
53
  "rollup-plugin-swc3": "^0.12.1",
71
54
  "typescript": "^4.0.0||^5.0.0",
72
- "vite-bundle-analyzer": "0.16.0-beta.1"
55
+ "vite-bundle-analyzer": "0.16.0-beta.3"
73
56
  },
74
57
  "dependencies": {
75
58
  "@inquirer/prompts": "^7.2.0",
76
- "@jiek/rollup-plugin-dts": "^6.2.1",
59
+ "@jiek/rollup-plugin-dts": "^6.3.8",
77
60
  "@rollup/plugin-commonjs": "^28.0.0",
78
61
  "@rollup/plugin-inject": "^5.0.5",
79
62
  "@rollup/plugin-json": "^6.0.1",
@@ -86,9 +69,15 @@
86
69
  "jsonc-parser": "^3.2.1",
87
70
  "koa": "^2.15.3",
88
71
  "rollup": "^4.0.0",
72
+ "@jiek/__internal__": "file:./dist/.internal",
89
73
  "@jiek/pkger": "^0.2.1",
90
74
  "@jiek/utils": "^0.2.3"
91
75
  },
76
+ "dependenciesMeta": {
77
+ "@jiek/__internal__": {
78
+ "injected": true
79
+ }
80
+ },
92
81
  "peerDependenciesMeta": {
93
82
  "@pnpm/filter-workspace-packages": {
94
83
  "optional": true
@@ -119,7 +108,7 @@
119
108
  }
120
109
  },
121
110
  "scripts": {
122
- "prepublish": "pnpm test && jb -nm && jk",
111
+ "prepublish": "jk build -nm && jk",
123
112
  "test": "vitest run"
124
113
  },
125
114
  "typesVersions": {
@@ -134,5 +123,13 @@
134
123
  }
135
124
  },
136
125
  "main": "./dist/index.cjs",
137
- "module": "./dist/index.js"
126
+ "module": "./dist/index.js",
127
+ "types": "./dist/index.d.ts",
128
+ "imports": {
129
+ "#~/*": {
130
+ "jiek/__source__": "./src/*.ts",
131
+ "require": "./dist/.internal/*.cjs",
132
+ "default": "./dist/.internal/*.js"
133
+ }
134
+ }
138
135
  }
@@ -0,0 +1,11 @@
1
+ import '../utils/filterSupport'
2
+ import '../commands/base'
3
+ import '../commands/build'
4
+
5
+ import process from 'node:process'
6
+
7
+ import parseArgv from '#~/bin/parseArgv'
8
+
9
+ if (process.env.JIEK_BIN__FILENAME === 'build.cjs') {
10
+ parseArgv()
11
+ }
@@ -0,0 +1,6 @@
1
+ import '../commands/publish'
2
+ import './build' with { external: 'true' }
3
+
4
+ import parseArgv from '#~/bin/parseArgv'
5
+
6
+ parseArgv()
package/src/bridge.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Module } from '#~/rollup/bundle-analyzer.ts'
1
+ import type { Module } from '#~/rollup/bundle-analyzer'
2
2
 
3
3
  import { sendMessage } from 'execa'
4
4
 
@@ -1,9 +1,9 @@
1
1
  import { program } from 'commander'
2
2
  import pkg from 'jiek/package.json'
3
3
 
4
- import { filterDescription } from '#~/commands/descriptions.ts'
5
- import { IS_WORKSPACE } from '#~/commands/meta.ts'
6
- import { type } from '#~/utils/filterSupport.ts'
4
+ import { filterDescription } from '#~/commands/descriptions'
5
+ import { IS_WORKSPACE } from '#~/commands/meta'
6
+ import { type } from '#~/utils/filterSupport'
7
7
 
8
8
  program
9
9
  .name('jk/jiek')
@@ -1,10 +1,10 @@
1
1
  import type { Command } from 'commander'
2
2
 
3
- import { CLIENT_CUSTOM_RENDER_SCRIPT } from '#~/commands/build/client/index.ts'
4
- import { parseBoolean } from '#~/commands/utils/optionParser.ts'
5
- import type { Module } from '#~/rollup/bundle-analyzer.ts'
6
- import type { createServer } from '#~/server.ts'
7
- import { checkDependency } from '#~/utils/checkDependency.ts'
3
+ import { CLIENT_CUSTOM_RENDER_SCRIPT } from '#~/commands/build/client/index'
4
+ import { parseBoolean } from '#~/commands/utils/optionParser'
5
+ import type { Module } from '#~/rollup/bundle-analyzer'
6
+ import type { createServer } from '#~/server'
7
+ import { checkDependency } from '#~/utils/checkDependency'
8
8
  import { existsSync, mkdirSync, statSync, writeFileSync } from 'node:fs'
9
9
  import path from 'node:path'
10
10
 
@@ -1,4 +1,4 @@
1
- import type { Module } from '#~/rollup/bundle-analyzer.ts'
1
+ import type { Module } from '#~/rollup/bundle-analyzer'
2
2
 
3
3
  interface Node {
4
4
  id: string
@@ -10,13 +10,11 @@ declare global {
10
10
  function render() {
11
11
  CUSTOM_SIDE_BAR = true
12
12
  window.addEventListener('client:ready', () =>
13
- setTimeout(() => {
14
- window.dispatchEvent(
15
- new CustomEvent('send:ui', {
16
- detail: { type: 'Main', Component: __REPLACE_INJECT__ }
17
- })
18
- )
19
- }, 0))
13
+ window.dispatchEvent(
14
+ new CustomEvent('send:ui', {
15
+ detail: { type: 'Main', Component: __REPLACE_INJECT__ }
16
+ })
17
+ ))
20
18
  }
21
19
 
22
20
  export const CLIENT_CUSTOM_RENDER_SCRIPT = [