@sfship/plugin-ship 1.0.0-beta.2

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.
Files changed (229) hide show
  1. package/LICENSE.txt +206 -0
  2. package/README.md +164 -0
  3. package/lib/commands/ship/flow/eject.d.ts +15 -0
  4. package/lib/commands/ship/flow/eject.js +55 -0
  5. package/lib/commands/ship/flow/eject.js.map +1 -0
  6. package/lib/commands/ship/flow/info.d.ts +15 -0
  7. package/lib/commands/ship/flow/info.js +86 -0
  8. package/lib/commands/ship/flow/info.js.map +1 -0
  9. package/lib/commands/ship/flow/list.d.ts +12 -0
  10. package/lib/commands/ship/flow/list.js +51 -0
  11. package/lib/commands/ship/flow/list.js.map +1 -0
  12. package/lib/commands/ship/flow/run.d.ts +16 -0
  13. package/lib/commands/ship/flow/run.js +90 -0
  14. package/lib/commands/ship/flow/run.js.map +1 -0
  15. package/lib/commands/ship/project/init.d.ts +13 -0
  16. package/lib/commands/ship/project/init.js +81 -0
  17. package/lib/commands/ship/project/init.js.map +1 -0
  18. package/lib/commands/ship/service/connect/github.d.ts +12 -0
  19. package/lib/commands/ship/service/connect/github.js +47 -0
  20. package/lib/commands/ship/service/connect/github.js.map +1 -0
  21. package/lib/commands/ship/service/delete.d.ts +13 -0
  22. package/lib/commands/ship/service/delete.js +44 -0
  23. package/lib/commands/ship/service/delete.js.map +1 -0
  24. package/lib/commands/ship/service/info.d.ts +13 -0
  25. package/lib/commands/ship/service/info.js +51 -0
  26. package/lib/commands/ship/service/info.js.map +1 -0
  27. package/lib/commands/ship/service/list.d.ts +9 -0
  28. package/lib/commands/ship/service/list.js +55 -0
  29. package/lib/commands/ship/service/list.js.map +1 -0
  30. package/lib/commands/ship/task/info.d.ts +15 -0
  31. package/lib/commands/ship/task/info.js +75 -0
  32. package/lib/commands/ship/task/info.js.map +1 -0
  33. package/lib/commands/ship/task/list.d.ts +12 -0
  34. package/lib/commands/ship/task/list.js +45 -0
  35. package/lib/commands/ship/task/list.js.map +1 -0
  36. package/lib/commands/ship/task/run.d.ts +16 -0
  37. package/lib/commands/ship/task/run.js +72 -0
  38. package/lib/commands/ship/task/run.js.map +1 -0
  39. package/lib/core/config.dependency.schema.d.ts +24 -0
  40. package/lib/core/config.dependency.schema.js +34 -0
  41. package/lib/core/config.dependency.schema.js.map +1 -0
  42. package/lib/core/config.loader.d.ts +23 -0
  43. package/lib/core/config.loader.js +62 -0
  44. package/lib/core/config.loader.js.map +1 -0
  45. package/lib/core/config.ship.schema.d.ts +174 -0
  46. package/lib/core/config.ship.schema.js +67 -0
  47. package/lib/core/config.ship.schema.js.map +1 -0
  48. package/lib/core/error.d.ts +29 -0
  49. package/lib/core/error.js +59 -0
  50. package/lib/core/error.js.map +1 -0
  51. package/lib/core/file.d.ts +34 -0
  52. package/lib/core/file.js +123 -0
  53. package/lib/core/file.js.map +1 -0
  54. package/lib/core/flow.context.d.ts +22 -0
  55. package/lib/core/flow.context.js +4 -0
  56. package/lib/core/flow.context.js.map +1 -0
  57. package/lib/core/flow.definition.schema.d.ts +60 -0
  58. package/lib/core/flow.definition.schema.js +56 -0
  59. package/lib/core/flow.definition.schema.js.map +1 -0
  60. package/lib/core/flow.interpolate.d.ts +21 -0
  61. package/lib/core/flow.interpolate.js +64 -0
  62. package/lib/core/flow.interpolate.js.map +1 -0
  63. package/lib/core/flow.registry.d.ts +32 -0
  64. package/lib/core/flow.registry.js +99 -0
  65. package/lib/core/flow.registry.js.map +1 -0
  66. package/lib/core/flow.renderer.d.ts +51 -0
  67. package/lib/core/flow.renderer.js +137 -0
  68. package/lib/core/flow.renderer.js.map +1 -0
  69. package/lib/core/flow.runner.d.ts +13 -0
  70. package/lib/core/flow.runner.js +133 -0
  71. package/lib/core/flow.runner.js.map +1 -0
  72. package/lib/core/flow.store.d.ts +24 -0
  73. package/lib/core/flow.store.js +57 -0
  74. package/lib/core/flow.store.js.map +1 -0
  75. package/lib/core/flow.view.d.ts +20 -0
  76. package/lib/core/flow.view.js +77 -0
  77. package/lib/core/flow.view.js.map +1 -0
  78. package/lib/core/flows/create/package.yml +18 -0
  79. package/lib/core/flows/dependencies/lock.yml +4 -0
  80. package/lib/core/flows/deploy/beta.yml +38 -0
  81. package/lib/core/flows/deploy/dev.yml +26 -0
  82. package/lib/core/flows/deploy/feature.yml +56 -0
  83. package/lib/core/flows/deploy/qa.yml +51 -0
  84. package/lib/core/flows/deploy/regression.yml +60 -0
  85. package/lib/core/flows/deploy/release.yml +38 -0
  86. package/lib/core/flows/release/beta.yml +25 -0
  87. package/lib/core/flows/release/production.yml +16 -0
  88. package/lib/core/org.registry.d.ts +45 -0
  89. package/lib/core/org.registry.js +76 -0
  90. package/lib/core/org.registry.js.map +1 -0
  91. package/lib/core/org.scratch.schema.d.ts +44 -0
  92. package/lib/core/org.scratch.schema.js +62 -0
  93. package/lib/core/org.scratch.schema.js.map +1 -0
  94. package/lib/core/package.dependencies.d.ts +45 -0
  95. package/lib/core/package.dependencies.js +158 -0
  96. package/lib/core/package.dependencies.js.map +1 -0
  97. package/lib/core/package.installer.d.ts +13 -0
  98. package/lib/core/package.installer.js +60 -0
  99. package/lib/core/package.installer.js.map +1 -0
  100. package/lib/core/package.metadata.d.ts +6 -0
  101. package/lib/core/package.metadata.js +33 -0
  102. package/lib/core/package.metadata.js.map +1 -0
  103. package/lib/core/package.namespace.d.ts +10 -0
  104. package/lib/core/package.namespace.js +40 -0
  105. package/lib/core/package.namespace.js.map +1 -0
  106. package/lib/core/package.version.d.ts +42 -0
  107. package/lib/core/package.version.js +60 -0
  108. package/lib/core/package.version.js.map +1 -0
  109. package/lib/core/project.init.d.ts +11 -0
  110. package/lib/core/project.init.js +121 -0
  111. package/lib/core/project.init.js.map +1 -0
  112. package/lib/core/service.d.ts +45 -0
  113. package/lib/core/service.github.d.ts +98 -0
  114. package/lib/core/service.github.js +270 -0
  115. package/lib/core/service.github.js.map +1 -0
  116. package/lib/core/service.js +91 -0
  117. package/lib/core/service.js.map +1 -0
  118. package/lib/core/sfdx-project.d.ts +25 -0
  119. package/lib/core/sfdx-project.js +39 -0
  120. package/lib/core/sfdx-project.js.map +1 -0
  121. package/lib/core/stdout.d.ts +1 -0
  122. package/lib/core/stdout.js +27 -0
  123. package/lib/core/stdout.js.map +1 -0
  124. package/lib/core/task.definition.schema.d.ts +69 -0
  125. package/lib/core/task.definition.schema.js +33 -0
  126. package/lib/core/task.definition.schema.js.map +1 -0
  127. package/lib/core/task.output.d.ts +29 -0
  128. package/lib/core/task.output.js +39 -0
  129. package/lib/core/task.output.js.map +1 -0
  130. package/lib/core/task.param.d.ts +30 -0
  131. package/lib/core/task.param.js +141 -0
  132. package/lib/core/task.param.js.map +1 -0
  133. package/lib/core/task.param.schema.d.ts +22 -0
  134. package/lib/core/task.param.schema.js +26 -0
  135. package/lib/core/task.param.schema.js.map +1 -0
  136. package/lib/core/task.registry.d.ts +22 -0
  137. package/lib/core/task.registry.js +85 -0
  138. package/lib/core/task.registry.js.map +1 -0
  139. package/lib/core/task.view.d.ts +10 -0
  140. package/lib/core/task.view.js +25 -0
  141. package/lib/core/task.view.js.map +1 -0
  142. package/lib/core/tasks/apex/run/test.d.ts +25 -0
  143. package/lib/core/tasks/apex/run/test.js +85 -0
  144. package/lib/core/tasks/apex/run/test.js.map +1 -0
  145. package/lib/core/tasks/data/import/tree.d.ts +12 -0
  146. package/lib/core/tasks/data/import/tree.js +61 -0
  147. package/lib/core/tasks/data/import/tree.js.map +1 -0
  148. package/lib/core/tasks/git/release/create.d.ts +42 -0
  149. package/lib/core/tasks/git/release/create.js +197 -0
  150. package/lib/core/tasks/git/release/create.js.map +1 -0
  151. package/lib/core/tasks/git/release/fetch.d.ts +24 -0
  152. package/lib/core/tasks/git/release/fetch.js +93 -0
  153. package/lib/core/tasks/git/release/fetch.js.map +1 -0
  154. package/lib/core/tasks/git/repo/info.d.ts +12 -0
  155. package/lib/core/tasks/git/repo/info.js +47 -0
  156. package/lib/core/tasks/git/repo/info.js.map +1 -0
  157. package/lib/core/tasks/metadata/deploy.d.ts +12 -0
  158. package/lib/core/tasks/metadata/deploy.js +39 -0
  159. package/lib/core/tasks/metadata/deploy.js.map +1 -0
  160. package/lib/core/tasks/org/assign/permsets.d.ts +12 -0
  161. package/lib/core/tasks/org/assign/permsets.js +54 -0
  162. package/lib/core/tasks/org/assign/permsets.js.map +1 -0
  163. package/lib/core/tasks/org/create/scratch.d.ts +36 -0
  164. package/lib/core/tasks/org/create/scratch.js +127 -0
  165. package/lib/core/tasks/org/create/scratch.js.map +1 -0
  166. package/lib/core/tasks/org/delete/scratch.d.ts +12 -0
  167. package/lib/core/tasks/org/delete/scratch.js +10 -0
  168. package/lib/core/tasks/org/delete/scratch.js.map +1 -0
  169. package/lib/core/tasks/package/create.d.ts +36 -0
  170. package/lib/core/tasks/package/create.js +93 -0
  171. package/lib/core/tasks/package/create.js.map +1 -0
  172. package/lib/core/tasks/package/dependencies/lock.d.ts +6 -0
  173. package/lib/core/tasks/package/dependencies/lock.js +35 -0
  174. package/lib/core/tasks/package/dependencies/lock.js.map +1 -0
  175. package/lib/core/tasks/package/dependencies/verify.d.ts +6 -0
  176. package/lib/core/tasks/package/dependencies/verify.js +44 -0
  177. package/lib/core/tasks/package/dependencies/verify.js.map +1 -0
  178. package/lib/core/tasks/package/install/dependencies.d.ts +22 -0
  179. package/lib/core/tasks/package/install/dependencies.js +43 -0
  180. package/lib/core/tasks/package/install/dependencies.js.map +1 -0
  181. package/lib/core/tasks/package/install/index.d.ts +25 -0
  182. package/lib/core/tasks/package/install/index.js +37 -0
  183. package/lib/core/tasks/package/install/index.js.map +1 -0
  184. package/lib/core/tasks/package/version/create.d.ts +36 -0
  185. package/lib/core/tasks/package/version/create.js +133 -0
  186. package/lib/core/tasks/package/version/create.js.map +1 -0
  187. package/lib/core/tasks/package/version/promote.d.ts +30 -0
  188. package/lib/core/tasks/package/version/promote.js +79 -0
  189. package/lib/core/tasks/package/version/promote.js.map +1 -0
  190. package/lib/core/tasks/package/version/resolve-latest.d.ts +24 -0
  191. package/lib/core/tasks/package/version/resolve-latest.js +78 -0
  192. package/lib/core/tasks/package/version/resolve-latest.js.map +1 -0
  193. package/lib/core/tasks/package/version/resolve-next.d.ts +24 -0
  194. package/lib/core/tasks/package/version/resolve-next.js +49 -0
  195. package/lib/core/tasks/package/version/resolve-next.js.map +1 -0
  196. package/lib/core/tasks/project/deploy/start.d.ts +22 -0
  197. package/lib/core/tasks/project/deploy/start.js +117 -0
  198. package/lib/core/tasks/project/deploy/start.js.map +1 -0
  199. package/lib/core/tasks/project/reset/tracking.d.ts +25 -0
  200. package/lib/core/tasks/project/reset/tracking.js +32 -0
  201. package/lib/core/tasks/project/reset/tracking.js.map +1 -0
  202. package/lib/core/tasks/util/file/exists.d.ts +24 -0
  203. package/lib/core/tasks/util/file/exists.js +53 -0
  204. package/lib/core/tasks/util/file/exists.js.map +1 -0
  205. package/lib/core/tasks/util/file/find.d.ts +30 -0
  206. package/lib/core/tasks/util/file/find.js +70 -0
  207. package/lib/core/tasks/util/file/find.js.map +1 -0
  208. package/lib/core/tasks/util/log.d.ts +13 -0
  209. package/lib/core/tasks/util/log.js +10 -0
  210. package/lib/core/tasks/util/log.js.map +1 -0
  211. package/lib/core/templates/README.md +35 -0
  212. package/lib/core/tree.d.ts +7 -0
  213. package/lib/core/tree.js +42 -0
  214. package/lib/core/tree.js.map +1 -0
  215. package/messages/service.connect.github.md +16 -0
  216. package/messages/ship.flow.eject.md +21 -0
  217. package/messages/ship.flow.info.md +21 -0
  218. package/messages/ship.flow.list.md +15 -0
  219. package/messages/ship.flow.run.md +23 -0
  220. package/messages/ship.project.init.md +23 -0
  221. package/messages/ship.service.delete.md +19 -0
  222. package/messages/ship.service.info.md +19 -0
  223. package/messages/ship.service.list.md +11 -0
  224. package/messages/ship.task.info.md +25 -0
  225. package/messages/ship.task.list.md +15 -0
  226. package/messages/ship.task.run.md +29 -0
  227. package/oclif.lock +10313 -0
  228. package/oclif.manifest.json +707 -0
  229. package/package.json +254 -0
