hereya-cli 0.13.0 → 0.13.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.
package/README.md CHANGED
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
20
20
  $ hereya COMMAND
21
21
  running command...
22
22
  $ hereya (--version)
23
- hereya-cli/0.13.0 linux-x64 node-v22.12.0
23
+ hereya-cli/0.13.1 linux-x64 node-v22.12.0
24
24
  $ hereya --help [COMMAND]
25
25
  USAGE
26
26
  $ hereya COMMAND
@@ -73,7 +73,7 @@ EXAMPLES
73
73
  $ hereya add cloudy/docker_postgres
74
74
  ```
75
75
 
76
- _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/add/index.ts)_
76
+ _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/add/index.ts)_
77
77
 
78
78
  ## `hereya bootstrap INFRASTRUCTURETYPE`
79
79
 
@@ -98,7 +98,7 @@ EXAMPLES
98
98
  $ hereya bootstrap local
99
99
  ```
100
100
 
101
- _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/bootstrap/index.ts)_
101
+ _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/bootstrap/index.ts)_
102
102
 
103
103
  ## `hereya deploy`
104
104
 
@@ -120,7 +120,7 @@ EXAMPLES
120
120
  $ hereya deploy
121
121
  ```
122
122
 
123
- _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/deploy/index.ts)_
123
+ _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/deploy/index.ts)_
124
124
 
125
125
  ## `hereya down`
126
126
 
@@ -143,7 +143,7 @@ EXAMPLES
143
143
  $ hereya down
144
144
  ```
145
145
 
146
- _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/down/index.ts)_
146
+ _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/down/index.ts)_
147
147
 
148
148
  ## `hereya env [NAME]`
149
149
 
@@ -174,7 +174,7 @@ EXAMPLES
174
174
  $ hereya env -w dev -l
175
175
  ```
176
176
 
177
- _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/env/index.ts)_
177
+ _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/env/index.ts)_
178
178
 
179
179
  ## `hereya help [COMMAND]`
180
180
 
@@ -220,7 +220,7 @@ EXAMPLES
220
220
  $ hereya init myProject -w=defaultWorkspace --chdir=./myProject
221
221
  ```
222
222
 
223
- _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/init/index.ts)_
223
+ _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/init/index.ts)_
224
224
 
225
225
  ## `hereya remove PACKAGE`
226
226
 
@@ -244,7 +244,7 @@ EXAMPLES
244
244
  $ hereya remove cloudy/docker_postgres
245
245
  ```
246
246
 
247
- _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/remove/index.ts)_
247
+ _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/remove/index.ts)_
248
248
 
249
249
  ## `hereya run CMD`
250
250
 
@@ -270,7 +270,7 @@ EXAMPLES
270
270
  $ hereya run -w uat -- node index.js
271
271
  ```
272
272
 
273
- _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/run/index.ts)_
273
+ _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/run/index.ts)_
274
274
 
275
275
  ## `hereya unbootstrap INFRASTRUCTURETYPE`
276
276
 
@@ -295,7 +295,7 @@ EXAMPLES
295
295
  $ hereya unbootstrap local
296
296
  ```
297
297
 
298
- _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/unbootstrap/index.ts)_
298
+ _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/unbootstrap/index.ts)_
299
299
 
300
300
  ## `hereya undeploy`
301
301
 
@@ -317,7 +317,7 @@ EXAMPLES
317
317
  $ hereya undeploy
318
318
  ```
319
319
 
320
- _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/undeploy/index.ts)_
320
+ _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/undeploy/index.ts)_
321
321
 
322
322
  ## `hereya up`
323
323
 
@@ -340,7 +340,7 @@ EXAMPLES
340
340
  $ hereya up
341
341
  ```
342
342
 
343
- _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/up/index.ts)_
343
+ _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/up/index.ts)_
344
344
 
345
345
  ## `hereya workspace create NAME`
346
346
 
@@ -360,7 +360,7 @@ EXAMPLES
360
360
  $ hereya workspace create dev
361
361
  ```
