@simplysf/simply-package 4.0.2 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,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.1/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.2/packages/simply-package/lib/commands/simply/package/dependencies/install.js)_
251
+ _See code: [lib/commands/simply/package/dependencies/install.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.1/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.2/packages/simply-package/lib/commands/simply/package/dependencies/manage.js)_
310
+ _See code: [lib/commands/simply/package/dependencies/manage.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.1/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.2/packages/simply-package/lib/commands/simply/package/version/cleanup.js)_
367
+ _See code: [lib/commands/simply/package/version/cleanup.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.1/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.2/packages/simply-package/lib/commands/simply/package/version/get.js)_
427
+ _See code: [lib/commands/simply/package/version/get.js](https://github.com/SimplySF/simply-plugins/blob/@simplysf/simply-package@4.1.1/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` reads optional settings from a `plugins.simply` block in `sfdx-project.json`:
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":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAA8B,MAAM,+BAA+B,CAAC;AAErG,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,mCAAmC,CAAC,CAAC;AAIxG;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,SAAkC;IAC/E,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MA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GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM;oBACnE,GAAG,EAAE,GAAG,CAAC,GAAG;oBACZ,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;iBACzE,CAAC,CAAC;gBACH,OAAO,EAAE;oBACP,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;oBAC3B,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;oBAC3B,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACjC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;oBAC3B,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE;iBACxC;aACF,CAAC,CAAC;QACL,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,EAAE,CAAC;YACnD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC"}
@@ -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
@@ -1,5 +1,118 @@
1
1
  {
2
2
  "commands": {
3
+ "simply:package:dependencies:clone": {
4
+ "aliases": [],
5
+ "args": {},
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
+ "examples": [
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"
12
+ ],
13
+ "flags": {
14
+ "json": {
15
+ "description": "Format output as json.",
16
+ "helpGroup": "GLOBAL",
17
+ "name": "json",
18
+ "allowNo": false,
19
+ "type": "boolean"
20
+ },
21
+ "flags-dir": {
22
+ "helpGroup": "GLOBAL",
23
+ "name": "flags-dir",
24
+ "summary": "Import flag values from a directory.",
25
+ "hasDynamicHelp": false,
26
+ "multiple": false,
27
+ "type": "option"
28
+ },
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": "..",
35
+ "hasDynamicHelp": false,
36
+ "multiple": false,
37
+ "type": "option"
38
+ },
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.",
43
+ "allowNo": false,
44
+ "type": "boolean"
45
+ },
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.",
50
+ "hasDynamicHelp": false,
51
+ "multiple": false,
52
+ "type": "option"
53
+ },
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"
61
+ },
62
+ "dry-run": {
63
+ "name": "dry-run",
64
+ "summary": "Show what would be cloned, without running git.",
65
+ "allowNo": false,
66
+ "type": "boolean"
67
+ }
68
+ },
69
+ "hasDynamicHelp": false,
70
+ "hiddenAliases": [],
71
+ "id": "simply:package:dependencies:clone",
72
+ "pluginAlias": "@simplysf/simply-package",
73
+ "pluginName": "@simplysf/simply-package",
74
+ "pluginType": "core",
75
+ "strict": true,
76
+ "summary": "Git-clone the source repositories of a Salesforce project's package dependencies.",
77
+ "enableJsonFlag": true,
78
+ "requiresProject": true,
79
+ "isESM": true,
80
+ "relativePath": [
81
+ "lib",
82
+ "commands",
83
+ "simply",
84
+ "package",
85
+ "dependencies",
86
+ "clone.js"
87
+ ],
88
+ "aliasPermutations": [],
89
+ "permutations": [
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"
114
+ ]
115
+ },
3
116
  "simply:package:dependencies:install": {
4
117
  "aliases": [],
5
118
  "args": {},
@@ -583,5 +696,5 @@
583
696
  ]
584
697
  }
585
698
  },
586
- "version": "4.0.2"
699
+ "version": "4.1.1"
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.2",
4
+ "version": "4.1.1",
5
5
  "author": "@ClayChipps",
6
6
  "homepage": "https://github.com/SimplySF/simply-plugins",
7
7
  "bugs": "https://github.com/SimplySF/simply-plugins/issues",
@@ -78,12 +78,12 @@
78
78
  "@salesforce/sf-plugins-core": "^12.2.16",
79
79
  "@simplysf/simply-core": "^1.6.12",
80
80
  "@simplysf/simply-package-core": "^0.5.0",
81
- "@simplysf/simply-plugin-kit": "^1.0.9"
81
+ "@simplysf/simply-plugin-kit": "^1.0.10"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@oclif/plugin-command-snapshot": "^5.4.0",
85
85
  "@salesforce/plugin-command-reference": "^3.1.134",
86
- "@vitest/coverage-v8": "^4.1.10",
86
+ "@vitest/coverage-v8": "^4.1.12",
87
87
  "vitest": "^4.1.10"
88
88
  },
89
89
  "publishConfig": {
@@ -216,5 +216,5 @@
216
216
  "output": []
217
217
  }
218
218
  },
219
- "gitHead": "a56733c880575b87e67571f179b98ab4f8990242"
219
+ "gitHead": "f5bb418eb45ca8bdc40ecbfc3ce9cd12dc61c433"
220
220
  }