@maizzle/framework 6.0.0-rc.1 → 6.0.0-rc.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.
Files changed (214) hide show
  1. package/bin/maizzle.mjs +1 -1
  2. package/dist/build.mjs +2 -1
  3. package/dist/build.mjs.map +1 -1
  4. package/dist/config/index.mjs +7 -0
  5. package/dist/config/index.mjs.map +1 -1
  6. package/dist/plugin.d.mts.map +1 -1
  7. package/dist/plugin.mjs +13 -0
  8. package/dist/plugin.mjs.map +1 -1
  9. package/dist/render/createRenderer.d.mts +2 -0
  10. package/dist/render/createRenderer.d.mts.map +1 -1
  11. package/dist/render/createRenderer.mjs +11 -4
  12. package/dist/render/createRenderer.mjs.map +1 -1
  13. package/dist/render/index.mjs +2 -1
  14. package/dist/render/index.mjs.map +1 -1
  15. package/dist/serve.mjs +2 -1
  16. package/dist/serve.mjs.map +1 -1
  17. package/dist/types/config.d.mts +3 -0
  18. package/dist/types/config.d.mts.map +1 -1
  19. package/dist/utils/detect.d.mts +5 -0
  20. package/dist/utils/detect.d.mts.map +1 -0
  21. package/dist/utils/detect.mjs +11 -0
  22. package/dist/utils/detect.mjs.map +1 -0
  23. package/node_modules/@clack/core/CHANGELOG.md +87 -4
  24. package/node_modules/@clack/core/README.md +1 -1
  25. package/node_modules/@clack/core/dist/index.d.mts +186 -48
  26. package/node_modules/@clack/core/dist/index.mjs +10 -14
  27. package/node_modules/@clack/core/dist/index.mjs.map +1 -1
  28. package/node_modules/@clack/core/package.json +7 -9
  29. package/node_modules/@clack/prompts/CHANGELOG.md +171 -7
  30. package/node_modules/@clack/prompts/README.md +66 -3
  31. package/node_modules/@clack/prompts/dist/index.d.mts +302 -76
  32. package/node_modules/@clack/prompts/dist/index.mjs +134 -84
  33. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
  34. package/node_modules/@clack/prompts/package.json +14 -10
  35. package/node_modules/citty/LICENSE +0 -15
  36. package/node_modules/citty/README.md +166 -69
  37. package/node_modules/citty/dist/index.d.mts +88 -56
  38. package/node_modules/citty/dist/index.mjs +399 -437
  39. package/node_modules/citty/package.json +28 -35
  40. package/node_modules/giget/README.md +59 -11
  41. package/node_modules/giget/dist/THIRD-PARTY-LICENSES.md +205 -0
  42. package/node_modules/giget/dist/_chunks/giget.mjs +508 -0
  43. package/node_modules/giget/dist/_chunks/libs/citty.mjs +269 -0
  44. package/node_modules/giget/dist/_chunks/libs/nypm.d.mts +1 -0
  45. package/node_modules/giget/dist/_chunks/libs/nypm.mjs +669 -0
  46. package/node_modules/giget/dist/_chunks/libs/tar.mjs +2931 -0
  47. package/node_modules/giget/dist/_chunks/rolldown-runtime.mjs +14 -0
  48. package/node_modules/giget/dist/cli.d.mts +1 -0
  49. package/node_modules/giget/dist/cli.mjs +89 -111
  50. package/node_modules/giget/dist/index.d.mts +46 -35
  51. package/node_modules/giget/dist/index.mjs +2 -22
  52. package/node_modules/giget/package.json +32 -45
  53. package/node_modules/maizzle/README.md +140 -0
  54. package/node_modules/maizzle/bin/maizzle.mjs +5 -0
  55. package/node_modules/maizzle/dist/commands/new.d.mts +7 -0
  56. package/node_modules/maizzle/dist/commands/new.mjs +278 -0
  57. package/node_modules/{@maizzle/cli → maizzle}/dist/index.d.mts +1 -1
  58. package/node_modules/maizzle/dist/index.mjs +44 -0
  59. package/node_modules/{commander → maizzle/node_modules/commander}/Readme.md +94 -67
  60. package/node_modules/{commander → maizzle/node_modules/commander}/lib/argument.js +5 -4
  61. package/node_modules/{commander → maizzle/node_modules/commander}/lib/command.js +154 -39
  62. package/node_modules/{commander → maizzle/node_modules/commander}/lib/help.js +77 -39
  63. package/node_modules/{commander → maizzle/node_modules/commander}/lib/option.js +16 -3
  64. package/node_modules/{commander → maizzle/node_modules/commander}/package-support.json +4 -1
  65. package/node_modules/{commander → maizzle/node_modules/commander}/package.json +8 -8
  66. package/node_modules/{commander → maizzle/node_modules/commander}/typings/index.d.ts +71 -3
  67. package/node_modules/{@maizzle/cli → maizzle}/package.json +13 -11
  68. package/node_modules/tinyexec/README.md +49 -3
  69. package/node_modules/tinyexec/dist/main.d.mts +25 -14
  70. package/node_modules/tinyexec/dist/main.mjs +148 -100
  71. package/node_modules/tinyexec/package.json +9 -8
  72. package/package.json +3 -3
  73. package/node_modules/@clack/core/dist/index.cjs +0 -15
  74. package/node_modules/@clack/core/dist/index.cjs.map +0 -1
  75. package/node_modules/@clack/core/dist/index.d.cts +0 -211
  76. package/node_modules/@clack/core/dist/index.d.ts +0 -211
  77. package/node_modules/@clack/prompts/dist/index.cjs +0 -87
  78. package/node_modules/@clack/prompts/dist/index.cjs.map +0 -1
  79. package/node_modules/@clack/prompts/dist/index.d.cts +0 -165
  80. package/node_modules/@clack/prompts/dist/index.d.ts +0 -165
  81. package/node_modules/@maizzle/cli/README.md +0 -58
  82. package/node_modules/@maizzle/cli/dist/index.mjs +0 -42
  83. package/node_modules/citty/dist/index.cjs +0 -475
  84. package/node_modules/citty/dist/index.d.cts +0 -80
  85. package/node_modules/citty/dist/index.d.ts +0 -80
  86. package/node_modules/consola/LICENSE +0 -47
  87. package/node_modules/consola/README.md +0 -352
  88. package/node_modules/consola/basic.d.ts +0 -1
  89. package/node_modules/consola/browser.d.ts +0 -1
  90. package/node_modules/consola/core.d.ts +0 -1
  91. package/node_modules/consola/dist/basic.cjs +0 -32
  92. package/node_modules/consola/dist/basic.d.cts +0 -23
  93. package/node_modules/consola/dist/basic.d.mts +0 -21
  94. package/node_modules/consola/dist/basic.d.ts +0 -23
  95. package/node_modules/consola/dist/basic.mjs +0 -24
  96. package/node_modules/consola/dist/browser.cjs +0 -84
  97. package/node_modules/consola/dist/browser.d.cts +0 -23
  98. package/node_modules/consola/dist/browser.d.mts +0 -21
  99. package/node_modules/consola/dist/browser.d.ts +0 -23
  100. package/node_modules/consola/dist/browser.mjs +0 -76
  101. package/node_modules/consola/dist/chunks/prompt.cjs +0 -288
  102. package/node_modules/consola/dist/chunks/prompt.mjs +0 -280
  103. package/node_modules/consola/dist/core.cjs +0 -517
  104. package/node_modules/consola/dist/core.d.cts +0 -459
  105. package/node_modules/consola/dist/core.d.mts +0 -459
  106. package/node_modules/consola/dist/core.d.ts +0 -459
  107. package/node_modules/consola/dist/core.mjs +0 -512
  108. package/node_modules/consola/dist/index.cjs +0 -663
  109. package/node_modules/consola/dist/index.d.cts +0 -24
  110. package/node_modules/consola/dist/index.d.mts +0 -22
  111. package/node_modules/consola/dist/index.d.ts +0 -24
  112. package/node_modules/consola/dist/index.mjs +0 -651
  113. package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +0 -75
  114. package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +0 -72
  115. package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +0 -288
  116. package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +0 -312
  117. package/node_modules/consola/dist/utils.cjs +0 -64
  118. package/node_modules/consola/dist/utils.d.cts +0 -286
  119. package/node_modules/consola/dist/utils.d.mts +0 -286
  120. package/node_modules/consola/dist/utils.d.ts +0 -286
  121. package/node_modules/consola/dist/utils.mjs +0 -54
  122. package/node_modules/consola/lib/index.cjs +0 -10
  123. package/node_modules/consola/package.json +0 -136
  124. package/node_modules/consola/utils.d.ts +0 -1
  125. package/node_modules/create-maizzle/README.md +0 -86
  126. package/node_modules/create-maizzle/bin/create-maizzle.mjs +0 -4
  127. package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +0 -340
  128. package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +0 -9
  129. package/node_modules/create-maizzle/node_modules/@clack/core/README.md +0 -22
  130. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +0 -349
  131. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +0 -11
  132. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +0 -1
  133. package/node_modules/create-maizzle/node_modules/@clack/core/package.json +0 -60
  134. package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +0 -576
  135. package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +0 -9
  136. package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +0 -270
  137. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +0 -391
  138. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +0 -137
  139. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
  140. package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +0 -65
  141. package/node_modules/create-maizzle/package.json +0 -47
  142. package/node_modules/create-maizzle/src/index.js +0 -242
  143. package/node_modules/defu/LICENSE +0 -21
  144. package/node_modules/defu/README.md +0 -171
  145. package/node_modules/defu/dist/defu.cjs +0 -77
  146. package/node_modules/defu/dist/defu.d.cts +0 -31
  147. package/node_modules/defu/dist/defu.d.mts +0 -29
  148. package/node_modules/defu/dist/defu.d.ts +0 -31
  149. package/node_modules/defu/dist/defu.mjs +0 -69
  150. package/node_modules/defu/lib/defu.cjs +0 -10
  151. package/node_modules/defu/lib/defu.d.cts +0 -12
  152. package/node_modules/defu/package.json +0 -48
  153. package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -468
  154. package/node_modules/node-fetch-native/LICENSE +0 -114
  155. package/node_modules/node-fetch-native/README.md +0 -225
  156. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -2
  157. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -2
  158. package/node_modules/node-fetch-native/dist/index.cjs +0 -1
  159. package/node_modules/node-fetch-native/dist/index.mjs +0 -1
  160. package/node_modules/node-fetch-native/dist/native.cjs +0 -1
  161. package/node_modules/node-fetch-native/dist/native.mjs +0 -1
  162. package/node_modules/node-fetch-native/dist/node.cjs +0 -19
  163. package/node_modules/node-fetch-native/dist/node.mjs +0 -19
  164. package/node_modules/node-fetch-native/dist/polyfill.cjs +0 -1
  165. package/node_modules/node-fetch-native/dist/polyfill.mjs +0 -1
  166. package/node_modules/node-fetch-native/dist/proxy-stub.cjs +0 -1
  167. package/node_modules/node-fetch-native/dist/proxy-stub.mjs +0 -1
  168. package/node_modules/node-fetch-native/dist/proxy.cjs +0 -58
  169. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -1
  170. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -1
  171. package/node_modules/node-fetch-native/index.d.ts +0 -1
  172. package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
  173. package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
  174. package/node_modules/node-fetch-native/lib/index.cjs +0 -11
  175. package/node_modules/node-fetch-native/lib/index.d.cts +0 -10
  176. package/node_modules/node-fetch-native/lib/index.d.mts +0 -10
  177. package/node_modules/node-fetch-native/lib/index.d.ts +0 -10
  178. package/node_modules/node-fetch-native/lib/native.cjs +0 -11
  179. package/node_modules/node-fetch-native/lib/polyfill.d.cts +0 -1
  180. package/node_modules/node-fetch-native/lib/polyfill.d.mts +0 -1
  181. package/node_modules/node-fetch-native/lib/polyfill.d.ts +0 -1
  182. package/node_modules/node-fetch-native/lib/proxy.d.ts +0 -32
  183. package/node_modules/node-fetch-native/node.d.ts +0 -1
  184. package/node_modules/node-fetch-native/package.json +0 -138
  185. package/node_modules/node-fetch-native/polyfill.d.ts +0 -1
  186. package/node_modules/node-fetch-native/proxy.d.ts +0 -1
  187. package/node_modules/nypm/node_modules/citty/LICENSE +0 -21
  188. package/node_modules/nypm/node_modules/citty/README.md +0 -231
  189. package/node_modules/nypm/node_modules/citty/dist/index.d.mts +0 -112
  190. package/node_modules/nypm/node_modules/citty/dist/index.mjs +0 -425
  191. package/node_modules/nypm/node_modules/citty/package.json +0 -42
  192. /package/node_modules/{nypm/node_modules/citty → citty}/dist/THIRD-PARTY-LICENSES.md +0 -0
  193. /package/node_modules/{nypm/node_modules/citty → citty}/dist/_chunks/libs/scule.mjs +0 -0
  194. /package/node_modules/{@maizzle/cli → maizzle}/LICENSE +0 -0
  195. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.d.mts +0 -0
  196. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.mjs +0 -0
  197. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.d.mts +0 -0
  198. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.mjs +0 -0
  199. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.d.mts +0 -0
  200. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.mjs +0 -0
  201. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.d.mts +0 -0
  202. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.mjs +0 -0
  203. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/component.vue +0 -0
  204. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/config.ts +0 -0
  205. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/layout.vue +0 -0
  206. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/template.vue +0 -0
  207. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.d.mts +0 -0
  208. /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.mjs +0 -0
  209. /package/node_modules/{commander → maizzle/node_modules/commander}/LICENSE +0 -0
  210. /package/node_modules/{commander → maizzle/node_modules/commander}/esm.mjs +0 -0
  211. /package/node_modules/{commander → maizzle/node_modules/commander}/index.js +0 -0
  212. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/error.js +0 -0
  213. /package/node_modules/{commander → maizzle/node_modules/commander}/lib/suggestSimilar.js +0 -0
  214. /package/node_modules/{commander → maizzle/node_modules/commander}/typings/esm.d.mts +0 -0