362
362
 
363
- _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/workspace/create/index.ts)_
363
+ _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/workspace/create/index.ts)_
364
364
 
365
365
  ## `hereya workspace delete NAME`
366
366
 
@@ -380,7 +380,7 @@ EXAMPLES
380
380
  $ hereya workspace delete dev
381
381
  ```
382
382
 
383
- _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/workspace/delete/index.ts)_
383
+ _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/workspace/delete/index.ts)_
384
384
 
385
385
  ## `hereya workspace env [NAME]`
386
386
 
@@ -406,7 +406,7 @@ EXAMPLES
406
406
  $ hereya workspace env myEnv -w dev
407
407
  ```
408
408
 
409
- _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/workspace/env/index.ts)_
409
+ _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/workspace/env/index.ts)_
410
410
 
411
411
  ## `hereya workspace env set`
412
412
 
@@ -430,7 +430,7 @@ EXAMPLES
430
430
  $ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
431
431
  ```
432
432
 
433
- _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/workspace/env/set/index.ts)_
433
+ _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/workspace/env/set/index.ts)_
434
434
 
435
435
  ## `hereya workspace env unset`
436
436
 
@@ -451,7 +451,7 @@ EXAMPLES
451
451
  $ hereya workspace env unset -w my-workspace -n myVar
452
452
  ```
453
453
 
454
- _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/workspace/env/unset/index.ts)_
454
+ _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/workspace/env/unset/index.ts)_
455
455
 
456
456
  ## `hereya workspace install PACKAGE`
457
457
 
@@ -477,7 +477,7 @@ EXAMPLES
477
477
  $ hereya workspace install hereya/aws-cognito
478
478
  ```
479
479
 
480
- _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/workspace/install/index.ts)_
480
+ _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/workspace/install/index.ts)_
481
481
 
482
482
  ## `hereya workspace uninstall PACKAGE`
483
483
 
@@ -503,5 +503,5 @@ EXAMPLES
503
503
  $ hereya workspace uninstall hereya/aws-cognito
504
504
  ```
505
505
 
506
- _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.0/src/commands/workspace/uninstall/index.ts)_
506
+ _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.13.1/src/commands/workspace/uninstall/index.ts)_
507
507
  <!-- commandsstop -->
@@ -1,4 +1,4 @@
1
1
  import type { GetRepoContentInput, GetRepoContentOutput, PackageManager } from './common.js';
2
2
  export declare class GitHubPackageManager implements PackageManager {
3
- getRepoContent({ owner, path, repo }: GetRepoContentInput): Promise<GetRepoContentOutput>;
3
+ getRepoContent({ owner, path: filePath, repo }: GetRepoContentInput): Promise<GetRepoContentOutput>;
4
4
  }
