jiek 0.4.6 → 0.4.7-alpha.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. package/README.md +22 -1
  2. package/bin/jiek.js +9 -5
  3. package/dist/cli.cjs +4734 -406
  4. package/dist/cli.d.cts +97 -0
  5. package/dist/cli.d.ts +96 -1
  6. package/dist/cli.js +5006 -0
  7. package/dist/cli.min.cjs +19 -2
  8. package/dist/cli.min.js +19 -0
  9. package/dist/index.cjs +0 -1
  10. package/dist/index.d.cts +58 -0
  11. package/dist/index.d.ts +47 -46
  12. package/dist/{index.esm.js → index.js} +0 -1
  13. package/dist/index.min.cjs +0 -1
  14. package/dist/index.min.js +1 -0
  15. package/dist/rollup/index.cjs +4669 -0
  16. package/dist/rollup/index.d.cts +53 -0
  17. package/dist/rollup/index.d.ts +53 -0
  18. package/dist/rollup/index.js +4666 -0
  19. package/dist/rollup/index.min.cjs +19 -0
  20. package/dist/rollup/index.min.js +19 -0
  21. package/package.json +52 -33
  22. package/src/cli.ts +9 -0
  23. package/src/commands/base.ts +8 -0
  24. package/src/commands/build.ts +159 -0
  25. package/src/commands/init.ts +373 -0
  26. package/src/commands/publish.ts +156 -0
  27. package/src/index.ts +8 -0
  28. package/src/inner.ts +11 -0
  29. package/src/merge-package-json.ts +75 -0
  30. package/src/rollup/base.ts +72 -0
  31. package/src/rollup/index.ts +420 -0
  32. package/src/rollup/plugins/globals.ts +34 -0
  33. package/src/rollup/plugins/progress.ts +26 -0
  34. package/src/rollup/plugins/skip.ts +23 -0
  35. package/src/rollup/utils/commonOptions.ts +9 -0
  36. package/src/rollup/utils/externalResolver.ts +21 -0
  37. package/src/rollup/utils/globalResolver.ts +13 -0
  38. package/src/rollup/utils/withMinify.ts +18 -0
  39. package/src/utils/filterSupport.ts +84 -0
  40. package/src/utils/getExports.ts +100 -0
  41. package/src/utils/getRoot.ts +16 -0
  42. package/src/utils/getWD.ts +31 -0
  43. package/src/utils/loadConfig.ts +93 -0
  44. package/src/utils/tsRegister.ts +22 -0
  45. package/dist/base.esm.d.ts +0 -55
  46. package/dist/cli.cjs.map +0 -1
  47. package/dist/cli.esm.d.ts +0 -2
  48. package/dist/cli.esm.js +0 -9
  49. package/dist/cli.esm.js.map +0 -1
  50. package/dist/cli.esm.min.js +0 -2
  51. package/dist/cli.esm.min.js.map +0 -1
  52. package/dist/cli.min.cjs.map +0 -1
  53. package/dist/commands/base.esm.js +0 -5
  54. package/dist/commands/base.esm.js.map +0 -1
  55. package/dist/commands/base.esm.min.js +0 -2
  56. package/dist/commands/base.esm.min.js.map +0 -1
  57. package/dist/commands/build.esm.js +0 -58
  58. package/dist/commands/build.esm.js.map +0 -1
  59. package/dist/commands/build.esm.min.js +0 -2
  60. package/dist/commands/build.esm.min.js.map +0 -1
  61. package/dist/commands/init.esm.js +0 -271
  62. package/dist/commands/init.esm.js.map +0 -1
  63. package/dist/commands/init.esm.min.js +0 -2
  64. package/dist/commands/init.esm.min.js.map +0 -1
  65. package/dist/commands/publish.esm.js +0 -87
  66. package/dist/commands/publish.esm.js.map +0 -1
  67. package/dist/commands/publish.esm.min.js +0 -2
  68. package/dist/commands/publish.esm.min.js.map +0 -1
  69. package/dist/index.cjs.map +0 -1
  70. package/dist/index.esm.d.ts +0 -6
  71. package/dist/index.esm.js.map +0 -1
  72. package/dist/index.esm.min.js +0 -2
  73. package/dist/index.esm.min.js.map +0 -1
  74. package/dist/index.min.cjs.map +0 -1
  75. package/dist/inner.esm.js +0 -10
  76. package/dist/inner.esm.js.map +0 -1
  77. package/dist/inner.esm.min.js +0 -2
  78. package/dist/inner.esm.min.js.map +0 -1
  79. package/dist/merge-package-json.esm.js +0 -64
  80. package/dist/merge-package-json.esm.js.map +0 -1
  81. package/dist/merge-package-json.esm.min.js +0 -2
  82. package/dist/merge-package-json.esm.min.js.map +0 -1
  83. package/dist/pkg.esm.js +0 -4
  84. package/dist/pkg.esm.js.map +0 -1
  85. package/dist/pkg.esm.min.js +0 -2
  86. package/dist/pkg.esm.min.js.map +0 -1
  87. package/dist/rollup/plugins/globals.esm.js +0 -31
  88. package/dist/rollup/plugins/globals.esm.js.map +0 -1
  89. package/dist/rollup/plugins/globals.esm.min.js +0 -2
  90. package/dist/rollup/plugins/globals.esm.min.js.map +0 -1
  91. package/dist/rollup/plugins/skip.esm.js +0 -16
  92. package/dist/rollup/plugins/skip.esm.js.map +0 -1
  93. package/dist/rollup/plugins/skip.esm.min.js +0 -2
  94. package/dist/rollup/plugins/skip.esm.min.js.map +0 -1
  95. package/dist/rollup/utils/commonOptions.esm.js +0 -9
  96. package/dist/rollup/utils/commonOptions.esm.js.map +0 -1
  97. package/dist/rollup/utils/commonOptions.esm.min.js +0 -2
  98. package/dist/rollup/utils/commonOptions.esm.min.js.map +0 -1
  99. package/dist/rollup/utils/externalResolver.esm.js +0 -12
  100. package/dist/rollup/utils/externalResolver.esm.js.map +0 -1
  101. package/dist/rollup/utils/externalResolver.esm.min.js +0 -2
  102. package/dist/rollup/utils/externalResolver.esm.min.js.map +0 -1
  103. package/dist/rollup/utils/globalResolver.esm.js +0 -9
  104. package/dist/rollup/utils/globalResolver.esm.js.map +0 -1
  105. package/dist/rollup/utils/globalResolver.esm.min.js +0 -2
  106. package/dist/rollup/utils/globalResolver.esm.min.js.map +0 -1
  107. package/dist/rollup/utils/withMinify.esm.js +0 -15
  108. package/dist/rollup/utils/withMinify.esm.js.map +0 -1
  109. package/dist/rollup/utils/withMinify.esm.min.js +0 -2
  110. package/dist/rollup/utils/withMinify.esm.min.js.map +0 -1
  111. package/dist/rollup.cjs +0 -330
  112. package/dist/rollup.cjs.map +0 -1
  113. package/dist/rollup.d.ts +0 -23
  114. package/dist/rollup.esm.d.ts +0 -23
  115. package/dist/rollup.esm.js +0 -248
  116. package/dist/rollup.esm.js.map +0 -1
  117. package/dist/rollup.esm.min.js +0 -2
  118. package/dist/rollup.esm.min.js.map +0 -1
  119. package/dist/rollup.min.cjs +0 -2
  120. package/dist/rollup.min.cjs.map +0 -1
  121. package/dist/utils/commondir.esm.js +0 -25
  122. package/dist/utils/commondir.esm.js.map +0 -1
  123. package/dist/utils/commondir.esm.min.js +0 -2
  124. package/dist/utils/commondir.esm.min.js.map +0 -1
  125. package/dist/utils/filterSupport.esm.js +0 -67
  126. package/dist/utils/filterSupport.esm.js.map +0 -1
  127. package/dist/utils/filterSupport.esm.min.js +0 -2
  128. package/dist/utils/filterSupport.esm.min.js.map +0 -1
  129. package/dist/utils/getRoot.esm.js +0 -14
  130. package/dist/utils/getRoot.esm.js.map +0 -1
  131. package/dist/utils/getRoot.esm.min.js +0 -2
  132. package/dist/utils/getRoot.esm.min.js.map +0 -1
  133. package/dist/utils/getWD.esm.js +0 -31
  134. package/dist/utils/getWD.esm.js.map +0 -1
  135. package/dist/utils/getWD.esm.min.js +0 -2
  136. package/dist/utils/getWD.esm.min.js.map +0 -1
  137. package/dist/utils/loadConfig.esm.js +0 -75
  138. package/dist/utils/loadConfig.esm.js.map +0 -1
  139. package/dist/utils/loadConfig.esm.min.js +0 -2
  140. package/dist/utils/loadConfig.esm.min.js.map +0 -1
  141. package/dist/utils/tsRegister.esm.js +0 -24
  142. package/dist/utils/tsRegister.esm.js.map +0 -1
  143. package/dist/utils/tsRegister.esm.min.js +0 -2
  144. package/dist/utils/tsRegister.esm.min.js.map +0 -1
