@nizza/devkit 0.1.0-alpha.0 → 0.1.0-alpha.10

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 (259) hide show
  1. package/README.md +2 -6
  2. package/dist/cjs/executors/deploy/helpers.cjs +26 -0
  3. package/dist/cjs/executors/deploy/helpers.d.cts +4 -0
  4. package/dist/cjs/executors/deploy/index.cjs +22 -0
  5. package/dist/cjs/executors/deploy/index.d.cts +11 -0
  6. package/dist/cjs/executors/environments/helpers.cjs +62 -0
  7. package/dist/{src/executors/environments/helpers.d.ts → cjs/executors/environments/helpers.d.cts} +9 -5
  8. package/dist/cjs/executors/environments/index.cjs +60 -0
  9. package/dist/{src/executors/environments/executor.d.ts → cjs/executors/environments/index.d.cts} +5 -5
  10. package/dist/cjs/executors/publish/helpers.cjs +51 -0
  11. package/dist/{src/executors/publish/helpers.d.ts → cjs/executors/publish/helpers.d.cts} +3 -3
  12. package/dist/cjs/executors/publish/index.cjs +53 -0
  13. package/dist/cjs/executors/publish/index.d.cts +12 -0
  14. package/dist/cjs/executors/shared/utils.cjs +67 -0
  15. package/dist/cjs/executors/shared/utils.d.cts +27 -0
  16. package/dist/cjs/executors/update-executors-file/helpers.cjs +64 -0
  17. package/dist/cjs/executors/update-executors-file/helpers.d.cts +17 -0
  18. package/dist/cjs/executors/update-executors-file/index.cjs +38 -0
  19. package/dist/{src/executors/update-executors-file/executor.d.ts → cjs/executors/update-executors-file/index.d.cts} +5 -5
  20. package/dist/cjs/executors/vtex-link/constants.cjs +9 -0
  21. package/dist/cjs/executors/vtex-link/constants.d.cts +4 -0
  22. package/dist/cjs/executors/vtex-link/helpers.cjs +206 -0
  23. package/dist/{src/executors/vtex-link/helpers.d.ts → cjs/executors/vtex-link/helpers.d.cts} +15 -15
  24. package/dist/cjs/executors/vtex-link/index.cjs +30 -0
  25. package/dist/cjs/executors/vtex-link/index.d.cts +5 -0
  26. package/dist/cjs/index-0ce2daf7.d.ts +2 -0
  27. package/dist/cjs/index-17143e35.d.ts +2 -0
  28. package/dist/cjs/index-3080371d.d.ts +3 -0
  29. package/dist/cjs/index-f6330edc.d.ts +2 -0
  30. package/dist/cjs/index.cjs +71 -0
  31. package/dist/cjs/index.d.cts +10 -0
  32. package/dist/cjs/index.d.cts.map +1 -0
  33. package/dist/cjs/scripts/changeset-pre-mode.cjs +41 -0
  34. package/dist/cjs/scripts/changeset-pre-mode.d.cts +2 -0
  35. package/dist/cjs/scripts/index.cjs +7 -0
  36. package/dist/cjs/scripts/index.d.cts +1 -0
  37. package/dist/cjs/shared/logger.cjs +98 -0
  38. package/dist/{src/logger.d.ts → cjs/shared/logger.d.cts} +5 -6
  39. package/dist/cjs/shared/utils.cjs +64 -0
  40. package/dist/cjs/shared/utils.d.cts +19 -0
  41. package/dist/{src/executors/vtex-link/types.d.ts → cjs/types-1282e639.d.ts} +3 -3
  42. package/dist/cjs/types-7377dcc9.d.ts +4 -0
  43. package/dist/cjs/types-763439e4.d.ts +14 -0
  44. package/dist/cjs/vite/config-builder/configs/app.cjs +13 -0
  45. package/dist/cjs/vite/config-builder/configs/app.d.cts +4 -0
  46. package/dist/cjs/vite/config-builder/configs/base.cjs +58 -0
  47. package/dist/cjs/vite/config-builder/configs/base.d.cts +4 -0
  48. package/dist/cjs/vite/config-builder/configs/index.cjs +36 -0
  49. package/dist/cjs/vite/config-builder/configs/index.d.cts +7 -0
  50. package/dist/cjs/vite/config-builder/configs/lib.cjs +57 -0
  51. package/dist/cjs/vite/config-builder/configs/lib.d.cts +4 -0
  52. package/dist/cjs/vite/config-builder/configs/script.cjs +46 -0
  53. package/dist/cjs/vite/config-builder/configs/script.d.cts +4 -0
  54. package/dist/cjs/vite/config-builder/main.cjs +42 -0
  55. package/dist/cjs/vite/config-builder/main.d.cts +10 -0
  56. package/dist/cjs/vite/config-builder/plugins.cjs +93 -0
  57. package/dist/{src/vite/config-builder/plugins.d.ts → cjs/vite/config-builder/plugins.d.cts} +7 -7
  58. package/dist/cjs/vite/config-builder/shared/types.cjs +33 -0
  59. package/dist/{src/vite/config-builder/shared/types.d.ts → cjs/vite/config-builder/shared/types.d.cts} +17 -17
  60. package/dist/cjs/vite/config-builder/shared/utils/helpers.cjs +115 -0
  61. package/dist/{src/vite/config-builder/shared/utils/helpers.d.ts → cjs/vite/config-builder/shared/utils/helpers.d.cts} +9 -19
  62. package/dist/cjs/vite/config-builder/shared/utils/projectConfig.cjs +114 -0
  63. package/dist/{src/vite/config-builder/shared/utils/projectConfig.d.ts → cjs/vite/config-builder/shared/utils/projectConfig.d.cts} +8 -8
  64. package/dist/cjs/vite/config-builder/shared/utils/viteCommand.cjs +59 -0
  65. package/dist/{src/vite/config-builder/shared/utils/viteCommand.d.ts → cjs/vite/config-builder/shared/utils/viteCommand.d.cts} +4 -4
  66. package/dist/{src/vite/plugins/shadow-dom-inject-css/index.js → cjs/vite/plugins/shadow-dom-inject-css/index.cjs} +4 -19
  67. package/dist/cjs/vite/plugins/shadow-dom-inject-css/index.d.cts +7 -0
  68. package/dist/{src/vite/plugins/third-party-css-inject/main.js → cjs/vite/plugins/third-party-css-inject/main.cjs} +13 -14
  69. package/dist/cjs/vite/plugins/third-party-css-inject/main.d.cts +17 -0
  70. package/dist/{src/vite/plugins/third-party-css-inject/utils.js → cjs/vite/plugins/third-party-css-inject/utils.cjs} +8 -20
  71. package/dist/cjs/vite/plugins/third-party-css-inject/utils.d.cts +5 -0
  72. package/dist/esm/executors/deploy/helpers.d.mts +4 -0
  73. package/dist/esm/executors/deploy/helpers.mjs +22 -0
  74. package/dist/esm/executors/deploy/index.d.mts +11 -0
  75. package/dist/esm/executors/deploy/index.mjs +20 -0
  76. package/dist/esm/executors/deploy/schema.json +41 -0
  77. package/dist/esm/executors/environments/helpers.d.mts +25 -0
  78. package/dist/esm/executors/environments/helpers.mjs +58 -0
  79. package/dist/esm/executors/environments/index.d.mts +16 -0
  80. package/dist/esm/executors/environments/index.mjs +58 -0
  81. package/dist/esm/executors/environments/schema.json +9 -0
  82. package/dist/esm/executors/publish/helpers.d.mts +19 -0
  83. package/dist/esm/executors/publish/helpers.mjs +48 -0
  84. package/dist/esm/executors/publish/index.d.mts +12 -0
  85. package/dist/esm/executors/publish/index.mjs +51 -0
  86. package/dist/esm/executors/publish/schema.json +19 -0
  87. package/dist/esm/executors/shared/utils.d.mts +27 -0
  88. package/dist/esm/executors/shared/utils.mjs +62 -0
  89. package/dist/esm/executors/update-executors-file/helpers.d.mts +17 -0
  90. package/dist/esm/executors/update-executors-file/helpers.mjs +59 -0
  91. package/dist/esm/executors/update-executors-file/index.d.mts +12 -0
  92. package/dist/esm/executors/update-executors-file/index.mjs +36 -0
  93. package/dist/esm/executors/update-executors-file/schema.json +9 -0
  94. package/dist/esm/executors/vtex-link/constants.d.mts +4 -0
  95. package/dist/esm/executors/vtex-link/constants.mjs +5 -0
  96. package/dist/esm/executors/vtex-link/helpers.d.mts +77 -0
  97. package/dist/esm/executors/vtex-link/helpers.mjs +192 -0
  98. package/dist/esm/executors/vtex-link/index.d.mts +5 -0
  99. package/dist/esm/executors/vtex-link/index.mjs +28 -0
  100. package/dist/esm/executors/vtex-link/schema.json +25 -0
  101. package/dist/esm/index-0ce2daf7.d.ts +2 -0
  102. package/dist/esm/index-17143e35.d.ts +2 -0
  103. package/dist/esm/index-3080371d.d.ts +3 -0
  104. package/dist/esm/index-f6330edc.d.ts +2 -0
  105. package/dist/esm/index.d.mts +10 -0
  106. package/dist/esm/index.d.mts.map +1 -0
  107. package/dist/esm/index.mjs +14 -0
  108. package/dist/esm/scripts/changeset-pre-mode.d.mts +2 -0
  109. package/dist/esm/scripts/changeset-pre-mode.mjs +39 -0
  110. package/dist/esm/scripts/index.d.mts +1 -0
  111. package/dist/esm/scripts/index.mjs +1 -0
  112. package/dist/esm/shared/logger.d.mts +33 -0
  113. package/dist/{src/logger.js → esm/shared/logger.mjs} +28 -39
  114. package/dist/esm/shared/utils.d.mts +19 -0
  115. package/dist/esm/shared/utils.mjs +60 -0
  116. package/dist/esm/types-1282e639.d.ts +12 -0
  117. package/dist/esm/types-7377dcc9.d.ts +4 -0
  118. package/dist/esm/types-763439e4.d.ts +14 -0
  119. package/dist/esm/vite/config-builder/configs/app.d.mts +4 -0
  120. package/dist/esm/vite/config-builder/configs/app.mjs +11 -0
  121. package/dist/esm/vite/config-builder/configs/base.d.mts +4 -0
  122. package/dist/{src/vite/config-builder/configs/base.js → esm/vite/config-builder/configs/base.mjs} +23 -22
  123. package/dist/esm/vite/config-builder/configs/index.d.mts +7 -0
  124. package/dist/esm/vite/config-builder/configs/index.mjs +30 -0
  125. package/dist/esm/vite/config-builder/configs/lib.d.mts +4 -0
  126. package/dist/{src/vite/config-builder/configs/lib.js → esm/vite/config-builder/configs/lib.mjs} +16 -18
  127. package/dist/esm/vite/config-builder/configs/script.d.mts +4 -0
  128. package/dist/esm/vite/config-builder/configs/script.mjs +44 -0
  129. package/dist/esm/vite/config-builder/main.d.mts +10 -0
  130. package/dist/esm/vite/config-builder/main.mjs +40 -0
  131. package/dist/esm/vite/config-builder/plugins.d.mts +30 -0
  132. package/dist/esm/vite/config-builder/plugins.mjs +87 -0
  133. package/dist/esm/vite/config-builder/shared/types.d.mts +155 -0
  134. package/dist/{src/vite/config-builder/shared/types.js → esm/vite/config-builder/shared/types.mjs} +2 -27
  135. package/dist/esm/vite/config-builder/shared/utils/helpers.d.mts +71 -0
  136. package/dist/esm/vite/config-builder/shared/utils/helpers.mjs +90 -0
  137. package/dist/esm/vite/config-builder/shared/utils/projectConfig.d.mts +60 -0
  138. package/dist/esm/vite/config-builder/shared/utils/projectConfig.mjs +109 -0
  139. package/dist/esm/vite/config-builder/shared/utils/viteCommand.d.mts +24 -0
  140. package/dist/esm/vite/config-builder/shared/utils/viteCommand.mjs +56 -0
  141. package/dist/esm/vite/plugins/shadow-dom-inject-css/index.d.mts +7 -0
  142. package/dist/esm/vite/plugins/shadow-dom-inject-css/index.mjs +27 -0
  143. package/dist/esm/vite/plugins/third-party-css-inject/main.d.mts +17 -0
  144. package/dist/esm/vite/plugins/third-party-css-inject/main.mjs +45 -0
  145. package/dist/esm/vite/plugins/third-party-css-inject/utils.d.mts +5 -0
  146. package/dist/esm/vite/plugins/third-party-css-inject/utils.mjs +97 -0
  147. package/dist/executors.json +29 -0
  148. package/executors.json +29 -0
  149. package/package.json +52 -6
  150. package/dist/package.json +0 -13
  151. package/dist/src/executors/deploy/executor.d.ts +0 -11
  152. package/dist/src/executors/deploy/executor.d.ts.map +0 -1
  153. package/dist/src/executors/deploy/executor.js +0 -27
  154. package/dist/src/executors/deploy/helpers.d.ts +0 -4
  155. package/dist/src/executors/deploy/helpers.d.ts.map +0 -1
  156. package/dist/src/executors/deploy/helpers.js +0 -40
  157. package/dist/src/executors/environments/executor.d.ts.map +0 -1
  158. package/dist/src/executors/environments/executor.js +0 -59
  159. package/dist/src/executors/environments/helpers.d.ts.map +0 -1
  160. package/dist/src/executors/environments/helpers.js +0 -63
  161. package/dist/src/executors/publish/executor.d.ts +0 -12
  162. package/dist/src/executors/publish/executor.d.ts.map +0 -1
  163. package/dist/src/executors/publish/executor.js +0 -57
  164. package/dist/src/executors/publish/helpers.d.ts.map +0 -1
  165. package/dist/src/executors/publish/helpers.js +0 -52
  166. package/dist/src/executors/shared/index.d.ts +0 -3
  167. package/dist/src/executors/shared/index.d.ts.map +0 -1
  168. package/dist/src/executors/shared/index.js +0 -7
  169. package/dist/src/executors/shared/types.d.ts +0 -4
  170. package/dist/src/executors/shared/types.d.ts.map +0 -1
  171. package/dist/src/executors/shared/types.js +0 -4
  172. package/dist/src/executors/shared/utils.d.ts +0 -34
  173. package/dist/src/executors/shared/utils.d.ts.map +0 -1
  174. package/dist/src/executors/shared/utils.js +0 -74
  175. package/dist/src/executors/update-executors-file/executor.d.ts.map +0 -1
  176. package/dist/src/executors/update-executors-file/executor.js +0 -46
  177. package/dist/src/executors/update-executors-file/helpers.d.ts +0 -24
  178. package/dist/src/executors/update-executors-file/helpers.d.ts.map +0 -1
  179. package/dist/src/executors/update-executors-file/helpers.js +0 -70
  180. package/dist/src/executors/update-executors-file/types.d.ts +0 -14
  181. package/dist/src/executors/update-executors-file/types.d.ts.map +0 -1
  182. package/dist/src/executors/update-executors-file/types.js +0 -4
  183. package/dist/src/executors/vtex-link/constants.d.ts +0 -4
  184. package/dist/src/executors/vtex-link/constants.d.ts.map +0 -1
  185. package/dist/src/executors/vtex-link/constants.js +0 -24
  186. package/dist/src/executors/vtex-link/executor.d.ts +0 -5
  187. package/dist/src/executors/vtex-link/executor.d.ts.map +0 -1
  188. package/dist/src/executors/vtex-link/executor.js +0 -35
  189. package/dist/src/executors/vtex-link/helpers.d.ts.map +0 -1
  190. package/dist/src/executors/vtex-link/helpers.js +0 -187
  191. package/dist/src/executors/vtex-link/types.d.ts.map +0 -1
  192. package/dist/src/executors/vtex-link/types.js +0 -4
  193. package/dist/src/index.d.ts +0 -2
  194. package/dist/src/index.d.ts.map +0 -1
  195. package/dist/src/index.js +0 -6
  196. package/dist/src/logger.d.ts.map +0 -1
  197. package/dist/src/scripts/changeset-pre-mode.d.ts +0 -2
  198. package/dist/src/scripts/changeset-pre-mode.d.ts.map +0 -1
  199. package/dist/src/scripts/changeset-pre-mode.js +0 -41
  200. package/dist/src/shared/index.d.ts +0 -2
  201. package/dist/src/shared/index.d.ts.map +0 -1
  202. package/dist/src/shared/index.js +0 -6
  203. package/dist/src/shared/utils.d.ts +0 -11
  204. package/dist/src/shared/utils.d.ts.map +0 -1
  205. package/dist/src/shared/utils.js +0 -22
  206. package/dist/src/vite/config-builder/configs/app.d.ts +0 -4
  207. package/dist/src/vite/config-builder/configs/app.d.ts.map +0 -1
  208. package/dist/src/vite/config-builder/configs/app.js +0 -19
  209. package/dist/src/vite/config-builder/configs/base.d.ts +0 -4
  210. package/dist/src/vite/config-builder/configs/base.d.ts.map +0 -1
  211. package/dist/src/vite/config-builder/configs/index.d.ts +0 -7
  212. package/dist/src/vite/config-builder/configs/index.d.ts.map +0 -1
  213. package/dist/src/vite/config-builder/configs/index.js +0 -28
  214. package/dist/src/vite/config-builder/configs/lib.d.ts +0 -4
  215. package/dist/src/vite/config-builder/configs/lib.d.ts.map +0 -1
  216. package/dist/src/vite/config-builder/configs/script.d.ts +0 -4
  217. package/dist/src/vite/config-builder/configs/script.d.ts.map +0 -1
  218. package/dist/src/vite/config-builder/configs/script.js +0 -42
  219. package/dist/src/vite/config-builder/index.d.ts +0 -3
  220. package/dist/src/vite/config-builder/index.d.ts.map +0 -1
  221. package/dist/src/vite/config-builder/index.js +0 -7
  222. package/dist/src/vite/config-builder/main.d.ts +0 -10
  223. package/dist/src/vite/config-builder/main.d.ts.map +0 -1
  224. package/dist/src/vite/config-builder/main.js +0 -37
  225. package/dist/src/vite/config-builder/plugins.d.ts.map +0 -1
  226. package/dist/src/vite/config-builder/plugins.js +0 -88
  227. package/dist/src/vite/config-builder/shared/index.d.ts +0 -3
  228. package/dist/src/vite/config-builder/shared/index.d.ts.map +0 -1
  229. package/dist/src/vite/config-builder/shared/index.js +0 -7
  230. package/dist/src/vite/config-builder/shared/types.d.ts.map +0 -1
  231. package/dist/src/vite/config-builder/shared/utils/helpers.d.ts.map +0 -1
  232. package/dist/src/vite/config-builder/shared/utils/helpers.js +0 -61
  233. package/dist/src/vite/config-builder/shared/utils/index.d.ts +0 -4
  234. package/dist/src/vite/config-builder/shared/utils/index.d.ts.map +0 -1
  235. package/dist/src/vite/config-builder/shared/utils/index.js +0 -8
  236. package/dist/src/vite/config-builder/shared/utils/projectConfig.d.ts.map +0 -1
  237. package/dist/src/vite/config-builder/shared/utils/projectConfig.js +0 -85
  238. package/dist/src/vite/config-builder/shared/utils/viteCommand.d.ts.map +0 -1
  239. package/dist/src/vite/config-builder/shared/utils/viteCommand.js +0 -54
  240. package/dist/src/vite/index.d.ts +0 -3
  241. package/dist/src/vite/index.d.ts.map +0 -1
  242. package/dist/src/vite/index.js +0 -7
  243. package/dist/src/vite/plugins/index.d.ts +0 -3
  244. package/dist/src/vite/plugins/index.d.ts.map +0 -1
  245. package/dist/src/vite/plugins/index.js +0 -7
  246. package/dist/src/vite/plugins/shadow-dom-inject-css/index.d.ts +0 -8
  247. package/dist/src/vite/plugins/shadow-dom-inject-css/index.d.ts.map +0 -1
  248. package/dist/src/vite/plugins/third-party-css-inject/index.d.ts +0 -4
  249. package/dist/src/vite/plugins/third-party-css-inject/index.d.ts.map +0 -1
  250. package/dist/src/vite/plugins/third-party-css-inject/index.js +0 -13
  251. package/dist/src/vite/plugins/third-party-css-inject/main.d.ts +0 -17
  252. package/dist/src/vite/plugins/third-party-css-inject/main.d.ts.map +0 -1
  253. package/dist/src/vite/plugins/third-party-css-inject/utils.d.ts +0 -5
  254. package/dist/src/vite/plugins/third-party-css-inject/utils.d.ts.map +0 -1
  255. /package/dist/{src → cjs}/executors/deploy/schema.json +0 -0
  256. /package/dist/{src → cjs}/executors/environments/schema.json +0 -0
  257. /package/dist/{src → cjs}/executors/publish/schema.json +0 -0
  258. /package/dist/{src → cjs}/executors/update-executors-file/schema.json +0 -0
  259. /package/dist/{src → cjs}/executors/vtex-link/schema.json +0 -0