@@ -1,31 +1,31 @@
1
- import { Octokit } from '@octokit/rest';
1
+ import fs from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { downloadPackage } from './index.js';
2
5
  export class GitHubPackageManager {
3
- async getRepoContent({ owner, path, repo }) {
4
- const octokit = new Octokit();
6
+ async getRepoContent({ owner, path: filePath, repo }) {
7
+ const pkgUrl = `https://github.com/${owner}/${repo}`;
8
+ const tmpFolder = path.join(os.tmpdir(), 'hereya', 'github', owner, repo);
5
9
  try {
6
- const response = await octokit.rest.repos.getContent({
7
- headers: {
8
- 'Accept': 'application/vnd.github.raw+json'
9
- },
10
- owner,
11
- path,
12
- repo
13
- });
14
- if (response.status !== 200) {
10
+ const destPath = await downloadPackage(pkgUrl, tmpFolder);
11
+ if (await fs.stat(path.join(destPath, filePath))) {
12
+ const content = await fs.readFile(path.join(destPath, filePath), 'utf8');
13
+ // remove the tmp folder
14
+ await fs.rm(destPath, { recursive: true });
15
15
  return {
16
- found: false,
17
- reason: `Failed to fetch content: ${response.status}`
16
+ content,
17
+ found: true,
18
18
  };
19
19
  }
20
20
  return {
21
- content: response.data,
22
- found: true
21
+ found: false,
22
+ reason: `File ${filePath} not found in ${pkgUrl}`,
23
23
  };
24
24
  }
25
25
  catch (error) {
26
26
  return {
27
27
  found: false,
28
- reason: error.message
28
+ reason: error.message,
29
29
  };
30
30
  }
31
31
  }
@@ -54,6 +54,45 @@
54
54
  "index.js"
55
55
  ]
56
56
  },
57
+ "bootstrap": {
58
+ "aliases": [],
59
+ "args": {
60
+ "infrastructureType": {
61
+ "description": "infrastructure to bootstrap. Options are local, aws",
62
+ "name": "infrastructureType",
63
+ "required": true
64
+ }
65
+ },
66
+ "description": "Install necessary resources for hereya operations in an infrastructure.",
67
+ "examples": [
68
+ "<%= config.bin %> <%= command.id %> aws",
69
+ "<%= config.bin %> <%= command.id %> local"
70
+ ],
71
+ "flags": {
72
+ "force": {
73
+ "char": "f",
74
+ "description": "redeploy hereya resources if already deployed",
75
+ "name": "force",
76
+ "allowNo": false,
77
+ "type": "boolean"
78
+ }
79
+ },
80
+ "hasDynamicHelp": false,
81
+ "hiddenAliases": [],
82
+ "id": "bootstrap",
83
+ "pluginAlias": "hereya-cli",
84
+ "pluginName": "hereya-cli",
85
+ "pluginType": "core",
86
+ "strict": true,
87
+ "enableJsonFlag": false,
88
+ "isESM": true,
89
+ "relativePath": [
90
+ "dist",
91
+ "commands",
92
+ "bootstrap",
93
+ "index.js"
94
+ ]
95
+ },
57
96
  "deploy": {
58
97
  "aliases": [],
59
98
  "args": {},
@@ -102,45 +141,6 @@
102
141
  "index.js"
103
142
  ]
104
143
  },
105
- "bootstrap": {
106
- "aliases": [],
107
- "args": {
108
- "infrastructureType": {
109
- "description": "infrastructure to bootstrap. Options are local, aws",
110
- "name": "infrastructureType",
111
- "required": true
112
- }
113
- },
114
- "description": "Install necessary resources for hereya operations in an infrastructure.",
115
- "examples": [
116
- "<%= config.bin %> <%= command.id %> aws",
117
- "<%= config.bin %> <%= command.id %> local"
118
- ],
119
- "flags": {
120
- "force": {
121
- "char": "f",
122
- "description": "redeploy hereya resources if already deployed",
123
- "name": "force",
124
- "allowNo": false,
125
- "type": "boolean"
126
- }
127
- },
128
- "hasDynamicHelp": false,
129
- "hiddenAliases": [],
130
- "id": "bootstrap",
131
- "pluginAlias": "hereya-cli",
132
- "pluginName": "hereya-cli",
133
- "pluginType": "core",
134
- "strict": true,
135
- "enableJsonFlag": false,
136
- "isESM": true,
137
- "relativePath": [
138
- "dist",
139
- "commands",
140
- "bootstrap",
141
- "index.js"
142
- ]
143
- },
144
144
  "down": {
145
145
  "aliases": [],
146
146
  "args": {},
@@ -571,6 +571,37 @@
571
571
  "index.js"
572
572
  ]
573
573
  },
