@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,42 @@
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
+ default: string;
15
+ description: string;
16
+ } | {
17
+ name: string;
18
+ type: "boolean";
19
+ required: false;
20
+ default: false;
21
+ description: string;
22
+ } | {
23
+ name: string;
24
+ type: "string";
25
+ required: false;
26
+ description: string;
27
+ default?: undefined;
28
+ } | {
29
+ name: string;
30
+ type: "boolean";
31
+ required: false;
32
+ default: true;
33
+ description: string;
34
+ })[];
35
+ outputs: {
36
+ name: string;
37
+ type: "string";
38
+ description: string;
39
+ }[];
40
+ run({ flow, params, output }: TaskContext): Promise<void>;
41
+ };
42
+ export default _default;
@@ -0,0 +1,197 @@
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
+ /* eslint-disable camelcase */
15
+ import { getGithubToken, normalizeRepo, gh, fetchFirstCommitSha, resolveCommitSha, } from '../../../service.github.js';
16
+ import { resolveDependencies } from '../../../package.dependencies.js';
17
+ import { ExpectedError } from '../../../error.js';
18
+ function buildInstallInfo(versionId, prerelease) {
19
+ const lines = [
20
+ '## Installation Info',
21
+ '',
22
+ '**Sandbox & Scratch Orgs:**',
23
+ `https://test.salesforce.com/packaging/installPackage.apexp?p0=${versionId}`,
24
+ ];
25
+ if (!prerelease) {
26
+ lines.push('', '**Production & Developer Edition Orgs:**', `https://login.salesforce.com/packaging/installPackage.apexp?p0=${versionId}`);
27
+ }
28
+ return lines.join('\n');
29
+ }
30
+ export default {
31
+ description: 'Creates an annotated git tag carrying the package version metadata, then a GitHub release pointing to it. Inherits CumulusCI’s tag annotation format so consumers resolve the version through a single path.',
32
+ params: [
33
+ {
34
+ name: 'tag',
35
+ type: 'string',
36
+ required: true,
37
+ description: 'Tag name to create (e.g. "v1.2.3").',
38
+ },
39
+ {
40
+ name: 'version-id',
41
+ type: 'string',
42
+ required: true,
43
+ description: '04t SubscriberPackageVersionId to embed in the tag annotation.',
44
+ },
45
+ {
46
+ name: 'package-type',
47
+ type: 'string',
48
+ required: false,
49
+ default: '2GP',
50
+ description: 'Package type written into the annotation (e.g. 2GP, Unlocked, 1GP).',
51
+ },
52
+ {
53
+ name: 'prerelease',
54
+ type: 'boolean',
55
+ required: false,
56
+ default: false,
57
+ description: 'Mark the GitHub release as a prerelease.',
58
+ },
59
+ {
60
+ name: 'name',
61
+ type: 'string',
62
+ required: false,
63
+ description: 'Release name. Defaults to the tag.',
64
+ },
65
+ {
66
+ name: 'body',
67
+ type: 'string',
68
+ required: false,
69
+ description: 'Release body. When omitted, GitHub auto-generates notes from PRs and commits since the previous release. Pass any value (including an empty string) to opt out of auto-generation and use your own.',
70
+ },
71
+ {
72
+ name: 'install-link',
73
+ type: 'boolean',
74
+ required: false,
75
+ default: true,
76
+ description: 'Prepend a Salesforce package-install link section (test + login URLs for the 04t) to the release body. Defaults to true.',
77
+ },
78
+ {
79
+ name: 'target',
80
+ type: 'string',
81
+ required: false,
82
+ description: 'Commit SHA or branch to tag. Defaults to the repository’s default branch.',
83
+ },
84
+ {
85
+ name: 'repo-url',
86
+ type: 'string',
87
+ required: false,
88
+ description: 'GitHub repository URL. Falls back to config.project.git.repoUrl.',
89
+ },
90
+ {
91
+ name: 'github-alias',
92
+ type: 'string',
93
+ required: false,
94
+ default: 'default',
95
+ description: 'GitHub token alias.',
96
+ },
97
+ ],
98
+ outputs: [
99
+ {
100
+ name: 'tag',
101
+ type: 'string',
102
+ description: 'The created tag name.',
103
+ },
104
+ {
105
+ name: 'release-url',
106
+ type: 'string',
107
+ description: 'URL of the created GitHub release.',
108
+ },
109
+ ],
110
+ async run({ flow, params, output }) {
111
+ const tagName = params['tag'];
112
+ const versionId = params['version-id'];
113
+ const packageType = params['package-type'] ?? '2GP';
114
+ const prerelease = params['prerelease'] === true;
115
+ const releaseName = params['name'] ?? tagName;
116
+ const customBody = params['body'];
117
+ const generateReleaseNotes = customBody === undefined;
118
+ const installInfo = params['install-link'] !== false ? buildInstallInfo(versionId, prerelease) : '';
119
+ const releaseBody = [installInfo, customBody ?? ''].filter((s) => s.length > 0).join('\n\n');
120
+ const alias = String(params['github-alias'] ?? 'default');
121
+ const token = getGithubToken(alias);
122
+ if (!token) {
123
+ throw new ExpectedError(`No GitHub token found for alias "${alias}". Run: sf ship service connect github`);
124
+ }
125
+ const repoUrl = params['repo-url'] ?? flow.config.project.git?.repoUrl;
126
+ if (!repoUrl) {
127
+ throw new ExpectedError('No repo URL. Set config.project.git.repoUrl in ship.yml or pass --param repo-url=<url>.');
128
+ }
129
+ const repo = normalizeRepo(repoUrl);
130
+ const commitSha = await resolveCommitSha(params['target'], token, repo);
131
+ const depsForAnnotation = [];
132
+ const deps = flow.config.project.package?.dependencies ?? [];
133
+ if (deps.length > 0) {
134
+ flow.log('Resolving dependencies for tag annotation...');
135
+ const steps = await resolveDependencies(deps);
136
+ for (const step of steps) {
137
+ if (step.kind === 'package-id') {
138
+ // eslint-disable-next-line camelcase
139
+ depsForAnnotation.push({ version_id: step.versionId, package_name: step.name });
140
+ }
141
+ }
142
+ }
143
+ const tagMessage = [
144
+ `version_id: ${versionId}`,
145
+ `package_type: ${packageType}`,
146
+ `dependencies: ${JSON.stringify(depsForAnnotation)}`,
147
+ ].join('\n');
148
+ flow.log(`Creating annotated tag ${tagName} at ${commitSha.slice(0, 7)}...`);
149
+ const tagObj = await gh(token, `/repos/${repo}/git/tags`, {
150
+ method: 'POST',
151
+ body: {
152
+ tag: tagName,
153
+ message: tagMessage,
154
+ object: commitSha,
155
+ type: 'commit',
156
+ tagger: { name: 'plugin-ship', email: 'noreply@plugin-ship', date: new Date().toISOString() },
157
+ },
158
+ });
159
+ flow.log(`Creating tag reference refs/tags/${tagName}...`);
160
+ await gh(token, `/repos/${repo}/git/refs`, {
161
+ method: 'POST',
162
+ body: { ref: `refs/tags/${tagName}`, sha: tagObj.sha },
163
+ });
164
+ // For production releases, anchor auto-generated notes against the previous
165
+ // production release. If none exists, anchor against the first commit so notes
166
+ // span the full history rather than an arbitrary prerelease.
167
+ let previousTagName;
168
+ if (!prerelease && generateReleaseNotes) {
169
+ const releases = await gh(token, `/repos/${repo}/releases?per_page=30`);
170
+ const previousProd = releases.find((r) => !r.prerelease);
171
+ if (previousProd) {
172
+ previousTagName = previousProd.tag_name;
173
+ }
174
+ else {
175
+ const firstSha = await fetchFirstCommitSha(repo, token);
176
+ if (firstSha)
177
+ previousTagName = firstSha;
178
+ }
179
+ }
180
+ flow.log(`Creating GitHub release ${tagName}...`);
181
+ const release = await gh(token, `/repos/${repo}/releases`, {
182
+ method: 'POST',
183
+ body: {
184
+ tag_name: tagName,
185
+ name: releaseName,
186
+ body: releaseBody,
187
+ prerelease,
188
+ generate_release_notes: generateReleaseNotes,
189
+ ...(previousTagName !== undefined ? { previous_tag_name: previousTagName } : {}),
190
+ },
191
+ });
192
+ flow.log(`Released: ${release.html_url}`);
193
+ output.set('tag', tagName);
194
+ output.set('release-url', release.html_url);
195
+ },
196
+ };
197
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/core/tasks/git/release/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,8BAA8B;AAE9B,OAAO,EACL,cAAc,EACd,aAAa,EACb,EAAE,EACF,mBAAmB,EACnB,gBAAgB,GAIjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAA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
+ description: string;
4
+ params: ({
5
+ name: string;
6
+ type: "boolean";
7
+ required: false;
8
+ default: false;
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,93 @@
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 { fetchRelease, fetchGitTag, normalizeRepo } from '../../../service.github.js';
15
+ import { ExpectedError } from '../../../error.js';
16
+ export default {
17
+ description: 'Resolves a package version ID from the latest GitHub release or pre-release.',
18
+ params: [
19
+ {
20
+ name: 'prerelease',
21
+ type: 'boolean',
22
+ required: false,
23
+ default: false,
24
+ description: 'When true, resolves from the latest pre-release. When false (default), the latest production release.',
25
+ },
26
+ {
27
+ name: 'tag',
28
+ type: 'string',
29
+ required: false,
30
+ description: 'Specific release tag to resolve. Overrides prerelease.',
31
+ },
32
+ {
33
+ name: 'repo-url',
34
+ type: 'string',
35
+ required: false,
36
+ description: 'GitHub repository URL. Falls back to config.project.git.repoUrl.',
37
+ },
38
+ ],
39
+ outputs: [
40
+ {
41
+ name: 'version-id',
42
+ type: 'string',
43
+ description: 'The 04t SubscriberPackageVersionId from the release tag annotation.',
44
+ },
45
+ {
46
+ name: 'version-number',
47
+ type: 'string',
48
+ description: 'Full version number (e.g. "0.4.0.1"), derived from the tag name.',
49
+ },
50
+ {
51
+ name: 'version-base',
52
+ type: 'string',
53
+ description: 'Major.minor.patch portion only (e.g. "0.4.0").',
54
+ },
55
+ {
56
+ name: 'tag',
57
+ type: 'string',
58
+ description: 'The release tag name (e.g. "v0.4.0.1").',
59
+ },
60
+ ],
61
+ async run({ flow, params, output }) {
62
+ const repoUrl = params['repo-url'] ?? flow.config.project.git?.repoUrl;
63
+ if (!repoUrl) {
64
+ throw new ExpectedError('No repo URL. Set project.git.repoUrl in ship.yml or pass --param repo-url=<url>.');
65
+ }
66
+ const repo = normalizeRepo(repoUrl);
67
+ const prerelease = params['prerelease'] === true;
68
+ const tag = params['tag'];
69
+ const release = await fetchRelease(repo, tag, prerelease);
70
+ if (!release) {
71
+ throw new ExpectedError(`No ${prerelease ? 'pre-release' : 'production release'} found for ${repo}.`);
72
+ }
73
+ const gitTag = await fetchGitTag(repo, release.tagName);
74
+ if (!gitTag) {
75
+ throw new ExpectedError(`No release metadata found in tag ${release.tagName} for ${repo}.`);
76
+ }
77
+ const match = /version_id:\s*(\S+)/.exec(gitTag.message);
78
+ if (!match) {
79
+ throw new ExpectedError(`No version_id found in tag annotation for ${release.tagName}.`);
80
+ }
81
+ const versionId = match[1];
82
+ const rawVersion = release.tagName.replace(/^v/, '');
83
+ const parts = rawVersion.split('.');
84
+ flow.log(`Resolved ${repo} → ${rawVersion} (${versionId}) [${prerelease ? 'pre-release' : 'release'}]`);
85
+ output.set('version-id', versionId);
86
+ output.set('tag', release.tagName);
87
+ if (rawVersion)
88
+ output.set('version-number', rawVersion);
89
+ if (parts.length >= 3)
90
+ output.set('version-base', `${parts[0]}.${parts[1]}.${parts[2]}`);
91
+ },
92
+ };
93
+ //# sourceMappingURL=fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../../../src/core/tasks/git/release/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,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ACnC,IAAI,UAAU;YAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;QACzD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3F,CAAC;CACuB,CAAC"}
@@ -0,0 +1,12 @@
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
+ run({ flow, params }: TaskContext): Promise<void>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,47 @@
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 { getGithubToken, normalizeRepo, fetchRepoInfo } from '../../../service.github.js';
15
+ import { ExpectedError } from '../../../error.js';
16
+ export default {
17
+ description: 'Fetches and logs basic repository info from the GitHub API.',
18
+ params: [
19
+ {
20
+ name: 'github-alias',
21
+ type: 'string',
22
+ required: false,
23
+ description: 'GitHub token alias. Defaults to "default".',
24
+ },
25
+ {
26
+ name: 'repo-url',
27
+ type: 'string',
28
+ required: false,
29
+ description: 'GitHub repository URL. Falls back to config.project.git.repoUrl.',
30
+ },
31
+ ],
32
+ async run({ flow, params }) {
33
+ const alias = String(params['github-alias'] ?? 'default');
34
+ const token = getGithubToken(alias);
35
+ if (!token)
36
+ throw new ExpectedError(`No GitHub token found for alias "${alias}". Run: sf ship service connect github`);
37
+ const repoUrl = params['repo-url'] ?? flow.config.project.git?.repoUrl;
38
+ if (!repoUrl)
39
+ throw new ExpectedError('No repo URL. Set config.project.git.repoUrl in ship.yml or pass --param repo-url=<url>.');
40
+ const data = await fetchRepoInfo(normalizeRepo(repoUrl), token);
41
+ flow.log(`Repo: ${data.full_name}`);
42
+ flow.log(`Description: ${data.description ?? '(none)'}`);
43
+ flow.log(`Default branch: ${data.default_branch}`);
44
+ flow.log(`Visibility: ${data.visibility}`);
45
+ },
46
+ };
47
+ //# sourceMappingURL=info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.js","sourceRoot":"","sources":["../../../../../src/core/tasks/git/repo/info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAe;IACb,WAAW,EAAE,6DAA6D;IAC1E,MAAM,EAAE;QACN;YACE,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,4CAA4C;SAC1D;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,kEAAkE;SAChF;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAe;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,SAAS,CAAC,CAAC;QAC1D,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK;YACR,MAAM,IAAI,aAAa,CAAC,oCAAoC,KAAK,wCAAwC,CAAC,CAAC;QAE7G,MAAM,OAAO,GAAI,MAAM,CAAC,UAAU,CAAwB,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/F,IAAI,CAAC,OAAO;YACV,MAAM,IAAI,aAAa,CACrB,yFAAyF,CAC1F,CAAC;QAEJ,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;QAEhE,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,WAAW,IAAI,QAAQ,EAAE,CAAC,CAAC;QAC7D,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IAClD,CAAC;CACuB,CAAC"}
@@ -0,0 +1,12 @@
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
+ run({ flow, params }: TaskContext): Promise<void>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,39 @@
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 { resolve } from 'node:path';
15
+ export default {
16
+ description: 'Deploys metadata to a target org using the Salesforce source deploy API.',
17
+ params: [
18
+ {
19
+ name: 'source-dir',
20
+ type: 'string',
21
+ required: false,
22
+ description: 'Path to the source directory to deploy. Defaults to "force-app".',
23
+ },
24
+ {
25
+ name: 'target-org',
26
+ type: 'string',
27
+ required: false,
28
+ description: 'Org alias or username to deploy to. Defaults to the SF CLI default target-org.',
29
+ },
30
+ ],
31
+ async run({ flow, params }) {
32
+ const sourceDir = resolve(process.cwd(), params['source-dir'] ?? 'force-app');
33
+ const alias = flow.orgs.resolveAlias(params['target-org']);
34
+ const orgArgs = alias !== undefined ? ['--target-org', alias] : [];
35
+ await flow.runCommand('project:deploy:start', ['--source-dir', sourceDir, ...orgArgs]);
36
+ flow.log('Deployed successfully.');
37
+ },
38
+ };
39
+ //# sourceMappingURL=deploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../src/core/tasks/metadata/deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAe;IACb,WAAW,EAAE,0EAA0E;IACvF,MAAM,EAAE;QACN;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,kEAAkE;SAChF;QACD;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,gFAAgF;SAC9F;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAe;QACrC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAG,MAAM,CAAC,YAAY,CAAwB,IAAI,WAAW,CAAC,CAAC;QACtG,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAuB,CAAC,CAAC;QACjF,MAAM,OAAO,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnE,MAAM,IAAI,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACrC,CAAC;CACuB,CAAC"}
@@ -0,0 +1,12 @@
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
+ run({ flow, params }: TaskContext): Promise<void>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,54 @@
1
+ import { ExpectedError } from '../../../error.js';
2
+ import { withSuppressedStdout } from '../../../stdout.js';
3
+ export default {
4
+ description: 'Assigns permission sets and/or permission set groups to a user. Defaults to the list in ship.yml under project.package.permsets.',
5
+ params: [
6
+ {
7
+ name: 'target-org',
8
+ type: 'string',
9
+ required: false,
10
+ description: 'Org alias or username. Defaults to the SF CLI default target-org.',
11
+ },
12
+ {
13
+ name: 'permsets',
14
+ type: 'string',
15
+ required: false,
16
+ description: 'Comma-separated permission set or permission set group API names. Defaults to project.package.permsets in ship.yml.',
17
+ },
18
+ {
19
+ name: 'username',
20
+ type: 'string',
21
+ required: false,
22
+ description: 'Username to assign to. Defaults to the org running user.',
23
+ },
24
+ ],
25
+ async run({ flow, params }) {
26
+ const alias = flow.orgs.resolveAlias(params['target-org']);
27
+ const namesParam = params['permsets'];
28
+ const names = namesParam
29
+ ? namesParam
30
+ .split(',')
31
+ .map((n) => n.trim())
32
+ .filter(Boolean)
33
+ : flow.config.project.package?.permsets ?? [];
34
+ if (names.length === 0) {
35
+ flow.log('No permission sets configured, skipping.');
36
+ return;
37
+ }
38
+ const argv = ['--json'];
39
+ if (alias !== undefined)
40
+ argv.push('--target-org', alias);
41
+ for (const name of names)
42
+ argv.push('--name', name);
43
+ if (params['username'])
44
+ argv.push('--on-behalf-of', params['username']);
45
+ const result = (await withSuppressedStdout(() => flow.runCommand('org:assign:permset', argv)));
46
+ // Reassigning perm sets reports as a failure, so we filter those out
47
+ const realFailures = (result.failures ?? []).filter((f) => !f.message.includes('Duplicate PermissionSetAssignment'));
48
+ if (realFailures.length > 0) {
49
+ throw new ExpectedError(`Failed to assign permission sets:\n${realFailures.map((f) => ` ${f.name}: ${f.message}`).join('\n')}`);
50
+ }
51
+ flow.log(`Assigned ${names.length} permission set(s) to ${alias ?? 'default org'}.`);
52
+ },
53
+ };
54
+ //# sourceMappingURL=permsets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permsets.js","sourceRoot":"","sources":["../../../../../src/core/tasks/org/assign/permsets.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAO1D,eAAe;IACb,WAAW,EACT,kIAAkI;IACpI,MAAM,EAAE;QACN;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,mEAAmE;SACjF;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EACT,qHAAqH;SACxH;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,0DAA0D;SACxE;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;QAEjF,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAuB,CAAC;QAC5D,MAAM,KAAK,GAAG,UAAU;YACtB,CAAC,CAAC,UAAU;i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AAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACxG,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,MAAM,yBAAyB,KAAK,IAAI,aAAa,GAAG,CAAC,CAAC;IACvF,CAAC;CACuB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { TaskContext } from '../../../task.definition.schema.js';
2
+ declare const _default: {
3
+ description: string;
4
+ outputs: ({
5
+ name: string;
6
+ type: "string";
7
+ description: string;
8
+ } | {
9
+ name: string;
10
+ type: "boolean";
11
+ description: string;
12
+ })[];
13
+ params: ({
14
+ name: string;
15
+ type: "string";
16
+ required: true;
17
+ description: string;
18
+ } | {
19
+ name: string;
20
+ type: "string";
21
+ required: false;
22
+ description: string;
23
+ } | {
24
+ name: string;
25
+ type: "number";
26
+ required: false;
27
+ description: string;
28
+ } | {
29
+ name: string;
30
+ type: "boolean";
31
+ required: false;
32
+ description: string;
33
+ })[];
34
+ run({ flow, params, output }: TaskContext): Promise<void>;
35
+ };
36
+ export default _default;