Skip to content

Commit d978f80

Browse files
committed
Rename for release
1 parent cc9e565 commit d978f80

7 files changed

Lines changed: 596 additions & 644 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"LDJSON",
5454
"LJSON",
5555
"ndjson",
56+
"oadacli",
5657
"oadaified",
5758
"oadaify",
5859
"oclif",

README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Pipeable OADA client CLI
44

55
[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
6-
[![Version](https://img.shields.io/npm/v/clioada.svg)](https://npmjs.org/package/clioada)
7-
[![Downloads/week](https://img.shields.io/npm/dw/clioada.svg)](https://npmjs.org/package/clioada)
8-
[![License](https://img.shields.io/npm/l/clioada.svg)](https://github.com/awlayton/clioada/blob/master/package.json)
6+
[![Version](https://img.shields.io/npm/v/@oada/cli.svg)](https://npmjs.org/package/@oada/cli)
7+
[![Downloads/week](https://img.shields.io/npm/dw/@oada/cli.svg)](https://npmjs.org/package/@oada/cli)
8+
[![License](https://img.shields.io/npm/l/@oada/cli.svg)](https://github.com/OADA/cli/blob/master/package.json)
99

1010
<!-- toc -->
1111

@@ -55,11 +55,9 @@ and they will be expanded).
5555
<!-- usage -->
5656

5757
```sh-session
58-
$ npm install -g clioada
58+
$ yarn global add @oada/cli
5959
$ oada COMMAND
6060
running command...
61-
$ oada (-v|--version|version)
62-
clioada/1.1.0 linux-x64 node-v15.7.0
6361
$ oada --help [COMMAND]
6462
USAGE
6563
$ oada COMMAND
@@ -134,7 +132,7 @@ ALIASES
134132
$ oada config
135133
```
136134

137-
_See code: [src/commands/config/show.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/config/show.ts)_
135+
_See code: [src/commands/config/show.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/config/show.ts)_
138136

139137
### `oada delete PATHS...`
140138

@@ -164,7 +162,7 @@ EXAMPLES
164162
$ oada rm /bookmarks/foo /bookmarks/bar /bookmarks/baz*
165163
```
166164

167-
_See code: [src/commands/delete.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/delete.ts)_
165+
_See code: [src/commands/delete.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/delete.ts)_
168166

169167
### `oada fs:copy PATHS... PATH`
170168

@@ -192,7 +190,7 @@ EXAMPLES
192190
$ oada cp /resources/foo1 /resources/foo2 /bookmarks/foos/
193191
```
194192

195-
_See code: [src/commands/fs/copy.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/fs/copy.ts)_
193+
_See code: [src/commands/fs/copy.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/fs/copy.ts)_
196194

197195
### `oada fs:link PATHS... PATH`
198196

@@ -222,7 +220,7 @@ EXAMPLES
222220
$ oada ln /resources/thingy1 /resources/thingy2 /bookmarks/thingies/
223221
```
224222

225-
_See code: [src/commands/fs/link.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/fs/link.ts)_
223+
_See code: [src/commands/fs/link.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/fs/link.ts)_
226224

227225
### `oada fs:list PATHS...`
228226

@@ -246,7 +244,7 @@ ALIASES
246244
$ oada l
247245
```
248246

249-
_See code: [src/commands/fs/list.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/fs/list.ts)_
247+
_See code: [src/commands/fs/list.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/fs/list.ts)_
250248

251249
### `oada fs:move PATHS... PATH`
252250

@@ -274,7 +272,7 @@ EXAMPLES
274272
$ oada mv /resources/foo1 /resources/foo2 /bookmarks/foos/
275273
```
276274

277-
_See code: [src/commands/fs/move.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/fs/move.ts)_
275+
_See code: [src/commands/fs/move.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/fs/move.ts)_
278276

279277
### `oada fs:remove PATHS...`
280278

@@ -304,7 +302,7 @@ EXAMPLES
304302
$ oada rm /bookmarks/foo /bookmarks/bar /bookmarks/baz*
305303
```
306304

307-
_See code: [src/commands/fs/remove.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/fs/remove.ts)_
305+
_See code: [src/commands/fs/remove.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/fs/remove.ts)_
308306

309307
### `oada fs:touch PATHS...`
310308

@@ -330,7 +328,7 @@ EXAMPLE
330328
$ oada touch /bookmarks
331329
```
332330

333-
_See code: [src/commands/fs/touch.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/fs/touch.ts)_
331+
_See code: [src/commands/fs/touch.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/fs/touch.ts)_
334332

335333
### `oada get PATHS...`
336334

@@ -375,7 +373,7 @@ EXAMPLES
375373
700
376374
```
377375

378-
_See code: [src/commands/get.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/get.ts)_
376+
_See code: [src/commands/get.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/get.ts)_
379377

380378
### `oada head PATHS...`
381379

@@ -405,7 +403,7 @@ EXAMPLES
405403
1
406404
```
407405

408-
_See code: [src/commands/head.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/head.ts)_
406+
_See code: [src/commands/head.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/head.ts)_
409407

410408
### `oada help [COMMAND]`
411409

@@ -568,7 +566,7 @@ EXAMPLE
568566
$ oada post - /bookmarks/ <<< '{"a": 1}{"b": true}'
569567
```
570568
571-
_See code: [src/commands/post.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/post.ts)_
569+
_See code: [src/commands/post.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/post.ts)_
572570
573571
### `oada put PATHS... PATH`
574572
@@ -597,7 +595,7 @@ EXAMPLE
597595
$ oada put - /bookmarks/ <<< '{"a": 1}'
598596
```
599597
600-
_See code: [src/commands/put.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/put.ts)_
598+
_See code: [src/commands/put.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/put.ts)_
601599
602600
### `oada watch PATH`
603601
@@ -690,7 +688,7 @@ EXAMPLE
690688
]
691689
```
692690
693-
_See code: [src/commands/watch.ts](https://github.com/awlayton/clioada/blob/v1.1.0/src/commands/watch.ts)_
691+
_See code: [src/commands/watch.ts](https://github.com/OADA/cli/blob/v1.1.0/src/commands/watch.ts)_
694692
695693
<!-- commandsstop -->
696694

package.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"node": ">=16.0.0"
1111
},
1212
"author": "Alex Layton <alex@layton.in>",
13-
"homepage": "https://github.com/awlayton/clioada",
14-
"repository": "awlayton/clioada",
15-
"bugs": "https://github.com/awlayton/clioada/issues",
13+
"homepage": "https://github.com/OADA/cli",
14+
"repository": "OADA/cli",
15+
"bugs": "https://github.com/OADA/cli/issues",
1616
"license": "MIT",
1717
"keywords": [
1818
"OADA",
@@ -31,8 +31,7 @@
3131
},
3232
"assets": [
3333
"oclif.manifest.json",
34-
".pnp.*",
35-
".yarn/**/*"
34+
"dist/**/*.map"
3635
],
3736
"scripts": "dist/**/*.js",
3837
"targets": [
@@ -75,7 +74,7 @@
7574
"yarn.lock"
7675
],
7776
"dependencies": {
78-
"@oada/client": "2.6.4",
77+
"@oada/client": "3.0.3",
7978
"@oada/oadaify": "^1.0.1",
8079
"@oclif/command": "^1.8.15",
8180
"@oclif/config": "1.18.2",
@@ -85,20 +84,17 @@
8584
"@oclif/plugin-help": "^5.1.10",
8685
"@oclif/plugin-not-found": "^2.2.3",
8786
"@oclif/plugin-plugins": "^2.0.11",
88-
"bluebird": "^3.7.2",
8987
"cli-highlight": "^2.1.11",
9088
"concatjson": "^2.0.1",
9189
"dotenv": "^10.0.0",
9290
"find-up": "^5.0.0",
9391
"gaxios": "^4.3.2",
9492
"hjson": "^3.2.2",
95-
"ix": "^4.5.2",
9693
"json-6": "^1.1.4",
9794
"ksuid": "^3.0.0",
9895
"minimatch": "^3.0.4",
9996
"ndjson": "^2.0.0",
10097
"object-assign-deep": "^0.4.0",
101-
"supports-color": "^9.2.1",
10298
"ts-node": "^10.4.0",
10399
"tslib": "^2.3.1",
104100
"type-fest": "^2.8.0"
@@ -107,15 +103,12 @@
107103
"@oclif/dev-cli": "^1.26.10",
108104
"@oclif/parser": "^3.8.6",
109105
"@tsconfig/node16": "^1.0.2",
110-
"@types/bluebird": "^3.5.36",
111106
"@types/glob": "^7.2.0",
112107
"@types/json5": "^2.2.0",
113108
"@types/minimatch": "^3.0.5",
114109
"@types/ndjson": "^2.0.1",
115110
"@types/node": "^16.11.14",
116111
"@types/object-assign-deep": "^0.4.0",
117-
"@types/semver": "^7.3.9",
118-
"@types/webpack": "^5.28.0",
119112
"@typescript-eslint/eslint-plugin": "^5.7.0",
120113
"@typescript-eslint/parser": "^5.7.0",
121114
"@yarnpkg/sdks": "^2.5.1-rc.6",
@@ -148,10 +141,7 @@
148141
"oclif": "^2.0.1",
149142
"pkg": "^5.5.1",
150143
"prettier": "^2.5.1",
151-
"shebang-loader": "^0.0.1",
152-
"source-map-loader": "^3.0.0",
153-
"ts-loader": "^9.2.6",
154-
"typescript": "^4.4.4"
144+
"typescript": "4.5.4"
155145
},
156146
"packageManager": "yarn@3.1.1"
157147
}

src/BaseCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export default abstract class BaseCommand extends Command {
182182

183183
override async init() {
184184
this.configFiles = [join(this.config.configDir, 'config')].concat(
185-
(await findUp(configTypes.map((extension) => `.clioada${extension}`))) ??
185+
(await findUp(configTypes.map((extension) => `.oadacli${extension}`))) ??
186186
[]
187187
);
188188
const userConfig = await loadUserConfig(this.configFiles);

src/commands/watch.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@
1111

1212
import { flags } from '@oclif/command';
1313

14-
import { AsyncSink } from 'ix/asynciterable';
15-
1614
import { json, shell } from '../highlight';
1715
import Command from '../BaseCommand';
1816

19-
import type { WatchRequest } from '@oada/client';
2017
import getConn from '../connections';
2118
import { output } from '../io';
2219

@@ -126,7 +123,6 @@ export default class Watch extends Command {
126123
const conn = getConn(this.iconfig);
127124

128125
const path = `${rawpath}`;
129-
const sink = new AsyncSink();
130126
await output(
131127
out,
132128
async function* () {
@@ -139,17 +135,15 @@ export default class Watch extends Command {
139135
rev = Number(current!) + rev;
140136
}
141137

138+
// @ts-expect-error the deprecated v2 API confuses the types
142139
// eslint-disable-next-line security/detect-non-literal-fs-filename
143-
await conn.watch({
144-
type,
140+
const { changes } = await conn.watch({
141+
type: type as 'single' | 'tree',
145142
rev: `${rev}`,
146143
path,
147-
watchCallback(change: unknown) {
148-
sink.write(change);
149-
},
150-
} as WatchRequest);
144+
});
151145

152-
yield* sink;
146+
yield* changes;
153147
},
154148
this.iconfig
155149
);

src/connections.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414

1515
import { URL } from 'node:url';
1616

17-
import {
18-
GETRequest,
19-
OADAClient,
20-
PUTRequest,
21-
WatchRequest,
22-
connect,
23-
} from '@oada/client';
17+
import { GETRequest, OADAClient, PUTRequest, connect } from '@oada/client';
2418

19+
import type {
20+
WatchRequestSingle,
21+
WatchRequestTree,
22+
} from '@oada/client/dist/client';
2523
import type { IConfig } from './BaseCommand';
2624

2725
interface Connections {
@@ -67,15 +65,24 @@ export function conn(config: IConfig): OADAClient {
6765
};
6866
}
6967

70-
client.watch = async ({ path: p, ...rest }: WatchRequest) => {
68+
client.watch = async <R extends WatchRequestSingle | WatchRequestTree>({
69+
path: p,
70+
...rest
71+
}: R) => {
7172
let path = `${p}`;
7273
let host;
7374
try {
7475
({ host, pathname: path } = new URL(p));
7576
} finally {
7677
const con = await getConnection(host);
7778
// eslint-disable-next-line security/detect-non-literal-fs-filename, no-unsafe-finally
78-
return con.watch({ path, ...rest });
79+
return con.watch(
80+
// @ts-expect-error the deprecated v2 API screws up the types
81+
{
82+
path,
83+
...rest,
84+
} as R
85+
);
7986
}
8087
};
8188

0 commit comments

Comments
 (0)