574
+ "workspace:delete": {
575
+ "aliases": [],
576
+ "args": {
577
+ "name": {
578
+ "description": "name of the workspace to delete",
579
+ "name": "name",
580
+ "required": true
581
+ }
582
+ },
583
+ "description": "Delete a workspace if it exists.",
584
+ "examples": [
585
+ "<%= config.bin %> <%= command.id %> dev"
586
+ ],
587
+ "flags": {},
588
+ "hasDynamicHelp": false,
589
+ "hiddenAliases": [],
590
+ "id": "workspace:delete",
591
+ "pluginAlias": "hereya-cli",
592
+ "pluginName": "hereya-cli",
593
+ "pluginType": "core",
594
+ "strict": true,
595
+ "enableJsonFlag": false,
596
+ "isESM": true,
597
+ "relativePath": [
598
+ "dist",
599
+ "commands",
600
+ "workspace",
601
+ "delete",
602
+ "index.js"
603
+ ]
604
+ },
574
605
  "workspace:env": {
575
606
  "aliases": [],
576
607
  "args": {
@@ -621,37 +652,6 @@
621
652
  "index.js"
622
653
  ]
623
654
  },
624
- "workspace:delete": {
625
- "aliases": [],
626
- "args": {
627
- "name": {
628
- "description": "name of the workspace to delete",
629
- "name": "name",
630
- "required": true
631
- }
632
- },
633
- "description": "Delete a workspace if it exists.",
634
- "examples": [
635
- "<%= config.bin %> <%= command.id %> dev"
636
- ],
637
- "flags": {},
638
- "hasDynamicHelp": false,
639
- "hiddenAliases": [],
640
- "id": "workspace:delete",
641
- "pluginAlias": "hereya-cli",
642
- "pluginName": "hereya-cli",
643
- "pluginType": "core",
644
- "strict": true,
645
- "enableJsonFlag": false,
646
- "isESM": true,
647
- "relativePath": [
648
- "dist",
649
- "commands",
650
- "workspace",
651
- "delete",
652
- "index.js"
653
- ]
654
- },
655
655
  "workspace:install": {
656
656
  "aliases": [],
657
657
  "args": {
@@ -768,51 +768,26 @@
768
768
  "index.js"
769
769
  ]
770
770
  },
