@xylabs/ts-scripts-yarn3 2.17.16 → 2.18.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 (283) hide show
  1. package/dist/cjs/actions/build.js +1 -0
  2. package/dist/cjs/actions/build.js.map +1 -1
  3. package/dist/cjs/actions/clean-docs.js +16 -0
  4. package/dist/cjs/actions/clean-docs.js.map +1 -0
  5. package/dist/cjs/actions/clean.js +2 -1
  6. package/dist/cjs/actions/clean.js.map +1 -1
  7. package/dist/cjs/actions/gitignore-gen.js +8 -0
  8. package/dist/cjs/actions/gitignore-gen.js.map +1 -0
  9. package/dist/cjs/actions/index.js +3 -0
  10. package/dist/cjs/actions/index.js.map +1 -1
  11. package/dist/cjs/actions/npmignore-gen.js +8 -0
  12. package/dist/cjs/actions/npmignore-gen.js.map +1 -0
  13. package/dist/cjs/actions/package/recompile.js +2 -3
  14. package/dist/cjs/actions/package/recompile.js.map +1 -1
  15. package/dist/cjs/actions/rebuild.js +1 -2
  16. package/dist/cjs/actions/rebuild.js.map +1 -1
  17. package/dist/cjs/lib/file/ReadFileSyncOptions.js +5 -0
  18. package/dist/cjs/lib/file/ReadFileSyncOptions.js.map +1 -0
  19. package/dist/cjs/lib/file/constants.js +6 -0
  20. package/dist/cjs/lib/file/constants.js.map +1 -0
  21. package/dist/cjs/lib/file/fileLines.js +20 -0
  22. package/dist/cjs/lib/file/fileLines.js.map +1 -0
  23. package/dist/cjs/lib/file/index.js +8 -0
  24. package/dist/cjs/lib/file/index.js.map +1 -0
  25. package/dist/cjs/lib/file/tryReadFileSync.js +10 -0
  26. package/dist/cjs/lib/file/tryReadFileSync.js.map +1 -0
  27. package/dist/cjs/lib/generateIgnoreFiles.js +32 -0
  28. package/dist/cjs/lib/generateIgnoreFiles.js.map +1 -0
  29. package/dist/cjs/lib/index.js +4 -3
  30. package/dist/cjs/lib/index.js.map +1 -1
  31. package/dist/cjs/lib/string/empty.js +8 -0
  32. package/dist/cjs/lib/string/empty.js.map +1 -0
  33. package/dist/cjs/lib/string/index.js +6 -0
  34. package/dist/cjs/lib/string/index.js.map +1 -0
  35. package/dist/cjs/lib/string/union.js +6 -0
  36. package/dist/cjs/lib/string/union.js.map +1 -0
  37. package/dist/cjs/lib/xy/xyCommonCommands.js +19 -0
  38. package/dist/cjs/lib/xy/xyCommonCommands.js.map +1 -1
  39. package/dist/cjs/lib/yarn/index.js +7 -0
  40. package/dist/cjs/lib/yarn/index.js.map +1 -0
  41. package/dist/cjs/lib/yarn/isYarnVersionOrGreater.js.map +1 -0
  42. package/dist/cjs/lib/yarn/workspace/Workspace.js +3 -0
  43. package/dist/cjs/lib/yarn/workspace/Workspace.js.map +1 -0
  44. package/dist/cjs/lib/yarn/workspace/index.js +7 -0
  45. package/dist/cjs/lib/yarn/workspace/index.js.map +1 -0
  46. package/dist/cjs/lib/yarn/workspace/yarnWorkspace.js +12 -0
  47. package/dist/cjs/lib/yarn/workspace/yarnWorkspace.js.map +1 -0
  48. package/dist/cjs/lib/{yarnWorkspaces.js → yarn/workspace/yarnWorkspaces.js} +2 -0
  49. package/dist/cjs/lib/yarn/workspace/yarnWorkspaces.js.map +1 -0
  50. package/dist/cjs/lib/yarn/yarnInitCwd.js.map +1 -0
  51. package/dist/esm/actions/build.js +1 -0
  52. package/dist/esm/actions/build.js.map +1 -1
  53. package/dist/esm/actions/clean-docs.js +11 -0
  54. package/dist/esm/actions/clean-docs.js.map +1 -0
  55. package/dist/esm/actions/clean.js +2 -1
  56. package/dist/esm/actions/clean.js.map +1 -1
  57. package/dist/esm/actions/gitignore-gen.js +4 -0
  58. package/dist/esm/actions/gitignore-gen.js.map +1 -0
  59. package/dist/esm/actions/index.js +3 -0
  60. package/dist/esm/actions/index.js.map +1 -1
  61. package/dist/esm/actions/npmignore-gen.js +4 -0
  62. package/dist/esm/actions/npmignore-gen.js.map +1 -0
  63. package/dist/esm/actions/package/recompile.js +2 -3
  64. package/dist/esm/actions/package/recompile.js.map +1 -1
  65. package/dist/esm/actions/rebuild.js +1 -2
  66. package/dist/esm/actions/rebuild.js.map +1 -1
  67. package/dist/esm/lib/file/ReadFileSyncOptions.js +2 -0
  68. package/dist/esm/lib/file/ReadFileSyncOptions.js.map +1 -0
  69. package/dist/esm/lib/file/constants.js +3 -0
  70. package/dist/esm/lib/file/constants.js.map +1 -0
  71. package/dist/esm/lib/file/fileLines.js +14 -0
  72. package/dist/esm/lib/file/fileLines.js.map +1 -0
  73. package/dist/esm/lib/file/index.js +5 -0
  74. package/dist/esm/lib/file/index.js.map +1 -0
  75. package/dist/esm/lib/file/tryReadFileSync.js +6 -0
  76. package/dist/esm/lib/file/tryReadFileSync.js.map +1 -0
  77. package/dist/esm/lib/generateIgnoreFiles.js +26 -0
  78. package/dist/esm/lib/generateIgnoreFiles.js.map +1 -0
  79. package/dist/esm/lib/index.js +4 -3
  80. package/dist/esm/lib/index.js.map +1 -1
  81. package/dist/esm/lib/string/empty.js +3 -0
  82. package/dist/esm/lib/string/empty.js.map +1 -0
  83. package/dist/esm/lib/string/index.js +3 -0
  84. package/dist/esm/lib/string/index.js.map +1 -0
  85. package/dist/esm/lib/string/union.js +2 -0
  86. package/dist/esm/lib/string/union.js.map +1 -0
  87. package/dist/esm/lib/xy/xyCommonCommands.js +20 -1
  88. package/dist/esm/lib/xy/xyCommonCommands.js.map +1 -1
  89. package/dist/esm/lib/yarn/index.js +4 -0
  90. package/dist/esm/lib/yarn/index.js.map +1 -0
  91. package/dist/esm/lib/yarn/isYarnVersionOrGreater.js.map +1 -0
  92. package/dist/esm/lib/yarn/workspace/Workspace.js +2 -0
  93. package/dist/esm/lib/yarn/workspace/Workspace.js.map +1 -0
  94. package/dist/esm/lib/yarn/workspace/index.js +4 -0
  95. package/dist/esm/lib/yarn/workspace/index.js.map +1 -0
  96. package/dist/esm/lib/yarn/workspace/yarnWorkspace.js +8 -0
  97. package/dist/esm/lib/yarn/workspace/yarnWorkspace.js.map +1 -0
  98. package/dist/esm/lib/{yarnWorkspaces.js → yarn/workspace/yarnWorkspaces.js} +2 -0
  99. package/dist/esm/lib/yarn/workspace/yarnWorkspaces.js.map +1 -0
  100. package/dist/esm/lib/yarn/yarnInitCwd.js.map +1 -0
  101. package/dist/types/actions/build.d.ts.map +1 -1
  102. package/dist/types/actions/clean-docs.d.ts +2 -0
  103. package/dist/types/actions/clean-docs.d.ts.map +1 -0
  104. package/dist/types/actions/clean.d.ts.map +1 -1
  105. package/dist/types/actions/gitignore-gen.d.ts +2 -0
  106. package/dist/types/actions/gitignore-gen.d.ts.map +1 -0
  107. package/dist/types/actions/index.d.ts +3 -0
  108. package/dist/types/actions/index.d.ts.map +1 -1
  109. package/dist/types/actions/npmignore-gen.d.ts +2 -0
  110. package/dist/types/actions/npmignore-gen.d.ts.map +1 -0
  111. package/dist/types/actions/package/recompile.d.ts.map +1 -1
  112. package/dist/types/actions/rebuild.d.ts.map +1 -1
  113. package/dist/types/lib/file/ReadFileSyncOptions.d.ts +7 -0
  114. package/dist/types/lib/file/ReadFileSyncOptions.d.ts.map +1 -0
  115. package/dist/types/lib/file/constants.d.ts +3 -0
  116. package/dist/types/lib/file/constants.d.ts.map +1 -0
  117. package/dist/types/lib/file/fileLines.d.ts +6 -0
  118. package/dist/types/lib/file/fileLines.d.ts.map +1 -0
  119. package/dist/types/lib/file/index.d.ts +5 -0
  120. package/dist/types/lib/file/index.d.ts.map +1 -0
  121. package/dist/types/lib/file/tryReadFileSync.d.ts +4 -0
  122. package/dist/types/lib/file/tryReadFileSync.d.ts.map +1 -0
  123. package/dist/types/lib/generateIgnoreFiles.d.ts +2 -0
  124. package/dist/types/lib/generateIgnoreFiles.d.ts.map +1 -0
  125. package/dist/types/lib/index.d.ts +4 -3
  126. package/dist/types/lib/index.d.ts.map +1 -1
  127. package/dist/types/lib/string/empty.d.ts +3 -0
  128. package/dist/types/lib/string/empty.d.ts.map +1 -0
  129. package/dist/types/lib/string/index.d.ts +3 -0
  130. package/dist/types/lib/string/index.d.ts.map +1 -0
  131. package/dist/types/lib/string/union.d.ts +2 -0
  132. package/dist/types/lib/string/union.d.ts.map +1 -0
  133. package/dist/types/lib/xy/xyCommonCommands.d.ts.map +1 -1
  134. package/dist/types/lib/yarn/index.d.ts +4 -0
  135. package/dist/types/lib/yarn/index.d.ts.map +1 -0
  136. package/dist/types/lib/yarn/isYarnVersionOrGreater.d.ts.map +1 -0
  137. package/dist/types/lib/yarn/workspace/Workspace.d.ts +5 -0
  138. package/dist/types/lib/yarn/workspace/Workspace.d.ts.map +1 -0
  139. package/dist/types/lib/yarn/workspace/index.d.ts +4 -0
  140. package/dist/types/lib/yarn/workspace/index.d.ts.map +1 -0
  141. package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts +3 -0
  142. package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts.map +1 -0
  143. package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts +3 -0
  144. package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts.map +1 -0
  145. package/dist/types/lib/yarn/yarnInitCwd.d.ts.map +1 -0
  146. package/package.json +10 -9
  147. package/src/actions/build.ts +1 -0
  148. package/src/actions/clean-docs.ts +12 -0
  149. package/src/actions/clean.ts +2 -1
  150. package/src/actions/gitignore-gen.ts +5 -0
  151. package/src/actions/index.ts +3 -0
  152. package/src/actions/npmignore-gen.ts +5 -0
  153. package/src/actions/package/recompile.ts +2 -3
  154. package/src/actions/rebuild.ts +1 -2
  155. package/src/lib/file/ReadFileSyncOptions.ts +3 -0
  156. package/src/lib/file/constants.ts +2 -0
  157. package/src/lib/file/fileLines.ts +18 -0
  158. package/src/lib/file/index.ts +4 -0
  159. package/src/lib/file/tryReadFileSync.ts +7 -0
  160. package/src/lib/generateIgnoreFiles.ts +27 -0
  161. package/src/lib/index.ts +4 -3
  162. package/src/lib/string/empty.ts +2 -0
  163. package/src/lib/string/index.ts +2 -0
  164. package/src/lib/string/union.ts +1 -0
  165. package/src/lib/xy/xyCommonCommands.ts +34 -0
  166. package/src/lib/yarn/index.ts +3 -0
  167. package/src/lib/yarn/workspace/Workspace.ts +4 -0
  168. package/src/lib/yarn/workspace/index.ts +3 -0
  169. package/src/lib/yarn/workspace/yarnWorkspace.ts +8 -0
  170. package/src/lib/{yarnWorkspaces.ts → yarn/workspace/yarnWorkspaces.ts} +3 -4
  171. package/.depcheckrc +0 -13
  172. package/.tsconfig.build.cjs.json +0 -30
  173. package/.tsconfig.build.esm.json +0 -30
  174. package/dist/.tsconfig.build.cjs.tsbuildinfo +0 -1
  175. package/dist/.tsconfig.build.esm.tsbuildinfo +0 -1
  176. package/dist/cjs/actions/package/tsconfig-gen-cjs.js +0 -37
  177. package/dist/cjs/actions/package/tsconfig-gen-cjs.js.map +0 -1
  178. package/dist/cjs/actions/package/tsconfig-gen-esm.js +0 -39
  179. package/dist/cjs/actions/package/tsconfig-gen-esm.js.map +0 -1
  180. package/dist/cjs/actions/tsconfig-gen-cjs.js +0 -43
  181. package/dist/cjs/actions/tsconfig-gen-cjs.js.map +0 -1
  182. package/dist/cjs/actions/tsconfig-gen-clean.js +0 -27
  183. package/dist/cjs/actions/tsconfig-gen-clean.js.map +0 -1
  184. package/dist/cjs/actions/tsconfig-gen-esm.js +0 -43
  185. package/dist/cjs/actions/tsconfig-gen-esm.js.map +0 -1
  186. package/dist/cjs/actions/tsconfig-gen-test.js +0 -43
  187. package/dist/cjs/actions/tsconfig-gen-test.js.map +0 -1
  188. package/dist/cjs/actions/tsconfig-gen.js +0 -18
  189. package/dist/cjs/actions/tsconfig-gen.js.map +0 -1
  190. package/dist/cjs/bin/package/tsconfig-gen-cjs.js +0 -6
  191. package/dist/cjs/bin/package/tsconfig-gen-cjs.js.map +0 -1
  192. package/dist/cjs/bin/package/tsconfig-gen-esm.js +0 -6
  193. package/dist/cjs/bin/package/tsconfig-gen-esm.js.map +0 -1
  194. package/dist/cjs/bin/package/tsconfig-gen.js +0 -7
  195. package/dist/cjs/bin/package/tsconfig-gen.js.map +0 -1
  196. package/dist/cjs/bin/tsconfig-gen-clean.js +0 -6
  197. package/dist/cjs/bin/tsconfig-gen-clean.js.map +0 -1
  198. package/dist/cjs/bin/tsconfig-gen.js +0 -6
  199. package/dist/cjs/bin/tsconfig-gen.js.map +0 -1
  200. package/dist/cjs/lib/isYarnVersionOrGreater.js.map +0 -1
  201. package/dist/cjs/lib/yarnInitCwd.js.map +0 -1
  202. package/dist/cjs/lib/yarnWorkspaces.js.map +0 -1
  203. package/dist/esm/actions/package/tsconfig-gen-cjs.js +0 -31
  204. package/dist/esm/actions/package/tsconfig-gen-cjs.js.map +0 -1
  205. package/dist/esm/actions/package/tsconfig-gen-esm.js +0 -33
  206. package/dist/esm/actions/package/tsconfig-gen-esm.js.map +0 -1
  207. package/dist/esm/actions/tsconfig-gen-cjs.js +0 -38
  208. package/dist/esm/actions/tsconfig-gen-cjs.js.map +0 -1
  209. package/dist/esm/actions/tsconfig-gen-clean.js +0 -23
  210. package/dist/esm/actions/tsconfig-gen-clean.js.map +0 -1
  211. package/dist/esm/actions/tsconfig-gen-esm.js +0 -38
  212. package/dist/esm/actions/tsconfig-gen-esm.js.map +0 -1
  213. package/dist/esm/actions/tsconfig-gen-test.js +0 -38
  214. package/dist/esm/actions/tsconfig-gen-test.js.map +0 -1
  215. package/dist/esm/actions/tsconfig-gen.js +0 -14
  216. package/dist/esm/actions/tsconfig-gen.js.map +0 -1
  217. package/dist/esm/bin/package/tsconfig-gen-cjs.js +0 -4
  218. package/dist/esm/bin/package/tsconfig-gen-cjs.js.map +0 -1
  219. package/dist/esm/bin/package/tsconfig-gen-esm.js +0 -4
  220. package/dist/esm/bin/package/tsconfig-gen-esm.js.map +0 -1
  221. package/dist/esm/bin/package/tsconfig-gen.js +0 -5
  222. package/dist/esm/bin/package/tsconfig-gen.js.map +0 -1
  223. package/dist/esm/bin/tsconfig-gen-clean.js +0 -4
  224. package/dist/esm/bin/tsconfig-gen-clean.js.map +0 -1
  225. package/dist/esm/bin/tsconfig-gen.js +0 -4
  226. package/dist/esm/bin/tsconfig-gen.js.map +0 -1
  227. package/dist/esm/lib/isYarnVersionOrGreater.js.map +0 -1
  228. package/dist/esm/lib/yarnInitCwd.js.map +0 -1
  229. package/dist/esm/lib/yarnWorkspaces.js.map +0 -1
  230. package/dist/tsconfig.build.cjs.tsbuildinfo +0 -1
  231. package/dist/tsconfig.build.esm.tsbuildinfo +0 -1
  232. package/dist/types/actions/package/tsconfig-gen-cjs.d.ts +0 -2
  233. package/dist/types/actions/package/tsconfig-gen-cjs.d.ts.map +0 -1
  234. package/dist/types/actions/package/tsconfig-gen-esm.d.ts +0 -2
  235. package/dist/types/actions/package/tsconfig-gen-esm.d.ts.map +0 -1
  236. package/dist/types/actions/tsconfig-gen-cjs.d.ts +0 -2
  237. package/dist/types/actions/tsconfig-gen-cjs.d.ts.map +0 -1
  238. package/dist/types/actions/tsconfig-gen-clean.d.ts +0 -2
  239. package/dist/types/actions/tsconfig-gen-clean.d.ts.map +0 -1
  240. package/dist/types/actions/tsconfig-gen-esm.d.ts +0 -2
  241. package/dist/types/actions/tsconfig-gen-esm.d.ts.map +0 -1
  242. package/dist/types/actions/tsconfig-gen-test.d.ts +0 -2
  243. package/dist/types/actions/tsconfig-gen-test.d.ts.map +0 -1
  244. package/dist/types/actions/tsconfig-gen.d.ts +0 -6
  245. package/dist/types/actions/tsconfig-gen.d.ts.map +0 -1
  246. package/dist/types/bin/package/tsconfig-gen-cjs.d.ts +0 -3
  247. package/dist/types/bin/package/tsconfig-gen-cjs.d.ts.map +0 -1
  248. package/dist/types/bin/package/tsconfig-gen-esm.d.ts +0 -3
  249. package/dist/types/bin/package/tsconfig-gen-esm.d.ts.map +0 -1
  250. package/dist/types/bin/package/tsconfig-gen.d.ts +0 -3
  251. package/dist/types/bin/package/tsconfig-gen.d.ts.map +0 -1
  252. package/dist/types/bin/tsconfig-gen-clean.d.ts +0 -3
  253. package/dist/types/bin/tsconfig-gen-clean.d.ts.map +0 -1
  254. package/dist/types/bin/tsconfig-gen.d.ts +0 -3
  255. package/dist/types/bin/tsconfig-gen.d.ts.map +0 -1
  256. package/dist/types/lib/isYarnVersionOrGreater.d.ts.map +0 -1
  257. package/dist/types/lib/yarnInitCwd.d.ts.map +0 -1
  258. package/dist/types/lib/yarnWorkspaces.d.ts +0 -6
  259. package/dist/types/lib/yarnWorkspaces.d.ts.map +0 -1
  260. package/src/actions/package/tsconfig-gen-cjs.ts +0 -32
  261. package/src/actions/package/tsconfig-gen-esm.ts +0 -34
  262. package/src/actions/tsconfig-gen-cjs.ts +0 -40
  263. package/src/actions/tsconfig-gen-clean.ts +0 -24
  264. package/src/actions/tsconfig-gen-esm.ts +0 -39
  265. package/src/actions/tsconfig-gen-test.ts +0 -44
  266. package/src/actions/tsconfig-gen.ts +0 -19
  267. package/src/bin/package/tsconfig-gen-cjs.ts +0 -5
  268. package/src/bin/package/tsconfig-gen-esm.ts +0 -5
  269. package/src/bin/package/tsconfig-gen.ts +0 -6
  270. package/src/bin/tsconfig-gen-clean.ts +0 -5
  271. package/src/bin/tsconfig-gen.ts +0 -5
  272. package/tsconfig.build.cjs.json +0 -29
  273. package/tsconfig.build.esm.json +0 -29
  274. package/tsconfig.json +0 -9
  275. package/tsconfig.test.json +0 -4
  276. /package/dist/cjs/lib/{isYarnVersionOrGreater.js → yarn/isYarnVersionOrGreater.js} +0 -0
  277. /package/dist/cjs/lib/{yarnInitCwd.js → yarn/yarnInitCwd.js} +0 -0
  278. /package/dist/esm/lib/{isYarnVersionOrGreater.js → yarn/isYarnVersionOrGreater.js} +0 -0
  279. /package/dist/esm/lib/{yarnInitCwd.js → yarn/yarnInitCwd.js} +0 -0
  280. /package/dist/types/lib/{isYarnVersionOrGreater.d.ts → yarn/isYarnVersionOrGreater.d.ts} +0 -0
  281. /package/dist/types/lib/{yarnInitCwd.d.ts → yarn/yarnInitCwd.d.ts} +0 -0
  282. /package/src/lib/{isYarnVersionOrGreater.ts → yarn/isYarnVersionOrGreater.ts} +0 -0
  283. /package/src/lib/{yarnInitCwd.ts → yarn/yarnInitCwd.ts} +0 -0
