@suluk/provision 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.
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * The @suluk/provision CLI shell (C047) — drizzle-kit-style. Loads `provision.config.ts` (its default export is a
4
+ * {@link ProvisionApp}), runs the command, prints, and exits. All logic is in `runCli` (pure of the process); this is
5
+ * only the I/O edge.
6
+ *
7
+ * provision plan diff the desired config against the live journal
8
+ * provision apply [--prune] provision + bind + land credentials (push)
9
+ * provision check fail (exit 1) on any drift — the CI gate
10
+ * provision status show what's provisioned
11
+ * --config <path> the config file (default ./provision.config.ts)
12
+ */
13
+ import { resolve } from "node:path";
14
+ import { runCli } from "../src/cli";
15
+ import type { ProvisionApp } from "../src/app";
16
+
17
+ const argv = process.argv.slice(2);
18
+ const ci = argv.indexOf("--config");
19
+ const configPath = ci >= 0 ? argv[ci + 1] : "provision.config.ts";
20
+ const args = argv.filter((a, i) => a !== "--config" && i !== ci + 1);
21
+
22
+ const mod = (await import(resolve(process.cwd(), configPath))) as { default?: ProvisionApp };
23
+ if (!mod.default) {
24
+ console.error(`✗ ${configPath} has no default export (expected a defineProvisionApp(...) result)`);
25
+ process.exit(2);
26
+ }
27
+
28
+ const { output, exitCode } = await runCli(mod.default, args);
29
+ console.log(output);
30
+ process.exit(exitCode);
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@suluk/provision",
3
+ "version": "0.1.0",
4
+ "description": "Declarative service provisioning for a Suluk app, modelled on the Open Service Broker API and driven like drizzle-kit. Declare the infra you want in one provision.config (D1/KV/R2/secrets/Stripe/domains/tokens as OSB brokers); `plan` diffs desired-vs-live, `apply` walks the binding DAG (provision → poll async last-operation → bind → land credentials in @suluk/env, encrypted + commit-safe), `check` flags drift/orphans. A layer ABOVE @suluk/cloudflare / @suluk/deploy / @suluk/env — it orchestrates, they execute. CANDIDATE tooling.",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "license": "Apache-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/MahmoodKhalil57/suluk.git",
12
+ "directory": "tooling/ts/packages/provision"
13
+ },
14
+ "homepage": "https://github.com/MahmoodKhalil57/suluk#readme",
15
+ "bugs": "https://github.com/MahmoodKhalil57/suluk/issues",
16
+ "type": "module",
17
+ "main": "src/index.ts",
18
+ "bin": {
19
+ "suluk-provision": "bin/provision.ts"
20
+ },
21
+ "exports": {
22
+ ".": "./src/index.ts"
23
+ },
24
+ "dependencies": {
25
+ "@suluk/cloudflare": "^0.2.0",
26
+ "@suluk/env": "^0.2.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/bun": "latest"
30
+ },
31
+ "scripts": {
32
+ "test": "bun test",
33
+ "typecheck": "tsc --noEmit -p ."
34
+ }
35
+ }