hereya-cli 0.84.1 → 0.85.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.
@@ -1198,8 +1198,7 @@
1198
1198
  "examples": [
1199
1199
  "<%= config.bin %> <%= command.id %> my-org/my-app -w my-workspace",
1200
1200
  "<%= config.bin %> <%= command.id %> my-org/my-app -w prod --version 1.2.0",
1201
- "<%= config.bin %> <%= command.id %> my-org/my-app -w prod -V 'app.yaml: \"key: value\"'",
1202
- "<%= config.bin %> <%= command.id %> my-org/my-app -w prod --vars-file ./hereyavars.yaml"
1201
+ "<%= config.bin %> <%= command.id %> my-org/my-app -w prod -p organizationId=org-123"
1203
1202
  ],
1204
1203
  "flags": {
1205
1204
  "parameter": {
@@ -1211,27 +1210,6 @@
1211
1210
  "multiple": true,
1212
1211
  "type": "option"
1213
1212
  },
1214
- "vars": {
1215
- "char": "V",
1216
- "description": "YAML string mapping hereyavars filename -> YAML body (mutually exclusive with --vars-file)",
1217
- "exclusive": [
1218
- "vars-file"
1219
- ],
1220
- "name": "vars",
1221
- "hasDynamicHelp": false,
1222
- "multiple": false,
1223
- "type": "option"
1224
- },
1225
- "vars-file": {
1226
- "description": "path to a YAML file mapping hereyavars filename -> YAML body (mutually exclusive with --vars)",
1227
- "exclusive": [
1228
- "vars"
1229
- ],
1230
- "name": "vars-file",
1231
- "hasDynamicHelp": false,
1232
- "multiple": false,
1233
- "type": "option"
1234
- },
1235
1213
  "version": {
1236
1214
  "description": "specific app version to deploy (defaults to latest)",
1237
1215
  "name": "version",
@@ -2702,46 +2680,60 @@
2702
2680
  "index.js"
2703
2681
  ]
2704
2682
  },
