convoker 0.5.0 → 0.5.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/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Convoker
2
+
3
+ A simple, type safe CLI library for TypeScript.
4
+
5
+ ```ts
6
+ import { i, Command } from "convoker";
7
+
8
+ const program = new Command("calc").description("A basic calculator.");
9
+
10
+ program
11
+ .subCommand("add", (c) =>
12
+ c
13
+ .description("Adds two numbers.")
14
+ .input({
15
+ x: i.option("number", "-x", "--x"),
16
+ y: i.option("number", "-y", "--y"),
17
+ })
18
+ .action(({ x, y }) => {
19
+ console.log(`${x} + ${y} = ${x + y}`);
20
+ }),
21
+ )
22
+ .subCommand("sub", (c) =>
23
+ c
24
+ .description("Subtracts any amount of numbers.")
25
+ .input({
26
+ numbers: i.option("number", "--numbers", "-n").list(),
27
+ })
28
+ .action(({ numbers }) => {
29
+ const sub = numbers.reduce((a, b) => a - b, 0);
30
+ console.log(`${numbers.join(" + ")} = ${sub}`);
31
+ }),
32
+ )
33
+ .run();
34
+ ```
package/dist/index.cjs CHANGED
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  }) : target, mod));
27
27
 
28
28
  //#endregion
29
+ let _convoker_input = require("@convoker/input");
30
+ _convoker_input = __toESM(_convoker_input);
29
31
  let _convoker_theme = require("@convoker/theme");
30
32
  _convoker_theme = __toESM(_convoker_theme);
31
33
  let _convoker_log = require("@convoker/log");
@@ -33,6 +35,12 @@ _convoker_log = __toESM(_convoker_log);
33
35
  let _convoker_prompt = require("@convoker/prompt");
34
36
  _convoker_prompt = __toESM(_convoker_prompt);
35
37
 
38
+ Object.defineProperty(exports, 'i', {
39
+ enumerable: true,
40
+ get: function () {
41
+ return _convoker_input;
42
+ }
43
+ });
36
44
  Object.defineProperty(exports, 'log', {
37
45
  enumerable: true,
38
46
  get: function () {
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
+ import * as i from "@convoker/input";
1
2
  import * as theme from "@convoker/theme";
2
3
  import * as log from "@convoker/log";
3
4
  import * as prompt from "@convoker/prompt";
4
5
  export * from "@convoker/core";
5
- export { log, prompt, theme };
6
+ export { i, log, prompt, theme };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
+ import * as i from "@convoker/input";
1
2
  import * as theme from "@convoker/theme";
2
3
  import * as log from "@convoker/log";
3
4
  import * as prompt from "@convoker/prompt";
4
5
  export * from "@convoker/core";
5
- export { log, prompt, theme };
6
+ export { i, log, prompt, theme };
package/dist/index.mjs CHANGED
@@ -1,7 +1,8 @@
1
+ import * as i from "@convoker/input";
1
2
  import * as theme from "@convoker/theme";
2
3
  import * as log from "@convoker/log";
3
4
  import * as prompt from "@convoker/prompt";
4
5
 
5
6
  export * from "@convoker/core"
6
7
 
7
- export { log, prompt, theme };
8
+ export { i, log, prompt, theme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "convoker",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "A simple, type-safe CLI framework.",
5
5
  "exports": {
6
6
  ".": {
@@ -19,11 +19,16 @@
19
19
  "log",
20
20
  "theme"
21
21
  ],
22
+ "files": [
23
+ "src",
24
+ "dist"
25
+ ],
22
26
  "dependencies": {
23
- "@convoker/core": "0.4.1",
24
- "@convoker/log": "0.1.0",
25
- "@convoker/prompt": "0.1.0",
26
- "@convoker/theme": "0.1.0"
27
+ "@convoker/core": "0.1.1",
28
+ "@convoker/log": "0.1.1",
29
+ "@convoker/prompt": "0.2.0",
30
+ "@convoker/input": "0.1.1",
31
+ "@convoker/theme": "0.1.1"
27
32
  },
28
33
  "publishConfig": {
29
34
  "access": "public"
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "@convoker/core";
2
+ export * as i from "@convoker/input";
2
3
  export * as theme from "@convoker/theme";
3
4
  export * as log from "@convoker/log";
4
5
  export * as prompt from "@convoker/prompt";
@@ -1,20 +0,0 @@
1
-
2
-
3
- > convoker@0.5.0 prepare /code/sprucepad/convoker/js/packages/convoker
4
- > tsdown
5
-
6
- ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
7
- ℹ config file: /code/sprucepad/convoker/js/packages/convoker/tsdown.config.ts (unrun)
8
- ℹ entry: src/index.ts
9
- ℹ tsconfig: tsconfig.json
10
- ℹ Build start
11
- ℹ Cleaning 4 files
12
- ℹ [CJS] dist/index.cjs 2.01 kB │ gzip: 0.75 kB
13
- ℹ [CJS] 1 files, total: 2.01 kB
14
- ℹ [CJS] dist/index.d.cts 0.19 kB │ gzip: 0.11 kB
15
- ℹ [CJS] 1 files, total: 0.19 kB
16
- ℹ [ESM] dist/index.mjs 0.19 kB │ gzip: 0.11 kB
17
- ℹ [ESM] dist/index.d.mts 0.19 kB │ gzip: 0.11 kB
18
- ℹ [ESM] 2 files, total: 0.37 kB
19
- ✔ Build complete in 1088ms
20
- ✔ Build complete in 1089ms
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "baseUrl": "."
5
- }
6
- }
package/tsdown.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import { defineConfig } from "tsdown";
2
-
3
- export default defineConfig({
4
- entry: ["./src/index.ts"],
5
- format: ["esm", "cjs"],
6
- dts: {
7
- sourcemap: true,
8
- },
9
- sourcemap: true,
10
- });