package/package.json CHANGED
@@ -8,6 +8,7 @@
8
8
  "bin": {
9
9
  "build": "dist/cjs/bin/build.js",
10
10
  "clean": "dist/cjs/bin/clean.js",
11
+ "clean-docs": "dist/cjs/bin/clean-docs.js",
11
12
  "compile": "dist/cjs/bin/compile.js",
12
13
  "compile-cjs": "dist/cjs/bin/compile-cjs.js",
13
14
  "compile-esm": "dist/cjs/bin/compile-esm.js",
@@ -65,9 +66,9 @@
65
66
  "dependencies": {
66
67
  "@babel/core": "^7.22.5",
67
68
  "@babel/preset-env": "^7.22.5",
68
- "@types/node": "~18.16.18",
69
- "@typescript-eslint/eslint-plugin": "^5.60.0",
70
- "@typescript-eslint/parser": "^5.60.0",
69
+ "@types/node": "^20.3.2",
70
+ "@typescript-eslint/eslint-plugin": "^5.60.1",
71
+ "@typescript-eslint/parser": "^5.60.1",
71
72
  "chalk": "^4.1.2",
72
73
  "cpy": "^8.1.2",
73
74
  "depcheck": "^1.4.3",
@@ -77,13 +78,13 @@
77
78
  "eslint-plugin-sonarjs": "^0.19.0",
78
79
  "jest": "^29.5.0",
79
80
  "jest-environment-jsdom": "^29.5.0",
80
- "jest-extended": "^3.2.4",
81
+ "jest-extended": "^4.0.0",
81
82
  "jest-mock-extended": "^3.0.4",
82
83
  "jest-sorted": "^1.0.14",
83
84
  "license-checker": "^25.0.1",
84
85
  "lodash": "^4.17.21",
85
86
  "node-cmd": "^5.0.0",
86
- "npm-check-updates": "^16.10.12",
87
+ "npm-check-updates": "^16.10.13",
87
88
  "npm-package-json-lint": "^6.4.0",
88
89
  "npm-package-json-lint-config-default": "^5.0.0",
89
90
  "parse-git-config": "^3.0.0",
@@ -104,9 +105,9 @@
104
105
  "@types/license-checker": "^25.0.3",
105
106
  "@types/lodash": "^4.14.195",
106
107
  "@types/parse-git-config": "^3.0.1",
107
- "@xylabs/eslint-config": "^2.17.16",
108
- "@xylabs/tsconfig": "^2.17.16",
109
- "typescript": "^5.1.3"
108
+ "@xylabs/eslint-config": "^2.18.0",
109
+ "@xylabs/tsconfig": "^2.18.0",
110
+ "typescript": "^5.1.5"
110
111
  },
111
112
  "peerDependencies": {
112
113
  "typescript": "^4 || ^5"
@@ -153,5 +154,5 @@
153
154
  "compile": "tsc --build tsconfig.build.cjs.json && tsc --build tsconfig.build.esm.json"
154
155
  },
155
156
  "sideEffects": false,
156
- "version": "2.17.16"
157
+ "version": "2.18.0"
157
158
  }