2705
- "workspace:uninstall": {
2683
+ "devenv:project:init": {
2706
2684
  "aliases": [],
2707
2685
  "args": {
2708
- "package": {
2709
- "description": "The package to remove. Packages are gitHub repositories. Use the format owner/repository",
2710
- "name": "package",
2686
+ "project": {
2687
+ "description": "project name",
2688
+ "name": "project",
2711
2689
  "required": true
2712
2690
  }
2713
2691
  },
2714
- "description": "Remove a package from a workspace.",
2692
+ "description": "Initialize a project on a remote dev environment.",
2715
2693
  "examples": [
2716
- "<%= config.bin %> <%= command.id %> hereya/aws-cognito"
2694
+ "<%= config.bin %> <%= command.id %> my-app -w my-workspace",
2695
+ "<%= config.bin %> <%= command.id %> my-app -w my-workspace -t acme/node-starter",
2696
+ "<%= config.bin %> <%= command.id %> my-app -w my-workspace -t acme/node-starter -p region=us-east-1"
2717
2697
  ],
2718
2698
  "flags": {
2719
- "debug": {
2720
- "description": "enable debug mode",
2721
- "name": "debug",
2699
+ "deploy-workspace": {
2700
+ "char": "d",
2701
+ "description": "workspace used for deployment (required when using a template)",
2702
+ "name": "deploy-workspace",
2703
+ "required": false,
2704
+ "hasDynamicHelp": false,
2705
+ "multiple": false,
2706
+ "type": "option"
2707
+ },
2708
+ "force": {
2709
+ "char": "f",
2710
+ "description": "continue even if folder already exists",
2711
+ "name": "force",
2722
2712
  "allowNo": false,
2723
2713
  "type": "boolean"
2724
2714
  },
2725
2715
  "parameter": {
2726
2716
  "char": "p",
2727
- "description": "parameter for the package, in the form of 'key=value'. Can be specified multiple times.",
2717
+ "description": "parameter for the template, in the form of 'key=value'. Can be specified multiple times.",
2728
2718
  "name": "parameter",
2719
+ "required": false,
2729
2720
  "default": [],
2730
2721
  "hasDynamicHelp": false,
2731
2722
  "multiple": true,
2732
2723
  "type": "option"
2733
2724
  },
2734
- "parameter-file": {
2735
- "char": "f",
2736
- "description": "path to a file containing parameters for the package",
2737
- "name": "parameter-file",
2725
+ "template": {
2726
+ "char": "t",
2727
+ "description": "template package to scaffold the project from",
2728
+ "name": "template",
2729
+ "required": false,
2738
2730
  "hasDynamicHelp": false,
2739
2731
  "multiple": false,
2740
2732
  "type": "option"
2741
2733
  },
2742
2734
  "workspace": {
2743
2735
  "char": "w",
2744
- "description": "name of the workspace to remove the package from",
2736
+ "description": "name of the workspace",
2745
2737
  "name": "workspace",
2746
2738
  "required": true,
2747
2739
  "hasDynamicHelp": false,
@@ -2751,7 +2743,7 @@
2751
2743
  },
2752
2744
  "hasDynamicHelp": false,
2753
2745
  "hiddenAliases": [],
2754
- "id": "workspace:uninstall",
2746
+ "id": "devenv:project:init",
2755
2747
  "pluginAlias": "hereya-cli",
2756
2748
  "pluginName": "hereya-cli",
2757
2749
  "pluginType": "core",
@@ -2761,65 +2753,52 @@
2761
2753
  "relativePath": [
2762
2754
  "dist",
2763
2755
  "commands",
2764
- "workspace",
2765
- "uninstall",
2756
+ "devenv",
2757
+ "project",
2758
+ "init",
2766
2759
  "index.js"
2767
2760
  ]
2768
2761
  },
2769
- "devenv:project:init": {
2762
+ "workspace:uninstall": {
2770
2763
  "aliases": [],
2771
2764
  "args": {
2772
- "project": {
2773
- "description": "project name",
2774
- "name": "project",
2765
+ "package": {
2766
+ "description": "The package to remove. Packages are gitHub repositories. Use the format owner/repository",
2767
+ "name": "package",
2775
2768
  "required": true
2776
2769
  }
2777
2770
  },
2778
- "description": "Initialize a project on a remote dev environment.",
2771
+ "description": "Remove a package from a workspace.",
2779
2772
  "examples": [
2780
- "<%= config.bin %> <%= command.id %> my-app -w my-workspace",
2781
- "<%= config.bin %> <%= command.id %> my-app -w my-workspace -t acme/node-starter",
2782
- "<%= config.bin %> <%= command.id %> my-app -w my-workspace -t acme/node-starter -p region=us-east-1"
2773
+ "<%= config.bin %> <%= command.id %> hereya/aws-cognito"
2783
2774
  ],
2784
2775
  "flags": {
2785
- "deploy-workspace": {
2786
- "char": "d",
2787
- "description": "workspace used for deployment (required when using a template)",
2788
- "name": "deploy-workspace",
2789
- "required": false,
2790
- "hasDynamicHelp": false,
2791
- "multiple": false,
2792
- "type": "option"
2793
- },
2794
- "force": {
2795
- "char": "f",
2796
- "description": "continue even if folder already exists",
2797
- "name": "force",
2776
+ "debug": {
2777
+ "description": "enable debug mode",
2778
+ "name": "debug",
2798
2779
  "allowNo": false,
2799
2780
  "type": "boolean"
2800
2781
  },
2801
2782
  "parameter": {
2802
2783
  "char": "p",
2803
- "description": "parameter for the template, in the form of 'key=value'. Can be specified multiple times.",
2784
+ "description": "parameter for the package, in the form of 'key=value'. Can be specified multiple times.",
2804
2785
  "name": "parameter",
2805
- "required": false,
2806
2786
  "default": [],
2807
2787
  "hasDynamicHelp": false,
2808
2788
  "multiple": true,
2809
2789
  "type": "option"
2810
2790
  },
2811
- "template": {
2812
- "char": "t",
2813
- "description": "template package to scaffold the project from",
2814
- "name": "template",
2815
- "required": false,
2791
+ "parameter-file": {
2792
+ "char": "f",
2793
+ "description": "path to a file containing parameters for the package",
2794
+ "name": "parameter-file",
2816
2795
  "hasDynamicHelp": false,
2817
2796
  "multiple": false,
2818
2797
  "type": "option"
2819
2798
  },
2820
2799
  "workspace": {
2821
2800
  "char": "w",
2822
- "description": "name of the workspace",
2801
+ "description": "name of the workspace to remove the package from",
2823
2802
  "name": "workspace",
2824
2803
  "required": true,
2825
2804
  "hasDynamicHelp": false,
@@ -2829,7 +2808,7 @@
2829
2808
  },
2830
2809
  "hasDynamicHelp": false,
2831
2810
  "hiddenAliases": [],
2832
- "id": "devenv:project:init",
2811
+ "id": "workspace:uninstall",
2833
2812
  "pluginAlias": "hereya-cli",
2834
2813
  "pluginName": "hereya-cli",
2835
2814
  "pluginType": "core",
@@ -2839,9 +2818,8 @@
2839
2818
  "relativePath": [
2840
2819
  "dist",
2841
2820
  "commands",
2842
- "devenv",
2843
- "project",
2844
- "init",
2821
+ "workspace",
2822
+ "uninstall",
2845
2823
  "index.js"
2846
2824
  ]
2847
2825
  },
@@ -2963,51 +2941,26 @@
2963
2941
  "index.js"
2964
2942
  ]
2965
2943
  },
2966
- "workspace:env:set": {
2944
+ "workspace:env:unset": {
2967
2945
  "aliases": [],
2968
2946
  "args": {},
2969
- "description": "set an env var for a workspace",
2947
+ "description": "unset an env var for a workspace",
2970
2948
  "examples": [
2971
- "<%= config.bin %> <%= command.id %> -w my-workspace -n myVar -v my-value -i aws -s"
2949
+ "<%= config.bin %> <%= command.id %> -w my-workspace -n myVar"
2972
2950
  ],
2973
2951
  "flags": {
2974
- "infra": {
2975
- "char": "i",
2976
- "description": "the infrastructure to store the env var in",
2977
- "name": "infra",
2978
- "required": true,
2979
- "hasDynamicHelp": false,
2980
- "multiple": false,
2981
- "type": "option"
2982
- },
2983
2952
  "name": {
2984
2953
  "char": "n",
2985
- "description": "name of the env var to set",
2954
+ "description": "name of the env var to unset",
2986
2955
  "name": "name",
2987
2956
  "required": true,
2988
2957
  "hasDynamicHelp": false,
2989
2958
  "multiple": false,
2990
2959
  "type": "option"
2991
2960
  },
2992
- "sensitive": {
2993
- "char": "s",
2994
- "description": "whether the env var is sensitive",
2995
- "name": "sensitive",
2996
- "allowNo": false,
2997
- "type": "boolean"
2998
- },
2999
- "value": {
3000
- "char": "v",
3001
- "description": "value of the env var to set",
3002
- "name": "value",
3003
- "required": true,
3004
- "hasDynamicHelp": false,
3005
- "multiple": false,
3006
- "type": "option"
3007
- },
3008
2961
  "workspace": {
3009
2962
  "char": "w",
3010
- "description": "name of the workspace to set an env var for",
2963
+ "description": "name of the workspace to unset an env var for",
3011
2964
  "name": "workspace",
3012
2965
  "required": true,
3013
2966
  "hasDynamicHelp": false,
@@ -3017,7 +2970,7 @@
3017
2970
  },
3018
2971
  "hasDynamicHelp": false,
3019
2972
  "hiddenAliases": [],
3020
- "id": "workspace:env:set",
2973
+ "id": "workspace:env:unset",
3021
2974
  "pluginAlias": "hereya-cli",
3022
2975
  "pluginName": "hereya-cli",
3023
2976
  "pluginType": "core",
@@ -3029,30 +2982,55 @@
3029
2982
  "commands",
3030
2983
  "workspace",
3031
2984
  "env",
3032
- "set",
2985
+ "unset",
3033
2986
  "index.js"
3034
2987
  ]
3035
2988
  },
3036
- "workspace:env:unset": {
2989
+ "workspace:env:set": {
3037
2990
  "aliases": [],
3038
2991
  "args": {},
3039
- "description": "unset an env var for a workspace",
2992
+ "description": "set an env var for a workspace",
3040
2993
  "examples": [
3041
- "<%= config.bin %> <%= command.id %> -w my-workspace -n myVar"
2994
+ "<%= config.bin %> <%= command.id %> -w my-workspace -n myVar -v my-value -i aws -s"
3042
2995
  ],
3043
2996
  "flags": {
2997
+ "infra": {
2998
+ "char": "i",
2999
+ "description": "the infrastructure to store the env var in",
3000
+ "name": "infra",
3001
+ "required": true,
3002
+ "hasDynamicHelp": false,
3003
+ "multiple": false,
3004
+ "type": "option"
3005
+ },
3044
3006
  "name": {
3045
3007
  "char": "n",
3046
- "description": "name of the env var to unset",
3008
+ "description": "name of the env var to set",
3047
3009
  "name": "name",
3048
3010
  "required": true,
3049
3011
  "hasDynamicHelp": false,
3050
3012
  "multiple": false,
3051
3013
  "type": "option"
3052
3014
  },
3015
+ "sensitive": {
3016
+ "char": "s",
3017
+ "description": "whether the env var is sensitive",
3018
+ "name": "sensitive",
3019
+ "allowNo": false,
3020
+ "type": "boolean"
3021
+ },
3022
+ "value": {
3023
+ "char": "v",
3024
+ "description": "value of the env var to set",
3025
+ "name": "value",
3026
+ "required": true,
3027
+ "hasDynamicHelp": false,
3028
+ "multiple": false,
3029
+ "type": "option"
3030
+ },
3053
3031
  "workspace": {
3054
3032
  "char": "w",
3055
- "description": "name of the workspace to unset an env var for",
3033
+ "description": "name of the workspace to set an env var for",
3056
3034
  "name": "workspace",
3057
3035
  "required": true,
3058
3036
  "hasDynamicHelp": false,
@@ -3062,7 +3040,7 @@
3062
3040
  },
3063
3041
  "hasDynamicHelp": false,
3064
3042
  "hiddenAliases": [],
3065
- "id": "workspace:env:unset",
3043
+ "id": "workspace:env:set",
3066
3044
  "pluginAlias": "hereya-cli",
3067
3045
  "pluginName": "hereya-cli",
3068
3046
  "pluginType": "core",
@@ -3074,7 +3052,7 @@
3074
3052
  "commands",
3075
3053
  "workspace",
3076
3054
  "env",
3077
- "unset",
3055
+ "set",
3078
3056
  "index.js"
3079
3057
  ]
3080
3058
  },
@@ -3197,5 +3175,5 @@
3197
3175
  ]
3198
3176
  }
3199
3177
  },
3200
- "version": "0.84.1"
3178
+ "version": "0.85.0"
3201
3179
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hereya-cli",
3
3
  "description": "Infrastructure as Package",
4
- "version": "0.84.1",
4
+ "version": "0.85.0",
5
5
  "author": "Hereya Developers",
6
6
  "bin": {
7
7
  "hereya": "./bin/run.js"
@@ -1,10 +0,0 @@
1
- /**
2
- * Write per-deployment hereyavars overrides into <appRootDir>/hereyaconfig/hereyavars/.
3
- *
4
- * `hereyaVarsYaml` is a YAML string mapping filename -> YAML body (string).
5
- * Each filename is validated against a safe pattern (no path traversal, must
6
- * end in `.yaml`/`.yml`). Each body must be a string.
7
- */
8
- export declare function applyHereyaVars(appRootDir: string, hereyaVarsYaml: string | undefined): Promise<{
9
- filesWritten: string[];
10
- }>;
@@ -1,45 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import path from 'node:path';
3
- import * as yaml from 'yaml';
4
- const HEREYAVARS_FILENAME_PATTERN = /^[\w.-]+\.ya?ml$/;
5
- /**
6
- * Write per-deployment hereyavars overrides into <appRootDir>/hereyaconfig/hereyavars/.
7
- *
8
- * `hereyaVarsYaml` is a YAML string mapping filename -> YAML body (string).
9
- * Each filename is validated against a safe pattern (no path traversal, must
10
- * end in `.yaml`/`.yml`). Each body must be a string.
11
- */
12
- export async function applyHereyaVars(appRootDir, hereyaVarsYaml) {
13
- if (!hereyaVarsYaml || hereyaVarsYaml.trim() === '') {
14
- return { filesWritten: [] };
15
- }
16
- let parsed;
17
- try {
18
- parsed = yaml.parse(hereyaVarsYaml);
19
- }
20
- catch (error) {
21
- throw new Error(`Failed to parse hereyaVarsYaml: ${error.message}`);
22
- }
23
- if (parsed === null || parsed === undefined) {
24
- return { filesWritten: [] };
25
- }
26
- if (typeof parsed !== 'object' || Array.isArray(parsed)) {
27
- throw new TypeError('hereyaVarsYaml must be a YAML mapping of filename -> body string');
28
- }
29
- const targetDir = path.join(appRootDir, 'hereyaconfig', 'hereyavars');
30
- await fs.mkdir(targetDir, { recursive: true });
31
- const filesWritten = [];
32
- for (const [filename, body] of Object.entries(parsed)) {
33
- if (!HEREYAVARS_FILENAME_PATTERN.test(filename)) {
34
- throw new Error(`Invalid hereyavars filename '${filename}'. Expected a name matching ${HEREYAVARS_FILENAME_PATTERN.source}`);
35
- }
36
- if (typeof body !== 'string') {
37
- throw new TypeError(`hereyavars value for '${filename}' must be a string (YAML body)`);
38
- }
39
- const filePath = path.join(targetDir, filename);
40
- // eslint-disable-next-line no-await-in-loop
41
- await fs.writeFile(filePath, body, { encoding: 'utf8' });
42
- filesWritten.push(filePath);
43
- }
44
- return { filesWritten };
45
- }