@bomb.sh/tab 0.0.1-pre.0 → 0.0.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.
- package/README.2.md +2 -2
- package/README.md +7 -7
- package/dist/bin/cli.d.ts +0 -0
- package/dist/bin/cli.js +1 -1
- package/package.json +19 -13
package/README.2.md
CHANGED
|
@@ -11,7 +11,7 @@ Autocompletions are the solution to not break the user's flow. The issue is they
|
|
|
11
11
|
`my-cli.ts`:
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import t from '@
|
|
14
|
+
import t from '@bomb.sh/tab';
|
|
15
15
|
|
|
16
16
|
t.name('my-cli');
|
|
17
17
|
|
|
@@ -87,7 +87,7 @@ And that made us develop our own autocompletion abstraction over npm, pnpm and y
|
|
|
87
87
|
They'd only have to run this command once and inject it in their shell config.
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
|
-
npx @
|
|
90
|
+
npx @bomb.sh/tab pnpm zsh
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
These autocompletions on top of the normal autocompletions that these package managers provide are going to be way more powerful.
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Check out the [examples directory](./examples) for complete examples of using Ta
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import { Completion, script } from '@
|
|
18
|
+
import { Completion, script } from '@bomb.sh/tab';
|
|
19
19
|
|
|
20
20
|
const name = 'my-cli';
|
|
21
21
|
const completion = new Completion();
|
|
@@ -70,11 +70,11 @@ Now your user can run `source <(my-cli complete zsh)` and they will get completi
|
|
|
70
70
|
|
|
71
71
|
Since we are heavy users of tools like `cac` and `citty`, we have created adapters for both of them. Ideally, tab would be integrated internally into these tools, but for now, this is a good compromise.
|
|
72
72
|
|
|
73
|
-
### `@
|
|
73
|
+
### `@bomb.sh/tab/cac`
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
76
|
import cac from 'cac';
|
|
77
|
-
import tab from '@
|
|
77
|
+
import tab from '@bomb.sh/tab/cac';
|
|
78
78
|
|
|
79
79
|
const cli = cac('my-cli');
|
|
80
80
|
|
|
@@ -105,11 +105,11 @@ Now autocompletion will be available for any specified command and option in you
|
|
|
105
105
|
|
|
106
106
|
Suggestions are missing in the adapters since yet cac or citty do not have a way to provide suggestions (tab just came out!), we'd have to provide them manually. Mutations do not hurt in this situation.
|
|
107
107
|
|
|
108
|
-
### `@
|
|
108
|
+
### `@bomb.sh/tab/citty`
|
|
109
109
|
|
|
110
110
|
```ts
|
|
111
111
|
import citty, { defineCommand, createMain } from 'citty';
|
|
112
|
-
import tab from '@
|
|
112
|
+
import tab from '@bomb.sh/tab/citty';
|
|
113
113
|
|
|
114
114
|
const main = defineCommand({
|
|
115
115
|
meta: {
|
|
@@ -154,11 +154,11 @@ const cli = createMain(main);
|
|
|
154
154
|
cli();
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
### `@
|
|
157
|
+
### `@bomb.sh/tab/commander`
|
|
158
158
|
|
|
159
159
|
```ts
|
|
160
160
|
import { Command } from 'commander';
|
|
161
|
-
import tab from '@
|
|
161
|
+
import tab from '@bomb.sh/tab/commander';
|
|
162
162
|
|
|
163
163
|
const program = new Command('my-cli');
|
|
164
164
|
program.version('1.0.0');
|
package/dist/bin/cli.d.ts
CHANGED
|
File without changes
|
package/dist/bin/cli.js
CHANGED
|
@@ -457,7 +457,7 @@ async function main() {
|
|
|
457
457
|
process.exit(0);
|
|
458
458
|
} else {
|
|
459
459
|
console.error(`Error: Expected '--' followed by command to complete`);
|
|
460
|
-
console.error(`Example: ${packageManager} exec @
|
|
460
|
+
console.error(`Example: ${packageManager} exec @bomb.sh/tab ${packageManager} complete -- command-to-complete`);
|
|
461
461
|
process.exit(1);
|
|
462
462
|
}
|
|
463
463
|
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bomb.sh/tab",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"main": "./dist/t.js",
|
|
5
5
|
"types": "./dist/t.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"tab": "./dist/bin/cli.js"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "vitest run",
|
|
12
|
-
"type-check": "tsc --noEmit",
|
|
13
|
-
"format": "prettier --write .",
|
|
14
|
-
"format:check": "prettier --check .",
|
|
15
|
-
"build": "tsdown",
|
|
16
|
-
"prepare": "pnpm build",
|
|
17
|
-
"lint": "eslint src \"./*.ts\"",
|
|
18
|
-
"benchmark": "tsx benchmarks/completion.bench.ts"
|
|
19
|
-
},
|
|
20
10
|
"files": [
|
|
21
11
|
"dist"
|
|
22
12
|
],
|
|
@@ -27,6 +17,14 @@
|
|
|
27
17
|
"autocomplete"
|
|
28
18
|
],
|
|
29
19
|
"author": "Bombshell Authors (https://github.com/bombshell-dev)",
|
|
20
|
+
"homepage": "https://github.com/bombshell-dev/tab#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/bombshell-dev/tab/issues"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/bombshell-dev/tab.git"
|
|
27
|
+
},
|
|
30
28
|
"license": "ISC",
|
|
31
29
|
"devDependencies": {
|
|
32
30
|
"@changesets/cli": "^2.29.6",
|
|
@@ -70,5 +68,13 @@
|
|
|
70
68
|
"require": "./dist/commander.cjs"
|
|
71
69
|
}
|
|
72
70
|
},
|
|
73
|
-
"
|
|
74
|
-
|
|
71
|
+
"scripts": {
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"type-check": "tsc --noEmit",
|
|
74
|
+
"format": "prettier --write .",
|
|
75
|
+
"format:check": "prettier --check .",
|
|
76
|
+
"build": "tsdown",
|
|
77
|
+
"lint": "eslint src \"./*.ts\"",
|
|
78
|
+
"benchmark": "tsx benchmarks/completion.bench.ts"
|
|
79
|
+
}
|
|
80
|
+
}
|