@saws/cli 2.0.0-beta.2 → 2.0.0-beta.21
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 +206 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/bin/saws.d.ts +0 -1
- package/dist/bin/saws.js +32 -40
- package/dist/commands/app/deploy.d.ts +4 -0
- package/dist/commands/app/deploy.js +20 -0
- package/dist/commands/app/files.d.ts +4 -0
- package/dist/commands/app/files.js +40 -0
- package/dist/commands/app/index.d.ts +2 -0
- package/dist/commands/app/index.js +22 -0
- package/dist/commands/app/install.d.ts +4 -0
- package/dist/commands/app/install.js +35 -0
- package/dist/commands/app/list.d.ts +1 -0
- package/dist/commands/app/list.js +67 -0
- package/dist/commands/app/metadata.d.ts +2 -0
- package/dist/commands/app/metadata.js +27 -0
- package/dist/commands/app/paths.d.ts +2 -0
- package/dist/commands/app/paths.js +11 -0
- package/dist/commands/app/process.d.ts +3 -0
- package/dist/commands/app/process.js +53 -0
- package/dist/commands/app/update.d.ts +1 -0
- package/dist/commands/app/update.js +62 -0
- package/dist/commands/deploy/command.d.ts +2 -7
- package/dist/commands/deploy/command.js +13 -19
- package/dist/commands/deploy/index.d.ts +0 -1
- package/dist/commands/deploy/index.js +1 -4
- package/dist/commands/dev/command.d.ts +1 -7
- package/dist/commands/dev/command.js +46 -48
- package/dist/commands/dev/index.d.ts +0 -1
- package/dist/commands/dev/index.js +1 -6
- package/dist/commands/dev/tui/dev-tui.d.ts +18 -3
- package/dist/commands/dev/tui/dev-tui.js +263 -29
- package/dist/commands/host/command.d.ts +3 -2
- package/dist/commands/host/command.js +112 -7
- package/dist/commands/host/create.d.ts +9 -0
- package/dist/commands/host/create.js +30 -0
- package/dist/commands/host/deployment-key.d.ts +2 -0
- package/dist/commands/host/deployment-key.js +40 -0
- package/dist/commands/host/import-key.d.ts +5 -0
- package/dist/commands/host/import-key.js +40 -0
- package/dist/commands/host/index.d.ts +0 -1
- package/dist/commands/host/index.js +25 -3
- package/dist/commands/init/command.d.ts +1 -7
- package/dist/commands/init/command.js +24 -15
- package/dist/commands/init/index.d.ts +0 -1
- package/dist/commands/init/index.js +1 -5
- package/dist/commands/init/templates/gitignore.template.d.ts +1 -0
- package/dist/commands/init/templates/gitignore.template.js +4 -0
- package/dist/commands/init/templates/saws-ts.template.d.ts +3 -0
- package/dist/commands/init/templates/saws-ts.template.js +7 -0
- package/dist/commands/init/templates/tsconfig-json.template.d.ts +1 -0
- package/dist/commands/init/templates/tsconfig-json.template.js +4 -0
- package/dist/commands/logs/command.d.ts +5 -0
- package/dist/commands/logs/command.js +19 -0
- package/dist/commands/logs/index.d.ts +2 -0
- package/dist/commands/logs/index.js +7 -0
- package/dist/commands/secrets/command.d.ts +2 -2
- package/dist/commands/secrets/command.js +31 -9
- package/dist/commands/secrets/index.d.ts +0 -1
- package/dist/commands/secrets/index.js +7 -5
- package/dist/hosts.d.ts +1 -3
- package/dist/hosts.js +11 -10
- package/docs/global-hosts-and-applications.md +307 -0
- package/package.json +13 -20
- package/dist/bin/saws.d.ts.map +0 -1
- package/dist/commands/deploy/command.d.ts.map +0 -1
- package/dist/commands/deploy/index.d.ts.map +0 -1
- package/dist/commands/dev/command.d.ts.map +0 -1
- package/dist/commands/dev/index.d.ts.map +0 -1
- package/dist/commands/dev/tui/dev-tui.d.ts.map +0 -1
- package/dist/commands/host/command.d.ts.map +0 -1
- package/dist/commands/host/command.test.d.ts +0 -2
- package/dist/commands/host/command.test.d.ts.map +0 -1
- package/dist/commands/host/command.test.js +0 -13
- package/dist/commands/host/index.d.ts.map +0 -1
- package/dist/commands/init/command.d.ts.map +0 -1
- package/dist/commands/init/command.test.d.ts +0 -2
- package/dist/commands/init/command.test.d.ts.map +0 -1
- package/dist/commands/init/command.test.js +0 -40
- package/dist/commands/init/index.d.ts.map +0 -1
- package/dist/commands/secrets/command.d.ts.map +0 -1
- package/dist/commands/secrets/index.d.ts.map +0 -1
- package/dist/hosts.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/command.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,oBAAoB,iBA2B9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,aAAa,eAOA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/command.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,iBAAiB,iBAoD3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,aAAa,eAMH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-tui.d.ts","sourceRoot":"","sources":["../../../../src/commands/dev/tui/dev-tui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,YAAY,CAAC;AAkBlE,qBAAa,MAAM;IACjB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAiC;IAEjE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAiC;IACtD,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,QAAQ,EAAE,MAAM,EAAE;IAQ9B,KAAK;IAkBL,IAAI;IAUJ,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,QAAQ,GAAG,QAAmB;IAStE,OAAO,CAAC,cAAc,CAqBpB;IAEF,OAAO,CAAC,MAAM;IAkBd,OAAO,CAAC,MAAM,CA6BZ;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/commands/host/command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,2BAA2B,iBAOrC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,QAmBtD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.test.d.ts","sourceRoot":"","sources":["../../../src/commands/host/command.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import test from "node:test";
|
|
3
|
-
import { Host } from "@saws/host";
|
|
4
|
-
import { selectHost } from "./command.js";
|
|
5
|
-
const first = new Host({ name: "first", address: "first.example.test" });
|
|
6
|
-
const second = new Host({ name: "second", address: "second.example.test" });
|
|
7
|
-
test("selects the only configured host when its name is omitted", () => {
|
|
8
|
-
assert.equal(selectHost([first]), first);
|
|
9
|
-
});
|
|
10
|
-
test("requires a valid name when several hosts are configured", () => {
|
|
11
|
-
assert.throws(() => selectHost([second, first]), /Host name is required\. Available hosts: first, second/);
|
|
12
|
-
assert.throws(() => selectHost([first, second], "missing"), /Host "missing" was not found\. Available hosts: first, second/);
|
|
13
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/host/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,aAAa,eAUrB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/commands/init/command.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,kBAAkB,iBAiB5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.test.d.ts","sourceRoot":"","sources":["../../../src/commands/init/command.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdtemp, readFile, writeFile } from "node:fs/promises";
|
|
3
|
-
import os from "node:os";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import test from "node:test";
|
|
6
|
-
import { pathToFileURL } from "node:url";
|
|
7
|
-
import { initCommand } from "./command.js";
|
|
8
|
-
test("initializes only the selected service branch in dependency order", async () => {
|
|
9
|
-
const directory = await mkdtemp(path.join(os.tmpdir(), "saws-init-"));
|
|
10
|
-
const configPath = path.join(directory, "saws.mjs");
|
|
11
|
-
const packageUrl = pathToFileURL(path.resolve("../core/dist/index.js")).href;
|
|
12
|
-
await writeFile(configPath, `
|
|
13
|
-
import { appendFile } from "node:fs/promises";
|
|
14
|
-
import path from "node:path";
|
|
15
|
-
import { ServiceDefinition } from ${JSON.stringify(packageUrl)};
|
|
16
|
-
|
|
17
|
-
class InitializableService extends ServiceDefinition {
|
|
18
|
-
async onInit(context) {
|
|
19
|
-
await appendFile(path.join(context.rootDir, "initialized.txt"), this.name + "\\n");
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const shared = new InitializableService({ name: "shared" });
|
|
24
|
-
const api = new InitializableService({
|
|
25
|
-
name: "api",
|
|
26
|
-
dependencies: [shared],
|
|
27
|
-
});
|
|
28
|
-
const worker = new InitializableService({ name: "worker" });
|
|
29
|
-
|
|
30
|
-
export default new InitializableService({
|
|
31
|
-
name: "app",
|
|
32
|
-
dependencies: [api, worker],
|
|
33
|
-
});
|
|
34
|
-
`);
|
|
35
|
-
await initCommand("api", undefined, {
|
|
36
|
-
config: configPath,
|
|
37
|
-
rootDir: directory,
|
|
38
|
-
});
|
|
39
|
-
assert.equal(await readFile(path.join(directory, "initialized.txt"), "utf8"), "shared\napi\n");
|
|
40
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,aAAa,eAQF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/commands/secrets/command.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,qBAAqB,iBAkB/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/secrets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,aAAa,eAOC,CAAC"}
|
package/dist/hosts.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../src/hosts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,UAkB1D"}
|