@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,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./types"), exports);
7
- _export_star._(require("./utils"), exports);
@@ -1,4 +0,0 @@
1
- export type ExecutorResponse = {
2
- success: boolean;
3
- };
4
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/executors/shared/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,34 +0,0 @@
1
- import { type ExecutorContext, type ProjectConfiguration } from '@nx/devkit';
2
- import type { ExecutorResponse } from './types';
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
- export 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
- export declare function err(err?: string | Error | unknown, message?: string): ExecutorResponse;
18
- /**
19
- * Generates a random alphanumeric identifier of a specified length.
20
- *
21
- * @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
22
- * @returns {string} - A string representing a unique identifier.
23
- */
24
- export declare function shortId(length?: number): string;
25
- /**
26
- * Retrieves the project configuration for the current execution context.
27
- *
28
- * @param {ExecutorContext} ctx - The execution context containing project information.
29
- * @returns {ProjectConfiguration} - The configuration object for the current project.
30
- * @throws {Error} If the project configuration is invalid or not found.
31
- */
32
- export declare function getProjectConfig(ctx: ExecutorContext): ProjectConfiguration;
33
- export declare function runCommand(command: string): Promise<void>;
34
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/executors/shared/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhD;;;;;GAKG;AACH,wBAAgB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAGrD;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CACjB,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,EAC9B,OAAO,CAAC,EAAE,MAAM,GACf,gBAAgB,CAUlB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,MAAM,SAAI,UAIjC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,GAAG,oBAAoB,CAK3E;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB/D"}
@@ -1,74 +0,0 @@
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
- err: function() {
13
- return err;
14
- },
15
- getProjectConfig: function() {
16
- return getProjectConfig;
17
- },
18
- ok: function() {
19
- return ok;
20
- },
21
- runCommand: function() {
22
- return runCommand;
23
- },
24
- shortId: function() {
25
- return shortId;
26
- }
27
- });
28
- const _devkit = require("@nx/devkit");
29
- const _crypto = require("crypto");
30
- const _child_process = require("child_process");
31
- const _util = require("util");
32
- const execAsync = (0, _util.promisify)(_child_process.exec);
33
- function ok(message) {
34
- message && _devkit.logger.info(message);
35
- return {
36
- success: true
37
- };
38
- }
39
- function err(err, message) {
40
- if (message) {
41
- _devkit.logger.error(message);
42
- } else {
43
- _devkit.logger.error(`❌ an error occurred:`);
44
- }
45
- if (err) _devkit.logger.error(err);
46
- return {
47
- success: false
48
- };
49
- }
50
- function shortId(length = 8) {
51
- const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
52
- return Array.from((0, _crypto.randomBytes)(length), (b)=>chars[b % chars.length]).join('');
53
- }
54
- function getProjectConfig(ctx) {
55
- const projectName = ctx.projectName || '';
56
- const projectConfig = ctx.projectsConfigurations?.projects?.[projectName];
57
- if (!projectConfig) throw new Error('Invalid project configuration.');
58
- return projectConfig;
59
- }
60
- async function runCommand(command) {
61
- try {
62
- const { stdout, stderr } = await execAsync(command);
63
- if (stderr) {
64
- _devkit.logger.error(`Error running command:`);
65
- _devkit.logger.error(stderr);
66
- throw new Error(stderr);
67
- }
68
- _devkit.logger.info(stdout);
69
- } catch (error) {
70
- _devkit.logger.error(`Unexpected error running command:`);
71
- _devkit.logger.error(error);
72
- throw error;
73
- }
74
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/executors/update-executors-file/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,EAAW,KAAK,gBAAgB,EAAoB,MAAM,WAAW,CAAC;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAI9D;;;;;;GAMG;AACH,wBAA8B,WAAW,CACvC,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,gBAAgB,CAAC,CA8B3B"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, /**
6
- * Executor function to update paths in the executors.json file.
7
- *
8
- * @param {ExecutorOptions} _opts - Executor options, currently not used but provided for future extensibility.
9
- * @param {ExecutorContext} ctx - The executor context, providing access to the project configuration.
10
- * @returns {Promise<ExecutorResponse>} The result object with a success or error status.
11
- */ "default", {
12
- enumerable: true,
13
- get: function() {
14
- return runExecutor;
15
- }
16
- });
17
- const _fs = require("fs");
18
- const _path = require("path");
19
- const _shared = require("../shared");
20
- const _helpers = require("./helpers");
21
- const { readFile } = _fs.promises;
22
- async function runExecutor(_opts, ctx) {
23
- try {
24
- const projectConfig = (0, _shared.getProjectConfig)(ctx);
25
- const rootDir = projectConfig.root;
26
- const executorsFilePath = (0, _path.join)(rootDir, 'executors.json');
27
- const distExecutorsFilePath = (0, _path.join)(rootDir, 'dist', 'executors.json');
28
- const originalContent = JSON.parse(await readFile(executorsFilePath, 'utf8'));
29
- // Update paths to point to './dist/' and add '.js'
30
- const updatedExecutors = (0, _helpers.updateExecutorPaths)(originalContent.executors, false);
31
- // Prepare the version for the dist folder by removing './dist/' from paths
32
- const distExecutors = (0, _helpers.updateExecutorPaths)(updatedExecutors, true);
33
- // Write both files asynchronously and in parallel
34
- await Promise.all([
35
- (0, _helpers.writeJsonFileAsync)(executorsFilePath, {
36
- executors: updatedExecutors
37
- }),
38
- (0, _helpers.writeJsonFileAsync)(distExecutorsFilePath, {
39
- executors: distExecutors
40
- })
41
- ]);
42
- return (0, _shared.ok)(`🚀 Executors updated successfully.`);
43
- } catch (error) {
44
- return (0, _shared.err)(error, `❌ Error processing file: ${error}`);
45
- }
46
- }
@@ -1,24 +0,0 @@
1
- import type { Executors } from './types';
2
- /**
3
- * Transforms the given path by adding or removing the './dist/' prefix
4
- * and ensuring that it has the '.js' extension if it's not a JSON file.
5
- *
6
- * @param {string} path - The original file path to transform.
7
- * @param {boolean} removeDist - Flag to determine if './dist/' should be removed.
8
- * @returns {string} The transformed file path.
9
- */
10
- export declare const transformPath: (path: string, removeDist: boolean) => string;
11
- /**
12
- * Updates the executor paths for the provided executors object.
13
- * @param {Executors} executors - The executors object from executors.json.
14
- * @param {boolean} removeDist - Flag to determine if './dist' should be removed from paths.
15
- * @returns - The updated executors object with transformed paths.
16
- */
17
- export declare const updateExecutorPaths: (executors: Executors, removeDist: boolean) => Executors;
18
- /**
19
- * Writes a JSON file asynchronously.
20
- * @param {string} path - The file path where to write the JSON data.
21
- * @param {any} data - The data to be written to the file.
22
- */
23
- export declare const writeJsonFileAsync: (path: string, data: any) => Promise<void>;
24
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/executors/update-executors-file/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,SAAU,MAAM,cAAc,OAAO,KAAG,MAuBjE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,cACnB,SAAS,cACR,OAAO,cAapB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,SAAgB,MAAM,QAAQ,GAAG,kBAO/D,CAAC"}
@@ -1,70 +0,0 @@
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
- transformPath: function() {
13
- return transformPath;
14
- },
15
- updateExecutorPaths: function() {
16
- return updateExecutorPaths;
17
- },
18
- writeJsonFileAsync: function() {
19
- return writeJsonFileAsync;
20
- }
21
- });
22
- const _devkit = require("@nx/devkit");
23
- const _fs = require("fs");
24
- const _ramda = require("ramda");
25
- const { writeFile } = _fs.promises;
26
- const transformPath = (path, removeDist)=>{
27
- const distPrefix = './dist/';
28
- const distRegex = /^\.\/dist\//;
29
- const jsExt = '.js';
30
- const isJs = (0, _ramda.endsWith)(jsExt, path);
31
- const isJson = (0, _ramda.endsWith)('.json', path);
32
- const hasDist = (0, _ramda.test)(distRegex, path);
33
- // Adds './dist/' prefix to the path if it's not already present.
34
- const addDist = (p)=>hasDist ? p : `${distPrefix}${p}`;
35
- // Removes './dist/' prefix from the path if present.
36
- const stripDist = (p)=>(0, _ramda.replace)(distRegex, './', p);
37
- // Adds '.js' extension to the path if it's not a JSON file and doesn't have the extension already.
38
- const addJs = (p)=>isJs || isJson ? p : `${p}${jsExt}`;
39
- // Cleans up any occurrences of '/./' within the path.
40
- const clean = (p)=>(0, _ramda.replace)(/\/\.\//g, '/', p);
41
- const transform = (0, _ramda.cond)([
42
- [
43
- (0, _ramda.always)(removeDist),
44
- (0, _ramda.pipe)(stripDist, addJs, clean)
45
- ],
46
- [
47
- _ramda.T,
48
- (0, _ramda.pipe)(addDist, addJs, clean)
49
- ]
50
- ]);
51
- return transform(path);
52
- };
53
- const updateExecutorPaths = (executors, removeDist)=>{
54
- return Object.entries(executors).reduce((updatedExecutors, [key, executor])=>{
55
- updatedExecutors[key] = {
56
- ...executor,
57
- implementation: transformPath(executor.implementation, removeDist),
58
- schema: transformPath(executor.schema, removeDist)
59
- };
60
- return updatedExecutors;
61
- }, {});
62
- };
63
- const writeJsonFileAsync = async (path, data)=>{
64
- try {
65
- await writeFile(path, JSON.stringify(data, null, 2));
66
- _devkit.logger.info(`✅ Updated: ${path}`);
67
- } catch (error) {
68
- _devkit.logger.error(`❌ Error writing file ${path}: ${error}`);
69
- }
70
- };
@@ -1,14 +0,0 @@
1
- export interface ExecutorOptions {
2
- }
3
- export interface ExecutorConfig {
4
- implementation: string;
5
- schema: string;
6
- description: string;
7
- }
8
- export interface Executors {
9
- [executorName: string]: ExecutorConfig;
10
- }
11
- export interface ExecutorsFile {
12
- executors: Executors;
13
- }
14
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/executors/update-executors-file/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;CAAG;AAGnC,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAID,MAAM,WAAW,SAAS;IACxB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,CAAC;CACxC;AAGD,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,SAAS,CAAC;CACtB"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,4 +0,0 @@
1
- export declare const VTEX_PROJECT_PATH: string | undefined;
2
- export declare const ERROR_LINKING_FLAG = "[31merror\u001B[39m: App build failed";
3
- export declare const SUCCESS_LINKING_FLAG = "[32minfo\u001B[39m: App running";
4
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/executors/vtex-link/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,oBAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,0CAAqC,CAAC;AACrE,eAAO,MAAM,oBAAoB,oCAA+B,CAAC"}
@@ -1,24 +0,0 @@
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
- ERROR_LINKING_FLAG: function() {
13
- return ERROR_LINKING_FLAG;
14
- },
15
- SUCCESS_LINKING_FLAG: function() {
16
- return SUCCESS_LINKING_FLAG;
17
- },
18
- VTEX_PROJECT_PATH: function() {
19
- return VTEX_PROJECT_PATH;
20
- }
21
- });
22
- const VTEX_PROJECT_PATH = process.env.NZ_VTEX_PROJECT;
23
- const ERROR_LINKING_FLAG = '[31merror: App build failed';
24
- const SUCCESS_LINKING_FLAG = '[32minfo: App running';
@@ -1,5 +0,0 @@
1
- import { type ExecutorContext } from '@nx/devkit';
2
- import { type ExecutorResponse } from '../shared';
3
- import type { ExecutorOptions } from './types';
4
- export default function runExecutor(opts: ExecutorOptions, ctx: ExecutorContext): Promise<ExecutorResponse>;
5
- //# sourceMappingURL=executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/executors/vtex-link/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAI9D,wBAA8B,WAAW,CACvC,IAAI,EAAE,eAAe,EACrB,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAwB3B"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return runExecutor;
9
- }
10
- });
11
- const _path = require("path");
12
- const _shared = require("../shared");
13
- const _helpers = require("./helpers");
14
- const VTEX_PROJECT_PATH = process.env.NZ_VTEX_PROJECT;
15
- async function runExecutor(opts, ctx) {
16
- try {
17
- const { rollback, skipLink, packageOrg } = opts;
18
- const projectName = ctx.projectName || '';
19
- (0, _helpers.validateEnvironment)();
20
- const projectConfig = (0, _shared.getProjectConfig)(ctx);
21
- const projectRoot = projectConfig.root;
22
- const vtexProjectPath = (0, _path.resolve)(VTEX_PROJECT_PATH, 'react');
23
- const sharedContext = {
24
- packageOrg,
25
- projectRoot,
26
- projectName,
27
- vtexProjectPath
28
- };
29
- if (rollback) return await (0, _helpers.performRollback)(sharedContext);
30
- await (0, _helpers.buildAndLink)(sharedContext, skipLink);
31
- return (0, _shared.ok)();
32
- } catch (error) {
33
- return (0, _shared.err)(error);
34
- }
35
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/executors/vtex-link/helpers.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC1D;AAED;;;;;;GAMG;AACH,wBAAsB,gCAAgC,CACpD,GAAG,EAAE,aAAa,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED;;;;;GAKG;AACH,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBvE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAQvE;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAe5E;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzE;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,aAAa,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAOpE;AAED;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAK7D;AAED,wBAAgB,mBAAmB,SAKlC;AAED,wBAAsB,eAAe,CAAC,aAAa,EAAE,aAAa,iDAGjE;AAED,wBAAsB,YAAY,CAChC,aAAa,EAAE,aAAa,EAC5B,QAAQ,UAAQ,iBAKjB"}
@@ -1,187 +0,0 @@
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
- buildAndLink: function() {
13
- return buildAndLink;
14
- },
15
- buildPackage: function() {
16
- return buildPackage;
17
- },
18
- changePackageJsonFromVtexProject: function() {
19
- return changePackageJsonFromVtexProject;
20
- },
21
- clean: function() {
22
- return clean;
23
- },
24
- createPackage: function() {
25
- return createPackage;
26
- },
27
- findLastPackages: function() {
28
- return findLastPackages;
29
- },
30
- movePackage: function() {
31
- return movePackage;
32
- },
33
- performRollback: function() {
34
- return performRollback;
35
- },
36
- removeOldPackages: function() {
37
- return removeOldPackages;
38
- },
39
- renamePackage: function() {
40
- return renamePackage;
41
- },
42
- restorePackageJsonFromVtexProject: function() {
43
- return restorePackageJsonFromVtexProject;
44
- },
45
- validateEnvironment: function() {
46
- return validateEnvironment;
47
- },
48
- vtexLink: function() {
49
- return vtexLink;
50
- }
51
- });
52
- const _devkit = require("@nx/devkit");
53
- const _child_process = require("child_process");
54
- const _fs = require("fs");
55
- const _path = require("path");
56
- const _util = require("util");
57
- const _shared = require("../../shared");
58
- const _shared1 = require("../shared");
59
- const _constants = require("./constants");
60
- const execAsync = (0, _util.promisify)(_child_process.exec);
61
- const getPkgJsonPath = (vtexProjectPath)=>(0, _path.resolve)(vtexProjectPath, 'package.json');
62
- function vtexLink(ctx) {
63
- const { vtexProjectPath } = ctx;
64
- return new Promise((resolve, reject)=>{
65
- _devkit.logger.info('🔗 Linking package to VTEX...');
66
- const link = (0, _child_process.spawn)('vtex', [
67
- 'link',
68
- '-u'
69
- ], {
70
- cwd: vtexProjectPath,
71
- detached: true
72
- });
73
- link.stdout.on('data', (chunk)=>{
74
- const data = chunk.toString('utf8');
75
- if (data.includes(_constants.ERROR_LINKING_FLAG)) {
76
- reject('could not link package in VTEX');
77
- }
78
- if (data.includes(_constants.SUCCESS_LINKING_FLAG)) {
79
- link.pid && process.kill(-link.pid);
80
- setTimeout(()=>{
81
- link.kill();
82
- _devkit.logger.info('✅ Successfully linked package to VTEX.');
83
- }, 200);
84
- resolve();
85
- }
86
- _devkit.logger.info(data);
87
- });
88
- link.on('error', (error)=>reject(error.message));
89
- });
90
- }
91
- async function changePackageJsonFromVtexProject(ctx, packageName) {
92
- const { vtexProjectPath, projectName, packageOrg } = ctx;
93
- const pkgJsonPath = getPkgJsonPath(vtexProjectPath);
94
- // Make backup of package.json
95
- await _fs.promises.copyFile(pkgJsonPath, (0, _path.join)(vtexProjectPath, 'package.json.nxback'));
96
- _devkit.logger.info('🔃 Created package.json backup.');
97
- // Find and edit value "@${packageOrg}/${projectName}" dependency
98
- const packageJson = (0, _shared.getPkgJson)(vtexProjectPath);
99
- const newPackageJson = {
100
- ...packageJson,
101
- dependencies: {
102
- ...packageJson.dependencies,
103
- [`@${packageOrg}/${projectName}`]: `file:./${packageName}`
104
- }
105
- };
106
- await _fs.promises.unlink(pkgJsonPath);
107
- await _fs.promises.writeFile(pkgJsonPath, JSON.stringify(newPackageJson, null, 2));
108
- _devkit.logger.info('📝 Updated package.json in VTEX project.');
109
- }
110
- async function restorePackageJsonFromVtexProject(ctx) {
111
- const { vtexProjectPath } = ctx;
112
- const pkgJsonPath = getPkgJsonPath(vtexProjectPath);
113
- const backupFile = (0, _path.resolve)(vtexProjectPath, 'package.json.nxback');
114
- if (!(0, _fs.existsSync)(backupFile)) return;
115
- await _fs.promises.unlink(pkgJsonPath);
116
- await _fs.promises.copyFile(backupFile, pkgJsonPath);
117
- await _fs.promises.unlink(backupFile);
118
- _devkit.logger.info('🔄 Restored package.json in VTEX project.');
119
- }
120
- async function renamePackage(ctx) {
121
- const { projectRoot, projectName, packageOrg } = ctx;
122
- const packageJson = (0, _shared.getPkgJson)('./');
123
- const oldName = `${packageOrg}-${projectName}-${packageJson.version}.tgz`;
124
- const oldPath = (0, _path.join)(projectRoot, oldName);
125
- const newName = `${packageOrg}-${projectName}-${packageJson.version}-${(0, _shared1.shortId)(8)}.tgz`;
126
- const newPath = (0, _path.join)(projectRoot, newName);
127
- await _fs.promises.rename(oldPath, newPath);
128
- _devkit.logger.info(`🏷️ New package name: ${newName}`);
129
- return newName;
130
- }
131
- async function createPackage(ctx) {
132
- const command = 'pnpm pack';
133
- const { stderr } = await execAsync(command);
134
- if (stderr) _devkit.logger.error(stderr);
135
- _devkit.logger.info('📦 Package generated successfully.');
136
- return renamePackage(ctx);
137
- }
138
- async function findLastPackages(ctx) {
139
- const { vtexProjectPath, projectName, packageOrg } = ctx;
140
- const matchedFiles = [];
141
- const files = await _fs.promises.readdir(vtexProjectPath);
142
- for (const file of files){
143
- const regex = new RegExp(`^${packageOrg}-${projectName}-.*$`);
144
- if (regex.test(file)) {
145
- matchedFiles.push(file);
146
- _devkit.logger.info(`🔍 Found deprecated package: ${file}`);
147
- }
148
- }
149
- return matchedFiles;
150
- }
151
- async function removeOldPackages(ctx) {
152
- const { vtexProjectPath } = ctx;
153
- const files = await findLastPackages(ctx);
154
- const toRemove = files.map((x)=>_fs.promises.unlink((0, _path.resolve)(vtexProjectPath, x)));
155
- await Promise.all(toRemove);
156
- _devkit.logger.info('🗑️ Removed old packages in VTEX project.');
157
- }
158
- async function movePackage(ctx, packageName) {
159
- const { vtexProjectPath } = ctx;
160
- await _fs.promises.rename((0, _path.resolve)(packageName), (0, _path.join)(vtexProjectPath, packageName));
161
- _devkit.logger.info(`🚚 Moved package "${packageName}" to VTEX project.`);
162
- }
163
- async function buildPackage(ctx) {
164
- const packageName = await createPackage(ctx);
165
- await Promise.all([
166
- movePackage(ctx, packageName),
167
- changePackageJsonFromVtexProject(ctx, packageName)
168
- ]);
169
- }
170
- async function clean(ctx) {
171
- await Promise.all([
172
- removeOldPackages(ctx),
173
- restorePackageJsonFromVtexProject(ctx)
174
- ]);
175
- }
176
- function validateEnvironment() {
177
- if (!_constants.VTEX_PROJECT_PATH) throw new Error('The NZ_VTEX_PROJECT environment variable is missing. Set it in the project root in a .env.local file.');
178
- }
179
- async function performRollback(sharedContext) {
180
- await clean(sharedContext);
181
- return (0, _shared1.ok)();
182
- }
183
- async function buildAndLink(sharedContext, skipLink = false) {
184
- await clean(sharedContext);
185
- await buildPackage(sharedContext);
186
- if (!skipLink) await vtexLink(sharedContext);
187
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/executors/vtex-link/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,2 +0,0 @@
1
- export * from './vite';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
package/dist/src/index.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./vite"), exports);
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAGD,eAAO,IAAI,eAAe,UAAgB,CAAC;AAgC3C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,UAAW,QAAQ,SAE1C,CAAC;AA+DF,eAAO,MAAM,MAAM;qBAtBP,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;oBAA7B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;oBAA7B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;qBAA7B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;CA2BxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=changeset-pre-mode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"changeset-pre-mode.d.ts","sourceRoot":"","sources":["../../../src/scripts/changeset-pre-mode.ts"],"names":[],"mappings":""}