@alloy-cd/sdk 0.0.1

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,90 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ // package.json
4
+ var package_default = {
5
+ name: "@alloy-cd/sdk",
6
+ version: "0.0.1",
7
+ private: false,
8
+ type: "module",
9
+ repository: {
10
+ type: "git",
11
+ url: "git+https://github.com/alloy-cd/alloy.git",
12
+ directory: "apps/sdk"
13
+ },
14
+ main: "./dist/package/index.js",
15
+ types: "./dist/package/index.d.ts",
16
+ exports: {
17
+ ".": {
18
+ types: "./dist/package/index.d.ts",
19
+ import: "./dist/package/index.js"
20
+ }
21
+ },
22
+ bin: {
23
+ alloy: "dist/cli/index.js"
24
+ },
25
+ files: [
26
+ "dist"
27
+ ],
28
+ publishConfig: {
29
+ access: "public"
30
+ },
31
+ scripts: {
32
+ build: `rm -rf dist .turbo/tsconfig.types.tsbuildinfo && mkdir -p dist/cli dist/package && bun build src/cli/index.ts --outfile dist/cli/index.js --target bun --define process.env.ALLOY_SDK_VERSION='"'"\${ALLOY_SDK_VERSION:-}"'"' && bun build src/package/index.ts --outfile dist/package/index.js --target bun && tsc -p tsconfig.types.json`,
33
+ "build:binaries": "mkdir -p dist/bin && bun build src/cli/index.ts --compile --minify --target=bun-linux-x64 --outfile dist/bin/alloy-linux-x64 && bun build src/cli/index.ts --compile --minify --target=bun-linux-arm64 --outfile dist/bin/alloy-linux-arm64 && bun build src/cli/index.ts --compile --minify --target=bun-darwin-x64 --outfile dist/bin/alloy-darwin-x64 && bun build src/cli/index.ts --compile --minify --target=bun-darwin-arm64 --outfile dist/bin/alloy-darwin-arm64 && bun build src/cli/index.ts --compile --minify --target=bun-windows-x64 --outfile dist/bin/alloy-windows-x64.exe",
34
+ dev: "bun run src/cli/index.ts",
35
+ typecheck: "tsc --noEmit -p tsconfig.json",
36
+ lint: "biome lint .",
37
+ "lint:fix": "biome lint --write .",
38
+ knip: "cd ../.. && bunx knip-bun --workspace apps/sdk --no-progress --production"
39
+ },
40
+ dependencies: {},
41
+ devDependencies: {
42
+ "@types/bun": "^1.3.14",
43
+ typescript: "^5.9.3"
44
+ }
45
+ };
46
+
47
+ // src/cli/index.ts
48
+ var command = process.argv[2];
49
+ var version = package_default.version;
50
+ function printHelp() {
51
+ console.log(`${package_default.name} ${version}`);
52
+ console.log("Usage: alloy <command>");
53
+ console.log("");
54
+ console.log("Commands:");
55
+ console.log(" init Create an alloy.config.ts file");
56
+ console.log(" --version Print the CLI version");
57
+ }
58
+ async function init() {
59
+ const configPath = "alloy.config.ts";
60
+ const file = Bun.file(configPath);
61
+ if (await file.exists()) {
62
+ console.error(`${configPath} already exists`);
63
+ process.exit(1);
64
+ }
65
+ await Bun.write(configPath, `import { defineConfig } from "${package_default.name}";
66
+
67
+ export default defineConfig({
68
+ name: "my-alloy-app",
69
+ });
70
+ `);
71
+ console.log(`Created ${configPath}`);
72
+ }
73
+ switch (command) {
74
+ case "init":
75
+ await init();
76
+ break;
77
+ case "--version":
78
+ case "-v":
79
+ console.log(version);
80
+ break;
81
+ case undefined:
82
+ case "--help":
83
+ case "-h":
84
+ printHelp();
85
+ break;
86
+ default:
87
+ console.error(`Unknown command: ${command}`);
88
+ printHelp();
89
+ process.exit(1);
90
+ }
@@ -0,0 +1,4 @@
1
+ export type AlloyConfig = {
2
+ name?: string;
3
+ };
4
+ export declare function defineConfig(config: AlloyConfig): AlloyConfig;
@@ -0,0 +1,8 @@
1
+ // @bun
2
+ // src/package/index.ts
3
+ function defineConfig(config) {
4
+ return config;
5
+ }
6
+ export {
7
+ defineConfig
8
+ };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@alloy-cd/sdk",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/alloy-cd/alloy.git",
9
+ "directory": "apps/sdk"
10
+ },
11
+ "main": "./dist/package/index.js",
12
+ "types": "./dist/package/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/package/index.d.ts",
16
+ "import": "./dist/package/index.js"
17
+ }
18
+ },
19
+ "bin": {
20
+ "alloy": "dist/cli/index.js"
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "scripts": {
29
+ "build": "rm -rf dist .turbo/tsconfig.types.tsbuildinfo && mkdir -p dist/cli dist/package && bun build src/cli/index.ts --outfile dist/cli/index.js --target bun --define process.env.ALLOY_SDK_VERSION='\"'\"${ALLOY_SDK_VERSION:-}\"'\"' && bun build src/package/index.ts --outfile dist/package/index.js --target bun && tsc -p tsconfig.types.json",
30
+ "build:binaries": "mkdir -p dist/bin && bun build src/cli/index.ts --compile --minify --target=bun-linux-x64 --outfile dist/bin/alloy-linux-x64 && bun build src/cli/index.ts --compile --minify --target=bun-linux-arm64 --outfile dist/bin/alloy-linux-arm64 && bun build src/cli/index.ts --compile --minify --target=bun-darwin-x64 --outfile dist/bin/alloy-darwin-x64 && bun build src/cli/index.ts --compile --minify --target=bun-darwin-arm64 --outfile dist/bin/alloy-darwin-arm64 && bun build src/cli/index.ts --compile --minify --target=bun-windows-x64 --outfile dist/bin/alloy-windows-x64.exe",
31
+ "dev": "bun run src/cli/index.ts",
32
+ "typecheck": "tsc --noEmit -p tsconfig.json",
33
+ "lint": "biome lint .",
34
+ "lint:fix": "biome lint --write .",
35
+ "knip": "cd ../.. && bunx knip-bun --workspace apps/sdk --no-progress --production"
36
+ },
37
+ "dependencies": {},
38
+ "devDependencies": {
39
+ "@types/bun": "^1.3.14",
40
+ "typescript": "^5.9.3"
41
+ }
42
+ }