package/README.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Jiek
2
2
 
3
- A powerful and clever monorepo cli tool.
3
+ 为什么没有一个在 monorepo 下面足够现代又足够简单的构建工具呢?恭喜你发现了宝藏~
4
4
 
5
5
  ## Features
6
+
7
+ ### build
8
+
9
+ 写构建脚本一直不是一件简单的事情,那么怎么把一个复杂的事情变简单呢?我们回到需求的本身,那就是「定义什么便构建什么」。在这里我们用自然的方式来定义构建产物,而不需要去多写一行多余的代码。
10
+
11
+ > 在这里你需要了解足够先进和现代的「[模块管理]()」以及「[导出策略]()」,在这里我们便是基于这俩点达成的一些自然而然的约定来实现的减轻负担。
12
+
13
+ 接下来我们可以一步步的来看看我们的构建工具是如何工作的。
14
+
15
+ #### 定义入口
16
+
17
+ #### 运行指令
18
+
19
+ #### 个性化需求
20
+
21
+ #### 幕后的故事
22
+
23
+ 一些关于本工具的设计思路和实现细节,不阅读也不会影响各位的使用,感兴趣的各位可以看看。
24
+
25
+ - 入口的约定
26
+ - 插件的抉择
package/bin/jiek.js CHANGED
@@ -1,9 +1,13 @@
1
1
  #!/usr/bin/env node
2
- const fs = require('node:fs')
3
- const path = require('node:path')
2
+ import { existsSync } from 'node:fs'
3
+ import { resolve, dirname } from 'node:path'
4
+ import { createRequire } from 'node:module'
4
5
 
5
- if (fs.existsSync(path.join(__dirname, '../.jiek-dev-tag'))) {
6
+ const __dirname = dirname(import.meta.url.replace('file://', ''))
7
+ if (existsSync(resolve(__dirname, '../.jiek-dev-tag'))) {
8
+ const require = createRequire(import.meta.url)
6
9
  require('esbuild-register')
7
10
  require('../src/cli.ts')
8
- } else
9
- require('../dist/cli.cjs')
11
+ } else {
12
+ import('jiek/cli')
13
+ }