@payfit/nx-core 4.42.3 → 4.42.4-ephemeral-bundle-nx-core-7fdfd20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/README.md +201 -0
  2. package/dist/_virtual/rolldown_runtime.js +39 -0
  3. package/dist/executors/publisher/docker.js +54 -0
  4. package/{src → dist}/executors/publisher/executor.d.ts +6 -3
  5. package/dist/executors/publisher/executor.js +20 -0
  6. package/dist/executors/publisher/helm.js +62 -0
  7. package/dist/executors/publisher/lambda.js +55 -0
  8. package/dist/executors/publisher/schema.d.ts +17 -0
  9. package/{src → dist}/executors/publisher/schema.json +17 -0
  10. package/dist/executors/release/executor.d.ts +7 -0
  11. package/dist/executors/release/executor.js +77 -0
  12. package/dist/executors/release/schema.d.ts +12 -0
  13. package/dist/index.d.ts +12 -0
  14. package/dist/index.js +62 -0
  15. package/dist/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js +68 -0
  16. package/dist/node_modules/@wry/caches/lib/bundle.js +201 -0
  17. package/dist/node_modules/@wry/context/lib/bundle.js +158 -0
  18. package/dist/node_modules/@wry/equality/lib/bundle.js +114 -0
  19. package/dist/node_modules/@wry/trie/lib/bundle.js +84 -0
  20. package/dist/node_modules/cross-fetch/dist/node-ponyfill.js +27 -0
  21. package/dist/node_modules/encoding/lib/encoding.js +63 -0
  22. package/dist/node_modules/graphql/error/GraphQLError.js +162 -0
  23. package/dist/node_modules/graphql/error/index.js +50 -0
  24. package/dist/node_modules/graphql/error/locatedError.js +39 -0
  25. package/dist/node_modules/graphql/error/syntaxError.js +27 -0
  26. package/dist/node_modules/graphql/execution/collectFields.js +110 -0
  27. package/dist/node_modules/graphql/execution/execute.js +477 -0
  28. package/dist/node_modules/graphql/execution/index.js +82 -0
  29. package/dist/node_modules/graphql/execution/mapAsyncIterator.js +55 -0
  30. package/dist/node_modules/graphql/execution/subscribe.js +148 -0
  31. package/dist/node_modules/graphql/execution/values.js +155 -0
  32. package/dist/node_modules/graphql/graphql.js +66 -0
  33. package/dist/node_modules/graphql/index.js +1296 -0
  34. package/dist/node_modules/graphql/jsutils/Path.js +38 -0
  35. package/dist/node_modules/graphql/jsutils/devAssert.js +19 -0
  36. package/dist/node_modules/graphql/jsutils/didYouMean.js +33 -0
  37. package/dist/node_modules/graphql/jsutils/groupBy.js +28 -0
  38. package/dist/node_modules/graphql/jsutils/identityFunc.js +21 -0
  39. package/dist/node_modules/graphql/jsutils/inspect.js +70 -0
  40. package/dist/node_modules/graphql/jsutils/instanceOf.js +52 -0
  41. package/dist/node_modules/graphql/jsutils/invariant.js +19 -0
  42. package/dist/node_modules/graphql/jsutils/isAsyncIterable.js +22 -0
  43. package/dist/node_modules/graphql/jsutils/isIterableObject.js +35 -0
  44. package/dist/node_modules/graphql/jsutils/isObjectLike.js +22 -0
  45. package/dist/node_modules/graphql/jsutils/isPromise.js +22 -0
  46. package/dist/node_modules/graphql/jsutils/keyMap.js +47 -0
  47. package/dist/node_modules/graphql/jsutils/keyValMap.js +37 -0
  48. package/dist/node_modules/graphql/jsutils/mapValue.js +24 -0
  49. package/dist/node_modules/graphql/jsutils/memoize3.js +40 -0
  50. package/dist/node_modules/graphql/jsutils/naturalCompare.js +57 -0
  51. package/dist/node_modules/graphql/jsutils/printPathArray.js +21 -0
  52. package/dist/node_modules/graphql/jsutils/promiseForObject.js +29 -0
  53. package/dist/node_modules/graphql/jsutils/promiseReduce.js +29 -0
  54. package/dist/node_modules/graphql/jsutils/suggestionList.js +101 -0
  55. package/dist/node_modules/graphql/jsutils/toError.js +30 -0
  56. package/dist/node_modules/graphql/jsutils/toObjMap.js +22 -0
  57. package/dist/node_modules/graphql/language/ast.js +280 -0
  58. package/dist/node_modules/graphql/language/blockString.js +114 -0
  59. package/dist/node_modules/graphql/language/characterClasses.js +76 -0
  60. package/dist/node_modules/graphql/language/directiveLocation.js +46 -0
  61. package/dist/node_modules/graphql/language/index.js +224 -0
  62. package/dist/node_modules/graphql/language/kinds.js +70 -0
  63. package/dist/node_modules/graphql/language/lexer.js +523 -0
  64. package/dist/node_modules/graphql/language/location.js +39 -0
  65. package/dist/node_modules/graphql/language/parser.js +1162 -0
  66. package/dist/node_modules/graphql/language/predicates.js +56 -0
  67. package/dist/node_modules/graphql/language/printLocation.js +62 -0
  68. package/dist/node_modules/graphql/language/printString.js +188 -0
  69. package/dist/node_modules/graphql/language/printer.js +198 -0
  70. package/dist/node_modules/graphql/language/source.js +54 -0
  71. package/dist/node_modules/graphql/language/tokenKind.js +50 -0
  72. package/dist/node_modules/graphql/language/visitor.js +267 -0
  73. package/dist/node_modules/graphql/type/assertName.js +42 -0
  74. package/dist/node_modules/graphql/type/definition.js +894 -0
  75. package/dist/node_modules/graphql/type/directives.js +191 -0
  76. package/dist/node_modules/graphql/type/index.js +562 -0
  77. package/dist/node_modules/graphql/type/introspection.js +485 -0
  78. package/dist/node_modules/graphql/type/scalars.js +167 -0
  79. package/dist/node_modules/graphql/type/schema.js +263 -0
  80. package/dist/node_modules/graphql/type/validate.js +310 -0
  81. package/dist/node_modules/graphql/utilities/TypeInfo.js +243 -0
  82. package/dist/node_modules/graphql/utilities/assertValidName.js +46 -0
  83. package/dist/node_modules/graphql/utilities/astFromValue.js +134 -0
  84. package/dist/node_modules/graphql/utilities/buildASTSchema.js +83 -0
  85. package/dist/node_modules/graphql/utilities/buildClientSchema.js +230 -0
  86. package/dist/node_modules/graphql/utilities/coerceInputValue.js +109 -0
  87. package/dist/node_modules/graphql/utilities/concatAST.js +30 -0
  88. package/dist/node_modules/graphql/utilities/extendSchema.js +441 -0
  89. package/dist/node_modules/graphql/utilities/findBreakingChanges.js +285 -0
  90. package/dist/node_modules/graphql/utilities/getIntrospectionQuery.js +145 -0
  91. package/dist/node_modules/graphql/utilities/getOperationAST.js +33 -0
  92. package/dist/node_modules/graphql/utilities/getOperationRootType.js +40 -0
  93. package/dist/node_modules/graphql/utilities/index.js +242 -0
  94. package/dist/node_modules/graphql/utilities/introspectionFromSchema.js +49 -0
  95. package/dist/node_modules/graphql/utilities/lexicographicSortSchema.js +146 -0
  96. package/dist/node_modules/graphql/utilities/printSchema.js +177 -0
  97. package/dist/node_modules/graphql/utilities/separateOperations.js +63 -0
  98. package/dist/node_modules/graphql/utilities/sortValueNode.js +51 -0
  99. package/dist/node_modules/graphql/utilities/stripIgnoredCharacters.js +108 -0
  100. package/dist/node_modules/graphql/utilities/typeComparators.js +64 -0
  101. package/dist/node_modules/graphql/utilities/typeFromAST.js +32 -0
  102. package/dist/node_modules/graphql/utilities/valueFromAST.js +115 -0
  103. package/dist/node_modules/graphql/utilities/valueFromASTUntyped.js +48 -0
  104. package/dist/node_modules/graphql/validation/ValidationContext.js +172 -0
  105. package/dist/node_modules/graphql/validation/index.js +340 -0
  106. package/dist/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js +38 -0
  107. package/dist/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js +87 -0
  108. package/dist/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js +53 -0
  109. package/dist/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js +79 -0
  110. package/dist/node_modules/graphql/validation/rules/KnownDirectivesRule.js +96 -0
  111. package/dist/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js +32 -0
  112. package/dist/node_modules/graphql/validation/rules/KnownTypeNamesRule.js +57 -0
  113. package/dist/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js +38 -0
  114. package/dist/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js +36 -0
  115. package/dist/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js +56 -0
  116. package/dist/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js +60 -0
  117. package/dist/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js +45 -0
  118. package/dist/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js +47 -0
  119. package/dist/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js +47 -0
  120. package/dist/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js +314 -0
  121. package/dist/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js +62 -0
  122. package/dist/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js +99 -0
  123. package/dist/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js +88 -0
  124. package/dist/node_modules/graphql/validation/rules/ScalarLeafsRule.js +50 -0
  125. package/dist/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js +56 -0
  126. package/dist/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js +58 -0
  127. package/dist/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js +40 -0
  128. package/dist/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js +36 -0
  129. package/dist/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +56 -0
  130. package/dist/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js +49 -0
  131. package/dist/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js +56 -0
  132. package/dist/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js +36 -0
  133. package/dist/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js +49 -0
  134. package/dist/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js +36 -0
  135. package/dist/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js +48 -0
  136. package/dist/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js +44 -0
  137. package/dist/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js +33 -0
  138. package/dist/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +140 -0
  139. package/dist/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js +41 -0
  140. package/dist/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js +79 -0
  141. package/dist/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js +75 -0
  142. package/dist/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +37 -0
  143. package/dist/node_modules/graphql/validation/specifiedRules.js +148 -0
  144. package/dist/node_modules/graphql/validation/validate.js +106 -0
  145. package/dist/node_modules/graphql/version.js +30 -0
  146. package/dist/node_modules/graphql-tag/lib/graphql-tag.umd.js +126 -0
  147. package/dist/node_modules/graphql-tag/main.js +15 -0
  148. package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +352 -0
  149. package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +197 -0
  150. package/dist/node_modules/iconv-lite/encodings/index.js +37 -0
  151. package/dist/node_modules/iconv-lite/encodings/internal.js +144 -0
  152. package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +56 -0
  153. package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +461 -0
  154. package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +157 -0
  155. package/dist/node_modules/iconv-lite/encodings/tables/big5-added.js +175 -0
  156. package/dist/node_modules/iconv-lite/encodings/tables/cp936.js +2590 -0
  157. package/dist/node_modules/iconv-lite/encodings/tables/cp949.js +2226 -0
  158. package/dist/node_modules/iconv-lite/encodings/tables/cp950.js +233 -0
  159. package/dist/node_modules/iconv-lite/encodings/tables/eucjp.js +431 -0
  160. package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.js +433 -0
  161. package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.js +236 -0
  162. package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.js +298 -0
  163. package/dist/node_modules/iconv-lite/encodings/utf16.js +129 -0
  164. package/dist/node_modules/iconv-lite/encodings/utf32.js +201 -0
  165. package/dist/node_modules/iconv-lite/encodings/utf7.js +186 -0
  166. package/dist/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  167. package/dist/node_modules/iconv-lite/lib/index.js +113 -0
  168. package/dist/node_modules/iconv-lite/lib/streams.js +96 -0
  169. package/dist/node_modules/node-fetch/lib/index.js +1184 -0
  170. package/dist/node_modules/optimism/lib/bundle.js +374 -0
  171. package/dist/node_modules/safer-buffer/safer.js +51 -0
  172. package/dist/node_modules/symbol-observable/lib/index.js +28 -0
  173. package/dist/node_modules/symbol-observable/lib/ponyfill.js +29 -0
  174. package/dist/node_modules/tr46/index.js +148 -0
  175. package/dist/node_modules/tr46/lib/mappingTable.js +35566 -0
  176. package/dist/node_modules/ts-invariant/lib/invariant.js +68 -0
  177. package/dist/node_modules/tslib/tslib.js +581 -0
  178. package/dist/node_modules/whatwg-url/lib/URL-impl.js +148 -0
  179. package/dist/node_modules/whatwg-url/lib/URL.js +177 -0
  180. package/dist/node_modules/whatwg-url/lib/public-api.js +24 -0
  181. package/dist/node_modules/whatwg-url/lib/url-state-machine.js +884 -0
  182. package/dist/node_modules/whatwg-url/lib/utils.js +25 -0
  183. package/dist/node_modules/whatwg-url/node_modules/webidl-conversions/lib/index.js +127 -0
  184. package/dist/node_modules/zen-observable/index.js +15 -0
  185. package/dist/node_modules/zen-observable/lib/Observable.js +531 -0
  186. package/dist/node_modules/zen-observable-ts/index.js +15 -0
  187. package/dist/packages/spacelift/node_modules/@apollo/client/cache/cache.js +2097 -0
  188. package/dist/packages/spacelift/node_modules/@apollo/client/core/core.js +2195 -0
  189. package/dist/packages/spacelift/node_modules/@apollo/client/errors/errors.js +56 -0
  190. package/dist/packages/spacelift/node_modules/@apollo/client/link/context/context.js +44 -0
  191. package/dist/packages/spacelift/node_modules/@apollo/client/link/core/core.js +118 -0
  192. package/dist/packages/spacelift/node_modules/@apollo/client/link/error/error.js +97 -0
  193. package/dist/packages/spacelift/node_modules/@apollo/client/link/http/http.js +539 -0
  194. package/dist/packages/spacelift/node_modules/@apollo/client/link/utils/utils.js +120 -0
  195. package/dist/packages/spacelift/node_modules/@apollo/client/utilities/globals/globals.js +102 -0
  196. package/dist/packages/spacelift/node_modules/@apollo/client/utilities/utilities.js +1425 -0
  197. package/dist/packages/spacelift/src/index.js +4 -0
  198. package/dist/packages/spacelift/src/lib/__generated__/graphql.js +65 -0
  199. package/dist/packages/spacelift/src/lib/graphql.service.js +141 -0
  200. package/dist/packages/spacelift/src/lib/query/spacelift.queries.js +54 -0
  201. package/dist/packages/spacelift/src/lib/spacelift.error.js +71 -0
  202. package/dist/packages/spacelift/src/lib/spacelift.service.js +52 -0
  203. package/dist/packages/spacelift/src/lib/utils.js +32 -0
  204. package/dist/scripts/version-actions.d.ts +11 -0
  205. package/dist/scripts/version-actions.js +37 -0
  206. package/dist/utils/common/aws-auth.js +127 -0
  207. package/dist/utils/common/circleci.js +17 -0
  208. package/dist/utils/common/exec.js +33 -0
  209. package/dist/utils/common/github.js +33 -0
  210. package/dist/utils/common/import-esm.js +12 -0
  211. package/dist/utils/common/logger.js +8 -0
  212. package/dist/utils/common/nx.js +71 -0
  213. package/dist/utils/common/s3.js +15 -0
  214. package/dist/utils/common/tsh.js +90 -0
  215. package/dist/utils/datadog.js +31 -0
  216. package/dist/utils/docker.js +60 -0
  217. package/dist/utils/helm.js +128 -0
  218. package/dist/utils/lambda/aws-lambda.js +165 -0
  219. package/dist/utils/lambda/lambda.js +14 -0
  220. package/dist/utils/lambda/oci.js +17 -0
  221. package/dist/utils/lambda/publish.js +31 -0
  222. package/dist/utils/lambda/spacelift.js +53 -0
  223. package/package.json +14 -15
  224. package/src/executors/publisher/docker.d.ts +0 -3
  225. package/src/executors/publisher/docker.js +0 -66
  226. package/src/executors/publisher/docker.js.map +0 -1
  227. package/src/executors/publisher/executor.js +0 -18
  228. package/src/executors/publisher/executor.js.map +0 -1
  229. package/src/executors/publisher/helm.d.ts +0 -3
  230. package/src/executors/publisher/helm.js +0 -69
  231. package/src/executors/publisher/helm.js.map +0 -1
  232. package/src/executors/release/executor.d.ts +0 -4
  233. package/src/executors/release/executor.js +0 -95
  234. package/src/executors/release/executor.js.map +0 -1
  235. package/src/generators/init/files/.circleci/config.yml.template +0 -222
  236. package/src/generators/init/files/.circleci/teleport/shared-charts.conf.template +0 -24
  237. package/src/generators/init/files/.npmrc.template +0 -1
  238. package/src/generators/init/init.d.ts +0 -13
  239. package/src/generators/init/init.js +0 -292
  240. package/src/generators/init/init.js.map +0 -1
  241. package/src/index.d.ts +0 -9
  242. package/src/index.js +0 -75
  243. package/src/index.js.map +0 -1
  244. package/src/scripts/version-actions.d.ts +0 -7
  245. package/src/scripts/version-actions.js +0 -42
  246. package/src/scripts/version-actions.js.map +0 -1
  247. package/src/scripts/version-actions.mock.d.ts +0 -6
  248. package/src/scripts/version-actions.mock.js +0 -61
  249. package/src/scripts/version-actions.mock.js.map +0 -1
  250. package/src/utils/aws-auth.d.ts +0 -46
  251. package/src/utils/aws-auth.js +0 -144
  252. package/src/utils/aws-auth.js.map +0 -1
  253. package/src/utils/circleci.d.ts +0 -2
  254. package/src/utils/circleci.js +0 -20
  255. package/src/utils/circleci.js.map +0 -1
  256. package/src/utils/datadog.d.ts +0 -1
  257. package/src/utils/datadog.js +0 -33
  258. package/src/utils/datadog.js.map +0 -1
  259. package/src/utils/docker.d.ts +0 -15
  260. package/src/utils/docker.js +0 -73
  261. package/src/utils/docker.js.map +0 -1
  262. package/src/utils/exec.d.ts +0 -4
  263. package/src/utils/exec.js +0 -50
  264. package/src/utils/exec.js.map +0 -1
  265. package/src/utils/github.d.ts +0 -16
  266. package/src/utils/github.js +0 -53
  267. package/src/utils/github.js.map +0 -1
  268. package/src/utils/helm.d.ts +0 -64
  269. package/src/utils/helm.js +0 -159
  270. package/src/utils/helm.js.map +0 -1
  271. package/src/utils/helm.mock.d.ts +0 -85
  272. package/src/utils/helm.mock.js +0 -100
  273. package/src/utils/helm.mock.js.map +0 -1
  274. package/src/utils/import-esm.d.ts +0 -2
  275. package/src/utils/import-esm.js +0 -12
  276. package/src/utils/import-esm.js.map +0 -1
  277. package/src/utils/logger.d.ts +0 -1
  278. package/src/utils/logger.js +0 -8
  279. package/src/utils/logger.js.map +0 -1
  280. package/src/utils/nx.d.ts +0 -8
  281. package/src/utils/nx.js +0 -95
  282. package/src/utils/nx.js.map +0 -1
  283. package/src/utils/tsh.d.ts +0 -11
  284. package/src/utils/tsh.js +0 -112
  285. package/src/utils/tsh.js.map +0 -1
  286. /package/{src → dist}/executors/release/schema.json +0 -0
  287. /package/{src → dist}/generators/init/schema.json +0 -0