@@ -0,0 +1,133 @@
1
+ import { resolvePassthroughArgs } from '../../../task.param.js';
2
+ import { ExpectedError } from '../../../error.js';
3
+ import { defaultPackageAlias } from '../../../sfdx-project.js';
4
+ import { formatVersionNumber } from '../../../package.version.js';
5
+ export default {
6
+ description: 'Creates a managed package version. Passthrough for `sf package version create`. Waits for completion so the resulting version ID is available to subsequent steps.',
7
+ params: [
8
+ {
9
+ name: 'package',
10
+ type: 'string',
11
+ required: false,
12
+ description: 'Package ID (0Ho), or alias from sfdx-project.json packageAliases. Defaults to the default package directory in sfdx-project.json.',
13
+ },
14
+ {
15
+ name: 'target-dev-hub',
16
+ type: 'string',
17
+ required: false,
18
+ description: 'Dev hub alias or username. Defaults to the SF CLI default target-dev-hub.',
19
+ },
20
+ {
21
+ name: 'wait',
22
+ type: 'number',
23
+ required: false,
24
+ description: 'Minutes to wait for the version create to complete. Defaults to 60.',
25
+ },
26
+ {
27
+ name: 'code-coverage',
28
+ type: 'boolean',
29
+ required: false,
30
+ description: 'Calculate and store code coverage info for Apex classes and triggers.',
31
+ },
32
+ {
33
+ name: 'skip-validation',
34
+ type: 'boolean',
35
+ required: false,
36
+ description: 'Skip validation during package version creation. Speeds up beta builds; not allowed for promotable versions.',
37
+ },
38
+ {
39
+ name: 'installation-key',
40
+ type: 'string',
41
+ required: false,
42
+ description: 'Installation key for key-protected package versions.',
43
+ },
44
+ {
45
+ name: 'installation-key-bypass',
46
+ type: 'boolean',
47
+ required: false,
48
+ default: true,
49
+ description: 'Bypass the installation key requirement.',
50
+ },
51
+ {
52
+ name: 'version-number',
53
+ type: 'string',
54
+ required: false,
55
+ description: 'Override the version number in sfdx-project.json (e.g. 1.2.0.NEXT).',
56
+ },
57
+ {
58
+ name: 'version-name',
59
+ type: 'string',
60
+ required: false,
61
+ description: 'Human-readable version name.',
62
+ },
63
+ {
64
+ name: 'branch',
65
+ type: 'string',
66
+ required: false,
67
+ description: 'Branch name to associate with the package version.',
68
+ },
69
+ {
70
+ name: 'tag',
71
+ type: 'string',
72
+ required: false,
73
+ description: 'Tag to associate with the package version.',
74
+ },
75
+ {
76
+ name: 'path',
77
+ type: 'string',
78
+ required: false,
79
+ description: 'Path to the package directory. Defaults to the default package directory in sfdx-project.json.',
80
+ },
81
+ ],
82
+ outputs: [
83
+ {
84
+ name: 'version-id',
85
+ type: 'string',
86
+ description: 'The 04t SubscriberPackageVersionId of the created package version.',
87
+ },
88
+ {
89
+ name: 'package-version-id',
90
+ type: 'string',
91
+ description: 'The 05i Package2VersionId of the created package version (used by package/version/promote).',
92
+ },
93
+ {
94
+ name: 'version-number',
95
+ type: 'string',
96
+ description: 'The resolved version number assigned to the created package version (e.g. "0.2.0.1").',
97
+ },
98
+ ],
99
+ async run({ flow, params, output }) {
100
+ const wait = params['wait'] ?? 60;
101
+ const overrides = {
102
+ '--wait': String(wait),
103
+ };
104
+ // sf package version create requires --package or --path explicitly; it does NOT
105
+ // auto-fall-back to the default packageDirectory. Do that fallback ourselves by
106
+ // reading the default packageDirectory's package alias from sfdx-project.json.
107
+ if (!params['package'] && !params['path']) {
108
+ const defaultPackage = defaultPackageAlias(flow.projectDir);
109
+ if (defaultPackage)
110
+ overrides['--package'] = defaultPackage;
111
+ }
112
+ const argv = resolvePassthroughArgs(params, overrides);
113
+ // Prevent sf from writing to sfdx-project.json
114
+ // https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_env_variables.htm
115
+ process.env.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE = 'true';
116
+ const label = params['package'] ?? overrides['--package'] ?? '(default package)';
117
+ flow.log(`Creating package version for ${label}...`);
118
+ const result = (await flow.runCommand('package:version:create', argv));
119
+ if (!result.SubscriberPackageVersionId) {
120
+ throw new ExpectedError(`Package version create completed without a SubscriberPackageVersionId (status: ${result.Status ?? 'unknown'}).`);
121
+ }
122
+ const versionNumber = formatVersionNumber(result);
123
+ flow.log(`Created ${result.SubscriberPackageVersionId}${versionNumber ? ` (${versionNumber})` : ''} (status: ${result.Status ?? 'Success'})`);
124
+ output.set('version-id', result.SubscriberPackageVersionId);
125
+ if (result.Package2VersionId) {
126
+ output.set('package-version-id', result.Package2VersionId);
127
+ }
128
+ if (versionNumber) {
129
+ output.set('version-number', versionNumber);
130
+ }
131
+ },
132
+ };
133
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/core/tasks/package/version/create.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAmC,MAAM,6BAA6B,CAAC;AAEnG,eAAe;IACb,WAAW,EACT,oKAAoK;IACtK,MAAM,EAAE;QACN;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EACT,mIAAmI;SACtI;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,2EAA2E;SACzF;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,qEAAqE;SACnF;QACD;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,uEAAuE;SACrF;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EACT,8GAA8G;SACjH;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EA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MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;CACuB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: true;
8
+ description: string;
9
+ default?: undefined;
10
+ } | {
11
+ name: string;
12
+ type: "string";
13
+ required: false;
14
+ description: string;
15
+ default?: undefined;
16
+ } | {
17
+ name: string;
18
+ type: "boolean";
19
+ required: false;
20
+ default: true;
21
+ description: string;
22
+ })[];
23
+ outputs: {
24
+ name: string;
25
+ type: "string";
26
+ description: string;
27
+ }[];
28
+ run({ flow, params, output }: TaskContext): Promise<void>;
29
+ };
30
+ export default _default;
@@ -0,0 +1,79 @@
1
+ /*
2
+ * Licensed under the Apache License, Version 2.0 (the "License");
3
+ * you may not use this file except in compliance with the License.
4
+ * You may obtain a copy of the License at
5
+ *
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ */
14
+ import { StandardColors } from '@salesforce/sf-plugins-core';
15
+ import { resolvePassthroughArgs } from '../../../task.param.js';
16
+ import { asError, ExpectedError } from '../../../error.js';
17
+ export default {
18
+ description: 'Promotes a 2GP package version from beta to released. Passthrough for `sf package version promote`.',
19
+ params: [
20
+ {
21
+ name: 'version-id',
22
+ type: 'string',
23
+ required: true,
24
+ description: '04t SubscriberPackageVersionId or alias of the package version to promote.',
25
+ },
26
+ {
27
+ name: 'target-dev-hub',
28
+ type: 'string',
29
+ required: false,
30
+ description: 'Dev hub alias or username. Defaults to the SF CLI default target-dev-hub.',
31
+ },
32
+ {
33
+ name: 'no-prompt',
34
+ type: 'boolean',
35
+ required: false,
36
+ default: true,
37
+ description: 'Skip the confirmation prompt. Defaults to true so the step never blocks a flow.',
38
+ },
39
+ ],
40
+ outputs: [
41
+ {
42
+ name: 'version-id',
43
+ type: 'string',
44
+ description: 'The 04t SubscriberPackageVersionId of the promoted package version (unchanged from input).',
45
+ },
46
+ ],
47
+ async run({ flow, params, output }) {
48
+ const versionId = params['version-id'];
49
+ const argv = resolvePassthroughArgs(params, {
50
+ '--package': versionId,
51
+ // sf calls the flag `--package`; our task param is `version-id`. Strip the task-name so it isn't doubled.
52
+ '--version-id': null,
53
+ });
54
+ flow.log(`Promoting ${versionId} to released...`);
55
+ try {
56
+ await flow.runCommand('package:version:promote', argv);
57
+ }
58
+ catch (err) {
59
+ const message = asError(err).message;
60
+ // Right after a 2GP beta is built, its SubscriberPackageVersionId (04t) exists for a few
61
+ // minutes before the Package2Version that `promote` looks up — a Salesforce propagation
62
+ // delay, not a real failure. Swap the cryptic platform error for something actionable.
63
+ if (/corresponding Package Version Id was not found/i.test(message)) {
64
+ throw new ExpectedError([
65
+ StandardColors.warning(`Beta package version ${versionId} can't be found by the Dev Hub yet.`),
66
+ '',
67
+ 'If the beta release is recent, wait a few minutes and try again — Salesforce takes a moment to',
68
+ 'register a newly-built version before it can be promoted.',
69
+ '',
70
+ StandardColors.info('Not recent? Make sure this version belongs to your default Dev Hub.'),
71
+ ].join('\n'));
72
+ }
73
+ throw err;
74
+ }
75
+ flow.log(`Promoted ${versionId}.`);
76
+ output.set('version-id', versionId);
77
+ },
78
+ };
79
+ //# sourceMappingURL=promote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promote.js","sourceRoot":"","sources":["../../../../../src/core/tasks/package/version/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE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AAO,CAAC,EAAE,CAAC;gBACpE,MAAM,IAAI,aAAa,CACrB;oBACE,cAAc,CAAC,OAAO,CAAC,wBAAwB,SAAS,qCAAqC,CAAC;oBAC9F,EAAE;oBACF,gGAAgG;oBAChG,2DAA2D;oBAC3D,EAAE;oBACF,cAAc,CAAC,IAAI,CAAC,qEAAqE,CAAC;iBAC3F,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;YACJ,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,YAAY,SAAS,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACtC,CAAC;CACuB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: false;
8
+ description: string;
9
+ default?: undefined;
10
+ } | {
11
+ name: string;
12
+ type: "boolean";
13
+ required: false;
14
+ default: false;
15
+ description: string;
16
+ })[];
17
+ outputs: {
18
+ name: string;
19
+ type: "string";
20
+ description: string;
21
+ }[];
22
+ run({ flow, params, output }: TaskContext): Promise<void>;
23
+ };
24
+ export default _default;
@@ -0,0 +1,78 @@
1
+ import { ExpectedError } from '../../../error.js';
2
+ import { withSuppressedStdout } from '../../../stdout.js';
3
+ import { selectLatest, extractVersionBase } from '../../../package.version.js';
4
+ export default {
5
+ description: 'Resolves the latest package version ID for the project package. Passthrough for `sf package version list`.',
6
+ params: [
7
+ {
8
+ name: 'package',
9
+ type: 'string',
10
+ required: false,
11
+ description: 'Package name, ID, or alias to look up. Defaults to the project package from ship.yml.',
12
+ },
13
+ {
14
+ name: 'target-dev-hub',
15
+ type: 'string',
16
+ required: false,
17
+ description: 'Dev hub alias or username. Defaults to the SF CLI default target-dev-hub.',
18
+ },
19
+ {
20
+ name: 'released',
21
+ type: 'boolean',
22
+ required: false,
23
+ default: false,
24
+ description: 'When true, resolve the latest released version. When false (default), the latest unreleased (beta).',
25
+ },
26
+ {
27
+ name: 'branch',
28
+ type: 'string',
29
+ required: false,
30
+ description: 'Filter to versions built from a specific branch.',
31
+ },
32
+ ],
33
+ outputs: [
34
+ {
35
+ name: 'version-id',
36
+ type: 'string',
37
+ description: 'The 04t SubscriberPackageVersionId of the latest matching package version.',
38
+ },
39
+ {
40
+ name: 'version-number',
41
+ type: 'string',
42
+ description: 'Full version number including build (e.g. "0.1.0.4").',
43
+ },
44
+ {
45
+ name: 'version-base',
46
+ type: 'string',
47
+ description: 'Major.minor.patch portion only (e.g. "0.1.0"), useful for production release tags.',
48
+ },
49
+ ],
50
+ async run({ flow, params, output }) {
51
+ const packageName = params['package'] ?? flow.config.project.package?.name;
52
+ if (!packageName) {
53
+ throw new ExpectedError('No package specified. Pass `package` param or set project.package.name in ship.yml.');
54
+ }
55
+ const argv = ['--packages', packageName, '--json'];
56
+ if (params['target-dev-hub'])
57
+ argv.push('--target-dev-hub', params['target-dev-hub']);
58
+ if (params['branch'])
59
+ argv.push('--branch', params['branch']);
60
+ const wantReleased = params['released'] === true;
61
+ if (wantReleased)
62
+ argv.push('--released');
63
+ const versions = (await withSuppressedStdout(() => flow.runCommand('package:version:list', argv)));
64
+ const latest = selectLatest(versions, wantReleased);
65
+ if (!latest) {
66
+ throw new ExpectedError(`No ${wantReleased ? 'released' : 'unreleased'} versions found for package "${packageName}".`);
67
+ }
68
+ flow.log(`Resolved ${packageName} → ${latest.Version ?? '(unknown version)'} (${latest.SubscriberPackageVersionId})${wantReleased ? ' [released]' : ' [beta]'}`);
69
+ output.set('version-id', latest.SubscriberPackageVersionId);
70
+ if (latest.Version) {
71
+ output.set('version-number', latest.Version);
72
+ const base = extractVersionBase(latest.Version);
73
+ if (base)
74
+ output.set('version-base', base);
75
+ }
76
+ },
77
+ };
78
+ //# sourceMappingURL=resolve-latest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-latest.js","sourceRoot":"","sources":["../../../../../src/core/tasks/package/version/resolve-latest.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAuB,MAAM,6BAA6B,CAAC;AAEpG,eAAe;IACb,WAAW,EACT,4GAA4G;IAC9G,MAAM,EAAE;QACN;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,uFAAuF;SACrG;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,2EAA2E;SACzF;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;YACd,WAAW,EACT,qGAAqG;SACxG;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,kDAAkD;SAChE;KACF;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4EAA4E;SAC1F;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uDAAuD;SACrE;QACD;YACE,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oFAAoF;SAClG;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAe;QAC7C,MAAM,WAAW,GAAI,MAAM,CAAC,SAAS,CAAwB,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;QACnG,IAA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,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAChD,IAAI,IAAI;gBAAE,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACuB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: false;
8
+ default: string;
9
+ description: string;
10
+ } | {
11
+ name: string;
12
+ type: "string";
13
+ required: false;
14
+ description: string;
15
+ default?: undefined;
16
+ })[];
17
+ outputs: {
18
+ name: string;
19
+ type: "string";
20
+ description: string;
21
+ }[];
22
+ run({ flow, params, output }: TaskContext): Promise<void>;
23
+ };
24
+ export default _default;
@@ -0,0 +1,49 @@
1
+ import { ExpectedError } from '../../../error.js';
2
+ import { normalizeRepo, fetchRelease } from '../../../service.github.js';
3
+ import { VERSION_TYPES, resolveNextVersion } from '../../../package.version.js';
4
+ export default {
5
+ description: 'Resolves the next package version number by reading the latest GitHub release. Outputs a `.NEXT` version so sf assigns the build slot automatically. Ancestor is handled by sf via `ancestorVersion: "HIGHEST"` in sfdx-project.json (scaffolded by `package/create`), so no ancestor output is needed.',
6
+ params: [
7
+ {
8
+ name: 'version-type',
9
+ type: 'string',
10
+ required: false,
11
+ default: 'build',
12
+ description: 'Which part of the version to bump relative to the latest released version. One of: build, patch, minor, major.',
13
+ },
14
+ {
15
+ name: 'repo-url',
16
+ type: 'string',
17
+ required: false,
18
+ description: 'GitHub repository URL. Falls back to config.project.git.repoUrl.',
19
+ },
20
+ ],
21
+ outputs: [
22
+ {
23
+ name: 'version-number',
24
+ type: 'string',
25
+ description: 'Next version number ending in `.NEXT`, ready to pass to `sf package version create --version-number`.',
26
+ },
27
+ ],
28
+ async run({ flow, params, output }) {
29
+ const versionType = params['version-type'] ?? 'build';
30
+ if (!VERSION_TYPES.includes(versionType)) {
31
+ throw new ExpectedError(`Invalid version-type "${versionType}". Use one of: ${VERSION_TYPES.join(', ')}.`);
32
+ }
33
+ const repoUrl = params['repo-url'] ?? flow.config.project.git?.repoUrl;
34
+ if (!repoUrl) {
35
+ throw new ExpectedError('No repo URL. Set config.project.git.repoUrl in ship.yml or pass --param repo-url=<url>.');
36
+ }
37
+ const repo = normalizeRepo(repoUrl);
38
+ const release = await fetchRelease(repo);
39
+ const versionNumber = resolveNextVersion(release?.tagName ?? null, versionType);
40
+ if (release) {
41
+ flow.log(`Latest release: ${release.tagName}. Bumping ${versionType} → ${versionNumber}`);
42
+ }
43
+ else {
44
+ flow.log(`No prior GitHub release found. First version: ${versionNumber}`);
45
+ }
46
+ output.set('version-number', versionNumber);
47
+ },
48
+ };
49
+ //# sourceMappingURL=resolve-next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-next.js","sourceRoot":"","sources":["../../../../../src/core/tasks/package/version/resolve-next.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAoB,MAAM,6BAA6B,CAAC;AAElG,eAAe;IACb,WAAW,EACT,ySAAyS;IAC3S,MAAM,EAAE;QACN;YACE,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,OAAO;YAChB,WAAW,EACT,gHAAgH;SACnH;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,kEAAkE;SAChF;KACF;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,uGAAuG;SAC1G;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAe;QAC7C,MAAM,WAAW,GAAI,MAAM,CAAC,cAAc,CAAwB,IAAI,OAAO,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,WAA0B,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,aAAa,CAAC,yBAAyB,WAAW,kBAAkB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7G,CAAC;QAED,MAAM,OAAO,GAAI,MAAM,CAAC,UAAU,CAAwB,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/F,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,aAAa,CACrB,yFAAyF,CAC1F,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QAEpC,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,WAA0B,CAAC,CAAC;QAE/F,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,GAAG,CAAC,mBAAmB,OAAO,CAAC,OAAO,aAAa,WAAW,MAAM,aAAa,EAAE,CAAC,CAAC;QAC5F,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,iDAAiD,aAAa,EAAE,CAAC,CAAC;QAC7E,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IAC9C,CAAC;CACuB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: false;
8
+ description: string;
9
+ } | {
10
+ name: string;
11
+ type: "boolean";
12
+ required: false;
13
+ description: string;
14
+ } | {
15
+ name: string;
16
+ type: "number";
17
+ required: false;
18
+ description: string;
19
+ })[];
20
+ run({ flow, params }: TaskContext): Promise<void>;
21
+ };
22
+ export default _default;
@@ -0,0 +1,117 @@
1
+ /*
2
+ * Licensed under the Apache License, Version 2.0 (the "License");
3
+ * you may not use this file except in compliance with the License.
4
+ * You may obtain a copy of the License at
5
+ *
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ */
14
+ import { join } from 'node:path';
15
+ import { resolvePassthroughArgs } from '../../../task.param.js';
16
+ import { ExpectedError } from '../../../error.js';
17
+ import { withSuppressedStdout } from '../../../stdout.js';
18
+ export default {
19
+ description: 'Deploys metadata to a target org. Passthrough for `sf project deploy start`.',
20
+ params: [
21
+ {
22
+ name: 'target-org',
23
+ type: 'string',
24
+ required: false,
25
+ description: 'Org alias or username to deploy to. Defaults to the SF CLI default target-org.',
26
+ },
27
+ {
28
+ name: 'source-dir',
29
+ type: 'string',
30
+ required: false,
31
+ description: 'Path to local source files to deploy. Defaults to "force-app".',
32
+ },
33
+ {
34
+ name: 'manifest',
35
+ type: 'string',
36
+ required: false,
37
+ description: 'Full file path for manifest (package.xml) of components to deploy.',
38
+ },
39
+ {
40
+ name: 'metadata',
41
+ type: 'string',
42
+ required: false,
43
+ description: 'Metadata component names to deploy.',
44
+ },
45
+ {
46
+ name: 'metadata-dir',
47
+ type: 'string',
48
+ required: false,
49
+ description: 'Root of directory or zip file of metadata formatted files to deploy.',
50
+ },
51
+ {
52
+ name: 'ignore-conflicts',
53
+ type: 'boolean',
54
+ required: false,
55
+ description: 'Ignore conflicts and deploy local files, even if they overwrite changes in the org.',
56
+ },
57
+ {
58
+ name: 'ignore-warnings',
59
+ type: 'boolean',
60
+ required: false,
61
+ description: 'Ignore warnings and allow a deployment to complete successfully.',
62
+ },
63
+ {
64
+ name: 'dry-run',
65
+ type: 'boolean',
66
+ required: false,
67
+ description: "Validate deploy and run Apex tests but don't save to the org.",
68
+ },
69
+ {
70
+ name: 'test-level',
71
+ type: 'string',
72
+ required: false,
73
+ description: 'Deployment Apex testing level: NoTestRun, RunSpecifiedTests, RunLocalTests, RunAllTestsInOrg, RunRelevantTests.',
74
+ },
75
+ {
76
+ name: 'tests',
77
+ type: 'string',
78
+ required: false,
79
+ description: 'Apex tests to run when --test-level is RunSpecifiedTests.',
80
+ },
81
+ {
82
+ name: 'wait',
83
+ type: 'number',
84
+ required: false,
85
+ description: 'Minutes to wait for the command to complete. Defaults to 33.',
86
+ },
87
+ ],
88
+ async run({ flow, params }) {
89
+ const alias = flow.orgs.resolveAlias(params['target-org']);
90
+ const argv = resolvePassthroughArgs(params, {
91
+ '--target-org': alias ?? null,
92
+ '--source-dir': join(flow.projectDir, params['source-dir'] ?? 'force-app'),
93
+ });
94
+ let result;
95
+ try {
96
+ result = await withSuppressedStdout(() => flow.runCommand('project:deploy:start', argv));
97
+ }
98
+ catch (err) {
99
+ if (err instanceof ExpectedError && err.message.includes('No local changes to deploy')) {
100
+ flow.log('Nothing to deploy — skipping.');
101
+ return;
102
+ }
103
+ throw err;
104
+ }
105
+ if (!result.success) {
106
+ const failed = result.files.filter((f) => f.state === 'Failed');
107
+ const lines = failed.map((f) => {
108
+ const loc = f.lineNumber !== undefined && f.columnNumber !== undefined ? ` (${f.lineNumber}:${f.columnNumber})` : '';
109
+ const err = f.error ? `: ${f.error}` : '';
110
+ return ` ${f.filePath}${loc}${err}`;
111
+ });
112
+ throw new ExpectedError(`Deploy failed:\n${lines.join('\n')}`);
113
+ }
114
+ flow.log('Deployed successfully.');
115
+ },
116
+ };
117
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../../../../src/core/tasks/project/deploy/start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAiB1D,eAAe;IACb,WAAW,EAAE,8EAA8E;IAC3F,MAAM,EAAE;QACN;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,gFAAgF;SAC9F;QACD;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,gEAAgE;SAC9E;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,oEAAoE;SAClF;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,qCAAqC;SACnD;QACD;YACE,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,sEAAsE;SACpF;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,qFAAqF;SACnG;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,kEAAkE;SAChF;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,+DAA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C,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC;YAChE,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC7B,MAAM,GAAG,GACP,CAAC,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3G,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1C,OAAO,KAAK,CAAC,CAAC,QAAQ,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;YACvC,CAAC,CAAC,CAAC;YACH,MAAM,IAAI,aAAa,CAAC,mBAAmB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACrC,CAAC;CACuB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "string";
7
+ required: false;
8
+ description: string;
9
+ default?: undefined;
10
+ } | {
11
+ name: string;
12
+ type: "number";
13
+ required: false;
14
+ description: string;
15
+ default?: undefined;
16
+ } | {
17
+ name: string;
18
+ type: "boolean";
19
+ required: false;
20
+ default: true;
21
+ description: string;
22
+ })[];
23
+ run({ flow, params }: TaskContext): Promise<void>;
24
+ };
25
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { resolvePassthroughArgs } from '../../../task.param.js';
2
+ export default {
3
+ description: 'Resets local and remote source tracking for an org. Passthrough for `sf project reset tracking`.',
4
+ params: [
5
+ {
6
+ name: 'target-org',
7
+ type: 'string',
8
+ required: false,
9
+ description: 'Org alias or username to reset source tracking for. Defaults to the SF CLI default target-org.',
10
+ },
11
+ {
12
+ name: 'revision',
13
+ type: 'number',
14
+ required: false,
15
+ description: 'SourceMember revision counter number to reset tracking to. Defaults to the latest.',
16
+ },
17
+ {
18
+ name: 'no-prompt',
19
+ type: 'boolean',
20
+ required: false,
21
+ default: true,
22
+ description: 'Skip the confirmation prompt. Defaults to true so the step never blocks a flow.',
23
+ },
24
+ ],
25
+ async run({ flow, params }) {
26
+ const alias = flow.orgs.resolveAlias(params['target-org']);
27
+ const argv = resolvePassthroughArgs(params, { '--target-org': alias ?? null });
28
+ await flow.runCommand('project:reset:tracking', argv);
29
+ flow.log(`Reset source tracking for ${alias ?? 'default org'}.`);
30
+ },
31
+ };
32
+ //# sourceMappingURL=tracking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../../../src/core/tasks/project/reset/tracking.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,eAAe;IACb,WAAW,EAAE,kGAAkG;IAC/G,MAAM,EAAE;QACN;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,gGAAgG;SAC9G;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,oFAAoF;SAClG;QACD;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,iFAAiF;SAC/F;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAe;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAuB,CAAC,CAAC;QACjF,MAAM,IAAI,GAAG,sBAAsB,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC;QAC/E,MAAM,IAAI,CAAC,UAAU,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,GAAG,CAAC,6BAA6B,KAAK,IAAI,aAAa,GAAG,CAAC,CAAC;IACnE,CAAC;CACuB,CAAC"}