@donezone/cli 0.1.0
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 +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Done CLI (Spec-first Stub)
|
|
2
|
+
|
|
3
|
+
The Done CLI is being rebuilt from the ground up. The four commands described in [`SPEC.md`](./SPEC.md)
|
|
4
|
+
(`init`, `build`, `deploy`, `dev`) are already exposed via Commander, but they intentionally exit with
|
|
5
|
+
"not implemented" messages until their full behaviour lands.
|
|
6
|
+
|
|
7
|
+
Use this package as a starting point when implementing the new workflow—wire each command to the
|
|
8
|
+
logic outlined in the spec, add supporting modules under `src/`, and extend the tests accordingly.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
const program = new Command();
|
|
4
|
+
program.name("done").description("Done developer toolkit (spec-first stub)").version("0.0.0-spec");
|
|
5
|
+
/* NOTE: All of these commands should be expected to be run from a standalone binary, not from the context of this repository / workspace. */
|
|
6
|
+
program
|
|
7
|
+
.command("build")
|
|
8
|
+
.description("Bundle Done contracts defined in done.json")
|
|
9
|
+
.option("-j, --contracts <path>", "Path to done.json")
|
|
10
|
+
.option("-n, --name <name...>", "Filter contract names")
|
|
11
|
+
.action(() => {
|
|
12
|
+
notImplemented("build");
|
|
13
|
+
// TODO: build contracts
|
|
14
|
+
/*
|
|
15
|
+
|
|
16
|
+
See how packages/demo/serve.ts handles Bun.build
|
|
17
|
+
|
|
18
|
+
Output compiled js artifacts to <cwd>/dist folder.
|
|
19
|
+
|
|
20
|
+
If cwd is a contract workspace, build all contract packages in workspace.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
});
|
|
24
|
+
program
|
|
25
|
+
.command("dev")
|
|
26
|
+
.description("Launch frontend dev server plus Done HTTP Local backend, watch sources, rebuild & redeploy contracts automatically")
|
|
27
|
+
.option("-b, --backend", "Run backend only")
|
|
28
|
+
.action(() => notImplemented("dev"));
|
|
29
|
+
program
|
|
30
|
+
.command("init")
|
|
31
|
+
.description("Set up a new Done project (see SPEC.md)")
|
|
32
|
+
.action(() => {
|
|
33
|
+
// TODO: create project template with frontend and backend
|
|
34
|
+
/*
|
|
35
|
+
|
|
36
|
+
Accept first argument for project name (`done init my-project`)
|
|
37
|
+
Download template, apply naming adjustments etc using whatever
|
|
38
|
+
JS project template generator library
|
|
39
|
+
|
|
40
|
+
Put contents in `my-project` (apply name input) folder
|
|
41
|
+
|
|
42
|
+
Install deps, and boot up full stack dev (`done dev`)
|
|
43
|
+
|
|
44
|
+
*/
|
|
45
|
+
});
|
|
46
|
+
program
|
|
47
|
+
.command("deploy")
|
|
48
|
+
.description("Deploy latest bundles to the configured Done workspace")
|
|
49
|
+
.option("-e, --env <profile>", "Environment/profile name")
|
|
50
|
+
.option("-f, --fresh", "Force rebuild before deploy")
|
|
51
|
+
.action(() => notImplemented("deploy"));
|
|
52
|
+
program
|
|
53
|
+
.command("test")
|
|
54
|
+
.description("Run unit tests for contracts");
|
|
55
|
+
program.parseAsync().catch((error) => notImplemented(error instanceof Error ? error.message : String(error)));
|
|
56
|
+
function notImplemented(label) {
|
|
57
|
+
console.error(`The command segment '${label}' is not implemented yet.\nSee packages/done-cli/SPEC.md for the planned behaviour.`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@donezone/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"done": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc -p tsconfig.json",
|
|
14
|
+
"clean": "rimraf dist"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@donezone/core": "^0.1.0",
|
|
18
|
+
"commander": "^12.1.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"rimraf": "^5.0.10",
|
|
22
|
+
"typescript": "^5.8.3"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
}
|
|
27
|
+
}
|