jiek 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -0
  3. package/bin/jiek.js +13 -0
  4. package/dist/cli.cjs +5041 -0
  5. package/dist/cli.d.cts +112 -0
  6. package/dist/cli.d.ts +112 -0
  7. package/dist/cli.js +5010 -0
  8. package/dist/cli.min.cjs +19 -0
  9. package/dist/cli.min.js +19 -0
  10. package/dist/index.cjs +5 -0
  11. package/dist/index.d.cts +73 -0
  12. package/dist/index.d.ts +73 -0
  13. package/dist/index.js +3 -0
  14. package/dist/index.min.cjs +1 -0
  15. package/dist/index.min.js +1 -0
  16. package/dist/rollup/index.cjs +4688 -0
  17. package/dist/rollup/index.d.cts +53 -0
  18. package/dist/rollup/index.d.ts +53 -0
  19. package/dist/rollup/index.js +4673 -0
  20. package/dist/rollup/index.min.cjs +19 -0
  21. package/dist/rollup/index.min.js +19 -0
  22. package/package.json +89 -4
  23. package/src/cli.ts +9 -0
  24. package/src/commands/base.ts +8 -0
  25. package/src/commands/build.ts +158 -0
  26. package/src/commands/init.ts +373 -0
  27. package/src/commands/publish.ts +171 -0
  28. package/src/index.ts +8 -0
  29. package/src/inner.ts +11 -0
  30. package/src/merge-package-json.ts +75 -0
  31. package/src/rollup/base.ts +72 -0
  32. package/src/rollup/index.ts +422 -0
  33. package/src/rollup/plugins/globals.ts +34 -0
  34. package/src/rollup/plugins/progress.ts +26 -0
  35. package/src/rollup/plugins/skip.ts +23 -0
  36. package/src/rollup/utils/commonOptions.ts +9 -0
  37. package/src/rollup/utils/externalResolver.ts +21 -0
  38. package/src/rollup/utils/globalResolver.ts +13 -0
  39. package/src/rollup/utils/withMinify.ts +18 -0
  40. package/src/utils/filterSupport.ts +84 -0
  41. package/src/utils/getExports.ts +104 -0
  42. package/src/utils/getRoot.ts +16 -0
  43. package/src/utils/getWD.ts +31 -0
  44. package/src/utils/loadConfig.ts +93 -0
  45. package/src/utils/tsRegister.ts +26 -0
  46. package/index.js +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present YiJie
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Jiek
2
+
3
+ 为什么没有一个在 monorepo 下面足够现代又足够简单的构建工具呢?恭喜你发现了宝藏~
4
+
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 ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync } from 'node:fs'
3
+ import { resolve, dirname } from 'node:path'
4
+ import { createRequire } from 'node:module'
5
+
6
+ const __dirname = dirname(import.meta.url.replace('file://', ''))
7
+ if (existsSync(resolve(__dirname, '../.jiek-dev-tag'))) {
8
+ const require = createRequire(import.meta.url)
9
+ require('esbuild-register')
10
+ require('../src/cli.ts')
11
+ } else {
12
+ import('jiek/cli')
13
+ }