puls-dev 0.1.9 → 0.2.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.
Files changed (47) hide show
  1. package/README.md +7 -7
  2. package/dist/index.d.ts +0 -7
  3. package/dist/index.js +0 -7
  4. package/dist/providers/aws/index.d.ts +1 -0
  5. package/dist/providers/aws/index.js +1 -0
  6. package/dist/providers/aws/lambda.js +6 -6
  7. package/dist/providers/aws/lambda.test.d.ts +1 -0
  8. package/dist/providers/aws/lambda.test.js +189 -0
  9. package/dist/providers/aws/route53.d.ts +1 -1
  10. package/dist/providers/aws/route53.js +20 -12
  11. package/dist/providers/aws/route53.test.d.ts +1 -0
  12. package/dist/providers/aws/route53.test.js +229 -0
  13. package/dist/providers/aws/s3.d.ts +3 -0
  14. package/dist/providers/aws/s3.js +65 -3
  15. package/dist/providers/aws/s3.test.d.ts +1 -0
  16. package/dist/providers/aws/s3.test.js +172 -0
  17. package/dist/providers/do/api.js +5 -1
  18. package/dist/providers/do/certificate.test.d.ts +1 -0
  19. package/dist/providers/do/certificate.test.js +133 -0
  20. package/dist/providers/do/domain.d.ts +12 -1
  21. package/dist/providers/do/domain.js +129 -13
  22. package/dist/providers/do/domain.test.d.ts +1 -0
  23. package/dist/providers/do/domain.test.js +200 -0
  24. package/dist/providers/do/droplet.js +2 -2
  25. package/dist/providers/do/droplet.test.d.ts +1 -0
  26. package/dist/providers/do/droplet.test.js +265 -0
  27. package/dist/providers/do/firewall.test.d.ts +1 -0
  28. package/dist/providers/do/firewall.test.js +176 -0
  29. package/dist/providers/do/index.d.ts +1 -0
  30. package/dist/providers/do/index.js +1 -0
  31. package/dist/providers/do/load_balancer.d.ts +39 -5
  32. package/dist/providers/do/load_balancer.js +272 -30
  33. package/dist/providers/do/load_balancer.test.d.ts +1 -0
  34. package/dist/providers/do/load_balancer.test.js +269 -0
  35. package/dist/providers/firebase/api.js +2 -2
  36. package/dist/providers/firebase/functions.d.ts +1 -0
  37. package/dist/providers/firebase/functions.js +24 -10
  38. package/dist/providers/firebase/functions.test.d.ts +1 -0
  39. package/dist/providers/firebase/functions.test.js +297 -0
  40. package/dist/providers/firebase/hosting.js +5 -5
  41. package/dist/providers/firebase/hosting.test.d.ts +1 -0
  42. package/dist/providers/firebase/hosting.test.js +181 -0
  43. package/dist/providers/proxmox/index.d.ts +1 -0
  44. package/dist/providers/proxmox/index.js +1 -0
  45. package/dist/providers/proxmox/vm.d.ts +0 -1
  46. package/dist/providers/proxmox/vm.js +4 -50
  47. package/package.json +78 -5
@@ -1,7 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { spawn } from "node:child_process";
4
- import { dirname } from "node:path";
5
4
  import { createConnection } from "node:net";
6
5
  import { BaseBuilder } from "../../core/resource.js";
7
6
  import { Config } from "../../core/config.js";
@@ -380,59 +379,14 @@ export class VMBuilder extends BaseBuilder {
380
379
  }
381
380
  runProvisioner(ip, script) {
382
381
  const ext = script.split(".").pop()?.toLowerCase();
383
- if (ext === "sh")
384
- return this.runShellScript(ip, script);
382
+ if (ext === "sh") {
383
+ throw new Error(`Shell script provisioning (.sh) is no longer supported. ` +
384
+ `Please migrate "${script}" to an Ansible playbook (.yaml/.yml).`);
385
+ }
385
386
  if (ext === "pp")
386
387
  return this.runPuppet(ip, script);
387
388
  return this.runAnsible(ip, script); // .yml / .yaml
388
389
  }