771
- "workspace:env:set": {
771
+ "workspace:env:unset": {
772
772
  "aliases": [],
773
773
  "args": {},
774
- "description": "set an env var for a workspace",
774
+ "description": "unset an env var for a workspace",
775
775
  "examples": [
776
- "<%= config.bin %> <%= command.id %> -w my-workspace -n myVar -v my-value -i aws -s"
776
+ "<%= config.bin %> <%= command.id %> -w my-workspace -n myVar"
777
777
  ],
778
778
  "flags": {
779
- "infra": {
780
- "char": "i",
781
- "description": "the infrastructure to store the env var in",
782
- "name": "infra",
783
- "required": true,
784
- "hasDynamicHelp": false,
785
- "multiple": false,
786
- "type": "option"
787
- },
788
779
  "name": {
789
780
  "char": "n",
790
- "description": "name of the env var to set",
781
+ "description": "name of the env var to unset",
791
782
  "name": "name",
792
783
  "required": true,
793
784
  "hasDynamicHelp": false,
794
785
  "multiple": false,
795
786
  "type": "option"
796
787
  },
797
- "sensitive": {
798
- "char": "s",
799
- "description": "whether the env var is sensitive",
800
- "name": "sensitive",
801
- "allowNo": false,
802
- "type": "boolean"
803
- },
804
- "value": {
805
- "char": "v",
806
- "description": "value of the env var to set",
807
- "name": "value",
808
- "required": true,
809
- "hasDynamicHelp": false,
810
- "multiple": false,
811
- "type": "option"
812
- },
813
788
  "workspace": {
814
789
  "char": "w",
815
- "description": "name of the workspace to set an env var for",
790
+ "description": "name of the workspace to unset an env var for",
816
791
  "name": "workspace",
817
792
  "required": true,
818
793
  "hasDynamicHelp": false,
@@ -822,7 +797,7 @@
822
797
  },
823
798
  "hasDynamicHelp": false,
824
799
  "hiddenAliases": [],
825
- "id": "workspace:env:set",
800
+ "id": "workspace:env:unset",
826
801
  "pluginAlias": "hereya-cli",
827
802
  "pluginName": "hereya-cli",
828
803
  "pluginType": "core",
@@ -834,30 +809,55 @@
834
809
  "commands",
835
810
  "workspace",
836
811
  "env",
837
- "set",
812
+ "unset",
838
813
  "index.js"
839
814
  ]
840
815
  },
841
- "workspace:env:unset": {
816
+ "workspace:env:set": {
842
817
  "aliases": [],
843
818
  "args": {},
844
- "description": "unset an env var for a workspace",
819
+ "description": "set an env var for a workspace",
845
820
  "examples": [
846
- "<%= config.bin %> <%= command.id %> -w my-workspace -n myVar"
821
+ "<%= config.bin %> <%= command.id %> -w my-workspace -n myVar -v my-value -i aws -s"
847
822
  ],
848
823
  "flags": {
824
+ "infra": {
825
+ "char": "i",
826
+ "description": "the infrastructure to store the env var in",
827
+ "name": "infra",
828
+ "required": true,
829
+ "hasDynamicHelp": false,
830
+ "multiple": false,
831
+ "type": "option"
832
+ },
849
833
  "name": {
850
834
  "char": "n",
851
- "description": "name of the env var to unset",
835
+ "description": "name of the env var to set",
852
836
  "name": "name",
853
837
  "required": true,
854
838
  "hasDynamicHelp": false,
855
839
  "multiple": false,
856
840
  "type": "option"
857
841
  },
842
+ "sensitive": {
843
+ "char": "s",
844
+ "description": "whether the env var is sensitive",
845
+ "name": "sensitive",
846
+ "allowNo": false,
847
+ "type": "boolean"
848
+ },
849
+ "value": {
850
+ "char": "v",
851
+ "description": "value of the env var to set",
852
+ "name": "value",
853
+ "required": true,
854
+ "hasDynamicHelp": false,
855
+ "multiple": false,
856
+ "type": "option"
857
+ },
858
858
  "workspace": {
859
859
  "char": "w",
860
- "description": "name of the workspace to unset an env var for",
860
+ "description": "name of the workspace to set an env var for",
861
861
  "name": "workspace",
862
862
  "required": true,
863
863
  "hasDynamicHelp": false,
@@ -867,7 +867,7 @@
867
867
  },
868
868
  "hasDynamicHelp": false,
869
869
  "hiddenAliases": [],
870
- "id": "workspace:env:unset",
870
+ "id": "workspace:env:set",
871
871
  "pluginAlias": "hereya-cli",
872
872
  "pluginName": "hereya-cli",
873
873
  "pluginType": "core",
@@ -879,10 +879,10 @@
879
879
  "commands",
880
880
  "workspace",
881
881
  "env",
882
- "unset",
882
+ "set",
883
883
  "index.js"
884
884
  ]
885
885
  }
886
886
  },
887
- "version": "0.13.0"
887
+ "version": "0.13.1"
888
888
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hereya-cli",
3
3
  "description": "Infrastructure as Package",
4
- "version": "0.13.0",
4
+ "version": "0.13.1",
5
5
  "author": "Hereya Developers",
6
6
  "bin": {
7
7
  "hereya": "./bin/run.js"
@@ -19,7 +19,6 @@
19
19
  "@oclif/core": "^3",
20
20
  "@oclif/plugin-help": "^6",
21
21
  "@oclif/plugin-plugins": "^5",
22
- "@octokit/rest": "^20.1.1",
23
22
  "cli-spinners": "^3.2.0",
24
23
  "glob": "^10.4.1",
25
24
  "ignore": "^5.3.1",