package/README.md ADDED
@@ -0,0 +1,201 @@
1
+ # @payfit/nx-core
2
+
3
+ A Nx plugin that simplifies Docker image and Helm chart packaging and releases using Nx's versionActions feature.
4
+
5
+ ## Features
6
+
7
+ - Automated Docker image building and publishing
8
+ - Helm chart packaging and versioning
9
+ - AWS Lambda function packaging and deployment
10
+ - Transparent version management through Nx's versionActions
11
+ - Seamless integration with your Nx workspace
12
+ - Auto setup using init generator to update your repository at plugin installation
13
+
14
+ ## Prerequisites
15
+
16
+ To make sure we are able to cache packages correctly, monorepo should be using yarn v4
17
+
18
+ ## Installation
19
+
20
+ ```shell
21
+ npx nx add @payfit/nx-core
22
+ ```
23
+
24
+ This command will:
25
+
26
+ - Install the package as a dev dependency
27
+ - Run the [init generator](./src/generators/init) to set up the necessary configuration
28
+ - Update your workspace configuration automatically
29
+
30
+ ### Init generator
31
+
32
+ Using the above command will setup your repo with the default recommended configuration. You are free to edit this configuration to your needs.
33
+
34
+ In the `nx.json` file:
35
+
36
+ ```
37
+ "release": {
38
+ "projectsRelationship": "independent",
39
+ "projects": ["*"],
40
+ "releaseTagPattern": "{projectName}-{version}",
41
+ "changelog": {
42
+ "projectChangelogs": {
43
+ "createRelease": "github",
44
+ "file": false,
45
+ "git": {
46
+ "commit": false,
47
+ "tag": true
48
+ }
49
+ },
50
+ "automaticFromRef": true
51
+ },
52
+ "version": {
53
+ "useLegacyVersioning": false,
54
+ "currentVersionResolver": "git-tag",
55
+ "fallbackCurrentVersionResolver": "disk",
56
+ "specifierSource": "conventional-commits",
57
+ "manifestRootsToUpdate": ["{workspaceRoot}/dist/{projectRoot}"],
58
+ "preserveLocalDependencyProtocols": false
59
+ }
60
+ },
61
+ "plugins": ["@payfit/nx-core"]
62
+ "targetDefaults": [
63
+ "nx-release-publish": {
64
+ "options": {
65
+ "packageRoot": "{workspaceRoot}/dist/{projectRoot}",
66
+ }
67
+ }
68
+ ]
69
+ ```
70
+
71
+ It will also generate the CircleCI config file & Teleport file needed.
72
+
73
+ ## Usage
74
+
75
+ ### Docker Image Release
76
+
77
+ The plugin automatically handles:
78
+
79
+ - Building Docker images
80
+ - Tagging with appropriate versions
81
+ - Publishing to your container registry
82
+
83
+ ### Helm Chart Release
84
+
85
+ The plugin manages:
86
+
87
+ - Chart version updates
88
+ - Chart packaging
89
+ - Chart publishing
90
+ - Automatic image tag patching in values.yaml files
91
+
92
+ #### Image Tag Patching Behavior
93
+
94
+ When releasing a new version, the plugin automatically updates Docker image tags in your Helm chart's `values.yaml` file. The patching behavior handles three scenarios:
95
+
96
+ 1. **Dependencies Only**: If your `values.yaml` contains service entries that match the dependencies in your `Chart.yaml`, the plugin will update the image tags for these services.
97
+
98
+ 2. **Global Tag Only**: If your `values.yaml` contains a global image tag (at `image.tag`), the plugin will update this tag with the new version.
99
+
100
+ 3. **Both Dependencies and Global Tag**: If both dependency-specific tags and a global tag are present, the plugin will update all of them to maintain consistency.
101
+
102
+ This ensures that all relevant image tags are updated to the new version during the release process, regardless of your Helm chart's structure.
103
+
104
+ ### Lambda Function Release
105
+
106
+ The plugin automates the process of packaging and deploying AWS Lambda functions:
107
+
108
+ - Creating a zip archive from your Lambda function code
109
+ - Uploading the archive to an S3 bucket
110
+ - Creating an empty OCI artifact and pushing it to ECR for versioning
111
+
112
+ #### Lambda Configuration Parameters
113
+
114
+ When using Lambda functions, you can configure the following parameters in your project's `project.json` file:
115
+
116
+ ```json
117
+ {
118
+ "metadata": {
119
+ "lambdaRegistry": "your-lambda-registry",
120
+ "lambdaBucket": "your-lambda-bucket"
121
+ }
122
+ }
123
+ ```
124
+
125
+ These fields are used to:
126
+
127
+ - `lambdaRegistry`: the ECR repository name for Lambda function artifacts (this is used to create an empty OCI artifact for versioning)
128
+ - `lambdaBucket`: the S3 bucket where Lambda function zip archives are stored
129
+
130
+ If `lambdaBucket` is not specified, the plugin will fall back to the default bucket: `payfit-shared-lambda-artifacts`.
131
+
132
+ #### Lambda Detection
133
+
134
+ The plugin automatically detects Lambda functions by looking for a `lambdaRegistry` metadata in your project root. When this metadata is present, the plugin will configure the necessary targets for packaging and deploying your Lambda function.
135
+
136
+ ## Configuration
137
+
138
+ The plugin uses Nx's versionActions to handle versioning transparently. The init generator will set up the required configuration automatically.
139
+
140
+ You'll need to add the following metadata to your project's `project.json` file:
141
+
142
+ ```json
143
+ {
144
+ "metadata": {
145
+ "ecrRegistry": "your-app-name",
146
+ "chartRegistry": "your-chart-registry",
147
+ "ociEcrRegistry": "your-app-name",
148
+ "helmChartFolder": "your-helm-folder",
149
+ "lambdaRegistry": "your-lambda-registry",
150
+ "lambdaBucket": "your-lambda-bucket"
151
+ }
152
+ }
153
+ ```
154
+
155
+ These fields are used to:
156
+
157
+ - `ecrRegistry`: the ECR repository name for Docker images
158
+ - `chartRegistry`: the Helm chart registry
159
+ - `ociEcrRegistry`: the OCI registry for container images
160
+ - `helmChartFolder`: the folder containing Helm chart files (Chart.yaml, values.yaml, etc.), defaults to `.deploy`
161
+ - `lambdaRegistry`: the ECR repository name for Lambda function artifacts
162
+ - `lambdaBucket`: the S3 bucket where Lambda function zip archives are stored (defaults to `payfit-shared-lambda-artifacts`)
163
+
164
+ ## Automatic Release Target Inference
165
+
166
+ The plugin automatically infers release targets for your projects based on the presence of deployment files:
167
+
168
+ 1. **Docker Image Release**: If a `Dockerfile` exists in your project root, the plugin will automatically:
169
+ - Configure Docker image building and publishing
170
+ - Set up version management for the image
171
+ - Handle ECR repository integration
172
+
173
+ 2. **Helm Chart Release**: If a `Chart.yaml` exists in your Helm chart folder (defaults to `.deploy/Chart.yaml`), the plugin will automatically:
174
+ - Configure Helm chart packaging and versioning
175
+ - Set up chart publishing to your registry
176
+ - Handle chart dependencies and updates
177
+
178
+ 3. **Lambda Function Release**: If a `.lambda` file exists in your project root, the plugin will automatically:
179
+ - Configure Lambda function packaging (zip archive creation)
180
+ - Set up S3 bucket uploading for the Lambda artifact
181
+ - Create and push an empty OCI artifact to ECR for versioning
182
+
183
+ The inference of the `nx-release-publish` target is handled through Nx's plugin system, which automatically adds the necessary targets and version actions to your project configuration. You don't need to manually configure these targets.
184
+
185
+ ---
186
+
187
+ # Debug locally
188
+
189
+ 1. Build everything:
190
+
191
+ ```bash
192
+ npx nx run-many -t build
193
+ ```
194
+
195
+ 2. Trigger a new release using the local plugin version:
196
+
197
+ ```bash
198
+ npx nx run @payfit/nx-common-packages:release --dry-run=true
199
+ ```
200
+
201
+ Make sure you pushed a change to your branch to actually trigger a release, otherwise it will say something like `No project to publish`
@@ -0,0 +1,39 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
+ key = keys[i];
14
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
25
+
26
+ //#endregion
27
+
28
+ Object.defineProperty(exports, '__commonJS', {
29
+ enumerable: true,
30
+ get: function () {
31
+ return __commonJS;
32
+ }
33
+ });
34
+ Object.defineProperty(exports, '__toESM', {
35
+ enumerable: true,
36
+ get: function () {
37
+ return __toESM;
38
+ }
39
+ });
@@ -0,0 +1,54 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
2
+ const require__home_circleci_project_packages_nx_core_src_utils_common_logger = require('../../utils/common/logger.js');
3
+ const require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth = require('../../utils/common/aws-auth.js');
4
+ const require__home_circleci_project_packages_nx_core_src_utils_common_github = require('../../utils/common/github.js');
5
+ const require__home_circleci_project_packages_nx_core_src_utils_datadog = require('../../utils/datadog.js');
6
+ const require__home_circleci_project_packages_nx_core_src_utils_docker = require('../../utils/docker.js');
7
+ const node_fs = require_rolldown_runtime.__toESM(require("node:fs"));
8
+
9
+ //#region src/executors/publisher/docker.ts
10
+ async function publishDocker(options, context, version, projectRoot, isDryRun) {
11
+ const projectDockerfile = `${projectRoot}/Dockerfile`;
12
+ if (!node_fs.existsSync(projectDockerfile)) {
13
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.warn(`Dockerfile not found at ${projectDockerfile}, skipping`);
14
+ return;
15
+ }
16
+ if (!options.ecrRegistry) {
17
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.error("Dockerfile detected but No ECR registry provided, add \"ecrRegistry\" to your project.json metadata");
18
+ return;
19
+ }
20
+ const registry = {
21
+ url: options.isPublicRegistry ? "public.ecr.aws/payfit" : process.env.AWS_ECR_REGISTRY,
22
+ name: options.isPublicRegistry ? "public.ecr.aws" : process.env.AWS_ECR_REGISTRY
23
+ };
24
+ if (isDryRun) {
25
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.box(`Would have published docker image located at ${projectDockerfile} to registry ${options.ecrRegistry} with version ${version} but --dry-run is enabled`);
26
+ return;
27
+ }
28
+ await require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth.checkAwsAuth();
29
+ await require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth.loginToEcr(registry.name, options.isPublicRegistry);
30
+ const hasValidCredentials = await require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth.verifyEcrCredentials(registry.name);
31
+ if (!hasValidCredentials) {
32
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.warn("ECR credentials verification failed. Attempting to login again...");
33
+ await require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth.loginToEcr(registry.name, options.isPublicRegistry);
34
+ const retryCredentials = await require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth.verifyEcrCredentials(registry.name);
35
+ if (!retryCredentials) throw new Error("No valid ECR credentials available for pushing Docker image");
36
+ }
37
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.box(`Publishing docker image to ${registry.url}/${options.ecrRegistry} with version ${version}`);
38
+ const extraTags = !version.includes("ephemeral") && options.extraReleaseTags ? options.extraReleaseTags : [];
39
+ const sanitizedRepoUrl = await require__home_circleci_project_packages_nx_core_src_utils_common_github.getSanitizedCurrentGitRepoUrl();
40
+ const commitSha = await require__home_circleci_project_packages_nx_core_src_utils_common_github.getCurrentGitCommitSha();
41
+ const appName = context.projectName || "unknown-app";
42
+ try {
43
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.start("Building and pushing docker image");
44
+ await require__home_circleci_project_packages_nx_core_src_utils_docker.buildAndPushDockerImage(options.ecrRegistry, projectDockerfile, version, sanitizedRepoUrl, commitSha, registry.url, extraTags, appName);
45
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success("Docker image built and pushed successfully!");
46
+ if (!version.includes("ephemeral")) await require__home_circleci_project_packages_nx_core_src_utils_datadog.correlateDeploymentImage(`${registry.url}/${options.ecrRegistry}:${version}`, sanitizedRepoUrl, commitSha);
47
+ } catch (error) {
48
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.error("Failed to build and push Docker image:", error);
49
+ throw error;
50
+ }
51
+ }
52
+
53
+ //#endregion
54
+ exports.publishDocker = publishDocker;
@@ -1,4 +1,7 @@
1
- import { ExecutorContext } from '@nx/devkit';
2
- import { PublisherExecutorOptions, PublisherExecutorSchema } from './schema';
1
+ import { PublisherExecutorOptions, PublisherExecutorSchema } from "./schema.js";
2
+ import { ExecutorContext } from "@nx/devkit";
3
+
4
+ //#region src/executors/publisher/executor.d.ts
3
5
  declare const runExecutor: (options: PublisherExecutorOptions, context: ExecutorContext) => Promise<PublisherExecutorSchema>;
