Skip to content

Commit 428030e

Browse files
authored
chore(watch): setup yarn watch for dev (#35)
* chore(watch): setup `yarn watch` for dev * docs: update readme example path * ci(test): fix artifacts path
1 parent bcee4ef commit 428030e

File tree

12 files changed

+136
-77
lines changed

12 files changed

+136
-77
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ jobs:
209209
uses: actions/download-artifact@v4
210210
with:
211211
name: bindings-${{ matrix.settings.target }}
212-
path: .
212+
path: ./@noctisynth/
213213
- name: List packages
214214
run: ls -R .
215215
shell: bash
@@ -239,7 +239,7 @@ jobs:
239239
uses: actions/download-artifact@v4
240240
with:
241241
name: bindings-x86_64-unknown-linux-gnu
242-
path: .
242+
path: ./@noctisynth/
243243
- name: List packages
244244
run: ls -R .
245245
shell: bash
@@ -271,7 +271,7 @@ jobs:
271271
uses: actions/download-artifact@v4
272272
with:
273273
name: bindings-x86_64-unknown-linux-musl
274-
path: .
274+
path: ./@noctisynth/
275275
- name: List packages
276276
run: ls -R .
277277
shell: bash
@@ -294,7 +294,7 @@ jobs:
294294
uses: actions/download-artifact@v4
295295
with:
296296
name: bindings-aarch64-unknown-linux-gnu
297-
path: .
297+
path: ./@noctisynth/
298298
- name: List packages
299299
run: ls -R .
300300
shell: bash
@@ -328,7 +328,7 @@ jobs:
328328
uses: actions/download-artifact@v4
329329
with:
330330
name: bindings-aarch64-unknown-linux-musl
331-
path: .
331+
path: ./@noctisynth/
332332
- name: List packages
333333
run: ls -R .
334334
shell: bash
@@ -367,7 +367,7 @@ jobs:
367367
uses: actions/download-artifact@v4
368368
with:
369369
name: bindings-armv7-unknown-linux-gnueabihf
370-
path: .
370+
path: ./@noctisynth/
371371
- name: List packages
372372
run: ls -R .
373373
shell: bash

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# archons
22

3-
Fast and elegant CLI build tool based on clap-rs
3+
Fast, powerful and elegant CLI build tool based on clap-rs
44

55
## Installation
66

77
```bash
8-
npm install -g clap-js
8+
npm install -g archons
99
```
1010

1111
## Usage
1212

13-
Look at [simple.js](./simple.js) for an example.
13+
Look at [Examples](./examples) for an example.
1414

1515
See [clap-rs](https://github.com/clap-rs/clap) for more information.

benchmark/bench.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import { Bench } from 'tinybench'
22

3-
import { plus100 } from '../index.js'
4-
5-
function add(a: number) {
6-
return a + 100
7-
}
8-
93
const b = new Bench()
104

115
b.add('Native a + 100', () => {
12-
plus100(10)
6+
137
})
148

159
b.add('JavaScript a + 100', () => {
16-
add(10)
10+
1711
})
1812

1913
await b.run()

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"napi",
1111
"noctisynth",
1212
"oxlint",
13+
"parens",
1314
"prebuild",
1415
"taplo",
1516
"tinybench"

examples/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.cjs

simple.js renamed to examples/simple.cts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { defineCommand, run } = require('./index.js')
1+
import { defineCommand, run, type Context } from '../index';
22

33
const dev = defineCommand({
44
meta: {
@@ -12,7 +12,7 @@ const dev = defineCommand({
1212
default: '3000',
1313
},
1414
},
15-
callback: (ctx) => {
15+
callback: (ctx: Context) => {
1616
console.log(ctx);
1717
}
1818
})
@@ -22,7 +22,7 @@ const main = defineCommand({
2222
name: 'simple',
2323
version: '0.0.1',
2424
about: 'A simple command line tool',
25-
alias: ['dev']
25+
styled: true,
2626
},
2727
options: {
2828
verbose: {

examples/tsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"moduleResolution": "NodeNext",
5+
"module": "NodeNext",
6+
"outDir": "."
7+
},
8+
"include": ["."],
9+
"exclude": ["index.cjs"]
10+
}
11+

index.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export interface CommandMeta {
2626
* This is optional and can be used to display the version of the CLI
2727
* when the command is called with the `--version` flag or `-V` option.
2828
*
29-
* This option will be ignored if the command is subcommand.
29+
* If not provided, the CLI will not display the version and you can't
30+
* call the command with the `--version` flag or `-V` option.
3031
*/
3132
version?: string
3233
/**
@@ -35,6 +36,12 @@ export interface CommandMeta {
3536
* Command description will be displayed in the help output.
3637
*/
3738
about?: string
39+
/**
40+
* Enable styled mode
41+
*
42+
* Determines whether the CLI output should be displayed in the styled format.
43+
*/
44+
styled?: boolean
3845
}
3946
export interface CommandOption {
4047
type?: 'positional' | 'flag' | 'option'

0 commit comments

Comments
 (0)