@simplysf/simply-package 4.0.1 → 4.1.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 +118 -10
- package/lib/commands/simply/package/dependencies/clone.d.ts +23 -0
- package/lib/commands/simply/package/dependencies/clone.js +107 -0
- package/lib/commands/simply/package/dependencies/clone.js.map +1 -0
- package/messages/simply.package.dependencies.clone.md +71 -0
- package/oclif.manifest.json +277 -164
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -20,11 +20,102 @@ This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/sim
|
|
|
20
20
|
|
|
21
21
|
<!-- commands -->
|
|
22
22
|
|
|
23
|
+
- [`sf simply package dependencies clone`](#sf-simply-package-dependencies-clone)
|
|
23
24
|
- [`sf simply package dependencies install`](#sf-simply-package-dependencies-install)
|
|
24
25
|
- [`sf simply package dependencies manage`](#sf-simply-package-dependencies-manage)
|
|
25
26
|
- [`sf simply package version cleanup`](#sf-simply-package-version-cleanup)
|
|
26
27
|
- [`sf simply package version get`](#sf-simply-package-version-get)
|
|
27
28
|
|
|
29
|
+
## `sf simply package dependencies clone`
|
|
30
|
+
|
|
31
|
+
Git-clone the source repositories of a Salesforce project's package dependencies.
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
USAGE
|
|
35
|
+
$ sf simply package dependencies clone [--json] [--flags-dir <value>] [-d <value>] [-r] [--depth <value>] [-u]
|
|
36
|
+
[--dry-run]
|
|
37
|
+
|
|
38
|
+
FLAGS
|
|
39
|
+
-d, --output-dir=<value> [default: ..] Directory to clone into, relative to the project root.
|
|
40
|
+
-r, --recursive Also clone the dependencies of each dependency, following each clone's own
|
|
41
|
+
sfdx-project.json.
|
|
42
|
+
-u, --update Fetch and update repositories that are already cloned.
|
|
43
|
+
--depth=<value> Create shallow clones with this many commits of history.
|
|
44
|
+
--dry-run Show what would be cloned, without running git.
|
|
45
|
+
|
|
46
|
+
GLOBAL FLAGS
|
|
47
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
48
|
+
--json Format output as json.
|
|
49
|
+
|
|
50
|
+
DESCRIPTION
|
|
51
|
+
Git-clone the source repositories of a Salesforce project's package dependencies.
|
|
52
|
+
|
|
53
|
+
Clones each package dependency declared in sfdx-project.json whose source repository is given under
|
|
54
|
+
plugins.simply.packages, so you can review the metadata the project depends on. Nothing is installed in an org.
|
|
55
|
+
|
|
56
|
+
Each plugins.simply.packages entry is keyed by package alias. Its "repository" gives a git "url", plus an optional
|
|
57
|
+
"ref" (branch, tag, or commit SHA) and "path" (the subdirectory holding the repository's own sfdx-project.json). A key
|
|
58
|
+
matches a dependency's "package" value exactly, or up to its first "@", so a key such as "fflib" keeps matching as the
|
|
59
|
+
dependency moves from "fflib@3.0.0-1" to "fflib@3.1.0-2". A key also matches through packageAliases: a dependency
|
|
60
|
+
written as a bare ID (0Ho… or 04t…) matches the key of any alias, or alias prefix, that packageAliases maps to that
|
|
61
|
+
ID.
|
|
62
|
+
|
|
63
|
+
The command runs your own git, so any host works (GitHub, GitLab, self-hosted servers) with the SSH keys or credential
|
|
64
|
+
helper you already use. A url that contains credentials is rejected. Nothing prompts for input: a missing credential
|
|
65
|
+
fails that dependency's row, and so do an unknown ssh host key and a key passphrase, unless you've set your own ssh
|
|
66
|
+
command. Dependencies with no mapping, such as AppExchange packages, are reported as "No repository".
|
|
67
|
+
|
|
68
|
+
Each repository is cloned into a folder named after it, next to the project by default. A folder that already holds a
|
|
69
|
+
clone of the same repository is reused.
|
|
70
|
+
|
|
71
|
+
With --recursive, your own plugins.simply.packages entries always come first. A dependency's sfdx-project.json can
|
|
72
|
+
supply a repository only for a package you don't map, and only as an https or ssh URL. Each repository that comes from
|
|
73
|
+
one is named in the output.
|
|
74
|
+
|
|
75
|
+
Cloning runs nothing from the repositories: no install scripts, no git hooks, and no submodules. Treat the clones as
|
|
76
|
+
untrusted code until you've reviewed them. Opening one in an editor that trusts the folder, running npm install or its
|
|
77
|
+
scripts, or deploying its metadata can run code it contains.
|
|
78
|
+
|
|
79
|
+
EXAMPLES
|
|
80
|
+
Clone the direct dependencies of the project in the current directory, next to it:
|
|
81
|
+
|
|
82
|
+
$ sf simply package dependencies clone
|
|
83
|
+
|
|
84
|
+
Clone every dependency, including dependencies of dependencies, as shallow clones into a "deps" folder:
|
|
85
|
+
|
|
86
|
+
$ sf simply package dependencies clone --recursive --depth 1 --output-dir ../deps
|
|
87
|
+
|
|
88
|
+
Bring existing clones up to date with their configured refs:
|
|
89
|
+
|
|
90
|
+
$ sf simply package dependencies clone --update
|
|
91
|
+
|
|
92
|
+
Preview what would be cloned:
|
|
93
|
+
|
|
94
|
+
$ sf simply package dependencies clone --recursive --dry-run
|
|
95
|
+
|
|
96
|
+
FLAG DESCRIPTIONS
|
|
97
|
+
-d, --output-dir=<value> Directory to clone into, relative to the project root.
|
|
98
|
+
|
|
99
|
+
Each repository goes into "<output-dir>/<repository name>". The default, "..", puts clones next to the project. When
|
|
100
|
+
two different repositories share a name, the second folder is prefixed with its group or owner.
|
|
101
|
+
|
|
102
|
+
-u, --update Fetch and update repositories that are already cloned.
|
|
103
|
+
|
|
104
|
+
A clone on the configured branch is fast-forwarded, and a clone at a detached HEAD (after a tag or SHA) is checked
|
|
105
|
+
out at the configured ref. A clone with uncommitted changes, or on some other branch, is left alone and reported as
|
|
106
|
+
skipped, because it may be your own working copy. The exception is a clone still on the remote's default branch with
|
|
107
|
+
no commits of its own, such as one made before "ref" was set: it moves to the configured ref. A clone that follows a
|
|
108
|
+
branch, including the default branch when no "ref" is set, gets that branch's newest commits; set "ref" to a tag to
|
|
109
|
+
stay on one version.
|
|
110
|
+
|
|
111
|
+
--depth=<value> Create shallow clones with this many commits of history.
|
|
112
|
+
|
|
113
|
+
Passed to "git clone --depth". A dependency pinned to a commit SHA always gets a full clone, because a shallow clone
|
|
114
|
+
can't check out an arbitrary commit.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
_See code: [lib/commands/simply/package/dependencies/clone.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.0/packages/simply-package/lib/commands/simply/package/dependencies/clone.js)_
|
|
118
|
+
|
|
28
119
|
## `sf simply package dependencies install`
|
|
29
120
|
|
|
30
121
|
Install package dependencies for a Salesforce project.
|
|
@@ -157,7 +248,7 @@ FLAG DESCRIPTIONS
|
|
|
157
248
|
Packages not listed here use --retry-attempts.
|
|
158
249
|
```
|
|
159
250
|
|
|
160
|
-
_See code: [lib/commands/simply/package/dependencies/install.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.0
|
|
251
|
+
_See code: [lib/commands/simply/package/dependencies/install.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.0/packages/simply-package/lib/commands/simply/package/dependencies/install.js)_
|
|
161
252
|
|
|
162
253
|
## `sf simply package dependencies manage`
|
|
163
254
|
|
|
@@ -216,7 +307,7 @@ FLAG DESCRIPTIONS
|
|
|
216
307
|
version without interactive prompts. Mutually exclusive with --update-to-latest.
|
|
217
308
|
```
|
|
218
309
|
|
|
219
|
-
_See code: [lib/commands/simply/package/dependencies/manage.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.0
|
|
310
|
+
_See code: [lib/commands/simply/package/dependencies/manage.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.0/packages/simply-package/lib/commands/simply/package/dependencies/manage.js)_
|
|
220
311
|
|
|
221
312
|
## `sf simply package version cleanup`
|
|
222
313
|
|
|
@@ -273,7 +364,7 @@ FLAG DESCRIPTIONS
|
|
|
273
364
|
that does not match any of the given selectors is deleted. Mutually exclusive with --selector.
|
|
274
365
|
```
|
|
275
366
|
|
|
276
|
-
_See code: [lib/commands/simply/package/version/cleanup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.0
|
|
367
|
+
_See code: [lib/commands/simply/package/version/cleanup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.0/packages/simply-package/lib/commands/simply/package/version/cleanup.js)_
|
|
277
368
|
|
|
278
369
|
## `sf simply package version get`
|
|
279
370
|
|
|
@@ -333,7 +424,7 @@ FLAG DESCRIPTIONS
|
|
|
333
424
|
"test-package@0.1.0+2", pass "test-package".
|
|
334
425
|
```
|
|
335
426
|
|
|
336
|
-
_See code: [lib/commands/simply/package/version/get.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.0
|
|
427
|
+
_See code: [lib/commands/simply/package/version/get.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.0/packages/simply-package/lib/commands/simply/package/version/get.js)_
|
|
337
428
|
<!-- commandsstop -->
|
|
338
429
|
|
|
339
430
|
## Configuration Files
|
|
@@ -366,9 +457,9 @@ Each package directory's `dependencies` array lists the packages to install/mana
|
|
|
366
457
|
| `versionNumber` | `string` | No | Required when `package` is a `Package2Id`. A `MAJOR.MINOR.PATCH.BUILD` version, where `BUILD` may be `LATEST` for a non-pinned build. |
|
|
367
458
|
| `branch` | `string` | No | Scopes dev hub version resolution to a specific build branch. Only used when `versionNumber` is also set. |
|
|
368
459
|
|
|
369
|
-
### `plugins.simply` (used by `dependencies manage`)
|
|
460
|
+
### `plugins.simply` (used by `dependencies manage` and `dependencies clone`)
|
|
370
461
|
|
|
371
|
-
`sf simply package dependencies manage`
|
|
462
|
+
`sf simply package dependencies manage` and `sf simply package dependencies clone` read optional settings from a `plugins.simply` block in `sfdx-project.json`:
|
|
372
463
|
|
|
373
464
|
```json
|
|
374
465
|
{
|
|
@@ -377,6 +468,21 @@ Each package directory's `dependencies` array lists the packages to install/mana
|
|
|
377
468
|
"dependencies": {
|
|
378
469
|
"ignore": ["MyLockedDependency", "0Ho000000000002AAA"]
|
|
379
470
|
},
|
|
471
|
+
"packages": {
|
|
472
|
+
"fflib-apex-common": {
|
|
473
|
+
"repository": {
|
|
474
|
+
"url": "https://github.com/apex-enterprise-patterns/fflib-apex-common.git",
|
|
475
|
+
"ref": "v3.0.0"
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
"my-core": {
|
|
479
|
+
"repository": {
|
|
480
|
+
"url": "git@gitlab.example.internal:salesforce/my-core.git",
|
|
481
|
+
"ref": "main",
|
|
482
|
+
"path": "sfdx-source"
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
},
|
|
380
486
|
"package": {
|
|
381
487
|
"brancheswithreleasedversions": ["release/2026-Q1"]
|
|
382
488
|
}
|
|
@@ -385,10 +491,12 @@ Each package directory's `dependencies` array lists the packages to install/mana
|
|
|
385
491
|
}
|
|
386
492
|
```
|
|
387
493
|
|
|
388
|
-
| Key | Type | Description
|
|
389
|
-
| ----------------------------------------------------- | ---------- |
|
|
390
|
-
| `plugins.simply.dependencies.ignore` | `string[]` | `Package2Id`s or aliases that `dependencies manage` should leave unchanged.
|
|
391
|
-
| `plugins.simply.package.brancheswithreleasedversions` | `string[]` | Branch names that contain released versions, considered in addition to the main build branch.
|
|
494
|
+
| Key | Type | Description |
|
|
495
|
+
| ----------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
496
|
+
| `plugins.simply.dependencies.ignore` | `string[]` | `Package2Id`s or aliases that `dependencies manage` should leave unchanged, and `dependencies clone` should skip. |
|
|
497
|
+
| `plugins.simply.package.brancheswithreleasedversions` | `string[]` | Branch names that contain released versions, considered in addition to the main build branch. |
|
|
498
|
+
| `plugins.simply.packages` | `object` | Settings per package, keyed by package alias, matched against a dependency's `package` value exactly, up to its first `@`, or through `packageAliases` (a bare `0Ho`/`04t` ID matches the key of any alias mapped to it). Used by `dependencies clone`. |
|
|
499
|
+
| `plugins.simply.packages.<alias>.repository` | `object` | Where that package's source lives, for `dependencies clone`: a git `url` (any host; credentials are rejected), and optionally a `ref` (branch, tag, or commit SHA) and a `path` (the subdirectory holding that repository's `sfdx-project.json`). |
|
|
392
500
|
|
|
393
501
|
## Report Files
|
|
394
502
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type DependencyCloneResult } from '@simplysf/simply-package-core';
|
|
3
|
+
export type { DependencyCloneResult };
|
|
4
|
+
/**
|
|
5
|
+
* Git-clones the source repositories of a Salesforce DX project's package dependencies, as given
|
|
6
|
+
* by each package's `repository` in `plugins.simply.packages`, so their metadata can be reviewed
|
|
7
|
+
* locally.
|
|
8
|
+
*/
|
|
9
|
+
export default class PackageDependenciesClone extends SfCommand<DependencyCloneResult[]> {
|
|
10
|
+
static readonly summary: string;
|
|
11
|
+
static readonly description: string;
|
|
12
|
+
static readonly examples: string[];
|
|
13
|
+
static readonly requiresProject = true;
|
|
14
|
+
static readonly flags: {
|
|
15
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
recursive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
depth: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
update: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
/** @returns One row per dependency. Sets `process.exitCode = 1` when any row is `Failed`. */
|
|
22
|
+
run(): Promise<DependencyCloneResult[]>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { Messages } from '@salesforce/core';
|
|
19
|
+
import { clonePackageDependencies } from '@simplysf/simply-package-core';
|
|
20
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
21
|
+
const messages = Messages.loadMessages('@simplysf/simply-package', 'simply.package.dependencies.clone');
|
|
22
|
+
/**
|
|
23
|
+
* Git-clones the source repositories of a Salesforce DX project's package dependencies, as given
|
|
24
|
+
* by each package's `repository` in `plugins.simply.packages`, so their metadata can be reviewed
|
|
25
|
+
* locally.
|
|
26
|
+
*/
|
|
27
|
+
export default class PackageDependenciesClone extends SfCommand {
|
|
28
|
+
static summary = messages.getMessage('summary');
|
|
29
|
+
static description = messages.getMessage('description');
|
|
30
|
+
static examples = messages.getMessages('examples');
|
|
31
|
+
static requiresProject = true;
|
|
32
|
+
static flags = {
|
|
33
|
+
'output-dir': Flags.string({
|
|
34
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
35
|
+
description: messages.getMessage('flags.output-dir.description'),
|
|
36
|
+
char: 'd',
|
|
37
|
+
default: '..',
|
|
38
|
+
}),
|
|
39
|
+
recursive: Flags.boolean({
|
|
40
|
+
summary: messages.getMessage('flags.recursive.summary'),
|
|
41
|
+
char: 'r',
|
|
42
|
+
default: false,
|
|
43
|
+
}),
|
|
44
|
+
// No default on purpose: leaving --depth out means full history, which git has no number for.
|
|
45
|
+
// eslint-disable-next-line sf-plugin/flag-min-max-default
|
|
46
|
+
depth: Flags.integer({
|
|
47
|
+
summary: messages.getMessage('flags.depth.summary'),
|
|
48
|
+
description: messages.getMessage('flags.depth.description'),
|
|
49
|
+
min: 1,
|
|
50
|
+
}),
|
|
51
|
+
update: Flags.boolean({
|
|
52
|
+
summary: messages.getMessage('flags.update.summary'),
|
|
53
|
+
description: messages.getMessage('flags.update.description'),
|
|
54
|
+
char: 'u',
|
|
55
|
+
default: false,
|
|
56
|
+
}),
|
|
57
|
+
'dry-run': Flags.boolean({
|
|
58
|
+
summary: messages.getMessage('flags.dry-run.summary'),
|
|
59
|
+
default: false,
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
/** @returns One row per dependency. Sets `process.exitCode = 1` when any row is `Failed`. */
|
|
63
|
+
async run() {
|
|
64
|
+
const { flags } = await this.parse(PackageDependenciesClone);
|
|
65
|
+
const projectDir = this.project.getPath();
|
|
66
|
+
const results = await clonePackageDependencies({
|
|
67
|
+
projectDir,
|
|
68
|
+
outputDir: flags['output-dir'],
|
|
69
|
+
recursive: flags.recursive,
|
|
70
|
+
depth: flags.depth,
|
|
71
|
+
update: flags.update,
|
|
72
|
+
dryRun: flags['dry-run'],
|
|
73
|
+
progress: {
|
|
74
|
+
info: (message) => this.info(message),
|
|
75
|
+
warn: (message) => this.warn(message),
|
|
76
|
+
stepStart: (message) => this.spinner.start(message, '', { stdout: true }),
|
|
77
|
+
stepStop: (message) => this.spinner.stop(message),
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
if (results.length === 0) {
|
|
81
|
+
this.info(messages.getMessage('info.noDependencies'));
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
this.table({
|
|
85
|
+
data: results.map((row) => ({
|
|
86
|
+
key: row.key ?? row.package,
|
|
87
|
+
ref: row.ref ?? '',
|
|
88
|
+
status: row.message ? `${row.status} (${row.message})` : row.status,
|
|
89
|
+
via: row.via,
|
|
90
|
+
directory: row.directory ? path.relative(projectDir, row.directory) : '',
|
|
91
|
+
})),
|
|
92
|
+
columns: [
|
|
93
|
+
{ key: 'key', name: 'KEY' },
|
|
94
|
+
{ key: 'ref', name: 'REF' },
|
|
95
|
+
{ key: 'status', name: 'STATUS' },
|
|
96
|
+
{ key: 'via', name: 'VIA' },
|
|
97
|
+
{ key: 'directory', name: 'DIRECTORY' },
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (results.some((row) => row.status === 'Failed')) {
|
|
102
|
+
process.exitCode = 1;
|
|
103
|
+
}
|
|
104
|
+
return results;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=clone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clone.js","sourceRoot":"","sources":["../../../../../src/commands/simply/package/dependencies/clone.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Git-clone the source repositories of a Salesforce project's package dependencies.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Clones each package dependency declared in sfdx-project.json whose source repository is given under plugins.simply.packages, so you can review the metadata the project depends on. Nothing is installed in an org.
|
|
8
|
+
|
|
9
|
+
Each plugins.simply.packages entry is keyed by package alias. Its "repository" gives a git "url", plus an optional "ref" (branch, tag, or commit SHA) and "path" (the subdirectory holding the repository's own sfdx-project.json). A key matches a dependency's "package" value exactly, or up to its first "@", so a key such as "fflib" keeps matching as the dependency moves from "fflib@3.0.0-1" to "fflib@3.1.0-2". A key also matches through packageAliases: a dependency written as a bare ID (0Ho… or 04t…) matches the key of any alias, or alias prefix, that packageAliases maps to that ID.
|
|
10
|
+
|
|
11
|
+
The command runs your own git, so any host works (GitHub, GitLab, self-hosted servers) with the SSH keys or credential helper you already use. A url that contains credentials is rejected. Nothing prompts for input: a missing credential fails that dependency's row, and so do an unknown ssh host key and a key passphrase, unless you've set your own ssh command. Dependencies with no mapping, such as AppExchange packages, are reported as "No repository".
|
|
12
|
+
|
|
13
|
+
Each repository is cloned into a folder named after it, next to the project by default. A folder that already holds a clone of the same repository is reused.
|
|
14
|
+
|
|
15
|
+
With --recursive, your own plugins.simply.packages entries always come first. A dependency's sfdx-project.json can supply a repository only for a package you don't map, and only as an https or ssh URL. Each repository that comes from one is named in the output.
|
|
16
|
+
|
|
17
|
+
Cloning runs nothing from the repositories: no install scripts, no git hooks, and no submodules. Treat the clones as untrusted code until you've reviewed them. Opening one in an editor that trusts the folder, running npm install or its scripts, or deploying its metadata can run code it contains.
|
|
18
|
+
|
|
19
|
+
# flags.output-dir.summary
|
|
20
|
+
|
|
21
|
+
Directory to clone into, relative to the project root.
|
|
22
|
+
|
|
23
|
+
# flags.output-dir.description
|
|
24
|
+
|
|
25
|
+
Each repository goes into "<output-dir>/<repository name>". The default, "..", puts clones next to the project. When two different repositories share a name, the second folder is prefixed with its group or owner.
|
|
26
|
+
|
|
27
|
+
# flags.recursive.summary
|
|
28
|
+
|
|
29
|
+
Also clone the dependencies of each dependency, following each clone's own sfdx-project.json.
|
|
30
|
+
|
|
31
|
+
# flags.depth.summary
|
|
32
|
+
|
|
33
|
+
Create shallow clones with this many commits of history.
|
|
34
|
+
|
|
35
|
+
# flags.depth.description
|
|
36
|
+
|
|
37
|
+
Passed to "git clone --depth". A dependency pinned to a commit SHA always gets a full clone, because a shallow clone can't check out an arbitrary commit.
|
|
38
|
+
|
|
39
|
+
# flags.update.summary
|
|
40
|
+
|
|
41
|
+
Fetch and update repositories that are already cloned.
|
|
42
|
+
|
|
43
|
+
# flags.update.description
|
|
44
|
+
|
|
45
|
+
A clone on the configured branch is fast-forwarded, and a clone at a detached HEAD (after a tag or SHA) is checked out at the configured ref. A clone with uncommitted changes, or on some other branch, is left alone and reported as skipped, because it may be your own working copy. The exception is a clone still on the remote's default branch with no commits of its own, such as one made before "ref" was set: it moves to the configured ref. A clone that follows a branch, including the default branch when no "ref" is set, gets that branch's newest commits; set "ref" to a tag to stay on one version.
|
|
46
|
+
|
|
47
|
+
# flags.dry-run.summary
|
|
48
|
+
|
|
49
|
+
Show what would be cloned, without running git.
|
|
50
|
+
|
|
51
|
+
# info.noDependencies
|
|
52
|
+
|
|
53
|
+
The project declares no package dependencies.
|
|
54
|
+
|
|
55
|
+
# examples
|
|
56
|
+
|
|
57
|
+
- Clone the direct dependencies of the project in the current directory, next to it:
|
|
58
|
+
|
|
59
|
+
<%= config.bin %> <%= command.id %>
|
|
60
|
+
|
|
61
|
+
- Clone every dependency, including dependencies of dependencies, as shallow clones into a "deps" folder:
|
|
62
|
+
|
|
63
|
+
<%= config.bin %> <%= command.id %> --recursive --depth 1 --output-dir ../deps
|
|
64
|
+
|
|
65
|
+
- Bring existing clones up to date with their configured refs:
|
|
66
|
+
|
|
67
|
+
<%= config.bin %> <%= command.id %> --update
|
|
68
|
+
|
|
69
|
+
- Preview what would be cloned:
|
|
70
|
+
|
|
71
|
+
<%= config.bin %> <%= command.id %> --recursive --dry-run
|
package/oclif.manifest.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
-
"simply:package:
|
|
3
|
+
"simply:package:dependencies:clone": {
|
|
4
4
|
"aliases": [],
|
|
5
5
|
"args": {},
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Clones each package dependency declared in sfdx-project.json whose source repository is given under plugins.simply.packages, so you can review the metadata the project depends on. Nothing is installed in an org.\n\nEach plugins.simply.packages entry is keyed by package alias. Its \"repository\" gives a git \"url\", plus an optional \"ref\" (branch, tag, or commit SHA) and \"path\" (the subdirectory holding the repository's own sfdx-project.json). A key matches a dependency's \"package\" value exactly, or up to its first \"@\", so a key such as \"fflib\" keeps matching as the dependency moves from \"fflib@3.0.0-1\" to \"fflib@3.1.0-2\". A key also matches through packageAliases: a dependency written as a bare ID (0Ho… or 04t…) matches the key of any alias, or alias prefix, that packageAliases maps to that ID.\n\nThe command runs your own git, so any host works (GitHub, GitLab, self-hosted servers) with the SSH keys or credential helper you already use. A url that contains credentials is rejected. Nothing prompts for input: a missing credential fails that dependency's row, and so do an unknown ssh host key and a key passphrase, unless you've set your own ssh command. Dependencies with no mapping, such as AppExchange packages, are reported as \"No repository\".\n\nEach repository is cloned into a folder named after it, next to the project by default. A folder that already holds a clone of the same repository is reused.\n\nWith --recursive, your own plugins.simply.packages entries always come first. A dependency's sfdx-project.json can supply a repository only for a package you don't map, and only as an https or ssh URL. Each repository that comes from one is named in the output.\n\nCloning runs nothing from the repositories: no install scripts, no git hooks, and no submodules. Treat the clones as untrusted code until you've reviewed them. Opening one in an editor that trusts the folder, running npm install or its scripts, or deploying its metadata can run code it contains.",
|
|
7
7
|
"examples": [
|
|
8
|
-
"<%= config.bin %> <%= command.id %>
|
|
9
|
-
"<%= config.bin %> <%= command.id %> --
|
|
10
|
-
"<%= config.bin %> <%= command.id %> --
|
|
8
|
+
"Clone the direct dependencies of the project in the current directory, next to it:\n<%= config.bin %> <%= command.id %>",
|
|
9
|
+
"Clone every dependency, including dependencies of dependencies, as shallow clones into a \"deps\" folder:\n<%= config.bin %> <%= command.id %> --recursive --depth 1 --output-dir ../deps",
|
|
10
|
+
"Bring existing clones up to date with their configured refs:\n<%= config.bin %> <%= command.id %> --update",
|
|
11
|
+
"Preview what would be cloned:\n<%= config.bin %> <%= command.id %> --recursive --dry-run"
|
|
11
12
|
],
|
|
12
13
|
"flags": {
|
|
13
14
|
"json": {
|
|
@@ -25,158 +26,54 @@
|
|
|
25
26
|
"multiple": false,
|
|
26
27
|
"type": "option"
|
|
27
28
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
},
|
|
35
|
-
"selector": {
|
|
36
|
-
"char": "s",
|
|
37
|
-
"description": "The MAJOR.MINOR.PATCH selector(s) that should be used to find package versions to delete. Only unreleased versions matching any of the given selectors are deleted. Mutually exclusive with --selector-exclude.",
|
|
38
|
-
"exclusive": [
|
|
39
|
-
"selector-exclude"
|
|
40
|
-
],
|
|
41
|
-
"name": "selector",
|
|
42
|
-
"summary": "One or more MAJOR.MINOR.PATCH values to select on",
|
|
43
|
-
"hasDynamicHelp": false,
|
|
44
|
-
"multiple": true,
|
|
45
|
-
"type": "option"
|
|
46
|
-
},
|
|
47
|
-
"selector-exclude": {
|
|
48
|
-
"char": "x",
|
|
49
|
-
"description": "The MAJOR.MINOR.PATCH selector(s) that should be used to find package versions to keep. Every unreleased version that does not match any of the given selectors is deleted. Mutually exclusive with --selector.",
|
|
50
|
-
"exclusive": [
|
|
51
|
-
"selector"
|
|
52
|
-
],
|
|
53
|
-
"name": "selector-exclude",
|
|
54
|
-
"summary": "One or more MAJOR.MINOR.PATCH values to exclude on",
|
|
55
|
-
"hasDynamicHelp": false,
|
|
56
|
-
"multiple": true,
|
|
57
|
-
"type": "option"
|
|
58
|
-
},
|
|
59
|
-
"package": {
|
|
60
|
-
"char": "p",
|
|
61
|
-
"description": "The 0Ht Package Id that you wish to cleanup versions for.",
|
|
62
|
-
"name": "package",
|
|
63
|
-
"required": true,
|
|
64
|
-
"summary": "Package Id",
|
|
29
|
+
"output-dir": {
|
|
30
|
+
"char": "d",
|
|
31
|
+
"description": "Each repository goes into \"<output-dir>/<repository name>\". The default, \"..\", puts clones next to the project. When two different repositories share a name, the second folder is prefixed with its group or owner.",
|
|
32
|
+
"name": "output-dir",
|
|
33
|
+
"summary": "Directory to clone into, relative to the project root.",
|
|
34
|
+
"default": "..",
|
|
65
35
|
"hasDynamicHelp": false,
|
|
66
36
|
"multiple": false,
|
|
67
37
|
"type": "option"
|
|
68
38
|
},
|
|
69
|
-
"
|
|
70
|
-
"char": "
|
|
71
|
-
"name": "
|
|
72
|
-
"
|
|
73
|
-
"required": true,
|
|
74
|
-
"summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
|
|
75
|
-
"hasDynamicHelp": true,
|
|
76
|
-
"multiple": false,
|
|
77
|
-
"type": "option"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"hasDynamicHelp": true,
|
|
81
|
-
"hiddenAliases": [],
|
|
82
|
-
"id": "simply:package:version:cleanup",
|
|
83
|
-
"pluginAlias": "@simplysf/simply-package",
|
|
84
|
-
"pluginName": "@simplysf/simply-package",
|
|
85
|
-
"pluginType": "core",
|
|
86
|
-
"strict": true,
|
|
87
|
-
"summary": "Cleanup package versions.",
|
|
88
|
-
"enableJsonFlag": true,
|
|
89
|
-
"requiresProject": true,
|
|
90
|
-
"isESM": true,
|
|
91
|
-
"relativePath": [
|
|
92
|
-
"lib",
|
|
93
|
-
"commands",
|
|
94
|
-
"simply",
|
|
95
|
-
"package",
|
|
96
|
-
"version",
|
|
97
|
-
"cleanup.js"
|
|
98
|
-
],
|
|
99
|
-
"aliasPermutations": [],
|
|
100
|
-
"permutations": [
|
|
101
|
-
"simply:package:version:cleanup",
|
|
102
|
-
"package:simply:version:cleanup",
|
|
103
|
-
"package:version:simply:cleanup",
|
|
104
|
-
"package:version:cleanup:simply",
|
|
105
|
-
"simply:version:package:cleanup",
|
|
106
|
-
"version:simply:package:cleanup",
|
|
107
|
-
"version:package:simply:cleanup",
|
|
108
|
-
"version:package:cleanup:simply",
|
|
109
|
-
"simply:version:cleanup:package",
|
|
110
|
-
"version:simply:cleanup:package",
|
|
111
|
-
"version:cleanup:simply:package",
|
|
112
|
-
"version:cleanup:package:simply",
|
|
113
|
-
"simply:package:cleanup:version",
|
|
114
|
-
"package:simply:cleanup:version",
|
|
115
|
-
"package:cleanup:simply:version",
|
|
116
|
-
"package:cleanup:version:simply",
|
|
117
|
-
"simply:cleanup:package:version",
|
|
118
|
-
"cleanup:simply:package:version",
|
|
119
|
-
"cleanup:package:simply:version",
|
|
120
|
-
"cleanup:package:version:simply",
|
|
121
|
-
"simply:cleanup:version:package",
|
|
122
|
-
"cleanup:simply:version:package",
|
|
123
|
-
"cleanup:version:simply:package",
|
|
124
|
-
"cleanup:version:package:simply"
|
|
125
|
-
]
|
|
126
|
-
},
|
|
127
|
-
"simply:package:version:get": {
|
|
128
|
-
"aliases": [],
|
|
129
|
-
"args": {},
|
|
130
|
-
"description": "Reads the version a package is declared at in your project's sfdx-project.json and prints it, so a script doesn't have to parse the project file itself.\n\nBoth dependencies and the project's own package are searched. A dependency declared as an alias (test-package@0.1.0+2) resolves to the version portion of the alias; a dependency declared as a package name plus a versionNumber resolves to that versionNumber; a dependency declared as a raw ID resolves through packageAliases. A package directory that builds the package resolves to that directory's versionNumber.\n\nThe version is returned exactly as it appears in the project file — no normalizing between the 0.1.0+2, 57.0.0-3, and 1.2.3.LATEST forms, since each means something to the tool that consumes it.\n\nThis command reads the project file only. It never contacts an org or a Dev Hub, so it can run in a pipeline before any authentication step.",
|
|
131
|
-
"examples": [
|
|
132
|
-
"Get the version of a dependency:\n<%= config.bin %> <%= command.id %> --package test-package",
|
|
133
|
-
"Get the version of the package the project itself builds:\n<%= config.bin %> <%= command.id %> --package my-package",
|
|
134
|
-
"Get a dependency's version from one package directory:\n<%= config.bin %> <%= command.id %> --package test-package --directory force-app"
|
|
135
|
-
],
|
|
136
|
-
"flags": {
|
|
137
|
-
"json": {
|
|
138
|
-
"description": "Format output as json.",
|
|
139
|
-
"helpGroup": "GLOBAL",
|
|
140
|
-
"name": "json",
|
|
39
|
+
"recursive": {
|
|
40
|
+
"char": "r",
|
|
41
|
+
"name": "recursive",
|
|
42
|
+
"summary": "Also clone the dependencies of each dependency, following each clone's own sfdx-project.json.",
|
|
141
43
|
"allowNo": false,
|
|
142
44
|
"type": "boolean"
|
|
143
45
|
},
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"name": "
|
|
147
|
-
"summary": "
|
|
46
|
+
"depth": {
|
|
47
|
+
"description": "Passed to \"git clone --depth\". A dependency pinned to a commit SHA always gets a full clone, because a shallow clone can't check out an arbitrary commit.",
|
|
48
|
+
"name": "depth",
|
|
49
|
+
"summary": "Create shallow clones with this many commits of history.",
|
|
148
50
|
"hasDynamicHelp": false,
|
|
149
51
|
"multiple": false,
|
|
150
52
|
"type": "option"
|
|
151
53
|
},
|
|
152
|
-
"
|
|
153
|
-
"char": "
|
|
154
|
-
"description": "
|
|
155
|
-
"name": "
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"multiple": false,
|
|
160
|
-
"type": "option"
|
|
54
|
+
"update": {
|
|
55
|
+
"char": "u",
|
|
56
|
+
"description": "A clone on the configured branch is fast-forwarded, and a clone at a detached HEAD (after a tag or SHA) is checked out at the configured ref. A clone with uncommitted changes, or on some other branch, is left alone and reported as skipped, because it may be your own working copy. The exception is a clone still on the remote's default branch with no commits of its own, such as one made before \"ref\" was set: it moves to the configured ref. A clone that follows a branch, including the default branch when no \"ref\" is set, gets that branch's newest commits; set \"ref\" to a tag to stay on one version.",
|
|
57
|
+
"name": "update",
|
|
58
|
+
"summary": "Fetch and update repositories that are already cloned.",
|
|
59
|
+
"allowNo": false,
|
|
60
|
+
"type": "boolean"
|
|
161
61
|
},
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"hasDynamicHelp": false,
|
|
168
|
-
"multiple": false,
|
|
169
|
-
"type": "option"
|
|
62
|
+
"dry-run": {
|
|
63
|
+
"name": "dry-run",
|
|
64
|
+
"summary": "Show what would be cloned, without running git.",
|
|
65
|
+
"allowNo": false,
|
|
66
|
+
"type": "boolean"
|
|
170
67
|
}
|
|
171
68
|
},
|
|
172
69
|
"hasDynamicHelp": false,
|
|
173
70
|
"hiddenAliases": [],
|
|
174
|
-
"id": "simply:package:
|
|
71
|
+
"id": "simply:package:dependencies:clone",
|
|
175
72
|
"pluginAlias": "@simplysf/simply-package",
|
|
176
73
|
"pluginName": "@simplysf/simply-package",
|
|
177
74
|
"pluginType": "core",
|
|
178
75
|
"strict": true,
|
|
179
|
-
"summary": "
|
|
76
|
+
"summary": "Git-clone the source repositories of a Salesforce project's package dependencies.",
|
|
180
77
|
"enableJsonFlag": true,
|
|
181
78
|
"requiresProject": true,
|
|
182
79
|
"isESM": true,
|
|
@@ -185,35 +82,35 @@
|
|
|
185
82
|
"commands",
|
|
186
83
|
"simply",
|
|
187
84
|
"package",
|
|
188
|
-
"
|
|
189
|
-
"
|
|
85
|
+
"dependencies",
|
|
86
|
+
"clone.js"
|
|
190
87
|
],
|
|
191
88
|
"aliasPermutations": [],
|
|
192
89
|
"permutations": [
|
|
193
|
-
"simply:package:
|
|
194
|
-
"package:simply:
|
|
195
|
-
"package:
|
|
196
|
-
"package:
|
|
197
|
-
"simply:
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"simply:
|
|
202
|
-
"
|
|
203
|
-
"
|
|
204
|
-
"
|
|
205
|
-
"simply:package:
|
|
206
|
-
"package:simply:
|
|
207
|
-
"package:
|
|
208
|
-
"package:
|
|
209
|
-
"simply:
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
"
|
|
213
|
-
"simply:
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
"
|
|
90
|
+
"simply:package:dependencies:clone",
|
|
91
|
+
"package:simply:dependencies:clone",
|
|
92
|
+
"package:dependencies:simply:clone",
|
|
93
|
+
"package:dependencies:clone:simply",
|
|
94
|
+
"simply:dependencies:package:clone",
|
|
95
|
+
"dependencies:simply:package:clone",
|
|
96
|
+
"dependencies:package:simply:clone",
|
|
97
|
+
"dependencies:package:clone:simply",
|
|
98
|
+
"simply:dependencies:clone:package",
|
|
99
|
+
"dependencies:simply:clone:package",
|
|
100
|
+
"dependencies:clone:simply:package",
|
|
101
|
+
"dependencies:clone:package:simply",
|
|
102
|
+
"simply:package:clone:dependencies",
|
|
103
|
+
"package:simply:clone:dependencies",
|
|
104
|
+
"package:clone:simply:dependencies",
|
|
105
|
+
"package:clone:dependencies:simply",
|
|
106
|
+
"simply:clone:package:dependencies",
|
|
107
|
+
"clone:simply:package:dependencies",
|
|
108
|
+
"clone:package:simply:dependencies",
|
|
109
|
+
"clone:package:dependencies:simply",
|
|
110
|
+
"simply:clone:dependencies:package",
|
|
111
|
+
"clone:simply:dependencies:package",
|
|
112
|
+
"clone:dependencies:simply:package",
|
|
113
|
+
"clone:dependencies:package:simply"
|
|
217
114
|
]
|
|
218
115
|
},
|
|
219
116
|
"simply:package:dependencies:install": {
|
|
@@ -581,7 +478,223 @@
|
|
|
581
478
|
"manage:dependencies:simply:package",
|
|
582
479
|
"manage:dependencies:package:simply"
|
|
583
480
|
]
|
|
481
|
+
},
|
|
482
|
+
"simply:package:version:cleanup": {
|
|
483
|
+
"aliases": [],
|
|
484
|
+
"args": {},
|
|
485
|
+
"description": "Delete package versions for a given package provided one or more MAJOR.MINOR.PATCH selectors, either to select on or to exclude on. Does not delete released package versions.\n\nIf --selector is provided, only the unreleased versions matching any of the given MAJOR.MINOR.PATCH values are deleted. If --selector-exclude is provided instead, every unreleased version that does _not_ match any of the given MAJOR.MINOR.PATCH values is deleted. Exactly one of --selector or --selector-exclude must be specified; each accepts multiple values.",
|
|
486
|
+
"examples": [
|
|
487
|
+
"<%= config.bin %> <%= command.id %> --package 0Hoxx00000000CqCAI --selector 2.10.0 --target-dev-hub myDevHub",
|
|
488
|
+
"<%= config.bin %> <%= command.id %> --package 0Hoxx00000000CqCAI --selector 2.10.0 --selector 2.11.0 --target-dev-hub myDevHub",
|
|
489
|
+
"<%= config.bin %> <%= command.id %> --package 0Hoxx00000000CqCAI --selector-exclude 2.10.0 --target-dev-hub myDevHub"
|
|
490
|
+
],
|
|
491
|
+
"flags": {
|
|
492
|
+
"json": {
|
|
493
|
+
"description": "Format output as json.",
|
|
494
|
+
"helpGroup": "GLOBAL",
|
|
495
|
+
"name": "json",
|
|
496
|
+
"allowNo": false,
|
|
497
|
+
"type": "boolean"
|
|
498
|
+
},
|
|
499
|
+
"flags-dir": {
|
|
500
|
+
"helpGroup": "GLOBAL",
|
|
501
|
+
"name": "flags-dir",
|
|
502
|
+
"summary": "Import flag values from a directory.",
|
|
503
|
+
"hasDynamicHelp": false,
|
|
504
|
+
"multiple": false,
|
|
505
|
+
"type": "option"
|
|
506
|
+
},
|
|
507
|
+
"api-version": {
|
|
508
|
+
"description": "Override the api version used for api requests made by this command",
|
|
509
|
+
"name": "api-version",
|
|
510
|
+
"hasDynamicHelp": false,
|
|
511
|
+
"multiple": false,
|
|
512
|
+
"type": "option"
|
|
513
|
+
},
|
|
514
|
+
"selector": {
|
|
515
|
+
"char": "s",
|
|
516
|
+
"description": "The MAJOR.MINOR.PATCH selector(s) that should be used to find package versions to delete. Only unreleased versions matching any of the given selectors are deleted. Mutually exclusive with --selector-exclude.",
|
|
517
|
+
"exclusive": [
|
|
518
|
+
"selector-exclude"
|
|
519
|
+
],
|
|
520
|
+
"name": "selector",
|
|
521
|
+
"summary": "One or more MAJOR.MINOR.PATCH values to select on",
|
|
522
|
+
"hasDynamicHelp": false,
|
|
523
|
+
"multiple": true,
|
|
524
|
+
"type": "option"
|
|
525
|
+
},
|
|
526
|
+
"selector-exclude": {
|
|
527
|
+
"char": "x",
|
|
528
|
+
"description": "The MAJOR.MINOR.PATCH selector(s) that should be used to find package versions to keep. Every unreleased version that does not match any of the given selectors is deleted. Mutually exclusive with --selector.",
|
|
529
|
+
"exclusive": [
|
|
530
|
+
"selector"
|
|
531
|
+
],
|
|
532
|
+
"name": "selector-exclude",
|
|
533
|
+
"summary": "One or more MAJOR.MINOR.PATCH values to exclude on",
|
|
534
|
+
"hasDynamicHelp": false,
|
|
535
|
+
"multiple": true,
|
|
536
|
+
"type": "option"
|
|
537
|
+
},
|
|
538
|
+
"package": {
|
|
539
|
+
"char": "p",
|
|
540
|
+
"description": "The 0Ht Package Id that you wish to cleanup versions for.",
|
|
541
|
+
"name": "package",
|
|
542
|
+
"required": true,
|
|
543
|
+
"summary": "Package Id",
|
|
544
|
+
"hasDynamicHelp": false,
|
|
545
|
+
"multiple": false,
|
|
546
|
+
"type": "option"
|
|
547
|
+
},
|
|
548
|
+
"target-dev-hub": {
|
|
549
|
+
"char": "v",
|
|
550
|
+
"name": "target-dev-hub",
|
|
551
|
+
"noCacheDefault": true,
|
|
552
|
+
"required": true,
|
|
553
|
+
"summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
|
|
554
|
+
"hasDynamicHelp": true,
|
|
555
|
+
"multiple": false,
|
|
556
|
+
"type": "option"
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
"hasDynamicHelp": true,
|
|
560
|
+
"hiddenAliases": [],
|
|
561
|
+
"id": "simply:package:version:cleanup",
|
|
562
|
+
"pluginAlias": "@simplysf/simply-package",
|
|
563
|
+
"pluginName": "@simplysf/simply-package",
|
|
564
|
+
"pluginType": "core",
|
|
565
|
+
"strict": true,
|
|
566
|
+
"summary": "Cleanup package versions.",
|
|
567
|
+
"enableJsonFlag": true,
|
|
568
|
+
"requiresProject": true,
|
|
569
|
+
"isESM": true,
|
|
570
|
+
"relativePath": [
|
|
571
|
+
"lib",
|
|
572
|
+
"commands",
|
|
573
|
+
"simply",
|
|
574
|
+
"package",
|
|
575
|
+
"version",
|
|
576
|
+
"cleanup.js"
|
|
577
|
+
],
|
|
578
|
+
"aliasPermutations": [],
|
|
579
|
+
"permutations": [
|
|
580
|
+
"simply:package:version:cleanup",
|
|
581
|
+
"package:simply:version:cleanup",
|
|
582
|
+
"package:version:simply:cleanup",
|
|
583
|
+
"package:version:cleanup:simply",
|
|
584
|
+
"simply:version:package:cleanup",
|
|
585
|
+
"version:simply:package:cleanup",
|
|
586
|
+
"version:package:simply:cleanup",
|
|
587
|
+
"version:package:cleanup:simply",
|
|
588
|
+
"simply:version:cleanup:package",
|
|
589
|
+
"version:simply:cleanup:package",
|
|
590
|
+
"version:cleanup:simply:package",
|
|
591
|
+
"version:cleanup:package:simply",
|
|
592
|
+
"simply:package:cleanup:version",
|
|
593
|
+
"package:simply:cleanup:version",
|
|
594
|
+
"package:cleanup:simply:version",
|
|
595
|
+
"package:cleanup:version:simply",
|
|
596
|
+
"simply:cleanup:package:version",
|
|
597
|
+
"cleanup:simply:package:version",
|
|
598
|
+
"cleanup:package:simply:version",
|
|
599
|
+
"cleanup:package:version:simply",
|
|
600
|
+
"simply:cleanup:version:package",
|
|
601
|
+
"cleanup:simply:version:package",
|
|
602
|
+
"cleanup:version:simply:package",
|
|
603
|
+
"cleanup:version:package:simply"
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
"simply:package:version:get": {
|
|
607
|
+
"aliases": [],
|
|
608
|
+
"args": {},
|
|
609
|
+
"description": "Reads the version a package is declared at in your project's sfdx-project.json and prints it, so a script doesn't have to parse the project file itself.\n\nBoth dependencies and the project's own package are searched. A dependency declared as an alias (test-package@0.1.0+2) resolves to the version portion of the alias; a dependency declared as a package name plus a versionNumber resolves to that versionNumber; a dependency declared as a raw ID resolves through packageAliases. A package directory that builds the package resolves to that directory's versionNumber.\n\nThe version is returned exactly as it appears in the project file — no normalizing between the 0.1.0+2, 57.0.0-3, and 1.2.3.LATEST forms, since each means something to the tool that consumes it.\n\nThis command reads the project file only. It never contacts an org or a Dev Hub, so it can run in a pipeline before any authentication step.",
|
|
610
|
+
"examples": [
|
|
611
|
+
"Get the version of a dependency:\n<%= config.bin %> <%= command.id %> --package test-package",
|
|
612
|
+
"Get the version of the package the project itself builds:\n<%= config.bin %> <%= command.id %> --package my-package",
|
|
613
|
+
"Get a dependency's version from one package directory:\n<%= config.bin %> <%= command.id %> --package test-package --directory force-app"
|
|
614
|
+
],
|
|
615
|
+
"flags": {
|
|
616
|
+
"json": {
|
|
617
|
+
"description": "Format output as json.",
|
|
618
|
+
"helpGroup": "GLOBAL",
|
|
619
|
+
"name": "json",
|
|
620
|
+
"allowNo": false,
|
|
621
|
+
"type": "boolean"
|
|
622
|
+
},
|
|
623
|
+
"flags-dir": {
|
|
624
|
+
"helpGroup": "GLOBAL",
|
|
625
|
+
"name": "flags-dir",
|
|
626
|
+
"summary": "Import flag values from a directory.",
|
|
627
|
+
"hasDynamicHelp": false,
|
|
628
|
+
"multiple": false,
|
|
629
|
+
"type": "option"
|
|
630
|
+
},
|
|
631
|
+
"package": {
|
|
632
|
+
"char": "p",
|
|
633
|
+
"description": "The package name as it appears in sfdx-project.json, without a version suffix. For a dependency declared as \"test-package@0.1.0+2\", pass \"test-package\".",
|
|
634
|
+
"name": "package",
|
|
635
|
+
"required": true,
|
|
636
|
+
"summary": "Package name or alias to look up.",
|
|
637
|
+
"hasDynamicHelp": false,
|
|
638
|
+
"multiple": false,
|
|
639
|
+
"type": "option"
|
|
640
|
+
},
|
|
641
|
+
"directory": {
|
|
642
|
+
"char": "d",
|
|
643
|
+
"description": "The path of a single package directory to search, matching a \"path\" value in packageDirectories. Use this when the same package is declared at different versions in more than one package directory.",
|
|
644
|
+
"name": "directory",
|
|
645
|
+
"summary": "Package directory to search.",
|
|
646
|
+
"hasDynamicHelp": false,
|
|
647
|
+
"multiple": false,
|
|
648
|
+
"type": "option"
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
"hasDynamicHelp": false,
|
|
652
|
+
"hiddenAliases": [],
|
|
653
|
+
"id": "simply:package:version:get",
|
|
654
|
+
"pluginAlias": "@simplysf/simply-package",
|
|
655
|
+
"pluginName": "@simplysf/simply-package",
|
|
656
|
+
"pluginType": "core",
|
|
657
|
+
"strict": true,
|
|
658
|
+
"summary": "Get a package version from sfdx-project.json.",
|
|
659
|
+
"enableJsonFlag": true,
|
|
660
|
+
"requiresProject": true,
|
|
661
|
+
"isESM": true,
|
|
662
|
+
"relativePath": [
|
|
663
|
+
"lib",
|
|
664
|
+
"commands",
|
|
665
|
+
"simply",
|
|
666
|
+
"package",
|
|
667
|
+
"version",
|
|
668
|
+
"get.js"
|
|
669
|
+
],
|
|
670
|
+
"aliasPermutations": [],
|
|
671
|
+
"permutations": [
|
|
672
|
+
"simply:package:version:get",
|
|
673
|
+
"package:simply:version:get",
|
|
674
|
+
"package:version:simply:get",
|
|
675
|
+
"package:version:get:simply",
|
|
676
|
+
"simply:version:package:get",
|
|
677
|
+
"version:simply:package:get",
|
|
678
|
+
"version:package:simply:get",
|
|
679
|
+
"version:package:get:simply",
|
|
680
|
+
"simply:version:get:package",
|
|
681
|
+
"version:simply:get:package",
|
|
682
|
+
"version:get:simply:package",
|
|
683
|
+
"version:get:package:simply",
|
|
684
|
+
"simply:package:get:version",
|
|
685
|
+
"package:simply:get:version",
|
|
686
|
+
"package:get:simply:version",
|
|
687
|
+
"package:get:version:simply",
|
|
688
|
+
"simply:get:package:version",
|
|
689
|
+
"get:simply:package:version",
|
|
690
|
+
"get:package:simply:version",
|
|
691
|
+
"get:package:version:simply",
|
|
692
|
+
"simply:get:version:package",
|
|
693
|
+
"get:simply:version:package",
|
|
694
|
+
"get:version:simply:package",
|
|
695
|
+
"get:version:package:simply"
|
|
696
|
+
]
|
|
584
697
|
}
|
|
585
698
|
},
|
|
586
|
-
"version": "4.0
|
|
699
|
+
"version": "4.1.0"
|
|
587
700
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysf/simply-package",
|
|
3
3
|
"description": "Utilities for working with packages",
|
|
4
|
-
"version": "4.0
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply-plugins",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply-plugins/issues",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"@salesforce/kit": "^3.2.6",
|
|
77
77
|
"@salesforce/packaging": "^4.22.16",
|
|
78
78
|
"@salesforce/sf-plugins-core": "^12.2.16",
|
|
79
|
-
"@simplysf/simply-core": "^1.6.
|
|
80
|
-
"@simplysf/simply-package-core": "^0.
|
|
79
|
+
"@simplysf/simply-core": "^1.6.12",
|
|
80
|
+
"@simplysf/simply-package-core": "^0.5.0",
|
|
81
81
|
"@simplysf/simply-plugin-kit": "^1.0.9"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
@@ -216,5 +216,5 @@
|
|
|
216
216
|
"output": []
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
-
"gitHead": "
|
|
219
|
+
"gitHead": "d0e8afb4cf5e070249c695e30d52ab7c82cab13e"
|
|
220
220
|
}
|