@@ -1 +0,0 @@
1
- var t=Object.defineProperty;var o=(e,l)=>t(e,"name",{value:l,configurable:!0});var n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(f,"getDefaultExportFromCjs");export{n as c,f as g};
@@ -1 +0,0 @@
1
- "use strict";var l=Object.defineProperty;var o=(e,t)=>l(e,"name",{value:t,configurable:!0});var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(getDefaultExportFromCjs,"getDefaultExportFromCjs"),exports.commonjsGlobal=commonjsGlobal,exports.getDefaultExportFromCjs=getDefaultExportFromCjs;
@@ -1 +0,0 @@
1
- export * from "./lib/index";
File without changes
File without changes
@@ -1,11 +0,0 @@
1
- const nodeFetch = require("../dist/index.cjs");
2
-
3
- function fetch(input, options) {
4
- return nodeFetch.fetch(input, options);
5
- }
6
-
7
- for (const key in nodeFetch) {
8
- fetch[key] = nodeFetch[key];
9
- }
10
-
11
- module.exports = fetch;
@@ -1,10 +0,0 @@
1
- export declare const fetch: typeof globalThis.fetch;
2
- export declare const Blob: typeof globalThis.Blob;
3
- export declare const File: typeof globalThis.File;
4
- export declare const FormData: typeof globalThis.FormData;
5
- export declare const Headers: typeof globalThis.Headers;
6
- export declare const Request: typeof globalThis.Request;
7
- export declare const Response: typeof globalThis.Response;
8
- export declare const AbortController: typeof globalThis.AbortController;
9
-
10
- export default fetch;
@@ -1,10 +0,0 @@
1
- export declare const fetch: typeof globalThis.fetch;
2
- export declare const Blob: typeof globalThis.Blob;
3
- export declare const File: typeof globalThis.File;
4
- export declare const FormData: typeof globalThis.FormData;
5
- export declare const Headers: typeof globalThis.Headers;
6
- export declare const Request: typeof globalThis.Request;
7
- export declare const Response: typeof globalThis.Response;
8
- export declare const AbortController: typeof globalThis.AbortController;
9
-
10
- export default fetch;
@@ -1,10 +0,0 @@
1
- export declare const fetch: typeof globalThis.fetch;
2
- export declare const Blob: typeof globalThis.Blob;
3
- export declare const File: typeof globalThis.File;
4
- export declare const FormData: typeof globalThis.FormData;
5
- export declare const Headers: typeof globalThis.Headers;
6
- export declare const Request: typeof globalThis.Request;
7
- export declare const Response: typeof globalThis.Response;
8
- export declare const AbortController: typeof globalThis.AbortController;
9
-
10
- export default fetch;
@@ -1,11 +0,0 @@
1
- const nodeFetch = require("../dist/native.cjs");
2
-
3
- function fetch(input, options) {
4
- return nodeFetch.fetch(input, options);
5
- }
6
-
7
- for (const key in nodeFetch) {
8
- fetch[key] = nodeFetch[key];
9
- }
10
-
11
- module.exports = fetch;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,32 +0,0 @@
1
- import type * as http from "node:http";
2
- import type * as https from "node:https";
3
- import type * as undici from "undici";
4
-
5
- export type ProxyOptions = {
6
- /**
7
- * HTTP(s) Proxy URL
8
- *
9
- * Default is read from `https_proxy`, `http_proxy`, `HTTPS_PROXY` or `HTTP_PROXY` environment variables
10
- * */
11
- url?: string;
12
-
13
- /**
14
- * List of hosts to skip proxy for (comma separated or array of strings)
15
- *
16
- * Default is read from `no_proxy` or `NO_PROXY` environment variables
17
- *
18
- * Hots starting with a leading dot, like `.foo.com` are also matched against domain and all its subdomains like `bar.foo.com`
19
- */
20
- noProxy?: string | string[];
21
- };
22
-
23
- export declare const createProxy: (opts?: ProxyOptions) => {
24
- agent: http.Agent | https.Agent | undefined;
25
- dispatcher: undici.Dispatcher | undefined;
26
- };
27
-
28
- export declare const createFetch: (
29
- proxyOptions?: ProxyOptions,
30
- ) => typeof globalThis.fetch;
31
-
32
- export declare const fetch: typeof globalThis.fetch;
@@ -1 +0,0 @@
1
- export * from "./lib/index";
@@ -1,138 +0,0 @@
1
- {
2
- "name": "node-fetch-native",
3
- "version": "1.6.7",
4
- "description": "better fetch for Node.js. Works on any JavaScript runtime!",
5
- "repository": "unjs/node-fetch-native",
6
- "license": "MIT",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "browser": "./dist/native.mjs",
11
- "bun": "./dist/native.mjs",
12
- "deno": "./dist/native.mjs",
13
- "edge-light": "./dist/native.mjs",
14
- "edge-routine": "./dist/native.mjs",
15
- "lagon": "./dist/native.mjs",
16
- "netlify": "./dist/native.mjs",
17
- "react-native": "./dist/native.mjs",
18
- "wintercg": "./dist/native.mjs",
19
- "worker": "./dist/native.mjs",
20
- "workerd": "./dist/native.mjs",
21
- "node": {
22
- "import": {
23
- "types": "./lib/index.d.mts",
24
- "default": "./dist/index.mjs"
25
- },
26
- "require": {
27
- "types": "./lib/index.d.cts",
28
- "default": "./lib/index.cjs"
29
- }
30
- },
31
- "types": "./lib/index.d.mts",
32
- "import": "./dist/native.mjs",
33
- "require": "./dist/native.cjs",
34
- "default": "./dist/native.mjs"
35
- },
36
- "./polyfill": {
37
- "node": {
38
- "import": {
39
- "types": "./lib/polyfill.d.mts",
40
- "default": "./dist/polyfill.mjs"
41
- },
42
- "require": {
43
- "types": "./lib/polyfill.d.cts",
44
- "default": "./dist/polyfill.cjs"
45
- }
46
- },
47
- "types": "./lib/polyfill.d.mts",
48
- "import": "./lib/empty.mjs",
49
- "require": "./lib/empty.cjs",
50
- "default": "./lib/empty.mjs"
51
- },
52
- "./node": {
53
- "import": {
54
- "types": "./lib/index.d.mts",
55
- "default": "./dist/node.mjs"
56
- },
57
- "require": {
58
- "types": "./lib/index.d.cts",
59
- "default": "./dist/node.cjs"
60
- }
61
- },
62
- "./native": {
63
- "import": {
64
- "types": "./lib/index.d.mts",
65
- "default": "./dist/native.mjs"
66
- },
67
- "require": {
68
- "types": "./lib/index.d.cts",
69
- "default": "./lib/native.cjs"
70
- }
71
- },
72
- "./src/index.js": {
73
- "import": {
74
- "types": "./lib/index.d.mts",
75
- "default": "./dist/index.mjs"
76
- },
77
- "require": {
78
- "types": "./lib/index.d.cts",
79
- "default": "./lib/index.cjs"
80
- }
81
- },
82
- "./proxy": {
83
- "node": {
84
- "types": "./lib/proxy.d.ts",
85
- "default": "./dist/proxy.cjs"
86
- },
87
- "default": {
88
- "import": {
89
- "types": "./lib/proxy.d.ts",
90
- "default": "./dist/proxy-stub.mjs"
91
- },
92
- "require": {
93
- "types": "./lib/proxy.d.ts",
94
- "default": "./dist/proxy-stub.cjs"
95
- }
96
- }
97
- }
98
- },
99
- "main": "./lib/index.cjs",
100
- "module": "./dist/index.mjs",
101
- "react-native": "./dist/native.mjs",
102
- "types": "./lib/index.d.mts",
103
- "files": [
104
- "dist",
105
- "lib",
106
- "index.d.ts",
107
- "node.d.ts",
108
- "polyfill.d.ts",
109
- "proxy.d.ts"
110
- ],
111
- "scripts": {
112
- "build": "unbuild",
113
- "lint": "eslint . && prettier -c src test lib",
114
- "lint:fix": "eslint --fix . && prettier -w src test lib",
115
- "prepack": "unbuild",
116
- "release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
117
- "test": "pnpm lint && pnpm build && vitest run --coverage"
118
- },
119
- "devDependencies": {
120
- "@types/node": "^24.1.0",
121
- "@vitest/coverage-v8": "^3.2.4",
122
- "abort-controller": "^3.0.0",
123
- "agent-base": "^7.1.4",
124
- "changelogen": "^0.6.2",
125
- "eslint": "^9.32.0",
126
- "eslint-config-unjs": "^0.5.0",
127
- "http-proxy-agent": "^7.0.2",
128
- "https-proxy-agent": "^7.0.6",
129
- "node-fetch": "^3.3.2",
130
- "prettier": "^3.6.2",
131
- "proxy-agent": "^6.5.0",
132
- "typescript": "^5.9.2",
133
- "unbuild": "^3.6.0",
134
- "undici": "^6.21.3",
135
- "vitest": "^3.2.4"
136
- },
137
- "packageManager": "pnpm@10.14.0"
138
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from "./lib/proxy";
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Pooya Parsa <pooya@pi0.io>
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.
@@ -1,231 +0,0 @@
1
- # 🌆 citty
2
-
3
- <!-- automd:badges color=yellow bundlephobia -->
4
-
5
- [![npm version](https://img.shields.io/npm/v/citty?color=yellow)](https://npmjs.com/package/citty)
6
- [![npm downloads](https://img.shields.io/npm/dm/citty?color=yellow)](https://npmjs.com/package/citty)
7
- [![bundle size](https://img.shields.io/bundlephobia/minzip/citty?color=yellow)](https://bundlephobia.com/package/citty)
8
-
9
- <!-- /automd -->
10
-
11
- Elegant CLI Builder
12
-
13
- - Zero dependency, fast and lightweight (based on native [`util.parseArgs`](https://nodejs.org/api/util.html#utilparseargsconfig))
14
- - Smart value parsing with typecast and boolean shortcuts
15
- - Nested sub-commands with lazy and async loading
16
- - Pluggable and composable API with auto generated usage
17
-
18
- ## Usage
19
-
20
- ```sh
21
- npx nypm add -D citty
22
- ```
23
-
24
- ```js
25
- import { defineCommand, runMain } from "citty";
26
-
27
- const main = defineCommand({
28
- meta: {
29
- name: "hello",
30
- version: "1.0.0",
31
- description: "My Awesome CLI App",
32
- },
33
- args: {
34
- name: {
35
- type: "positional",
36
- description: "Your name",
37
- required: true,
38
- },
39
- friendly: {
40
- type: "boolean",
41
- description: "Use friendly greeting",
42
- },
43
- },
44
- setup({ args }) {
45
- console.log(`now setup ${args.command}`);
46
- },
47
- cleanup({ args }) {
48
- console.log(`now cleanup ${args.command}`);
49
- },
50
- run({ args }) {
51
- console.log(`${args.friendly ? "Hi" : "Greetings"} ${args.name}!`);
52
- },
53
- });
54
-
55
- runMain(main);
56
- ```
57
-
58
- ```sh
59
- node index.mjs john
60
- # Greetings john!
61
- ```
62
-
63
- ### Sub Commands
64
-
65
- Sub commands can be nested recursively. Use lazy imports for large CLIs to avoid loading all commands at once.
66
-
67
- ```js
68
- import { defineCommand, runMain } from "citty";
69
-
70
- const sub = defineCommand({
71
- meta: { name: "sub", description: "Sub command" },
72
- args: {
73
- name: { type: "positional", description: "Your name", required: true },
74
- },
75
- run({ args }) {
76
- console.log(`Hello ${args.name}!`);
77
- },
78
- });
79
-
80
- const main = defineCommand({
81
- meta: { name: "hello", version: "1.0.0", description: "My Awesome CLI App" },
82
- subCommands: { sub },
83
- });
84
-
85
- runMain(main);
86
- ```
87
-
88
- Subcommands support `meta.alias` (e.g., `["i", "add"]`) and `meta.hidden: true` to hide from help output.
89
-
90
- ### Lazy Commands
91
-
92
- For large CLIs, lazy load sub commands so only the executed command is imported:
93
-
94
- ```js
95
- const main = defineCommand({
96
- meta: { name: "hello", version: "1.0.0", description: "My Awesome CLI App" },
97
- subCommands: {
98
- sub: () => import("./sub.mjs").then((m) => m.default),
99
- },
100
- });
101
- ```
102
-
103
- `meta`, `args`, and `subCommands` all accept `Resolvable<T>` values — a value, Promise, function, or async function — enabling lazy and dynamic resolution.
104
-
105
- ### Hooks
106
-
107
- Commands support `setup` and `cleanup` functions called before and after `run()`. Only the executed command's hooks run. `cleanup` always runs, even if `run()` throws.
108
-
109
- ```js
110
- const main = defineCommand({
111
- meta: { name: "hello", version: "1.0.0", description: "My Awesome CLI App" },
112
- setup() {
113
- console.log("Setting up...");
114
- },
115
- cleanup() {
116
- console.log("Cleaning up...");
117
- },
118
- run() {
119
- console.log("Hello World!");
120
- },
121
- });
122
- ```
123
-
124
- ### Plugins
125
-
126
- Plugins extend commands with reusable `setup` and `cleanup` hooks:
127
-
128
- ```js
129
- import { defineCommand, defineCittyPlugin, runMain } from "citty";
130
-
131
- const logger = defineCittyPlugin({
132
- name: "logger",
133
- setup({ args }) {
134
- console.log("Logger setup, args:", args);
135
- },
136
- cleanup() {
137
- console.log("Logger cleanup");
138
- },
139
- });
140
-
141
- const main = defineCommand({
142
- meta: { name: "hello", description: "My CLI App" },
143
- plugins: [logger],
144
- run() {
145
- console.log("Hello!");
146
- },
147
- });
148
-
149
- runMain(main);
150
- ```
151
-
152
- Plugin `setup` hooks run before the command's `setup` (in order), `cleanup` hooks run after (in reverse). Plugins can be async or factory functions.
153
-
154
- ## Arguments
155
-
156
- ### Argument Types
157
-
158
- | Type | Description | Example |
159
- | ------------ | ---------------------------------------- | --------------------------- |
160
- | `positional` | Unnamed positional args | `cli <name>` |
161
- | `string` | Named string options | `--name value` |
162
- | `boolean` | Boolean flags, supports `--no-` negation | `--verbose` |
163
- | `enum` | Constrained to `options` array | `--level=info\|warn\|error` |
164
-
165
- ### Common Options
166
-
167
- | Option | Description |
168
- | ------------- | ------------------------------------------------------------- |
169
- | `description` | Help text shown in usage output |
170
- | `required` | Whether the argument is required |
171
- | `default` | Default value when not provided |
172
- | `alias` | Short aliases (e.g., `["f"]`). Not for `positional` |
173
- | `valueHint` | Display hint in help (e.g., `"host"` renders `--name=<host>`) |
174
-
175
- ### Example
176
-
177
- ```js
178
- const main = defineCommand({
179
- args: {
180
- name: { type: "positional", description: "Your name", required: true },
181
- friendly: { type: "boolean", description: "Use friendly greeting", alias: ["f"] },
182
- greeting: { type: "string", description: "Custom greeting", default: "Hello" },
183
- level: {
184
- type: "enum",
185
- description: "Log level",
186
- options: ["debug", "info", "warn", "error"],
187
- default: "info",
188
- },
189
- },
190
- run({ args }) {
191
- console.log(`${args.greeting} ${args.name}! (level: ${args.level})`);
192
- },
193
- });
194
- ```
195
-
196
- ### Boolean Negation
197
-
198
- Boolean args support `--no-` prefix. The negative variant appears in help when `default: true` or `negativeDescription` is set.
199
-
200
- ### Case-Agnostic Access
201
-
202
- Kebab-case args can be accessed as camelCase: `args["output-dir"]` and `args.outputDir` both work.
203
-
204
- ## Built-in Flags
205
-
206
- `--help` / `-h` and `--version` / `-v` are handled automatically. Disabled if your command defines args with the same names or aliases.
207
-
208
- ## API
209
-
210
- | Function | Description |
211
- | ----------------------------- | -------------------------------------------------------------------------- |
212
- | `defineCommand(def)` | Type helper for defining commands |
213
- | `runMain(cmd, opts?)` | Run a command with usage support and graceful error handling |
214
- | `createMain(cmd)` | Create a wrapper that calls `runMain` when invoked |
215
- | `runCommand(cmd, opts)` | Parse args and run command/sub-commands; access `result` from return value |
216
- | `parseArgs(rawArgs, argsDef)` | Parse input arguments and apply defaults |
217
- | `renderUsage(cmd, parent?)` | Render command usage to a string |
218
- | `showUsage(cmd, parent?)` | Render usage and print to console |
219
- | `defineCittyPlugin(def)` | Type helper for defining plugins |
220
-
221
- ## Development
222
-
223
- - Clone this repository
224
- - Install latest LTS version of [Node.js](https://nodejs.org/en/)
225
- - Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
226
- - Install dependencies using `pnpm install`
227
- - Run interactive tests using `pnpm dev`
228
-
229
- ## License
230
-
231
- Made with 💛 Published under [MIT License](./LICENSE).
@@ -1,112 +0,0 @@
1
- //#region src/types.d.ts
2
- type ArgType = "boolean" | "string" | "enum" | "positional" | undefined;
3
- type _ArgDef<T extends ArgType, VT extends boolean | number | string> = {
4
- type?: T;
5
- description?: string;
6
- valueHint?: string;
7
- alias?: string | string[];
8
- default?: VT;
9
- required?: boolean;
10
- options?: string[];
11
- };
12
- type BooleanArgDef = Omit<_ArgDef<"boolean", boolean>, "options"> & {
13
- negativeDescription?: string;
14
- };
15
- type StringArgDef = Omit<_ArgDef<"string", string>, "options">;
16
- type EnumArgDef = _ArgDef<"enum", string>;
17
- type PositionalArgDef = Omit<_ArgDef<"positional", string>, "alias" | "options">;
18
- type ArgDef = BooleanArgDef | StringArgDef | PositionalArgDef | EnumArgDef;
19
- type ArgsDef = Record<string, ArgDef>;
20
- type Arg = ArgDef & {
21
- name: string;
22
- alias: string[];
23
- };
24
- type ResolveParsedArgType<T extends ArgDef, VT> = T extends {
25
- default?: any;
26
- required?: boolean;
27
- } ? T["default"] extends NonNullable<VT> ? VT : T["required"] extends true ? VT : VT | undefined : VT | undefined;
28
- type ParsedPositionalArg<T extends ArgDef> = T extends {
29
- type: "positional";
30
- } ? ResolveParsedArgType<T, string> : never;
31
- type ParsedStringArg<T extends ArgDef> = T extends {
32
- type: "string";
33
- } ? ResolveParsedArgType<T, string> : never;
34
- type ParsedBooleanArg<T extends ArgDef> = T extends {
35
- type: "boolean";
36
- } ? ResolveParsedArgType<T, boolean> : never;
37
- type ParsedEnumArg<T extends ArgDef> = T extends {
38
- type: "enum";
39
- options: infer U;
40
- } ? U extends Array<any> ? ResolveParsedArgType<T, U[number]> : never : never;
41
- type RawArgs = {
42
- _: string[];
43
- };
44
- type ParsedArg<T extends ArgDef> = T["type"] extends "positional" ? ParsedPositionalArg<T> : T["type"] extends "boolean" ? ParsedBooleanArg<T> : T["type"] extends "string" ? ParsedStringArg<T> : T["type"] extends "enum" ? ParsedEnumArg<T> : never;
45
- type ParsedArgs<T extends ArgsDef = ArgsDef> = RawArgs & { [K in keyof T]: ParsedArg<T[K]> } & { [K in keyof T as T[K] extends {
46
- alias: string;
47
- } ? T[K]["alias"] : never]: ParsedArg<T[K]> } & { [K in keyof T as T[K] extends {
48
- alias: string[];
49
- } ? T[K]["alias"][number] : never]: ParsedArg<T[K]> } & Record<string, string | number | boolean | string[]>;
50
- interface CommandMeta {
51
- name?: string;
52
- version?: string;
53
- description?: string;
54
- hidden?: boolean;
55
- alias?: string | string[];
56
- }
57
- type SubCommandsDef = Record<string, Resolvable<CommandDef<any>>>;
58
- type CommandDef<T extends ArgsDef = ArgsDef> = {
59
- meta?: Resolvable<CommandMeta>;
60
- args?: Resolvable<T>;
61
- default?: Resolvable<string>;
62
- subCommands?: Resolvable<SubCommandsDef>;
63
- plugins?: Resolvable<CittyPlugin>[];
64
- setup?: (context: CommandContext<T>) => any | Promise<any>;
65
- cleanup?: (context: CommandContext<T>) => any | Promise<any>;
66
- run?: (context: CommandContext<T>) => any | Promise<any>;
67
- };
68
- type CommandContext<T extends ArgsDef = ArgsDef> = {
69
- rawArgs: string[];
70
- args: ParsedArgs<T>;
71
- cmd: CommandDef<T>;
72
- subCommand?: CommandDef<T>;
73
- data?: any;
74
- };
75
- type CittyPlugin = {
76
- name: string;
77
- setup?(context: CommandContext<any>): void | Promise<void>;
78
- cleanup?(context: CommandContext<any>): void | Promise<void>;
79
- };
80
- type Awaitable<T> = () => T | Promise<T>;
81
- type Resolvable<T> = T | Promise<T> | (() => T) | (() => Promise<T>);
82
- //#endregion
83
- //#region src/command.d.ts
84
- declare function defineCommand<const T extends ArgsDef = ArgsDef>(def: CommandDef<T>): CommandDef<T>;
85
- interface RunCommandOptions {
86
- rawArgs: string[];
87
- data?: any;
88
- showUsage?: boolean;
89
- }
90
- declare function runCommand<T extends ArgsDef = ArgsDef>(cmd: CommandDef<T>, opts: RunCommandOptions): Promise<{
91
- result: unknown;
92
- }>;
93
- //#endregion
94
- //#region src/usage.d.ts
95
- declare function showUsage<T extends ArgsDef = ArgsDef>(cmd: CommandDef<T>, parent?: CommandDef<T>): Promise<void>;
96
- declare function renderUsage<T extends ArgsDef = ArgsDef>(cmd: CommandDef<T>, parent?: CommandDef<T>): Promise<string>;
97
- //#endregion
98
- //#region src/main.d.ts
99
- interface RunMainOptions {
100
- rawArgs?: string[];
101
- showUsage?: typeof showUsage;
102
- }
103
- declare function runMain<T extends ArgsDef = ArgsDef>(cmd: CommandDef<T>, opts?: RunMainOptions): Promise<void>;
104
- declare function createMain<T extends ArgsDef = ArgsDef>(cmd: CommandDef<T>): (opts?: RunMainOptions) => Promise<void>;
105
- //#endregion
106
- //#region src/args.d.ts
107
- declare function parseArgs<T extends ArgsDef = ArgsDef>(rawArgs: string[], argsDef: ArgsDef): ParsedArgs<T>;
108
- //#endregion
109
- //#region src/plugin.d.ts
110
- declare function defineCittyPlugin(plugin: Resolvable<CittyPlugin>): Resolvable<CittyPlugin>;
111
- //#endregion
112
- export { Arg, ArgDef, ArgType, ArgsDef, Awaitable, BooleanArgDef, CittyPlugin, CommandContext, CommandDef, CommandMeta, EnumArgDef, ParsedArgs, PositionalArgDef, Resolvable, type RunCommandOptions, type RunMainOptions, StringArgDef, SubCommandsDef, _ArgDef, createMain, defineCittyPlugin, defineCommand, parseArgs, renderUsage, runCommand, runMain, showUsage };