hereya-cli 0.25.0 → 0.27.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 +25 -23
- package/dist/backend/local.d.ts +1 -0
- package/dist/backend/local.js +9 -0
- package/dist/commands/down/index.d.ts +1 -0
- package/dist/commands/down/index.js +10 -1
- package/dist/commands/up/index.d.ts +1 -0
- package/dist/commands/up/index.js +10 -1
- package/dist/lib/config/simple.d.ts +1 -0
- package/dist/lib/config/simple.js +33 -19
- package/dist/lib/package/index.js +6 -6
- package/dist/lib/package/local.js +2 -2
- package/oclif.manifest.json +19 -1
- package/package.json +1 -1
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.
|
|
23
|
+
hereya-cli/0.27.0 linux-x64 node-v22.14.0
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -82,7 +82,7 @@ EXAMPLES
|
|
|
82
82
|
$ hereya add cloudy/docker_postgres
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
85
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/add/index.ts)_
|
|
86
86
|
|
|
87
87
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
88
88
|
|
|
@@ -107,7 +107,7 @@ EXAMPLES
|
|
|
107
107
|
$ hereya bootstrap local
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
110
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/bootstrap/index.ts)_
|
|
111
111
|
|
|
112
112
|
## `hereya deploy`
|
|
113
113
|
|
|
@@ -132,7 +132,7 @@ EXAMPLES
|
|
|
132
132
|
$ hereya deploy
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
135
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/deploy/index.ts)_
|
|
136
136
|
|
|
137
137
|
## `hereya down`
|
|
138
138
|
|
|
@@ -140,9 +140,10 @@ Destroy all packages in the project.
|
|
|
140
140
|
|
|
141
141
|
```
|
|
142
142
|
USAGE
|
|
143
|
-
$ hereya down [--chdir <value>] [--debug] [--deploy] [-w <value>]
|
|
143
|
+
$ hereya down [--chdir <value>] [--debug] [--deploy] [-s <value>...] [-w <value>]
|
|
144
144
|
|
|
145
145
|
FLAGS
|
|
146
|
+
-s, --select=<value>... [default: ] select the packages to destroy
|
|
146
147
|
-w, --workspace=<value> name of the workspace to destroy the packages for
|
|
147
148
|
--chdir=<value> Directory where the command will be executed.
|
|
148
149
|
If not specified, it defaults to the current working directory.
|
|
@@ -158,7 +159,7 @@ EXAMPLES
|
|
|
158
159
|
$ hereya down
|
|
159
160
|
```
|
|
160
161
|
|
|
161
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
162
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/down/index.ts)_
|
|
162
163
|
|
|
163
164
|
## `hereya env [NAME]`
|
|
164
165
|
|
|
@@ -189,7 +190,7 @@ EXAMPLES
|
|
|
189
190
|
$ hereya env -w dev -l
|
|
190
191
|
```
|
|
191
192
|
|
|
192
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
193
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/env/index.ts)_
|
|
193
194
|
|
|
194
195
|
## `hereya env set [NAME]`
|
|
195
196
|
|
|
@@ -216,7 +217,7 @@ EXAMPLES
|
|
|
216
217
|
$ hereya env set FOO -v bar -w dev
|
|
217
218
|
```
|
|
218
219
|
|
|
219
|
-
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
220
|
+
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/env/set/index.ts)_
|
|
220
221
|
|
|
221
222
|
## `hereya help [COMMAND]`
|
|
222
223
|
|
|
@@ -262,7 +263,7 @@ EXAMPLES
|
|
|
262
263
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
263
264
|
```
|
|
264
265
|
|
|
265
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
266
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/init/index.ts)_
|
|
266
267
|
|
|
267
268
|
## `hereya remove PACKAGE`
|
|
268
269
|
|
|
@@ -289,7 +290,7 @@ EXAMPLES
|
|
|
289
290
|
$ hereya remove cloudy/docker_postgres
|
|
290
291
|
```
|
|
291
292
|
|
|
292
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
293
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/remove/index.ts)_
|
|
293
294
|
|
|
294
295
|
## `hereya run CMD`
|
|
295
296
|
|
|
@@ -315,7 +316,7 @@ EXAMPLES
|
|
|
315
316
|
$ hereya run -w uat -- node index.js
|
|
316
317
|
```
|
|
317
318
|
|
|
318
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
319
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/run/index.ts)_
|
|
319
320
|
|
|
320
321
|
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
321
322
|
|
|
@@ -340,7 +341,7 @@ EXAMPLES
|
|
|
340
341
|
$ hereya unbootstrap local
|
|
341
342
|
```
|
|
342
343
|
|
|
343
|
-
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
344
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/unbootstrap/index.ts)_
|
|
344
345
|
|
|
345
346
|
## `hereya undeploy`
|
|
346
347
|
|
|
@@ -365,7 +366,7 @@ EXAMPLES
|
|
|
365
366
|
$ hereya undeploy
|
|
366
367
|
```
|
|
367
368
|
|
|
368
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
369
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/undeploy/index.ts)_
|
|
369
370
|
|
|
370
371
|
## `hereya up`
|
|
371
372
|
|
|
@@ -373,9 +374,10 @@ Provision all packages in the project.
|
|
|
373
374
|
|
|
374
375
|
```
|
|
375
376
|
USAGE
|
|
376
|
-
$ hereya up [--chdir <value>] [--debug] [--deploy] [-w <value>]
|
|
377
|
+
$ hereya up [--chdir <value>] [--debug] [--deploy] [-s <value>...] [-w <value>]
|
|
377
378
|
|
|
378
379
|
FLAGS
|
|
380
|
+
-s, --select=<value>... [default: ] select the packages to provision
|
|
379
381
|
-w, --workspace=<value> name of the workspace to install the packages for
|
|
380
382
|
--chdir=<value> Directory where the command will be executed.
|
|
381
383
|
If not specified, it defaults to the current working directory.
|
|
@@ -391,7 +393,7 @@ EXAMPLES
|
|
|
391
393
|
$ hereya up
|
|
392
394
|
```
|
|
393
395
|
|
|
394
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
396
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/up/index.ts)_
|
|
395
397
|
|
|
396
398
|
## `hereya workspace create NAME`
|
|
397
399
|
|
|
@@ -414,7 +416,7 @@ EXAMPLES
|
|
|
414
416
|
$ hereya workspace create dev
|
|
415
417
|
```
|
|
416
418
|
|
|
417
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
419
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/workspace/create/index.ts)_
|
|
418
420
|
|
|
419
421
|
## `hereya workspace delete NAME`
|
|
420
422
|
|
|
@@ -434,7 +436,7 @@ EXAMPLES
|
|
|
434
436
|
$ hereya workspace delete dev
|
|
435
437
|
```
|
|
436
438
|
|
|
437
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
439
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/workspace/delete/index.ts)_
|
|
438
440
|
|
|
439
441
|
## `hereya workspace env [NAME]`
|
|
440
442
|
|
|
@@ -460,7 +462,7 @@ EXAMPLES
|
|
|
460
462
|
$ hereya workspace env myEnv -w dev
|
|
461
463
|
```
|
|
462
464
|
|
|
463
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
465
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/workspace/env/index.ts)_
|
|
464
466
|
|
|
465
467
|
## `hereya workspace env set`
|
|
466
468
|
|
|
@@ -484,7 +486,7 @@ EXAMPLES
|
|
|
484
486
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
485
487
|
```
|
|
486
488
|
|
|
487
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
489
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/workspace/env/set/index.ts)_
|
|
488
490
|
|
|
489
491
|
## `hereya workspace env unset`
|
|
490
492
|
|
|
@@ -505,7 +507,7 @@ EXAMPLES
|
|
|
505
507
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
506
508
|
```
|
|
507
509
|
|
|
508
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
510
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/workspace/env/unset/index.ts)_
|
|
509
511
|
|
|
510
512
|
## `hereya workspace install PACKAGE`
|
|
511
513
|
|
|
@@ -532,7 +534,7 @@ EXAMPLES
|
|
|
532
534
|
$ hereya workspace install hereya/aws-cognito
|
|
533
535
|
```
|
|
534
536
|
|
|
535
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
537
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/workspace/install/index.ts)_
|
|
536
538
|
|
|
537
539
|
## `hereya workspace list`
|
|
538
540
|
|
|
@@ -549,7 +551,7 @@ EXAMPLES
|
|
|
549
551
|
$ hereya workspace list
|
|
550
552
|
```
|
|
551
553
|
|
|
552
|
-
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
554
|
+
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/workspace/list/index.ts)_
|
|
553
555
|
|
|
554
556
|
## `hereya workspace uninstall PACKAGE`
|
|
555
557
|
|
|
@@ -576,5 +578,5 @@ EXAMPLES
|
|
|
576
578
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
577
579
|
```
|
|
578
580
|
|
|
579
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
581
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.27.0/src/commands/workspace/uninstall/index.ts)_
|
|
580
582
|
<!-- commandsstop -->
|
package/dist/backend/local.d.ts
CHANGED
package/dist/backend/local.js
CHANGED
|
@@ -160,6 +160,7 @@ export class LocalBackend {
|
|
|
160
160
|
async getState(input) {
|
|
161
161
|
await this.migrateProjectState(input);
|
|
162
162
|
const projectStatePath = await this.getProjectStatePath(input);
|
|
163
|
+
await this.migrateLocalPackageReferences(projectStatePath);
|
|
163
164
|
const { data, found } = await load(projectStatePath);
|
|
164
165
|
if (found) {
|
|
165
166
|
return {
|
|
@@ -173,6 +174,7 @@ export class LocalBackend {
|
|
|
173
174
|
}
|
|
174
175
|
async getWorkspace(workspace) {
|
|
175
176
|
const workspacePath = await getAnyPath(path.join(os.homedir(), '.hereya', 'state', 'workspaces', `${workspace}.yaml`), path.join(os.homedir(), '.hereya', 'state', 'workspaces', `${workspace}.yml`));
|
|
177
|
+
await this.migrateLocalPackageReferences(workspacePath);
|
|
176
178
|
const { data, error, found } = await load(workspacePath);
|
|
177
179
|
if (error) {
|
|
178
180
|
return {
|
|
@@ -379,6 +381,13 @@ export class LocalBackend {
|
|
|
379
381
|
async getWorkspacePath(name) {
|
|
380
382
|
return getAnyPath(path.join(os.homedir(), '.hereya', 'state', 'workspaces', `${name}.yaml`), path.join(os.homedir(), '.hereya', 'state', 'workspaces', `${name}.yml`));
|
|
381
383
|
}
|
|
384
|
+
async migrateLocalPackageReferences(statePath) {
|
|
385
|
+
if (await fs.stat(statePath).catch(() => false)) {
|
|
386
|
+
let stateContent = await fs.readFile(statePath, 'utf8');
|
|
387
|
+
stateContent = stateContent.replace('local://', 'local/');
|
|
388
|
+
await fs.writeFile(statePath, stateContent);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
382
391
|
async migrateProjectState(input) {
|
|
383
392
|
const oldProjectStatePath = await this.getOldProjectStatePath(input);
|
|
384
393
|
const newProjectStatePath = await this.getProjectStatePath(input);
|
|
@@ -6,6 +6,7 @@ export default class Down extends Command {
|
|
|
6
6
|
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
deploy: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
select: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
};
|
|
11
12
|
run(): Promise<void>;
|
|
@@ -27,6 +27,12 @@ export default class Down extends Command {
|
|
|
27
27
|
description: 'destroy deployment companion packages',
|
|
28
28
|
required: false,
|
|
29
29
|
}),
|
|
30
|
+
select: Flags.string({
|
|
31
|
+
char: 's',
|
|
32
|
+
default: [],
|
|
33
|
+
description: 'select the packages to destroy',
|
|
34
|
+
multiple: true,
|
|
35
|
+
}),
|
|
30
36
|
workspace: Flags.string({
|
|
31
37
|
char: 'w',
|
|
32
38
|
description: 'name of the workspace to destroy the packages for',
|
|
@@ -57,7 +63,7 @@ export default class Down extends Command {
|
|
|
57
63
|
},
|
|
58
64
|
{
|
|
59
65
|
async task(ctx) {
|
|
60
|
-
|
|
66
|
+
let packages = Object.keys(ctx.configOutput.config.packages ?? {});
|
|
61
67
|
const backend = await getBackend();
|
|
62
68
|
const savedStateOutput = await backend.getState({
|
|
63
69
|
project: ctx.configOutput.config.project,
|
|
@@ -68,6 +74,9 @@ export default class Down extends Command {
|
|
|
68
74
|
const savedPackages = Object.keys(savedStateOutput.config.packages ?? {});
|
|
69
75
|
removedPackages = savedPackages.filter((packageName) => !packages.includes(packageName));
|
|
70
76
|
}
|
|
77
|
+
if (flags.select.length > 0) {
|
|
78
|
+
packages = packages.filter((packageName) => flags.select.includes(packageName));
|
|
79
|
+
}
|
|
71
80
|
ctx.packages = [...packages, ...removedPackages];
|
|
72
81
|
await delay(500);
|
|
73
82
|
},
|
|
@@ -6,6 +6,7 @@ export default class Up extends Command {
|
|
|
6
6
|
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
deploy: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
select: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
};
|
|
11
12
|
run(): Promise<void>;
|
|
@@ -27,6 +27,12 @@ export default class Up extends Command {
|
|
|
27
27
|
description: 'provision deployment companion packages',
|
|
28
28
|
required: false,
|
|
29
29
|
}),
|
|
30
|
+
select: Flags.string({
|
|
31
|
+
char: 's',
|
|
32
|
+
default: [],
|
|
33
|
+
description: 'select the packages to provision',
|
|
34
|
+
multiple: true,
|
|
35
|
+
}),
|
|
30
36
|
workspace: Flags.string({
|
|
31
37
|
char: 'w',
|
|
32
38
|
description: 'name of the workspace to install the packages for',
|
|
@@ -75,7 +81,10 @@ export default class Up extends Command {
|
|
|
75
81
|
const savedPackages = Object.keys(ctx.savedStateOutput?.config?.packages ?? {});
|
|
76
82
|
const removedPackages = savedPackages.filter((packageName) => !packages.includes(packageName));
|
|
77
83
|
ctx.removedPackages = removedPackages;
|
|
78
|
-
ctx.packages =
|
|
84
|
+
ctx.packages =
|
|
85
|
+
flags.select.length > 0
|
|
86
|
+
? packages.filter((packageName) => flags.select.includes(packageName))
|
|
87
|
+
: packages;
|
|
79
88
|
await delay(500);
|
|
80
89
|
},
|
|
81
90
|
title: 'Searching for removed packages',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import { getAnyPath } from '../filesystem.js';
|
|
3
4
|
import * as yaml from '../yaml-utils.js';
|
|
@@ -6,29 +7,34 @@ export class SimpleConfigManager {
|
|
|
6
7
|
const { config } = await this.loadConfig({ projectRootDir: input.projectRootDir });
|
|
7
8
|
await yaml.save({
|
|
8
9
|
...config,
|
|
9
|
-
...(input.metadata.deploy
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
...(input.metadata.deploy
|
|
11
|
+
? {
|
|
12
|
+
deploy: {
|
|
13
|
+
...config.deploy,
|
|
14
|
+
[input.package]: {
|
|
15
|
+
version: '',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
: {
|
|
20
|
+
packages: {
|
|
21
|
+
...config.packages,
|
|
22
|
+
[input.package]: {
|
|
23
|
+
version: '',
|
|
24
|
+
...(input.metadata.onDeploy
|
|
25
|
+
? {
|
|
26
|
+
onDeploy: {
|
|
27
|
+
...input.metadata.onDeploy,
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
: {}),
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
29
34
|
}, await this.getConfigPath(input.projectRootDir));
|
|
30
35
|
}
|
|
31
36
|
async loadConfig(input) {
|
|
37
|
+
await this.migrateLocalPackageReferences(input.projectRootDir ?? process.cwd());
|
|
32
38
|
const configFilePath = await this.getConfigPath(input.projectRootDir);
|
|
33
39
|
const { data: config, found } = await yaml.load(configFilePath);
|
|
34
40
|
return {
|
|
@@ -59,4 +65,12 @@ export class SimpleConfigManager {
|
|
|
59
65
|
async getConfigPath(rootDir) {
|
|
60
66
|
return getAnyPath(path.join(rootDir ?? process.cwd(), 'hereya.yaml'), path.join(rootDir ?? process.cwd(), 'hereya.yml'));
|
|
61
67
|
}
|
|
68
|
+
async migrateLocalPackageReferences(projectRootDir) {
|
|
69
|
+
const hereyaYamlPath = await this.getConfigPath(projectRootDir);
|
|
70
|
+
if (await fs.stat(hereyaYamlPath).catch(() => false)) {
|
|
71
|
+
let hereyaYamlContent = await fs.readFile(hereyaYamlPath, 'utf8');
|
|
72
|
+
hereyaYamlContent = hereyaYamlContent.replace('local://', 'local/');
|
|
73
|
+
await fs.writeFile(hereyaYamlPath, hereyaYamlContent);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
62
76
|
}
|
|
@@ -13,11 +13,11 @@ export function getPackageManager(protocol) {
|
|
|
13
13
|
return packageManager;
|
|
14
14
|
}
|
|
15
15
|
export async function resolvePackage(input) {
|
|
16
|
-
const isLocal = input.package.startsWith('local
|
|
16
|
+
const isLocal = input.package.startsWith('local/');
|
|
17
17
|
let [owner, repo] = ['', ''];
|
|
18
18
|
if (isLocal) {
|
|
19
|
-
;
|
|
20
|
-
|
|
19
|
+
owner = 'local';
|
|
20
|
+
repo = input.package.replace('local/', '');
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
23
|
const pkgParts = input.package.split('/');
|
|
@@ -57,14 +57,14 @@ export async function resolvePackage(input) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
export function getPackageCanonicalName(packageName) {
|
|
60
|
-
const isLocal = packageName.startsWith('local
|
|
60
|
+
const isLocal = packageName.startsWith('local/');
|
|
61
61
|
if (isLocal) {
|
|
62
|
-
return packageName.replace('local
|
|
62
|
+
return packageName.replace('local/', 'local--').replace('/', '-');
|
|
63
63
|
}
|
|
64
64
|
return packageName.replace('/', '-');
|
|
65
65
|
}
|
|
66
66
|
export async function downloadPackage(pkgUrl, destPath) {
|
|
67
|
-
const packageManager = getPackageManager(pkgUrl.startsWith('local
|
|
67
|
+
const packageManager = getPackageManager(pkgUrl.startsWith('local/') ? 'local' : '');
|
|
68
68
|
return packageManager.downloadPackage(pkgUrl, destPath);
|
|
69
69
|
}
|
|
70
70
|
export const PackageMetadata = z.object({
|
|
@@ -2,7 +2,7 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
export class LocalPackageManager {
|
|
4
4
|
async downloadPackage(pkgUrl, destPath) {
|
|
5
|
-
const
|
|
5
|
+
const source = pkgUrl.replace('local/', '');
|
|
6
6
|
await copyRecursive(source, destPath);
|
|
7
7
|
return destPath;
|
|
8
8
|
}
|
|
@@ -15,7 +15,7 @@ export class LocalPackageManager {
|
|
|
15
15
|
return {
|
|
16
16
|
content,
|
|
17
17
|
found: true,
|
|
18
|
-
pkgUrl: `local
|
|
18
|
+
pkgUrl: `local/${pkgRootDir}`,
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
return {
|
package/oclif.manifest.json
CHANGED
|
@@ -170,6 +170,15 @@
|
|
|
170
170
|
"allowNo": false,
|
|
171
171
|
"type": "boolean"
|
|
172
172
|
},
|
|
173
|
+
"select": {
|
|
174
|
+
"char": "s",
|
|
175
|
+
"description": "select the packages to destroy",
|
|
176
|
+
"name": "select",
|
|
177
|
+
"default": [],
|
|
178
|
+
"hasDynamicHelp": false,
|
|
179
|
+
"multiple": true,
|
|
180
|
+
"type": "option"
|
|
181
|
+
},
|
|
173
182
|
"workspace": {
|
|
174
183
|
"char": "w",
|
|
175
184
|
"description": "name of the workspace to destroy the packages for",
|
|
@@ -514,6 +523,15 @@
|
|
|
514
523
|
"allowNo": false,
|
|
515
524
|
"type": "boolean"
|
|
516
525
|
},
|
|
526
|
+
"select": {
|
|
527
|
+
"char": "s",
|
|
528
|
+
"description": "select the packages to provision",
|
|
529
|
+
"name": "select",
|
|
530
|
+
"default": [],
|
|
531
|
+
"hasDynamicHelp": false,
|
|
532
|
+
"multiple": true,
|
|
533
|
+
"type": "option"
|
|
534
|
+
},
|
|
517
535
|
"workspace": {
|
|
518
536
|
"char": "w",
|
|
519
537
|
"description": "name of the workspace to install the packages for",
|
|
@@ -988,5 +1006,5 @@
|
|
|
988
1006
|
]
|
|
989
1007
|
}
|
|
990
1008
|
},
|
|
991
|
-
"version": "0.
|
|
1009
|
+
"version": "0.27.0"
|
|
992
1010
|
}
|