@@ -24,6 +24,7 @@ export const build = async ({ incremental, jobs, target, verbose, pkg }: BuildPa
24
24
  const result = await runStepsAsync(`Build${incremental ? '-Incremental' : ''} [${pkg ?? 'All'}]`, [
25
25
  ['yarn', ['xy', 'recompile', ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
26
26
  ['yarn', ['xy', 'relint', ...pkgOptions, ...verboseOptions, ...incrementalOptions]],
27
+ ['yarn', ['xy', 'gen-docs', ...pkgOptions, ...verboseOptions, ...incrementalOptions]],
27
28
  ['yarn', ['xy', 'deps', ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
28
29
  ])
29
30
  console.log(`${chalk.gray('Built in')} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`)
@@ -0,0 +1,12 @@
1
+ import chalk from 'chalk'
2
+ import path from 'path'
3
+ import { rimrafSync } from 'rimraf'
4
+
5
+ import { yarnWorkspaces } from '../lib'
6
+
7
+ export const cleanDocs = () => {
8
+ const pkgName = process.env.npm_package_name
9
+ console.log(chalk.green(`Cleaning Docs [${pkgName}]`))
10
+ yarnWorkspaces().map(({ location }) => rimrafSync(path.join(location, 'docs'), { glob: true }))
11
+ return 0
12
+ }
@@ -1,4 +1,5 @@
1
1
  import { runSteps } from '../lib'
2
+ import { cleanDocs } from './clean-docs'
2
3
  import { cleanESLint } from './clean-eslint'
3
4
  import { cleanJest } from './clean-jest'
4
5
 
@@ -7,5 +8,5 @@ export interface CleanParams {
7
8
  }
8
9
 
9
10
  export const clean = () => {
10
- return cleanJest() + cleanESLint() + runSteps('Clean', [['yarn', 'workspaces foreach -pA run package-clean']])
11
+ return cleanJest() + cleanESLint() + cleanDocs() + runSteps('Clean', [['yarn', 'workspaces foreach -pA run package-clean']])
11
12
  }
@@ -0,0 +1,5 @@
1
+ import { generateIgnoreFiles } from '../lib'
2
+
3
+ const filename = '.gitignore'
4
+
5
+ export const gitignoreGen = (pkg?: string) => generateIgnoreFiles(filename, pkg)
@@ -1,5 +1,6 @@
1
1
  export * from './build'
2
2
  export * from './clean'
3
+ export * from './clean-docs'
3
4
  export * from './compile'
4
5
  export * from './copy-assets'
5
6
  export * from './cycle'
@@ -12,12 +13,14 @@ export * from './deps'
12
13
  export * from './dupdeps'
13
14
  export * from './fix'
14
15
  export * from './gen-docs'
16
+ export * from './gitignore-gen'
15
17
  export * from './gitlint'
16
18
  export * from './gitlint-fix'
17
19
  export * from './license'
18
20
  export * from './lint'
19
21
  export * from './lint-clean'
20
22
  export * from './lint-profile'
23
+ export * from './npmignore-gen'
21
24
  export * from './package'
22
25
  export * from './rebuild'
23
26
  export * from './recompile'
@@ -0,0 +1,5 @@
1
+ import { generateIgnoreFiles } from '../lib'
2
+
3
+ const filename = '.npmignore'
4
+
5
+ export const npmignoreGen = (pkg?: string) => generateIgnoreFiles(filename, pkg)
@@ -1,7 +1,6 @@
1
1
  import { packageClean } from './clean'
2
- import { packageCompileCjs } from './compile-cjs'
3
- import { packageCompileEsm } from './compile-esm'
2
+ import { packageCompile } from './compile'
4
3
 
5
4
  export const packageRecompile = async () => {
6
- return (await Promise.all([packageClean(), packageCompileEsm(), packageCompileCjs()])).reduce((prev, value) => prev + value, 0)
5
+ return (await Promise.all([packageClean(), packageCompile()])).reduce((prev, value) => prev + value, 0)
7
6
  }
@@ -8,7 +8,6 @@ export interface RebuildParams {
8
8
  export const rebuild = ({ target }: RebuildParams) => {
9
9
  return runSteps('Rebuild', [
10
10
  ['yarn', 'xy clean'],
11
- ['yarn', target ? `xy compile -t ${target}` : 'xy compile'],
12
- ['yarn', 'xy relint'],
11
+ ['yarn', target ? `xy build -t ${target}` : 'xy build'],
13
12
  ])
14
13
  }
@@ -0,0 +1,3 @@
1
+ export type ReadFileSyncOptions = BufferEncoding | { encoding: BufferEncoding; flags?: string }
2
+
3
+ export const defaultReadFileSyncOptions: ReadFileSyncOptions = { encoding: 'utf-8' }
@@ -0,0 +1,2 @@
1
+ export const WINDOWS_NEWLINE_REGEX = /\r\n/g
2
+ export const CROSS_PLATFORM_NEWLINE = '\n'
@@ -0,0 +1,18 @@
1
+ import { existsSync, PathLike, readFileSync, WriteFileOptions, writeFileSync } from 'node:fs'
2
+
3
+ import { notEmpty } from '../string'
4
+ import { CROSS_PLATFORM_NEWLINE, WINDOWS_NEWLINE_REGEX } from './constants'
5
+ import { defaultReadFileSyncOptions, ReadFileSyncOptions } from './ReadFileSyncOptions'
6
+
7
+ export const readLines = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string[] =>
8
+ existsSync(uri) ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : []
9
+
10
+ export const readNonEmptyLines = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string[] =>
11
+ readLines(uri, options).filter(notEmpty)
12
+
13
+ export const writeLines = (uri: PathLike, lines: string[], options: WriteFileOptions = defaultReadFileSyncOptions) => {
14
+ const existing = existsSync(uri) ? readFileSync(uri, options) : undefined
15
+ const desired = lines.join(CROSS_PLATFORM_NEWLINE)
16
+ // Check if the file is different before writing
17
+ if (existing !== desired) writeFileSync(uri, desired, options)
18
+ }
@@ -0,0 +1,4 @@
1
+ export * from './constants'
2
+ export * from './fileLines'
3
+ export * from './ReadFileSyncOptions'
4
+ export * from './tryReadFileSync'
@@ -0,0 +1,7 @@
1
+ import { existsSync, PathLike, readFileSync } from 'node:fs'
2
+
3
+ import { defaultReadFileSyncOptions, ReadFileSyncOptions } from './ReadFileSyncOptions'
4
+
5
+ export const tryReadFileSync = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string | undefined => {
6
+ return existsSync(uri) ? readFileSync(uri, options) : undefined
7
+ }
@@ -0,0 +1,27 @@
1
+ import chalk from 'chalk'
2
+
3
+ import { readNonEmptyLines, writeLines } from './file'
4
+ import { union } from './string'
5
+ import { INIT_CWD, yarnWorkspace, yarnWorkspaces } from './yarn'
6
+
7
+ const mergeEntries = (a: string[], b: string[]): string[] => [...union(a, b)].sort()
8
+
9
+ export const generateIgnoreFiles = (filename: string, pkg?: string) => {
10
+ console.log(chalk.green(`Generate ${filename} Files`))
11
+ const cwd = INIT_CWD() ?? '.'
12
+ const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces()
13
+ const readEntries = (location: string): string[] => readNonEmptyLines(`${location}/${filename}`)
14
+ const writeEntries = (location: string, entries: string[]) => writeLines(`${location}/${filename}`, entries)
15
+ const results = workspaces.map(({ location, name }) => {
16
+ try {
17
+ writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)))
18
+ return 0
19
+ } catch (ex) {
20
+ const error = ex as Error
21
+ console.error(`Generate ${filename} Files [${name}] [${error.message}]`)
22
+ return 1
23
+ }
24
+ })
25
+ const succeeded = results.every((result) => result === 0)
26
+ return succeeded ? 0 : 1
27
+ }
package/src/lib/index.ts CHANGED
@@ -2,7 +2,8 @@ export * from './checkResult'
2
2
  export * from './createBuildConfig'
3
3
  export * from './defaultBuildConfig'
4
4
  export * from './dependencies'
5
- export * from './isYarnVersionOrGreater'
5
+ export * from './file'
6
+ export * from './generateIgnoreFiles'
6
7
  export * from './jsonFormatters'
7
8
  export * from './parsedPackageJSON'
8
9
  export * from './processEx'
@@ -11,8 +12,8 @@ export * from './runStepsAsync'
11
12
  export * from './runXy'
12
13
  export * from './runXyWithWarning'
13
14
  export * from './safeExit'
15
+ export * from './string'
14
16
  export * from './withErrnoException'
15
17
  export * from './withError'
16
18
  export * from './xy'
17
- export * from './yarnInitCwd'
18
- export * from './yarnWorkspaces'
19
+ export * from './yarn'
@@ -0,0 +1,2 @@
1
+ export const empty = (value?: string | undefined): boolean => value?.trim().length === 0
2
+ export const notEmpty = (value?: string | undefined): boolean => !empty(value)
@@ -0,0 +1,2 @@
1
+ export * from './empty'
2
+ export * from './union'
@@ -0,0 +1 @@
1
+ export const union = (a: string[], b: string[]): Set<string> => new Set([...new Set(a), ...new Set(b)])
@@ -1,12 +1,15 @@
1
1
  import yargs from 'yargs'
2
2
 
3
3
  import {
4
+ cleanDocs,
4
5
  dead,
5
6
  deps,
6
7
  genDocs,
8
+ gitignoreGen,
7
9
  gitlint,
8
10
  gitlintFix,
9
11
  license,
12
+ npmignoreGen,
10
13
  retest,
11
14
  test,
12
15
  tsconfigGen,
@@ -71,6 +74,15 @@ export const xyCommonCommands = (args: yargs.Argv) => {
71
74
  process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package as string })
72
75
  },
73
76
  )
77
+ .command(
78
+ 'clean-docs',
79
+ 'CleanDocs - Clean TypeDocs',
80
+ (yargs) => yargs,
81
+ (argv) => {
82
+ if (argv.verbose) console.log('Cleaning TypeDocs: all')
83
+ process.exitCode = cleanDocs()
84
+ },
85
+ )
74
86
  .command(
75
87
  'gitlint [package]',
76
88
  'Gitlint - Lint your git config',
@@ -82,6 +94,28 @@ export const xyCommonCommands = (args: yargs.Argv) => {
82
94
  process.exitCode = argv.fix ? gitlintFix() : gitlint()
83
95
  },
84
96
  )
97
+ .command(
98
+ 'gitignore-gen',
99
+ 'GitIgnore Gen - Generate .gitignore files',
100
+ (yargs) => {
101
+ return yargs
102
+ },
103
+ (argv) => {
104
+ if (argv.verbose) console.log('GitIgnore Gen')
105
+ process.exitCode = gitignoreGen()
106
+ },
107
+ )
108
+ .command(
109
+ 'npmignore-gen',
110
+ 'NpmIgnore Gen - Generate .npmignore files',
111
+ (yargs) => {
112
+ return yargs
113
+ },
114
+ (argv) => {
115
+ if (argv.verbose) console.log('NpmIgnore Gen')
116
+ process.exitCode = npmignoreGen()
117
+ },
118
+ )
85
119
  .command(
86
120
  'retest',
87
121
  'Re-Test - Run Jest Tests with cleaned cache',
@@ -0,0 +1,3 @@
1
+ export * from './isYarnVersionOrGreater'
2
+ export * from './workspace'
3
+ export * from './yarnInitCwd'
@@ -0,0 +1,4 @@
1
+ export interface Workspace {
2
+ location: string
3
+ name: string
4
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Workspace'
2
+ export * from './yarnWorkspace'
3
+ export * from './yarnWorkspaces'
@@ -0,0 +1,8 @@
1
+ import { Workspace } from './Workspace'
2
+ import { yarnWorkspaces } from './yarnWorkspaces'
3
+
4
+ export const yarnWorkspace = (pkg: string): Workspace => {
5
+ const workspace = yarnWorkspaces().find(({ name }) => name === pkg)
6
+ if (!workspace) throw new Error(`Workspace ${pkg} not found`)
7
+ return workspace
8
+ }
@@ -1,9 +1,6 @@
1
1
  import { spawnSync } from 'child_process'
2
2
 
3
- export interface Workspace {
4
- location: string
5
- name: string
6
- }
3
+ import { Workspace } from './Workspace'
7
4
 
8
5
  export const yarnWorkspaces = (): Workspace[] => {
9
6
  const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })
@@ -12,6 +9,8 @@ export const yarnWorkspaces = (): Workspace[] => {
12
9
  }
13
10
  const list = result.stdout
14
11
  .toString()
12
+ // NOTE: This probably doesn't work on Windows
13
+ // TODO: Replace /r/n with /n first
15
14
  .split('\n')
16
15
  .slice(0, -1)
17
16
  .map((item) => {
package/.depcheckrc DELETED
@@ -1,13 +0,0 @@
1
- ignores: [
2
- "@xylabs/rollup-config",
3
- "npm-package-json-lint-config-default",
4
- "npm-check-updates",
5
- "eslint-plugin-sonarjs",
6
- "copyfiles",
7
- "jest",
8
- "jest-sorted",
9
- "ts-jest",
10
- "rollup",
11
- "node-cmd",
12
- "tslib"
13
- ]
@@ -1,30 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "src",
4
- "rootDirs": [
5
- "package.json"
6
- ],
7
- "composite": true,
8
- "declarationDir": "./dist/types",
9
- "typeRoots": [],
10
- "module": "CommonJS",
11
- "outDir": "./dist/cjs",
12
- "target": "ES6"
13
- },
14
- "extends": "@xylabs/tsconfig",
15
- "include": [
16
- "src",
17
- "src"
18
- ],
19
- "exclude": [
20
- "**/build",
21
- "**/dist",
22
- "**/node_modules",
23
- "**/*.spec.*",
24
- "**/*.spec",
25
- "**/*.stories.*",
26
- "**/*.example.*",
27
- "**/spec/*",
28
- "**/stories/*"
29
- ]
30
- }
@@ -1,30 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "src",
4
- "rootDirs": [
5
- "package.json"
6
- ],
7
- "composite": true,
8
- "declarationDir": "./dist/types",
9
- "typeRoots": [],
10
- "module": "ESNext",
11
- "outDir": "./dist/esm",
12
- "target": "ESNext"
13
- },
14
- "extends": "@xylabs/tsconfig",
15
- "include": [
16
- "src",
17
- "src"
18
- ],
19
- "exclude": [
20
- "**/build",
21
- "**/dist",
22
- "**/node_modules",
23
- "**/*.spec.*",
24
- "**/*.spec",
25
- "**/*.stories.*",
26
- "**/*.example.*",
27
- "**/spec/*",
28
- "**/stories/*"
29
- ]
30
- }