hereya-cli 0.84.0 → 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.
- package/README.md +66 -71
- package/dist/backend/cloud/cloud-backend.d.ts +13 -1
- package/dist/backend/cloud/cloud-backend.js +23 -2
- package/dist/commands/app/deploy/index.d.ts +0 -2
- package/dist/commands/app/deploy/index.js +15 -29
- package/dist/commands/executor/start/index.d.ts +2 -0
- package/dist/commands/executor/start/index.js +96 -22
- package/dist/commands/publish/index.d.ts +3 -0
- package/dist/commands/publish/index.js +25 -0
- package/dist/lib/app-parameters.d.ts +41 -0
- package/dist/lib/app-parameters.js +120 -0
- package/dist/lib/package/index.d.ts +62 -0
- package/dist/lib/package/index.js +20 -0
- package/oclif.manifest.json +111 -133
- package/package.json +1 -1
- package/dist/lib/app-vars.d.ts +0 -10
- package/dist/lib/app-vars.js +0 -45
|
@@ -75,6 +75,16 @@ export async function downloadPackage(pkgUrl, destPath) {
|
|
|
75
75
|
return packageManager.downloadPackage(pkgUrl, destPath);
|
|
76
76
|
}
|
|
77
77
|
export const PackageKind = z.enum(['app', 'package']).default('package');
|
|
78
|
+
export const PARAMETER_NAME_PATTERN = /^[A-Za-z][\w-]*$/;
|
|
79
|
+
export const ParameterSpec = z
|
|
80
|
+
.object({
|
|
81
|
+
default: z.string().optional(),
|
|
82
|
+
description: z.string().optional(),
|
|
83
|
+
mandatory: z.boolean().default(false).optional(),
|
|
84
|
+
})
|
|
85
|
+
.refine((p) => !(p.mandatory && p.default !== undefined), {
|
|
86
|
+
message: 'mandatory parameter cannot have a default',
|
|
87
|
+
});
|
|
78
88
|
export const PackageMetadata = z.object({
|
|
79
89
|
dependencies: z.record(z.string()).optional(),
|
|
80
90
|
deploy: z.boolean().optional(),
|
|
@@ -91,6 +101,16 @@ export const PackageMetadata = z.object({
|
|
|
91
101
|
.optional(),
|
|
92
102
|
originalInfra: z.nativeEnum(InfrastructureType).optional(),
|
|
93
103
|
outputs: z.record(z.object({}).passthrough()).optional(),
|
|
104
|
+
parameters: z
|
|
105
|
+
.record(z.string(), ParameterSpec)
|
|
106
|
+
.optional()
|
|
107
|
+
.refine((params) => {
|
|
108
|
+
if (!params)
|
|
109
|
+
return true;
|
|
110
|
+
return Object.keys(params).every((name) => PARAMETER_NAME_PATTERN.test(name));
|
|
111
|
+
}, {
|
|
112
|
+
message: `parameter names must match ${PARAMETER_NAME_PATTERN.source}`,
|
|
113
|
+
}),
|
|
94
114
|
snakeCase: z.boolean().optional(),
|
|
95
115
|
});
|
|
96
116
|
// Helper function to parse package spec into name and version
|
package/oclif.manifest.json
CHANGED
|
@@ -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 -
|
|
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",
|
|
@@ -1501,17 +1479,24 @@
|
|
|
1501
1479
|
"index.js"
|
|
1502
1480
|
]
|
|
1503
1481
|
},
|
|
1504
|
-
"config:
|
|
1482
|
+
"config:export-backend": {
|
|
1505
1483
|
"aliases": [],
|
|
1506
|
-
"args": {
|
|
1507
|
-
|
|
1484
|
+
"args": {
|
|
1485
|
+
"file": {
|
|
1486
|
+
"description": "Path to save the export file. Defaults to cloud-backend.json in current directory",
|
|
1487
|
+
"name": "file",
|
|
1488
|
+
"required": false
|
|
1489
|
+
}
|
|
1490
|
+
},
|
|
1491
|
+
"description": "Export the cloud backend configuration to a file",
|
|
1508
1492
|
"examples": [
|
|
1509
|
-
"<%= config.bin %> <%= command.id %>"
|
|
1493
|
+
"<%= config.bin %> <%= command.id %>",
|
|
1494
|
+
"<%= config.bin %> <%= command.id %> ./path/to/export.json"
|
|
1510
1495
|
],
|
|
1511
1496
|
"flags": {},
|
|
1512
1497
|
"hasDynamicHelp": false,
|
|
1513
1498
|
"hiddenAliases": [],
|
|
1514
|
-
"id": "config:
|
|
1499
|
+
"id": "config:export-backend",
|
|
1515
1500
|
"pluginAlias": "hereya-cli",
|
|
1516
1501
|
"pluginName": "hereya-cli",
|
|
1517
1502
|
"pluginType": "core",
|
|
@@ -1522,28 +1507,21 @@
|
|
|
1522
1507
|
"dist",
|
|
1523
1508
|
"commands",
|
|
1524
1509
|
"config",
|
|
1525
|
-
"
|
|
1510
|
+
"export-backend",
|
|
1526
1511
|
"index.js"
|
|
1527
1512
|
]
|
|
1528
1513
|
},
|
|
1529
|
-
"config:
|
|
1514
|
+
"config:get-backend": {
|
|
1530
1515
|
"aliases": [],
|
|
1531
|
-
"args": {
|
|
1532
|
-
|
|
1533
|
-
"description": "Path to save the export file. Defaults to cloud-backend.json in current directory",
|
|
1534
|
-
"name": "file",
|
|
1535
|
-
"required": false
|
|
1536
|
-
}
|
|
1537
|
-
},
|
|
1538
|
-
"description": "Export the cloud backend configuration to a file",
|
|
1516
|
+
"args": {},
|
|
1517
|
+
"description": "get the current backend type",
|
|
1539
1518
|
"examples": [
|
|
1540
|
-
"<%= config.bin %> <%= command.id %>"
|
|
1541
|
-
"<%= config.bin %> <%= command.id %> ./path/to/export.json"
|
|
1519
|
+
"<%= config.bin %> <%= command.id %>"
|
|
1542
1520
|
],
|
|
1543
1521
|
"flags": {},
|
|
1544
1522
|
"hasDynamicHelp": false,
|
|
1545
1523
|
"hiddenAliases": [],
|
|
1546
|
-
"id": "config:
|
|
1524
|
+
"id": "config:get-backend",
|
|
1547
1525
|
"pluginAlias": "hereya-cli",
|
|
1548
1526
|
"pluginName": "hereya-cli",
|
|
1549
1527
|
"pluginType": "core",
|
|
@@ -1554,7 +1532,7 @@
|
|
|
1554
1532
|
"dist",
|
|
1555
1533
|
"commands",
|
|
1556
1534
|
"config",
|
|
1557
|
-
"
|
|
1535
|
+
"get-backend",
|
|
1558
1536
|
"index.js"
|
|
1559
1537
|
]
|
|
1560
1538
|
},
|
|
@@ -2702,46 +2680,60 @@
|
|
|
2702
2680
|
"index.js"
|
|
2703
2681
|
]
|
|
2704
2682
|
},
|
|
2705
|
-
"
|
|
2683
|
+
"devenv:project:init": {
|
|
2706
2684
|
"aliases": [],
|
|
2707
2685
|
"args": {
|
|
2708
|
-
"
|
|
2709
|
-
"description": "
|
|
2710
|
-
"name": "
|
|
2686
|
+
"project": {
|
|
2687
|
+
"description": "project name",
|
|
2688
|
+
"name": "project",
|
|
2711
2689
|
"required": true
|
|
2712
2690
|
}
|
|
2713
2691
|
},
|
|
2714
|
-
"description": "
|
|
2692
|
+
"description": "Initialize a project on a remote dev environment.",
|
|
2715
2693
|
"examples": [
|
|
2716
|
-
"<%= config.bin %> <%= command.id %>
|
|
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
|
-
"
|
|
2720
|
-
"
|
|
2721
|
-
"
|
|
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
|
|
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
|
-
"
|
|
2735
|
-
"char": "
|
|
2736
|
-
"description": "
|
|
2737
|
-
"name": "
|
|
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
|
|
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": "
|
|
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
|
-
"
|
|
2765
|
-
"
|
|
2756
|
+
"devenv",
|
|
2757
|
+
"project",
|
|
2758
|
+
"init",
|
|
2766
2759
|
"index.js"
|
|
2767
2760
|
]
|
|
2768
2761
|
},
|
|
2769
|
-
"
|
|
2762
|
+
"workspace:uninstall": {
|
|
2770
2763
|
"aliases": [],
|
|
2771
2764
|
"args": {
|
|
2772
|
-
"
|
|
2773
|
-
"description": "
|
|
2774
|
-
"name": "
|
|
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": "
|
|
2771
|
+
"description": "Remove a package from a workspace.",
|
|
2779
2772
|
"examples": [
|
|
2780
|
-
"<%= config.bin %> <%= command.id %>
|
|
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
|
-
"
|
|
2786
|
-
"
|
|
2787
|
-
"
|
|
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
|
|
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
|
-
"
|
|
2812
|
-
"char": "
|
|
2813
|
-
"description": "
|
|
2814
|
-
"name": "
|
|
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": "
|
|
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
|
-
"
|
|
2843
|
-
"
|
|
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:
|
|
2944
|
+
"workspace:env:unset": {
|
|
2967
2945
|
"aliases": [],
|
|
2968
2946
|
"args": {},
|
|
2969
|
-
"description": "
|
|
2947
|
+
"description": "unset an env var for a workspace",
|
|
2970
2948
|
"examples": [
|
|
2971
|
-
"<%= config.bin %> <%= command.id %> -w my-workspace -n myVar
|
|
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
|
|
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
|
|
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:
|
|
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
|
-
"
|
|
2985
|
+
"unset",
|
|
3033
2986
|
"index.js"
|
|
3034
2987
|
]
|
|
3035
2988
|
},
|
|
3036
|
-
"workspace:env:
|
|
2989
|
+
"workspace:env:set": {
|
|
3037
2990
|
"aliases": [],
|
|
3038
2991
|
"args": {},
|
|
3039
|
-
"description": "
|
|
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
|
|
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
|
|
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:
|
|
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
|
-
"
|
|
3055
|
+
"set",
|
|
3078
3056
|
"index.js"
|
|
3079
3057
|
]
|
|
3080
3058
|
},
|
|
@@ -3197,5 +3175,5 @@
|
|
|
3197
3175
|
]
|
|
3198
3176
|
}
|
|
3199
3177
|
},
|
|
3200
|
-
"version": "0.
|
|
3178
|
+
"version": "0.85.0"
|
|
3201
3179
|
}
|
package/package.json
CHANGED
package/dist/lib/app-vars.d.ts
DELETED
|
@@ -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
|
-
}>;
|
package/dist/lib/app-vars.js
DELETED
|
@@ -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
|
-
}
|