389
- runShellScript(ip, script) {
390
- console.log(` 🔧 Running shell script: ${script} → ${ip}`);
391
- const keyPath = this.sshKeyPath();
392
- const scriptDir = dirname(script); // e.g. 'config'
393
- const sshArgs = [
394
- "-i",
395
- keyPath,
396
- "-o",
397
- "StrictHostKeyChecking=no",
398
- "-o",
399
- "ConnectTimeout=30",
400
- ];
401
- return new Promise((resolve, reject) => {
402
- // Copy the script's directory to the same path on the remote (e.g. config/ → /config/)
403
- console.log(` 📂 Copying ${scriptDir}/ → ${ip}:/${scriptDir}/`);
404
- const scp = spawn("scp", [
405
- "-i",
406
- keyPath,
407
- "-o",
408
- "StrictHostKeyChecking=no",
409
- "-r",
410
- scriptDir,
411
- `root@${ip}:/`,
412
- ], { stdio: "inherit" });
413
- scp.on("error", (err) => reject(new Error(`scp failed: ${err.message}`)));
414
- scp.on("close", (scpCode) => {
415
- if (scpCode !== 0) {
416
- reject(new Error(`scp exited with code ${scpCode}`));
417
- return;
418
- }
419
- const proc = spawn("ssh", [...sshArgs, `root@${ip}`, "bash -s"], {
420
- stdio: ["pipe", "inherit", "inherit"],
421
- });
422
- proc.stdin.write(readFileSync(script));
423
- proc.stdin.end();
424
- proc.on("close", (code) => {
425
- if (code === 0) {
426
- console.log(` ✅ Provisioning complete`);
427
- resolve();
428
- }
429
- else
430
- reject(new Error(`Shell script exited with code ${code}`));
431
- });
432
- proc.on("error", (err) => reject(new Error(`ssh failed: ${err.message}`)));
433
- });
434
- });
435
- }
436
390
  runPuppet(ip, manifest) {
437
391
  console.log(` 🔧 Applying Puppet manifest: ${manifest} → ${ip}`);
438
392
  const keyPath = this.sshKeyPath();
package/package.json CHANGED
@@ -1,11 +1,33 @@
1
1
  {
2
2
  "name": "puls-dev",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "description": "Intent-driven infrastructure-as-code with eager discovery and no state files.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./aws": {
15
+ "types": "./dist/providers/aws/index.d.ts",
16
+ "default": "./dist/providers/aws/index.js"
17
+ },
18
+ "./do": {
19
+ "types": "./dist/providers/do/index.d.ts",
20
+ "default": "./dist/providers/do/index.js"
21
+ },
22
+ "./proxmox": {
23
+ "types": "./dist/providers/proxmox/index.d.ts",
24
+ "default": "./dist/providers/proxmox/index.js"
25
+ },
26
+ "./firebase": {
27
+ "types": "./dist/providers/firebase/index.d.ts",
28
+ "default": "./dist/providers/firebase/index.js"
29
+ }
30
+ },
9
31
  "files": [
10
32
  "dist",
11
33
  "README.md",
@@ -14,7 +36,7 @@
14
36
  "scripts": {
15
37
  "build": "tsc",
16
38
  "prepublishOnly": "npm run build",
17
- "test": "tsx --test src/**/*.test.ts"
39
+ "test": "tsx --test \"src/**/*.test.ts\""
18
40
  },
19
41
  "keywords": [
20
42
  "iac",
@@ -34,6 +56,10 @@
34
56
  "typescript": "^6.0.3"
35
57
  },
36
58
  "dependencies": {
59
+ "dotenv": "^17.4.2",
60
+ "reflect-metadata": "^0.2.2"
61
+ },
62
+ "peerDependencies": {
37
63
  "@aws-sdk/client-acm": "^3.1040.0",
38
64
  "@aws-sdk/client-apigatewayv2": "^3.1044.0",
39
65
  "@aws-sdk/client-cloudfront": "^3.1040.0",
@@ -48,10 +74,57 @@
48
74
  "@aws-sdk/client-s3": "^3.1040.0",
49
75
  "@aws-sdk/client-secrets-manager": "^3.1045.0",
50
76
  "@aws-sdk/client-sqs": "^3.1045.0",
51
- "dotenv": "^17.4.2",
52
77
  "google-auth-library": "^10.6.2",
53
- "mkdocs": "^0.0.1",
54
- "reflect-metadata": "^0.2.2",
55
78
  "undici": "^8.2.0"
79
+ },
80
+ "peerDependenciesMeta": {
81
+ "@aws-sdk/client-acm": {
82
+ "optional": true
83
+ },
84
+ "@aws-sdk/client-apigatewayv2": {
85
+ "optional": true
86
+ },
87
+ "@aws-sdk/client-cloudfront": {
88
+ "optional": true
89
+ },
90
+ "@aws-sdk/client-cloudwatch-logs": {
91
+ "optional": true
92
+ },
93
+ "@aws-sdk/client-ec2": {
94
+ "optional": true
95
+ },
96
+ "@aws-sdk/client-ecs": {
97
+ "optional": true
98
+ },
99
+ "@aws-sdk/client-iam": {
100
+ "optional": true
101
+ },
102
+ "@aws-sdk/client-lambda": {
103
+ "optional": true
104
+ },
105
+ "@aws-sdk/client-rds": {
106
+ "optional": true
107
+ },
108
+ "@aws-sdk/client-route-53": {
109
+ "optional": true
110
+ },
111
+ "@aws-sdk/client-route-53-domains": {
112
+ "optional": true
113
+ },
114
+ "@aws-sdk/client-s3": {
115
+ "optional": true
116
+ },
117
+ "@aws-sdk/client-secrets-manager": {
118
+ "optional": true
119
+ },
120
+ "@aws-sdk/client-sqs": {
121
+ "optional": true
122
+ },
123
+ "google-auth-library": {
124
+ "optional": true
125
+ },
126
+ "undici": {
127
+ "optional": true
128
+ }
56
129
  }
57
130
  }