4
- export default runExecutor;
6
+ //#endregion
7
+ export { runExecutor as default };
@@ -0,0 +1,20 @@
1
+ const require__home_circleci_project_packages_nx_core_src_utils_common_nx = require('../../utils/common/nx.js');
2
+ const require__home_circleci_project_packages_nx_core_src_executors_publisher_docker = require('./docker.js');
3
+ const require__home_circleci_project_packages_nx_core_src_executors_publisher_helm = require('./helm.js');
4
+ const require__home_circleci_project_packages_nx_core_src_executors_publisher_lambda = require('./lambda.js');
5
+
6
+ //#region src/executors/publisher/executor.ts
7
+ const runExecutor = async (options, context) => {
8
+ const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
9
+ const projectRoot = context.projectGraph.nodes[context.projectName].data.root;
10
+ const projectDist = await require__home_circleci_project_packages_nx_core_src_utils_common_nx.getDistForApp(context);
11
+ const version = require__home_circleci_project_packages_nx_core_src_utils_common_nx.getVersion(context);
12
+ await require__home_circleci_project_packages_nx_core_src_executors_publisher_docker.publishDocker(options, context, version, projectRoot, isDryRun);
13
+ await require__home_circleci_project_packages_nx_core_src_executors_publisher_helm.publishHelm(options, context, version, projectRoot, projectDist, isDryRun);
14
+ await require__home_circleci_project_packages_nx_core_src_executors_publisher_lambda.publishLambda(options, context, version, projectRoot, projectDist, isDryRun);
15
+ return { success: true };
16
+ };
17
+ var executor_default = runExecutor;
18
+
19
+ //#endregion
20
+ module.exports = executor_default;
@@ -0,0 +1,62 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
2
+ const require__home_circleci_project_packages_nx_core_src_utils_common_logger = require('../../utils/common/logger.js');
3
+ const require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth = require('../../utils/common/aws-auth.js');
4
+ const require__home_circleci_project_packages_nx_core_src_utils_common_github = require('../../utils/common/github.js');
5
+ const require__home_circleci_project_packages_nx_core_src_utils_common_tsh = require('../../utils/common/tsh.js');
6
+ const require__home_circleci_project_packages_nx_core_src_utils_helm = require('../../utils/helm.js');
7
+ const require__home_circleci_project_node_modules__oxc_project_runtime_src_helpers_usingCtx = require('../../node_modules/@oxc-project/runtime/src/helpers/usingCtx.js');
8
+ const node_fs = require_rolldown_runtime.__toESM(require("node:fs"));
9
+
10
+ //#region src/executors/publisher/helm.ts
11
+ var import_usingCtx = require_rolldown_runtime.__toESM(require__home_circleci_project_node_modules__oxc_project_runtime_src_helpers_usingCtx.require_usingCtx());
12
+ async function publishHelm(options, context, version, projectRoot, projectDist, isDryRun) {
13
+ try {
14
+ var _usingCtx = (0, import_usingCtx.default)();
15
+ const helmChartFolder = options.helmChartFolder || ".deploy";
16
+ const projectHelmFolder = `${projectRoot}/${helmChartFolder}`;
17
+ const valuesConfigPath = `${projectHelmFolder}/values.yaml`;
18
+ const chartConfigPath = `${projectHelmFolder}/Chart.yaml`;
19
+ const destinationHelmFolder = `${projectDist}/chart/`;
20
+ const gitBranchName = await require__home_circleci_project_packages_nx_core_src_utils_common_github.getSanitizedCurrentGitBranch();
21
+ if (!gitBranchName) throw new Error("Unable to get current Git branch");
22
+ if (!node_fs.existsSync(chartConfigPath)) {
23
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.warn(`No helm chart found in project ${context.projectName}, searching ${chartConfigPath}, skipping`);
24
+ return;
25
+ }
26
+ if (!options.chartRegistry) {
27
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.error("Helm chart detected but no chart registry provided, add \"chartRegistry\" to your project.json metadata");
28
+ return;
29
+ }
30
+ if (isDryRun) {
31
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.box(`Would have published Helm chart located at ${projectHelmFolder} to ${options.ociEcrRegistry ? options.ociEcrRegistry : options.chartRegistry}/${gitBranchName} with version ${version} but --dry-run is enabled`);
32
+ return;
33
+ }
34
+ await require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth.checkAwsAuth();
35
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.box(`Publishing Helm chart to ${options.chartRegistry}/${gitBranchName} with version ${version}`);
36
+ const proxyData = _usingCtx.u(await require__home_circleci_project_packages_nx_core_src_utils_common_tsh.getLocalPortForChartMuseum());
37
+ await proxyData.isReady();
38
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.start("Building Helm chart");
39
+ await require__home_circleci_project_packages_nx_core_src_utils_helm.setupTeleportProxyHelmChartFile(projectHelmFolder, proxyData.port);
40
+ await require__home_circleci_project_packages_nx_core_src_utils_helm.installHelmRepo(projectHelmFolder);
41
+ await require__home_circleci_project_packages_nx_core_src_utils_helm.patchImageTag(valuesConfigPath, chartConfigPath, version);
42
+ await require__home_circleci_project_packages_nx_core_src_utils_helm.packageHelm(projectHelmFolder, version, destinationHelmFolder);
43
+ await require__home_circleci_project_packages_nx_core_src_utils_helm.resetTeleportProxyHelmChartFile(projectHelmFolder, proxyData.port);
44
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success("Helm chart packaged!");
45
+ const chartConfig = await require__home_circleci_project_packages_nx_core_src_utils_helm.getHelmChartFile(projectHelmFolder);
46
+ const packagedHelmChartName = `${chartConfig.name}-${version}.tgz`;
47
+ const packagedHelmChartPath = `${destinationHelmFolder}${packagedHelmChartName}`;
48
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.start("Publishing Helm chart");
49
+ if (options.ociEcrRegistry) {
50
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.log(`Publishing Helm chart to OCI registry ${options.ociEcrRegistry}`);
51
+ await require__home_circleci_project_packages_nx_core_src_utils_helm.pushOciPackagedHelm(packagedHelmChartPath, options.ociEcrRegistry);
52
+ } else await require__home_circleci_project_packages_nx_core_src_utils_helm.pushPackagedHelm(packagedHelmChartPath, packagedHelmChartName, options.chartRegistry, gitBranchName);
53
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success("Helm chart published successfully!");
54
+ } catch (_) {
55
+ _usingCtx.e = _;
56
+ } finally {
57
+ _usingCtx.d();
58
+ }
59
+ }
60
+
61
+ //#endregion
62
+ exports.publishHelm = publishHelm;
@@ -0,0 +1,55 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
2
+ const require__home_circleci_project_packages_nx_core_src_utils_common_logger = require('../../utils/common/logger.js');
3
+ const require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth = require('../../utils/common/aws-auth.js');
4
+ const require__home_circleci_project_packages_nx_core_src_utils_common_github = require('../../utils/common/github.js');
5
+ const require__home_circleci_project_packages_nx_core_src_utils_common_s3 = require('../../utils/common/s3.js');
6
+ const require__home_circleci_project_packages_nx_core_src_utils_lambda_lambda = require('../../utils/lambda/lambda.js');
7
+ const require__home_circleci_project_packages_nx_core_src_utils_lambda_oci = require('../../utils/lambda/oci.js');
8
+ const require__home_circleci_project_packages_nx_core_src_utils_lambda_publish = require('../../utils/lambda/publish.js');
9
+ const path = require_rolldown_runtime.__toESM(require("path"));
10
+
11
+ //#region src/executors/publisher/lambda.ts
12
+ async function publishLambda(options, context, version, projectRoot, projectDist, isDryRun) {
13
+ const gitBranchName = await require__home_circleci_project_packages_nx_core_src_utils_common_github.getSanitizedCurrentGitBranch();
14
+ const repoUrl = await require__home_circleci_project_packages_nx_core_src_utils_common_github.getSanitizedCurrentGitRepoUrl();
15
+ const repoName = repoUrl.split("/").pop() ?? "unknown-repo";
16
+ const sanitizedProjectName = context.projectName.replace(/^@payfit\//, "").replace(/[^a-zA-Z0-9-_]/g, "-");
17
+ const zipName = `${version}.zip`;
18
+ const zipFileNameS3 = `${options.lambdaBucket}/${repoName}/${sanitizedProjectName}/${zipName}`;
19
+ if (!gitBranchName) throw new Error("Unable to get current Git branch");
20
+ if (!options.lambdaRegistry) {
21
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.warn("No lambda registry provided, add \"lambdaRegistry\" to your project.json metadata if this app is a lambda function, otherwise ignore this warning. skipping.");
22
+ return;
23
+ }
24
+ if (!options.lambdaStacks) {
25
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.error("No lambda spacelift stacks provided, add \"lambdaStacks\" to your project.json metadata");
26
+ return;
27
+ }
28
+ if (!options.lambdaFunctions) {
29
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.error("No lambda functions provided, add \"lambdaFunctions\" to your project.json metadata");
30
+ return;
31
+ }
32
+ if (isDryRun) {
33
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.box(`Would have published lambda artefact to S3 ${zipFileNameS3} and ECR ${process.env.AWS_ECR_REGISTRY}/${options.lambdaRegistry}:${version} but --dry-run is enabled`);
34
+ return;
35
+ }
36
+ await require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth.checkAwsAuth();
37
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.box(`Publishing the lambda artefact ${zipFileNameS3}`);
38
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.info(`Zipping ${zipName} from ${projectDist}`);
39
+ await require__home_circleci_project_packages_nx_core_src_utils_lambda_lambda.createZip(projectDist, zipName);
40
+ const zipPath = (0, path.join)(projectDist, zipName);
41
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.info(`Uploading ${zipPath} to S3 at ${zipFileNameS3}`);
42
+ await require__home_circleci_project_packages_nx_core_src_utils_common_s3.pushToS3(zipPath, zipFileNameS3);
43
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success(`Lambda artefact successfully pushed to S3 at ${zipFileNameS3}`);
44
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.box(`Creating new Lambda version and running smoke tests`);
45
+ await require__home_circleci_project_packages_nx_core_src_utils_lambda_publish.createLambdaVersion(options.lambdaStacks, options.lambdaFunctions, version);
46
+ const packageJsonPath = (0, path.join)(projectDist, "package.json");
47
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.info(`Pushing empty image to ECR ${process.env.AWS_ECR_REGISTRY}/${options.lambdaRegistry}:${version}`);
48
+ await require__home_circleci_project_packages_nx_core_src_utils_common_aws_auth.loginToEcr(process.env.AWS_ECR_REGISTRY);
49
+ await require__home_circleci_project_packages_nx_core_src_utils_lambda_oci.pushImageToEcr(options.lambdaRegistry, version, packageJsonPath);
50
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success("Lambda artifact successfully pushed to S3!");
51
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success(`Lambda version ${version} successfully created and smoke tests passed, you're lambda is ready to be promoted in Kargo !`);
52
+ }
53
+
54
+ //#endregion
55
+ exports.publishLambda = publishLambda;
@@ -0,0 +1,17 @@
1
+ //#region src/executors/publisher/schema.d.ts
2
+ interface PublisherExecutorSchema {} // eslint-disable-line
3
+ interface PublisherExecutorOptions {
4
+ chartRegistry: string;
5
+ ecrRegistry: string;
6
+ ociEcrRegistry?: string;
7
+ isPublicRegistry?: boolean;
8
+ helmChartFolder?: string;
9
+ extraReleaseTags?: string[];
10
+ dryRun?: boolean;
11
+ lambdaBucket?: string;
12
+ lambdaRegistry?: string;
13
+ lambdaStacks?: string[];
14
+ lambdaFunctions?: string[];
15
+ }
16
+ //#endregion
17
+ export { PublisherExecutorOptions, PublisherExecutorSchema };
@@ -39,6 +39,23 @@
39
39
  "type": "boolean",
40
40
  "description": "Whether to run in dry run mode. When true, shows what would be published without actually publishing.",
41
41
  "default": false
42
+ },
43
+ "lambdaBucket": {
44
+ "type": "string",
45
+ "description": "The S3 bucket for lambda",
46
+ "default": "payfit-shared-lambda-artifacts"
47
+ },
48
+ "lambdaRegistry": {
49
+ "type": "string",
50
+ "description": "The OCI registry for lambda"
51
+ },
52
+ "lambdaStacks": {
53
+ "type": "array",
54
+ "description": "The list of stacks to publish the lambda to"
55
+ },
56
+ "lambdaFunctions": {
57
+ "type": "array",
58
+ "description": "The list of lambda functions inside the workload"
42
59
  }