@@ -1,22 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- buildCSSInjectionCode: function() {
13
- return buildCSSInjectionCode;
14
- },
15
- removeLinkStyleSheets: function() {
16
- return removeLinkStyleSheets;
17
- }
18
- });
19
- const _vite = require("vite");
1
+ 'use strict';
2
+
3
+ var vite = require('vite');
4
+
20
5
  const cssInjectedByJsId = '\0vite/all-css';
21
6
  const waitForElement = (selector, observerElementName = 'body')=>{
22
7
  const getElement = (selector)=>document.querySelector(selector);
@@ -47,7 +32,7 @@ const waitForElement = (selector, observerElementName = 'body')=>{
47
32
  });
48
33
  };
49
34
  async function buildCSSInjectionCode(execute) {
50
- const res = await (0, _vite.build)({
35
+ const res = await vite.build({
51
36
  root: '',
52
37
  configFile: false,
53
38
  logLevel: 'error',
@@ -110,3 +95,6 @@ function removeLinkStyleSheets(html, cssFileName) {
110
95
  const removeCSS = new RegExp(`<link rel=".*"[^>]*?href=".*/?${cssFileName}"[^>]*?>`);
111
96
  return html.replace(removeCSS, '');
112
97
  }
98
+
99
+ exports.buildCSSInjectionCode = buildCSSInjectionCode;
100
+ exports.removeLinkStyleSheets = removeLinkStyleSheets;
@@ -0,0 +1,5 @@
1
+ import { OutputChunk } from 'rollup';
2
+ import { Execute } from "../../../index-3080371d.js";
3
+ declare function buildCSSInjectionCode(execute?: Execute[]): Promise<OutputChunk | null | any>;
4
+ declare function removeLinkStyleSheets(html: string, cssFileName: string): string;
5
+ export { buildCSSInjectionCode, removeLinkStyleSheets };
@@ -0,0 +1,4 @@
1
+ declare function cleanS3Bucket(s3BucketPath: string): Promise<void>;
2
+ declare function copyAssetsToS3(s3BucketPath: string, projectRoot: string): Promise<void>;
3
+ declare function createCloudFrontInvalidation(distributionId: string, invalidationPaths: string[]): Promise<void>;
4
+ export { cleanS3Bucket, copyAssetsToS3, createCloudFrontInvalidation };
@@ -0,0 +1,22 @@
1
+ import { logger } from '@nx/devkit';
2
+ import { runCommand } from '../shared/utils.mjs';
3
+
4
+ async function cleanS3Bucket(s3BucketPath) {
5
+ logger.info('🧹 Cleaning S3 bucket...');
6
+ await runCommand(`aws s3 rm ${s3BucketPath} --recursive`);
7
+ logger.info('✅ S3 bucket cleared.');
8
+ }
9
+ async function copyAssetsToS3(s3BucketPath, projectRoot) {
10
+ logger.info('📦 Copying assets to S3 bucket...');
11
+ await runCommand(`aws s3 cp ${projectRoot}/dist ${s3BucketPath} --recursive`);
12
+ logger.info('🚚 Assets files copied.');
13
+ }
14
+ async function createCloudFrontInvalidation(distributionId, invalidationPaths) {
15
+ const pathsString = invalidationPaths.map((path)=>`"${path}"`).join(' ');
16
+ const command = `aws cloudfront create-invalidation --distribution-id ${distributionId} --paths ${pathsString}`;
17
+ logger.info('🔃 Creating invalidation for CloudFront...');
18
+ await runCommand(command);
19
+ logger.info('🔄 CloudFront invalidation created.');
20
+ }
21
+
22
+ export { cleanS3Bucket, copyAssetsToS3, createCloudFrontInvalidation };
@@ -0,0 +1,11 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { ExecutorResponse } from "../../index-f6330edc.js";
3
+ interface ExecutorOptions {
4
+ s3BucketPath: string;
5
+ cloudFrontDistributionId: string;
6
+ cloudFrontInvalidationPaths: string[];
7
+ buildTarget: string;
8
+ skipBuild?: boolean;
9
+ }
10
+ declare function deployExecutor(opts: ExecutorOptions, ctx: ExecutorContext): Promise<ExecutorResponse>;
11
+ export { ExecutorOptions, deployExecutor as default };
@@ -0,0 +1,20 @@
1
+ import { getProjectConfig, runCommand, ok, err } from '../shared/utils.mjs';
2
+ import { cleanS3Bucket, copyAssetsToS3, createCloudFrontInvalidation } from './helpers.mjs';
3
+
4
+ async function deployExecutor(opts, ctx) {
5
+ try {
6
+ const { root, name } = getProjectConfig(ctx);
7
+ const { s3BucketPath, cloudFrontDistributionId, cloudFrontInvalidationPaths, skipBuild = false } = opts;
8
+ const buildTarget = `${name}:${opts.buildTarget}`;
9
+ if (!skipBuild) await runCommand(`nx run ${buildTarget}`);
10
+ await cleanS3Bucket(s3BucketPath);
11
+ await copyAssetsToS3(s3BucketPath, root);
12
+ await createCloudFrontInvalidation(cloudFrontDistributionId, cloudFrontInvalidationPaths);
13
+ const now = new Date().toLocaleString();
14
+ return ok(`✨ Build completed successfully on ${now}`);
15
+ } catch (error) {
16
+ return err(error, '❌ Error when executing deploy command');
17
+ }
18
+ }
19
+
20
+ export { deployExecutor as default };
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Deploy executor",
5
+ "description": "",
6
+ "type": "object",
7
+ "properties": {
8
+ "s3BucketPath": {
9
+ "type": "string",
10
+ "description": "S3 BUCKET ROUTE"
11
+ },
12
+ "cloudFrontDistributionId": {
13
+ "type": "string",
14
+ "description": "Cloudfront distribution id for cache invalidation"
15
+ },
16
+ "cloudFrontInvalidationPaths": {
17
+ "type": "array",
18
+ "description": "Cloudfront path list that must be invalidated in the cache",
19
+ "items": {
20
+ "type": "string"
21
+ },
22
+ "uniqueItems": true,
23
+ "minItems": 1
24
+ },
25
+ "buildTarget": {
26
+ "type": "string",
27
+ "description": "Build command relative to the project and without the name of the project because it is not necessary"
28
+ },
29
+ "skipBuild": {
30
+ "type": "boolean",
31
+ "description": "It allows to omit the Build process and assumes that it was already done",
32
+ "default": false
33
+ }
34
+ },
35
+ "required": [
36
+ "s3BucketPath",
37
+ "cloudFrontDistributionId",
38
+ "cloudFrontInvalidationPaths",
39
+ "buildTarget"
40
+ ]
41
+ }
@@ -0,0 +1,25 @@
1
+ interface CreateEnvironmentData {
2
+ projectOrg: string;
3
+ coreEnvFile: string;
4
+ }
5
+ /**
6
+ * Creates the content for an environment file based on the core environment path.
7
+ *
8
+ * @param {CreateEnvironmentData} data - Values to replace in template.
9
+ * @returns {string} The content of the environment file.
10
+ */
11
+ declare function createEnvironmentFileContent({ coreEnvFile, projectOrg, }: CreateEnvironmentData): Promise<string>;
12
+ /**
13
+ * Ensures that the given directory exists, creating it if it does not.
14
+ *
15
+ * @param {string} dir - The path to the directory to check/create.
16
+ */
17
+ declare function ensureDirectoryExists(dir: string): Promise<void>;
18
+ /**
19
+ * Writes environment files to the given base path if they do not already exist.
20
+ *
21
+ * @param {string} basePath - The base directory where the files should be written.
22
+ * @param {Record<string, string>} files - An object containing filenames and their respective content.
23
+ */
24
+ declare function writeFilesIfNotExist(basePath: string, files: Record<string, string>): Promise<void>;
25
+ export { createEnvironmentFileContent, ensureDirectoryExists, writeFilesIfNotExist };
@@ -0,0 +1,58 @@
1
+ import { promises } from 'fs';
2
+ import { join } from 'path';
3
+ import { logger } from '@nx/devkit';
4
+
5
+ const { mkdir, writeFile, access } = promises;
6
+ /**
7
+ * Creates the content for an environment file based on the core environment path.
8
+ *
9
+ * @param {CreateEnvironmentData} data - Values to replace in template.
10
+ * @returns {string} The content of the environment file.
11
+ */ async function createEnvironmentFileContent({ coreEnvFile, projectOrg }) {
12
+ return `import { Environment } from '@${projectOrg}/core';
13
+ import coreEnvs from '@${projectOrg}/core/envs/${coreEnvFile}';
14
+
15
+ const config = {
16
+ ...coreEnvs,
17
+ };
18
+
19
+ export const environment: Environment<typeof config> = config;
20
+ export default environment;
21
+ `;
22
+ }
23
+ /**
24
+ * Ensures that the given directory exists, creating it if it does not.
25
+ *
26
+ * @param {string} dir - The path to the directory to check/create.
27
+ */ async function ensureDirectoryExists(dir) {
28
+ try {
29
+ await access(dir);
30
+ logger.info('✅ Directory exists.');
31
+ } catch {
32
+ logger.info('📁 Directory does not exist. Creating...');
33
+ await mkdir(dir, {
34
+ recursive: true
35
+ });
36
+ logger.info('📁 Directory created.');
37
+ }
38
+ }
39
+ /**
40
+ * Writes environment files to the given base path if they do not already exist.
41
+ *
42
+ * @param {string} basePath - The base directory where the files should be written.
43
+ * @param {Record<string, string>} files - An object containing filenames and their respective content.
44
+ */ async function writeFilesIfNotExist(basePath, files) {
45
+ await Promise.all(Object.entries(files).map(async ([filename, content])=>{
46
+ const filePath = join(basePath, filename);
47
+ try {
48
+ await access(filePath);
49
+ logger.info(`✅ The file "${filename}" already exists.`);
50
+ } catch {
51
+ logger.warn(`📝 The file "${filename}" does not exist. Creating...`);
52
+ await writeFile(filePath, content);
53
+ logger.info(`🎉 The file "${filename}" has been created.`);
54
+ }
55
+ }));
56
+ }
57
+
58
+ export { createEnvironmentFileContent, ensureDirectoryExists, writeFilesIfNotExist };
@@ -0,0 +1,16 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { ExecutorResponse } from "../../index-f6330edc.js";
3
+ interface ExecutorOptions {
4
+ }
5
+ /**
6
+ * The executor function to create environment files.
7
+ * Ensures that the directory for the environment files exists and creates the files
8
+ * if they do not exist already. Files created are 'environment.ts', 'environment.prod.ts',
9
+ * and 'environment.staging.ts'.
10
+ *
11
+ * @param {ExecutorOptions} _opts - Executor options, currently not used but provided for future extensibility.
12
+ * @param {ExecutorContext} ctx - The executor context, providing access to the project configuration.
13
+ * @returns {Promise<ExecutorResponse>} The result object with a success or error status.
14
+ */
15
+ declare function runExecutor(_opts: ExecutorOptions, ctx: ExecutorContext): Promise<ExecutorResponse>;
16
+ export { ExecutorOptions, runExecutor as default };
@@ -0,0 +1,58 @@
1
+ import { join } from 'path';
2
+ import { getProjectConfig, ok, err } from '../shared/utils.mjs';
3
+ import { ensureDirectoryExists, createEnvironmentFileContent, writeFilesIfNotExist } from './helpers.mjs';
4
+ import '../../shared/logger.mjs';
5
+ import { getPkgJson } from '../../shared/utils.mjs';
6
+
7
+ const ENV_DIR = 'src/environments';
8
+ const ENV_DEV_FILE = 'environment.ts';
9
+ const ENV_LOCAL_FILE = 'environment.local.ts';
10
+ const ENV_PROD_FILE = 'environment.prod.ts';
11
+ const ENV_STAGING_FILE = 'environment.staging.ts';
12
+ const environmentFiles = [
13
+ ENV_DEV_FILE,
14
+ ENV_LOCAL_FILE,
15
+ ENV_PROD_FILE,
16
+ ENV_STAGING_FILE
17
+ ];
18
+ /**
19
+ * The executor function to create environment files.
20
+ * Ensures that the directory for the environment files exists and creates the files
21
+ * if they do not exist already. Files created are 'environment.ts', 'environment.prod.ts',
22
+ * and 'environment.staging.ts'.
23
+ *
24
+ * @param {ExecutorOptions} _opts - Executor options, currently not used but provided for future extensibility.
25
+ * @param {ExecutorContext} ctx - The executor context, providing access to the project configuration.
26
+ * @returns {Promise<ExecutorResponse>} The result object with a success or error status.
27
+ */ async function runExecutor(_opts, ctx) {
28
+ try {
29
+ const projectConfig = getProjectConfig(ctx);
30
+ const environmentsDir = join(projectConfig.root, ENV_DIR);
31
+ const mainPkgJson = getPkgJson(ctx.root);
32
+ const getEnvPath = (fileName)=>{
33
+ const isLocal = fileName.includes('.local');
34
+ const coreEnvFile = (isLocal ? ENV_DEV_FILE : fileName).replace('.ts', '');
35
+ const key = isLocal ? ENV_LOCAL_FILE : fileName;
36
+ return {
37
+ key,
38
+ coreEnvFile
39
+ };
40
+ };
41
+ await ensureDirectoryExists(environmentsDir);
42
+ for (const envFileName of environmentFiles){
43
+ const { key, coreEnvFile } = getEnvPath(envFileName);
44
+ const content = await createEnvironmentFileContent({
45
+ coreEnvFile,
46
+ projectOrg: mainPkgJson.name
47
+ });
48
+ await writeFilesIfNotExist(environmentsDir, {
49
+ [key]: content
50
+ });
51
+ }
52
+ return ok();
53
+ } catch (error) {
54
+ return err(error, `Failed to create environment files:`);
55
+ }
56
+ }
57
+
58
+ export { runExecutor as default };
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Environments executor",
5
+ "description": "",
6
+ "type": "object",
7
+ "properties": {},
8
+ "required": []
9
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Retrieves the version of a published package with a given name and tag.
3
+ *
4
+ * @param {string} packageName The name of the package to retrieve the version for.
5
+ * @param {string} tag The tag to retrieve the version for.
6
+ * @returns The version of the package as a string or an object containing versions for each tag.
7
+ */
8
+ declare function getPublishedPackageVersion(packageName: string, tag?: string): Promise<any>;
9
+ /**
10
+ * Checks if a package with the given name is already published and returns its version.
11
+ *
12
+ * @param {string} packageName The name of the package to check for.
13
+ * @returns An object containing the published versions of the package and a flag indicating if it is the first version.
14
+ */
15
+ declare function checkPublishedVersion(packageName: string): Promise<{
16
+ publishedVersion: any;
17
+ isFirstVersion: boolean;
18
+ }>;
19
+ export { getPublishedPackageVersion, checkPublishedVersion };
@@ -0,0 +1,48 @@
1
+ import { logger } from '@nx/devkit';
2
+ import { exec } from 'child_process';
3
+ import { promisify } from 'util';
4
+
5
+ const execAsync = promisify(exec);
6
+ /**
7
+ * Retrieves the version of a published package with a given name and tag.
8
+ *
9
+ * @param {string} packageName The name of the package to retrieve the version for.
10
+ * @param {string} tag The tag to retrieve the version for.
11
+ * @returns The version of the package as a string or an object containing versions for each tag.
12
+ */ async function getPublishedPackageVersion(packageName, tag) {
13
+ const withTag = tag ? `.${tag}` : ' --json';
14
+ const command = `npm view ${packageName} dist-tags${withTag}`;
15
+ const { stdout, stderr } = await execAsync(command);
16
+ if (stderr) {
17
+ logger.error(stderr.trim());
18
+ process.exit(1);
19
+ }
20
+ const published = stdout.trim();
21
+ return tag ? published : JSON.parse(published);
22
+ }
23
+ /**
24
+ * Checks if a package with the given name is already published and returns its version.
25
+ *
26
+ * @param {string} packageName The name of the package to check for.
27
+ * @returns An object containing the published versions of the package and a flag indicating if it is the first version.
28
+ */ async function checkPublishedVersion(packageName) {
29
+ let publishedVersion;
30
+ let isFirstVersion = false;
31
+ try {
32
+ publishedVersion = await getPublishedPackageVersion(packageName);
33
+ } catch (err) {
34
+ if (err?.message.includes('code E404')) {
35
+ isFirstVersion = true;
36
+ logger.info(`🏁 This is the first version of "${packageName}" package. \n`);
37
+ } else {
38
+ logger.error('❌ Error when checking the last published versions \n');
39
+ throw err;
40
+ }
41
+ }
42
+ return {
43
+ publishedVersion,
44
+ isFirstVersion
45
+ };
46
+ }
47
+
48
+ export { checkPublishedVersion, getPublishedPackageVersion };
@@ -0,0 +1,12 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { ExecutorResponse } from "../../index-f6330edc.js";
3
+ interface ExecutorOptions {
4
+ tag: string;
5
+ dryRun?: boolean;
6
+ }
7
+ /**
8
+ * This is a minimal script to publish package to "npm".
9
+ * Need to authenticate with NPM before running this script.
10
+ */
11
+ declare function runExecutor(opts: ExecutorOptions, ctx: ExecutorContext): Promise<ExecutorResponse>;
12
+ export { ExecutorOptions, runExecutor as default };
@@ -0,0 +1,51 @@
1
+ import { logger } from '@nx/devkit';
2
+ import semver from 'semver';
3
+ import '../../shared/logger.mjs';
4
+ import { getPkgJson } from '../../shared/utils.mjs';
5
+ import { getProjectConfig, runCommand, ok, err } from '../shared/utils.mjs';
6
+ import { checkPublishedVersion } from './helpers.mjs';
7
+
8
+ /**
9
+ * This is a minimal script to publish package to "npm".
10
+ * Need to authenticate with NPM before running this script.
11
+ */ async function runExecutor(opts, ctx) {
12
+ try {
13
+ const { tag, dryRun: isDryRun } = opts;
14
+ const { root: projectRoot } = getProjectConfig(ctx);
15
+ // Read the package.json file and extract the name and version.
16
+ const packageJson = getPkgJson(projectRoot);
17
+ const { name: packageName, version: packageVersion } = packageJson;
18
+ // Check if the package has been previously published and get the published version.
19
+ const { publishedVersion, isFirstVersion } = await checkPublishedVersion(packageName);
20
+ let greaterThanTagVersion, greaterThanLatestVersion;
21
+ if (!isFirstVersion) {
22
+ // Check if the package version is greater than the latest published version for the specified tag.
23
+ greaterThanTagVersion = publishedVersion?.[tag] ? semver.gt(packageVersion, publishedVersion?.[tag]) : true;
24
+ // Check if the package version is greater than the latest published version.
25
+ greaterThanLatestVersion = semver.gt(packageVersion, publishedVersion.latest);
26
+ console.log(`🔎 package.json version: ${packageVersion}`);
27
+ console.log('🔺 published versions:');
28
+ Object.entries(publishedVersion).forEach(([k, v])=>console.log(` * ${k}: ${v}`));
29
+ console.log('\n');
30
+ }
31
+ // Publish the package if it's the first version or if it's a new version.
32
+ const needsPublish = isFirstVersion || greaterThanLatestVersion && greaterThanTagVersion;
33
+ if (needsPublish) {
34
+ const dryRun = isDryRun ? '--dry-run' : '';
35
+ const commandToPublish = `pnpm publish --access public --tag ${tag} --no-git-checks ${dryRun}`;
36
+ isDryRun && logger.info('👀 Skip publish (dry run) \n');
37
+ logger.info(`${commandToPublish} \n`);
38
+ // Execute the command to publish the package.
39
+ // process.chdir(projectRoot);
40
+ await runCommand(commandToPublish, projectRoot);
41
+ logger.info(`\n🚀 Successfully published ${packageName}@${packageVersion}`);
42
+ } else {
43
+ logger.warn(`👻 Package version "${packageVersion}" is invalid.`);
44
+ }
45
+ return ok();
46
+ } catch (error) {
47
+ return err(error, '❌ Error when publishing the package');
48
+ }
49
+ }
50
+
51
+ export { runExecutor as default };
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Publish executor",
5
+ "description": "",
6
+ "type": "object",
7
+ "properties": {
8
+ "tag": {
9
+ "type": "string",
10
+ "description": "Tag name to publish"
11
+ },
12
+ "dryRun": {
13
+ "type": "boolean",
14
+ "description": "Indicates whether a test execution should be done without really publishing",
15
+ "default": false
16
+ }
17
+ },
18
+ "required": ["tag"]
19
+ }
@@ -0,0 +1,27 @@
1
+ import { ExecutorContext, ProjectConfiguration } from '@nx/devkit';
2
+ import { ExecutorResponse } from "../../types-7377dcc9.js";
3
+ /**
4
+ * Indicates a successful executor operation.
5
+ *
6
+ * @param {string} message - Optional message to log for the success case.
7
+ * @returns {ExecutorResponse} - An object representing a successful operation.
8
+ */
9
+ declare function ok(message?: string): ExecutorResponse;
10
+ /**
11
+ * Indicates a failed executor operation.
12
+ *
13
+ * @param {string | Error | unknown} err - An optional error object or message indicating the nature of the failure.
14
+ * @param {string} message - An optional message to log for the error case. If not provided, a default error message is logged.
15
+ * @returns {ExecutorResponse} - An object representing a failed operation.
16
+ */
17
+ declare function err(err?: string | Error | unknown, message?: string): ExecutorResponse;
18
+ /**
19
+ * Retrieves the project configuration for the current execution context.
20
+ *
21
+ * @param {ExecutorContext} ctx - The execution context containing project information.
22
+ * @returns {ProjectConfiguration} - The configuration object for the current project.
23
+ * @throws {Error} If the project configuration is invalid or not found.
24
+ */
25
+ declare function getProjectConfig(ctx: ExecutorContext): ProjectConfiguration;
26
+ declare function runCommand(command: string, cwd?: string | URL): Promise<void>;
27
+ export { ok, err, getProjectConfig, runCommand };
@@ -0,0 +1,62 @@
1
+ import { logger } from '@nx/devkit';
2
+ import { exec } from 'child_process';
3
+ import { promisify } from 'util';
4
+
5
+ const execAsync = promisify(exec);
6
+ /**
7
+ * Indicates a successful executor operation.
8
+ *
9
+ * @param {string} message - Optional message to log for the success case.
10
+ * @returns {ExecutorResponse} - An object representing a successful operation.
11
+ */ function ok(message) {
12
+ message && logger.info(message);
13
+ return {
14
+ success: true
15
+ };
16
+ }
17
+ /**
18
+ * Indicates a failed executor operation.
19
+ *
20
+ * @param {string | Error | unknown} err - An optional error object or message indicating the nature of the failure.
21
+ * @param {string} message - An optional message to log for the error case. If not provided, a default error message is logged.
22
+ * @returns {ExecutorResponse} - An object representing a failed operation.
23
+ */ function err(err, message) {
24
+ if (message) {
25
+ logger.error(message);
26
+ } else {
27
+ logger.error(`❌ an error occurred:`);
28
+ }
29
+ if (err) logger.error(err);
30
+ return {
31
+ success: false
32
+ };
33
+ }
34
+ /**
35
+ * Retrieves the project configuration for the current execution context.
36
+ *
37
+ * @param {ExecutorContext} ctx - The execution context containing project information.
38
+ * @returns {ProjectConfiguration} - The configuration object for the current project.
39
+ * @throws {Error} If the project configuration is invalid or not found.
40
+ */ function getProjectConfig(ctx) {
41
+ const projectName = ctx.projectName || '';
42
+ const projectConfig = ctx.projectsConfigurations?.projects?.[projectName];
43
+ if (!projectConfig) throw new Error('Invalid project configuration.');
44
+ return projectConfig;
45
+ }
46
+ async function runCommand(command, cwd) {
47
+ try {
48
+ const { stdout, stderr } = await execAsync(command, {
49
+ ...cwd && {
50
+ cwd
51
+ }
52
+ });
53
+ logger.info(stdout);
54
+ logger.info(stderr);
55
+ } catch (error) {
56
+ logger.error(`Unexpected error running command:`);
57
+ logger.error(error);
58
+ throw error;
59
+ }
60
+ }
61
+
62
+ export { err, getProjectConfig, ok, runCommand };
@@ -0,0 +1,17 @@
1
+ import { Executors } from "../../types-763439e4.js";
2
+ declare const transformPathToRoot: (path: string) => string;
3
+ declare const transformPathToDist: (path: string) => string;
4
+ /**
5
+ * Updates the executor paths for the provided executors object.
6
+ * @param {Executors} executors - The executors object from executors.json.
7
+ * @param {boolean} toDist - Flag to determine if './dist' should be removed from paths.
8
+ * @returns - The updated executors object with transformed paths.
9
+ */
10
+ declare const updateExecutorPaths: (executors: Executors, toDist: boolean) => Executors;
11
+ /**
12
+ * Writes a JSON file asynchronously.
13
+ * @param {string} path - The file path where to write the JSON data.
14
+ * @param {any} data - The data to be written to the file.
15
+ */
16
+ declare const writeJsonFileAsync: (path: string, data: any) => Promise<void>;
17
+ export { transformPathToRoot, transformPathToDist, updateExecutorPaths, writeJsonFileAsync };
@@ -0,0 +1,59 @@
1
+ import { logger } from '@nx/devkit';
2
+ import { promises } from 'fs';
3
+ import { cond, always, T, pipe } from 'ramda';
4
+
5
+ const { writeFile } = promises;
6
+ const transformPathToRoot = (path)=>{
7
+ const distPrefix = './dist/cjs/';
8
+ const srcRegex = /^\.\/src\//;
9
+ const executorTsRegex = /executor\.ts$/;
10
+ const jsonFileRegex = /\.json$/;
11
+ const isJson = jsonFileRegex.test(path);
12
+ const changeSrcPath = (p)=>p.replace(srcRegex, distPrefix);
13
+ const changeFileName = (p)=>isJson ? p : p.replace(executorTsRegex, 'index.cjs');
14
+ return pipe(changeSrcPath, changeFileName)(path);
15
+ };
16
+ const transformPathToDist = (path)=>{
17
+ const cjsPrefix = './cjs/';
18
+ const distRegex = /^\.\/dist\/cjs\//;
19
+ return path.replace(distRegex, cjsPrefix);
20
+ };
21
+ /**
22
+ * Updates the executor paths for the provided executors object.
23
+ * @param {Executors} executors - The executors object from executors.json.
24
+ * @param {boolean} toDist - Flag to determine if './dist' should be removed from paths.
25
+ * @returns - The updated executors object with transformed paths.
26
+ */ const updateExecutorPaths = (executors, toDist)=>{
27
+ const transform = cond([
28
+ [
29
+ always(toDist),
30
+ transformPathToDist
31
+ ],
32
+ [
33
+ T,
34
+ transformPathToRoot
35
+ ]
36
+ ]);
37
+ return Object.entries(executors).reduce((updatedExecutors, [key, executor])=>{
38
+ updatedExecutors[key] = {
39
+ ...executor,
40
+ implementation: transform(executor.implementation),
41
+ schema: transform(executor.schema)
42
+ };
43
+ return updatedExecutors;
44
+ }, {});
45
+ };
46
+ /**
47
+ * Writes a JSON file asynchronously.
48
+ * @param {string} path - The file path where to write the JSON data.
49
+ * @param {any} data - The data to be written to the file.
50
+ */ const writeJsonFileAsync = async (path, data)=>{
51
+ try {
52
+ await writeFile(path, JSON.stringify(data, null, 2));
53
+ logger.info(`✅ Updated: ${path}`);
54
+ } catch (error) {
55
+ logger.error(`❌ Error writing file ${path}: ${error}`);
56
+ }
57
+ };
58
+
59
+ export { transformPathToDist, transformPathToRoot, updateExecutorPaths, writeJsonFileAsync };
@@ -0,0 +1,12 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { ExecutorResponse } from "../../index-f6330edc.js";
3
+ import { ExecutorOptions } from "../../types-763439e4.js";
4
+ /**
5
+ * Executor function to update paths in the executors.json file.
6
+ *
7
+ * @param {ExecutorOptions} _opts - Executor options, currently not used but provided for future extensibility.
8
+ * @param {ExecutorContext} ctx - The executor context, providing access to the project configuration.
9
+ * @returns {Promise<ExecutorResponse>} The result object with a success or error status.
10
+ */
11
+ declare function runExecutor(_opts: ExecutorOptions, ctx: ExecutorContext): Promise<ExecutorResponse>;
12
+ export { runExecutor as default };