43
60
  },
44
61
  "required": []
@@ -0,0 +1,7 @@
1
+ import { ReleaseExecutorOptions, ReleaseExecutorSchema } from "./schema.js";
2
+ import { ExecutorContext } from "@nx/devkit";
3
+
4
+ //#region src/executors/release/executor.d.ts
5
+ declare const runExecutor: (options: ReleaseExecutorOptions, context: ExecutorContext) => Promise<ReleaseExecutorSchema>;
6
+ //#endregion
7
+ export { runExecutor as default };
@@ -0,0 +1,77 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
2
+ const require__home_circleci_project_packages_nx_core_src_utils_common_logger = require('../../utils/common/logger.js');
3
+ const require__home_circleci_project_packages_nx_core_src_utils_common_github = require('../../utils/common/github.js');
4
+ const require__home_circleci_project_packages_nx_core_src_utils_common_tsh = require('../../utils/common/tsh.js');
5
+ const require__home_circleci_project_packages_nx_core_src_utils_common_circleci = require('../../utils/common/circleci.js');
6
+ const nx_release = require_rolldown_runtime.__toESM(require("nx/release"));
7
+
8
+ //#region src/executors/release/executor.ts
9
+ const runExecutor = async (options, context) => {
10
+ const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
11
+ if (require__home_circleci_project_packages_nx_core_src_utils_common_circleci.isCircleCIRunner()) {
12
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.start("CircleCI runner detected, setting it up!");
13
+ await require__home_circleci_project_packages_nx_core_src_utils_common_circleci.setupCircleCIRunner();
14
+ await require__home_circleci_project_packages_nx_core_src_utils_common_tsh.startTbot();
15
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success("CircleCI runner setup successfully!");
16
+ }
17
+ const branchName = await require__home_circleci_project_packages_nx_core_src_utils_common_github.getSanitizedCurrentGitBranch();
18
+ const commit = await require__home_circleci_project_packages_nx_core_src_utils_common_github.getCurrentGitCommitSha();
19
+ const isPreRelease = options?.preRelease != null ? options.preRelease : branchName != "main" && branchName != "master";
20
+ if (isPreRelease) require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.warn("This is an ephemeral release");
21
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.start("Calculating new versions");
22
+ const { projectsVersionData } = await (0, nx_release.releaseVersion)({
23
+ dryRun: isDryRun,
24
+ verbose: options.verbose,
25
+ groups: options.groups && options.groups.length > 0 ? options.groups : void 0,
26
+ specifier: options.specifier,
27
+ preid: isPreRelease ? `ephemeral-${branchName.substring(0, 100)}-${commit.substring(0, 7)}` : void 0
28
+ });
29
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success("New versions calculated successfully!");
30
+ const projectsToPublish = Object.entries(projectsVersionData).map(([projectName, versionData]) => {
31
+ if (versionData?.newVersion) {
32
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.info(`Project '${projectName}' will be updated to version ${versionData.newVersion}`);
33
+ return projectName;
34
+ }
35
+ return null;
36
+ }).filter(Boolean);
37
+ if (projectsToPublish.length === 0) {
38
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.warn("No project to publish");
39
+ return { success: true };
40
+ }
41
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.start("Generating & pushing changelogs");
42
+ await (0, nx_release.releaseChangelog)({
43
+ versionData: projectsVersionData,
44
+ dryRun: isDryRun,
45
+ verbose: options.verbose,
46
+ projects: projectsToPublish,
47
+ createRelease: isPreRelease ? false : "github",
48
+ groups: options.groups && options.groups.length > 0 ? options.groups : void 0
49
+ });
50
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success("Generated & pushed changelogs successfully!");
51
+ if (options.skipPublish) {
52
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.warn("Skipping publishing step as skipPublish = true");
53
+ return { success: true };
54
+ }
55
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.start("Publishing packages");
56
+ const publishResults = await (0, nx_release.releasePublish)({
57
+ projects: projectsToPublish,
58
+ dryRun: isDryRun,
59
+ verbose: options.verbose,
60
+ tag: isPreRelease ? "ephemeral" : void 0,
61
+ groups: options.groups && options.groups.length > 0 ? options.groups : void 0
62
+ });
63
+ let publishError = false;
64
+ Object.entries(publishResults).forEach(([projectName, result]) => {
65
+ if (result.code === 0) require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.success(`Published ${projectName} successfully!`);
66
+ else {
67
+ publishError = true;
68
+ require__home_circleci_project_packages_nx_core_src_utils_common_logger.consola.fail(`Failed to publish ${projectName} with exit code ${result.code}`);
69
+ }
70
+ });
71
+ if (publishError) throw new Error("We got errors when publishing, check the logs");
72
+ return { success: true };
73
+ };
74
+ var executor_default = runExecutor;
75
+
76
+ //#endregion
77
+ module.exports = executor_default;
@@ -0,0 +1,12 @@
1
+ //#region src/executors/release/schema.d.ts
2
+ interface ReleaseExecutorSchema {} // eslint-disable-line
3
+ interface ReleaseExecutorOptions {
4
+ skipPublish?: boolean;
5
+ preRelease?: boolean;
6
+ dryRun?: boolean;
7
+ verbose?: boolean;
8
+ groups?: string[];
9
+ specifier?: string;
10
+ }
11
+ //#endregion
12
+ export { ReleaseExecutorOptions, ReleaseExecutorSchema };
@@ -0,0 +1,12 @@
1
+ import { CreateNodesContextV2, CreateNodesV2 } from "@nx/devkit";
2
+
3
+ //#region src/index.d.ts
4
+ interface MyPluginOptions {}
5
+ declare const createNodesV2: CreateNodesV2<MyPluginOptions>;
6
+ declare function createNodesInternal(configFilePath: string, options: MyPluginOptions, context: CreateNodesContextV2): Promise<{
7
+ projects: {
8
+ [x: string]: any;
9
+ };
10
+ }>;
11
+ //#endregion
12
+ export { MyPluginOptions, createNodesInternal, createNodesV2 };