@xylabs/ts-scripts-react-yarn3 2.5.121 → 2.5.124

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 (198) hide show
  1. package/dist/cjs/actions/clean.d.ts +3 -0
  2. package/dist/cjs/actions/clean.d.ts.map +1 -0
  3. package/dist/cjs/actions/clean.js +14 -0
  4. package/dist/cjs/actions/clean.js.map +1 -0
  5. package/dist/cjs/actions/deps.d.ts +2 -0
  6. package/dist/cjs/actions/deps.d.ts.map +1 -0
  7. package/dist/cjs/actions/deps.js +9 -0
  8. package/dist/cjs/actions/deps.js.map +1 -0
  9. package/dist/cjs/actions/index.d.ts +3 -0
  10. package/dist/cjs/actions/index.d.ts.map +1 -0
  11. package/dist/cjs/actions/index.js +6 -0
  12. package/dist/cjs/actions/index.js.map +1 -0
  13. package/dist/cjs/analyze.js +2 -2
  14. package/dist/cjs/analyze.js.map +1 -1
  15. package/dist/cjs/build-ci.js +2 -2
  16. package/dist/cjs/build-ci.js.map +1 -1
  17. package/dist/cjs/build.js +2 -2
  18. package/dist/cjs/build.js.map +1 -1
  19. package/dist/cjs/clean.js +2 -4
  20. package/dist/cjs/clean.js.map +1 -1
  21. package/dist/cjs/compile-cjs.js +0 -0
  22. package/dist/cjs/compile-esm.js +0 -0
  23. package/dist/cjs/compile.js +0 -0
  24. package/dist/cjs/copy-images-cjs.js +0 -0
  25. package/dist/cjs/copy-images-esm.js +0 -0
  26. package/dist/cjs/copy-images.js +0 -0
  27. package/dist/cjs/copy-styles-cjs.js +0 -0
  28. package/dist/cjs/copy-styles-esm.js +0 -0
  29. package/dist/cjs/copy-styles.js +0 -0
  30. package/dist/cjs/cycle.js +2 -3
  31. package/dist/cjs/cycle.js.map +1 -1
  32. package/dist/cjs/dead.js +2 -2
  33. package/dist/cjs/dead.js.map +1 -1
  34. package/dist/cjs/deploy-major.js +0 -0
  35. package/dist/cjs/deploy-minor.js +0 -0
  36. package/dist/cjs/deploy.js +0 -0
  37. package/dist/cjs/deps.js +2 -4
  38. package/dist/cjs/deps.js.map +1 -1
  39. package/dist/cjs/eject.js +2 -2
  40. package/dist/cjs/eject.js.map +1 -1
  41. package/dist/cjs/fix.js +2 -2
  42. package/dist/cjs/fix.js.map +1 -1
  43. package/dist/cjs/gen-docs.js +2 -22
  44. package/dist/cjs/gen-docs.js.map +1 -1
  45. package/dist/cjs/gitlint-fix.js +2 -22
  46. package/dist/cjs/gitlint-fix.js.map +1 -1
  47. package/dist/cjs/gitlint.js +2 -45
  48. package/dist/cjs/gitlint.js.map +1 -1
  49. package/dist/cjs/license.js +2 -21
  50. package/dist/cjs/license.js.map +1 -1
  51. package/dist/cjs/lint-clean.js +2 -5
  52. package/dist/cjs/lint-clean.js.map +1 -1
  53. package/dist/cjs/lint-fast.js +2 -5
  54. package/dist/cjs/lint-fast.js.map +1 -1
  55. package/dist/cjs/lint-profile.js +2 -2
  56. package/dist/cjs/lint-profile.js.map +1 -1
  57. package/dist/cjs/lint.js +2 -2
  58. package/dist/cjs/lint.js.map +1 -1
  59. package/dist/cjs/rebuild.js +2 -5
  60. package/dist/cjs/rebuild.js.map +1 -1
  61. package/dist/cjs/reinstall.js +2 -6
  62. package/dist/cjs/reinstall.js.map +1 -1
  63. package/dist/cjs/relint.js +2 -2
  64. package/dist/cjs/relint.js.map +1 -1
  65. package/dist/cjs/sitemap.js +2 -2
  66. package/dist/cjs/sitemap.js.map +1 -1
  67. package/dist/cjs/sonar.js +2 -2
  68. package/dist/cjs/sonar.js.map +1 -1
  69. package/dist/cjs/start.js +2 -2
  70. package/dist/cjs/start.js.map +1 -1
  71. package/dist/cjs/test.js +2 -2
  72. package/dist/cjs/test.js.map +1 -1
  73. package/dist/cjs/up.js +2 -2
  74. package/dist/cjs/up.js.map +1 -1
  75. package/dist/cjs/updo.js +2 -6
  76. package/dist/cjs/updo.js.map +1 -1
  77. package/dist/cjs/yarn3only.js +2 -7
  78. package/dist/cjs/yarn3only.js.map +1 -1
  79. package/dist/esm/actions/clean.d.ts +3 -0
  80. package/dist/esm/actions/clean.d.ts.map +1 -0
  81. package/dist/esm/actions/clean.js +10 -0
  82. package/dist/esm/actions/clean.js.map +1 -0
  83. package/dist/esm/actions/deps.d.ts +2 -0
  84. package/dist/esm/actions/deps.d.ts.map +1 -0
  85. package/dist/esm/actions/deps.js +5 -0
  86. package/dist/esm/actions/deps.js.map +1 -0
  87. package/dist/esm/actions/index.d.ts +3 -0
  88. package/dist/esm/actions/index.d.ts.map +1 -0
  89. package/dist/esm/actions/index.js +3 -0
  90. package/dist/esm/actions/index.js.map +1 -0
  91. package/dist/esm/analyze.js +1 -1
  92. package/dist/esm/analyze.js.map +1 -1
  93. package/dist/esm/build-ci.js +1 -1
  94. package/dist/esm/build-ci.js.map +1 -1
  95. package/dist/esm/build.js +1 -1
  96. package/dist/esm/build.js.map +1 -1
  97. package/dist/esm/clean.js +2 -4
  98. package/dist/esm/clean.js.map +1 -1
  99. package/dist/esm/cycle.js +2 -3
  100. package/dist/esm/cycle.js.map +1 -1
  101. package/dist/esm/dead.js +2 -2
  102. package/dist/esm/dead.js.map +1 -1
  103. package/dist/esm/deps.js +2 -4
  104. package/dist/esm/deps.js.map +1 -1
  105. package/dist/esm/eject.js +1 -1
  106. package/dist/esm/eject.js.map +1 -1
  107. package/dist/esm/fix.js +2 -2
  108. package/dist/esm/fix.js.map +1 -1
  109. package/dist/esm/gen-docs.js +2 -22
  110. package/dist/esm/gen-docs.js.map +1 -1
  111. package/dist/esm/gitlint-fix.js +2 -21
  112. package/dist/esm/gitlint-fix.js.map +1 -1
  113. package/dist/esm/gitlint.js +2 -44
  114. package/dist/esm/gitlint.js.map +1 -1
  115. package/dist/esm/license.js +2 -21
  116. package/dist/esm/license.js.map +1 -1
  117. package/dist/esm/lint-clean.js +2 -5
  118. package/dist/esm/lint-clean.js.map +1 -1
  119. package/dist/esm/lint-fast.js +2 -4
  120. package/dist/esm/lint-fast.js.map +1 -1
  121. package/dist/esm/lint-profile.js +2 -2
  122. package/dist/esm/lint-profile.js.map +1 -1
  123. package/dist/esm/lint.js +2 -2
  124. package/dist/esm/lint.js.map +1 -1
  125. package/dist/esm/rebuild.js +2 -5
  126. package/dist/esm/rebuild.js.map +1 -1
  127. package/dist/esm/reinstall.js +2 -6
  128. package/dist/esm/reinstall.js.map +1 -1
  129. package/dist/esm/relint.js +2 -2
  130. package/dist/esm/relint.js.map +1 -1
  131. package/dist/esm/sitemap.js +1 -1
  132. package/dist/esm/sitemap.js.map +1 -1
  133. package/dist/esm/sonar.js +2 -2
  134. package/dist/esm/sonar.js.map +1 -1
  135. package/dist/esm/start.js +1 -1
  136. package/dist/esm/start.js.map +1 -1
  137. package/dist/esm/test.js +1 -1
  138. package/dist/esm/test.js.map +1 -1
  139. package/dist/esm/up.js +2 -2
  140. package/dist/esm/up.js.map +1 -1
  141. package/dist/esm/updo.js +2 -6
  142. package/dist/esm/updo.js.map +1 -1
  143. package/dist/esm/yarn3only.js +2 -7
  144. package/dist/esm/yarn3only.js.map +1 -1
  145. package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
  146. package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
  147. package/package.json +5 -23
  148. package/src/actions/clean.ts +10 -0
  149. package/src/actions/deps.ts +5 -0
  150. package/src/actions/index.ts +2 -0
  151. package/src/analyze.ts +1 -1
  152. package/src/build-ci.ts +1 -1
  153. package/src/build.ts +1 -1
  154. package/src/clean.ts +2 -6
  155. package/src/cycle.ts +2 -4
  156. package/src/dead.ts +2 -2
  157. package/src/deps.ts +2 -11
  158. package/src/eject.ts +1 -1
  159. package/src/fix.ts +2 -2
  160. package/src/gitlint-fix.ts +2 -26
  161. package/src/gitlint.ts +2 -46
  162. package/src/license.ts +2 -29
  163. package/src/lint-clean.ts +2 -5
  164. package/src/lint-fast.ts +2 -6
  165. package/src/lint-profile.ts +2 -2
  166. package/src/lint.ts +2 -2
  167. package/src/rebuild.ts +2 -5
  168. package/src/reinstall.ts +2 -6
  169. package/src/relint.ts +2 -2
  170. package/src/sitemap.ts +1 -1
  171. package/src/sonar.ts +3 -2
  172. package/src/start.ts +1 -1
  173. package/src/test.ts +1 -1
  174. package/src/up.ts +2 -2
  175. package/src/updo.ts +2 -6
  176. package/src/yarn3only.ts +3 -7
  177. package/src/compile-cjs.ts +0 -9
  178. package/src/compile-esm.ts +0 -9
  179. package/src/compile.ts +0 -13
  180. package/src/copy-images-cjs.ts +0 -21
  181. package/src/copy-images-esm.ts +0 -21
  182. package/src/copy-images.ts +0 -8
  183. package/src/copy-styles-cjs.ts +0 -21
  184. package/src/copy-styles-esm.ts +0 -21
  185. package/src/copy-styles.ts +0 -8
  186. package/src/deploy-major.ts +0 -13
  187. package/src/deploy-minor.ts +0 -13
  188. package/src/deploy.ts +0 -13
  189. package/src/gen-docs.ts +0 -26
  190. package/src/lib/index.ts +0 -8
  191. package/src/lib/isYarnVersionOrGreater.ts +0 -16
  192. package/src/lib/processEx.ts +0 -28
  193. package/src/lib/runSteps.ts +0 -29
  194. package/src/lib/safeExit.ts +0 -13
  195. package/src/lib/withErrnoException.ts +0 -6
  196. package/src/lib/withError.ts +0 -8
  197. package/src/lib/yarnInitCwd.ts +0 -4
  198. package/src/lib/yarnWorkspaces.ts +0 -21
package/src/analyze.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
5
  runSteps('Analyze', [['yarn', ['source-map-explorer', 'build/static/js/*.js']]])
package/src/build-ci.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
5
  runSteps('Build CI', [
6
6
  ['yarn', 'react-scripts build'],
package/src/build.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
5
  runSteps('Build', [
6
6
  ['yarn', 'version patch --deferred'],
package/src/clean.ts CHANGED
@@ -1,8 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
2
+ import { clean } from './actions'
3
3
 
4
- const workspaces = yarnWorkspaces()
5
-
6
- const steps = workspaces.map<ScriptStep>(({ location }) => ['./node_modules/rimraf/bin.js', ['-q', `${location}/dist`]])
7
-
8
- runSteps('Deps', steps)
4
+ clean()
package/src/cycle.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { cycle } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- const rules = ['"\'import/no-cycle\': [1, { maxDepth: 6 }]"', "\"'import/no-internal-modules': ['off']\""]
6
-
7
- runSteps('Cycle', [['node', ['./node_modules/eslint/bin/eslint.js', ...rules.map((rule) => ['--rule', rule]).flat(), '--cache', '.']]])
5
+ cycle()
package/src/dead.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { dead } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Dead', [['yarn', 'ts-prune']])
5
+ dead()
package/src/deps.ts CHANGED
@@ -1,14 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
3
+ import { deps } from './actions'
4
4
 
5
- const workspaces = yarnWorkspaces()
6
-
7
- const steps = workspaces.map<ScriptStep>(({ location }) => ['node', ['./node_modules/depcheck/bin/depcheck.js', `${location}/.`]])
8
-
9
- runSteps(
10
- 'Deps',
11
- steps,
12
- false,
13
- workspaces.map(({ name }) => name),
14
- )
5
+ deps()
package/src/eject.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
5
  runSteps('Eject', [['yarn', 'react-scripts eject']])
package/src/fix.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { fix } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Fix', [['node', ['./node_modules/eslint/bin/eslint.js', '.', '--fix', '--cache']]])
5
+ fix()
@@ -1,29 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import chalk from 'chalk'
3
- import { execSync } from 'child_process'
4
- import { sync } from 'parse-git-config'
5
2
 
6
- import { safeExit } from './lib'
3
+ import { gitlintFix } from '@xylabs/ts-scripts-yarn3'
7
4
 
8
- safeExit(() => {
9
- console.log(`\nGitlint Fix Start [${process.cwd()}]\n`)
10
-
11
- const gitConfig = sync()
12
-
13
- if (gitConfig.core.ignorecase) {
14
- execSync('git config core.ignorecase false', { stdio: 'inherit' })
15
- console.warn(chalk.yellow('\nGitlint Fix: Updated core.ignorecase to be false\n'))
16
- }
17
-
18
- if (gitConfig.core.autocrlf !== false) {
19
- execSync('git config core.autocrlf false', { stdio: 'inherit' })
20
- console.warn(chalk.yellow('\nGitlint Fix: Updated core.autocrlf to be false\n'))
21
- }
22
-
23
- if (gitConfig.core.eol !== 'lf') {
24
- execSync('git config core.eol lf', { stdio: 'inherit' })
25
- console.warn(chalk.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'))
26
- }
27
-
28
- return 1
29
- })
5
+ gitlintFix()
package/src/gitlint.ts CHANGED
@@ -1,49 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import chalk from 'chalk'
3
- import { sync } from 'parse-git-config'
4
2
 
5
- import { safeExit } from './lib'
3
+ import { gitlint } from '@xylabs/ts-scripts-yarn3'
6
4
 
7
- safeExit(() => {
8
- console.log(`\nGitlint Start [${process.cwd()}]\n`)
9
- let valid = 0
10
- let warnings = 0
11
- const errors = 0
12
- const gitConfig = sync()
13
-
14
- const warn = (message: string) => {
15
- console.warn(chalk.yellow(`Warning: ${message}`))
16
- warnings++
17
- }
18
-
19
- if (gitConfig.core.ignorecase) {
20
- warn('Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]')
21
- } else {
22
- valid++
23
- }
24
-
25
- if (gitConfig.core.autocrlf !== false) {
26
- warn('Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]')
27
- } else {
28
- valid++
29
- }
30
-
31
- if (gitConfig.core.eol !== 'lf') {
32
- warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]')
33
- } else {
34
- valid++
35
- }
36
-
37
- const resultMessages: string[] = []
38
- if (valid > 0) {
39
- resultMessages.push(chalk.green(`Passed: ${valid}`))
40
- }
41
- if (warnings > 0) {
42
- resultMessages.push(chalk.yellow(`Warnings: ${warnings}`))
43
- }
44
- if (errors > 0) {
45
- resultMessages.push(chalk.red(` Errors: ${errors}`))
46
- }
47
- console.warn(`Gitlint Finish [ ${resultMessages.join(' | ')} ]\n`)
48
- return warnings + errors === 0 ? 1 : 0
49
- })
5
+ gitlint()
package/src/license.ts CHANGED
@@ -1,32 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
3
+ import { license } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- const workspaces = yarnWorkspaces()
6
-
7
- const exclude: string[] = [
8
- 'MIT',
9
- 'ISC',
10
- 'Apache-2.0',
11
- 'BSD',
12
- 'BSD-2-Clause',
13
- 'CC-BY-4.0',
14
- 'Unlicense',
15
- 'CC-BY-3.0',
16
- 'CC0-1.0',
17
- 'LGPL-3.0-only',
18
- 'LGPL-3.0',
19
- 'LGPL-3.0-or-later',
20
- ]
21
-
22
- const steps = workspaces.map<ScriptStep>(({ location }) => [
23
- 'node',
24
- ['./node_modules/license-checker/bin/license-checker', '--start', `./${location}`, '--exclude', `'${exclude.join(', ')}'`, '--production'],
25
- ])
26
-
27
- runSteps(
28
- 'License',
29
- steps,
30
- false,
31
- workspaces.map(({ name }) => name),
32
- )
5
+ license()
package/src/lint-clean.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { lintClean } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Lint [Clean]', [
6
- ['node', ['./node_modules/rimraf/bin.js', '.eslintcache']],
7
- ['node', ['./node_modules/eslint/bin/eslint.js', '.', '--cache']],
8
- ])
5
+ lintClean()
package/src/lint-fast.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import chalk from 'chalk'
3
+ import { lintFast } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- import { runSteps } from './lib'
6
-
7
- console.log(chalk.magenta("Deprected. Use 'yarn lint' instead"))
8
-
9
- runSteps('Lint [Caching]', [['node', ['./node_modules/eslint/bin/eslint.js', '.', '--cache']]])
5
+ lintFast()
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { lintProfile } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Lint Profile', [['node', ['./node_modules/eslint/bin/eslint.js', '.'], { env: { ...process.env, TIMING: '1' } }]])
5
+ lintProfile()
package/src/lint.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { lint } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Lint [Caching]', [['node', ['./node_modules/eslint/bin/eslint.js', '.', '--cache']]])
5
+ lint()
package/src/rebuild.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { rebuild } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Rebuild', [
6
- ['yarn', 'clean'],
7
- ['yarn', 'build'],
8
- ])
5
+ rebuild()
package/src/reinstall.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { reinstall } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Reinstall', [
6
- ['node', './node_modules/rimraf/bin.js ./yarn.lock'],
7
- ['node', './node_modules/rimraf/bin.js ./node_modules'],
8
- ['yarn', 'install --network-timeout 10000'],
9
- ])
5
+ reinstall()
package/src/relint.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { relint } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Relint [Caching]', [['node', ['./node_modules/eslint/bin/eslint.js', '.']]])
5
+ relint()
package/src/sitemap.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
5
  runSteps('Sitemap', [['ts-node-script', './scripts/sitemap.ts']])
package/src/sonar.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runSteps } from './lib'
3
2
 
4
- runSteps('Sonar', [['node', ['./node_modules/eslint/bin/eslint.js', '-c', 'sonar.eslintrc', '.']]])
3
+ import { sonar } from '@xylabs/ts-scripts-yarn3'
4
+
5
+ sonar()
package/src/start.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
5
  runSteps('Start', [['yarn', 'react-scripts start']])
package/src/test.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
5
  runSteps('Test', [['yarn', 'react-scripts test']])
package/src/up.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { up } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Up', [['yarn', 'outdated']])
5
+ up()
package/src/updo.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from './lib'
3
+ import { updo } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Updo', [
6
- ['yarn', 'install'],
7
- ['yarn', 'upgrade-interactive'],
8
- ['yarn', 'dedupe'],
9
- ])
5
+ updo()
package/src/yarn3only.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { isYarnVersionOrGreater, processEx, safeExit } from './lib'
4
- safeExit(() => {
5
- const [valid, version] = isYarnVersionOrGreater(3)
6
- if (!valid) {
7
- processEx(`Invalid Yarn version [${version}]`)
8
- }
9
- })
3
+ import { yarn3Only } from '@xylabs/ts-scripts-yarn3'
4
+
5
+ yarn3Only()
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runSteps } from './lib'
4
-
5
- runSteps('Compile [CJS]', [
6
- ['yarn', 'workspaces foreach -ptA exec tsc -p ./tsconfig.build.cjs.json'],
7
- ['yarn', 'copy-images:cjs'],
8
- ['yarn', 'copy-styles:cjs'],
9
- ])
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runSteps } from './lib'
4
-
5
- runSteps('Compile [ESM]', [
6
- ['yarn', 'workspaces foreach -ptA exec tsc -p ./tsconfig.build.esm.json'],
7
- ['yarn', 'copy-images:esm'],
8
- ['yarn', 'copy-styles:esm'],
9
- ])
package/src/compile.ts DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runSteps } from './lib'
4
-
5
- runSteps('Compile', [
6
- ['yarn', 'compile:esm'],
7
- ['yarn', 'compile:cjs'],
8
- ['yarn', 'copy-images:esm'],
9
- ['yarn', 'copy-images:cjs'],
10
- ['yarn', 'copy-styles:esm'],
11
- ['yarn', 'copy-styles:cjs'],
12
- ['yarn', 'deps'],
13
- ])
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import chalk from 'chalk'
4
- import cpy from 'cpy'
5
-
6
- import { yarnWorkspaces } from './lib'
7
-
8
- const workspaces = yarnWorkspaces()
9
-
10
- console.log(chalk.green('Copying Images [CJS]'))
11
-
12
- workspaces.forEach(({ name, location }) => {
13
- return cpy(['**/*.jpg', '**/*.png', '**/*.gif', '**/*.svg', '**/*.webp'], '../dist/cjs', {
14
- cwd: `${process.cwd()}/${location}/src`,
15
- parents: true,
16
- })
17
- .then((values) => values.forEach((value) => console.log(`Copied: ${value}`)))
18
- .catch((reason) => {
19
- console.log(`Copy Failed: ${name}: ${reason}`)
20
- })
21
- })
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import chalk from 'chalk'
4
- import cpy from 'cpy'
5
-
6
- import { yarnWorkspaces } from './lib'
7
-
8
- const workspaces = yarnWorkspaces()
9
-
10
- console.log(chalk.green('Copying Images [ESM]'))
11
-
12
- workspaces.forEach(({ name, location }) => {
13
- return cpy(['**/*.jpg', '**/*.png', '**/*.gif', '**/*.svg', '**/*.webp'], '../dist/esm', {
14
- cwd: `${process.cwd()}/${location}/src`,
15
- parents: true,
16
- })
17
- .then((values) => values.forEach((value) => console.log(`Copied: ${value}`)))
18
- .catch((reason) => {
19
- console.log(`Copy Failed: ${name}: ${reason}`)
20
- })
21
- })
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runSteps } from './lib'
4
-
5
- runSteps('Copy Images', [
6
- ['yarn', 'copy-images:esm'],
7
- ['yarn', 'copy-images:cjs'],
8
- ])
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import chalk from 'chalk'
4
- import cpy from 'cpy'
5
-
6
- import { yarnWorkspaces } from './lib'
7
-
8
- const workspaces = yarnWorkspaces()
9
-
10
- console.log(chalk.green('Copying Styles [CJS]'))
11
-
12
- workspaces.forEach(({ name, location }) => {
13
- return cpy(['**/*.sass', '**/*.scss', '**/*.gif', '**/*.css'], '../dist/cjs', {
14
- cwd: `${process.cwd()}/${location}/src`,
15
- parents: true,
16
- })
17
- .then((values) => values.forEach((value) => console.log(`Copied: ${value}`)))
18
- .catch((reason) => {
19
- console.log(`Copy Failed: ${name}: ${reason}`)
20
- })
21
- })
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import chalk from 'chalk'
4
- import cpy from 'cpy'
5
-
6
- import { yarnWorkspaces } from './lib'
7
-
8
- const workspaces = yarnWorkspaces()
9
-
10
- console.log(chalk.green('Copying Styles [ESM]'))
11
-
12
- workspaces.forEach(({ name, location }) => {
13
- return cpy(['**/*.sass', '**/*.scss', '**/*.gif', '**/*.css'], '../dist/esm', {
14
- cwd: `${process.cwd()}/${location}/src`,
15
- parents: true,
16
- })
17
- .then((values) => values.forEach((value) => console.log(`Copied: ${value}`)))
18
- .catch((reason) => {
19
- console.log(`Copy Failed: ${name}: ${reason}`)
20
- })
21
- })
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runSteps } from './lib'
4
-
5
- runSteps('Copy Styles', [
6
- ['yarn', 'copy-styles:esm'],
7
- ['yarn', 'copy-styles:cjs'],
8
- ])
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runSteps } from './lib'
4
-
5
- runSteps('Deploy [Major]', [
6
- ['yarn', 'clean'],
7
- ['yarn', 'workspaces foreach --all version minor --deferred'],
8
- ['yarn', 'build'],
9
- ['yarn', 'cycle'],
10
- ['yarn', 'gen-docs'],
11
- ['yarn', 'version apply --all'],
12
- ['yarn', 'workspaces foreach -pt npm publish'],
13
- ])
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runSteps } from './lib'
4
-
5
- runSteps('Deploy [Minor]', [
6
- ['yarn', 'clean'],
7
- ['yarn', 'workspaces foreach --all version minor --deferred'],
8
- ['yarn', 'build'],
9
- ['yarn', 'cycle'],
10
- ['yarn', 'gen-docs'],
11
- ['yarn', 'version apply --all'],
12
- ['yarn', 'workspaces foreach -pt npm publish'],
13
- ])
package/src/deploy.ts DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runSteps } from './lib'
4
-
5
- runSteps('Deploy [Patch]', [
6
- ['yarn', 'clean'],
7
- ['yarn', 'workspaces foreach --all version patch --deferred'],
8
- ['yarn', 'build'],
9
- ['yarn', 'cycle'],
10
- ['yarn', 'gen-docs'],
11
- ['yarn', 'version apply --all'],
12
- ['yarn', 'workspaces foreach -pt npm publish'],
13
- ])
package/src/gen-docs.ts DELETED
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { cwd } from 'process'
4
-
5
- import { runSteps } from './lib'
6
-
7
- runSteps('Generate TypeDocs', [
8
- [
9
- 'yarn',
10
- [
11
- 'workspaces',
12
- 'foreach',
13
- '-ptA',
14
- 'exec',
15
- `${cwd()}/node_modules/typedoc/bin/typedoc`,
16
- '--logLevel',
17
- 'Error',
18
- '--tsconfig',
19
- './tsconfig.build.esm.json',
20
- '--excludeExternals',
21
- './src/index.ts',
22
- '--json',
23
- './dist/docs.json',
24
- ],
25
- ],
26
- ])
package/src/lib/index.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './isYarnVersionOrGreater'
2
- export * from './processEx'
3
- export * from './runSteps'
4
- export * from './safeExit'
5
- export * from './withErrnoException'
6
- export * from './withError'
7
- export * from './yarnInitCwd'
8
- export * from './yarnWorkspaces'
@@ -1,16 +0,0 @@
1
- import { spawnSync } from 'child_process'
2
-
3
- export const isYarnVersionOrGreater = (major: number, minor?: number, patch?: number): [boolean, string] => {
4
- const result = spawnSync('yarn', ['-v'], { encoding: 'utf8', shell: true })
5
- const version = result.stdout.toString().replaceAll('\n', '')
6
- const versionNumbers = version.split('.').map((ver) => parseInt(ver))
7
- const majorDelta = versionNumbers[0] - major
8
- const minorDelta = versionNumbers[1] - (minor ?? versionNumbers[1])
9
- const patchDelta = versionNumbers[2] - (patch ?? versionNumbers[2])
10
-
11
- const majorOk = majorDelta >= 0
12
- const minorOk = majorDelta > 0 || minorDelta >= 0
13
- const patchOk = majorDelta > 0 || minorDelta > 0 || patchDelta >= 0
14
-
15
- return [majorOk && minorOk && patchOk, version]
16
- }
@@ -1,28 +0,0 @@
1
- import chalk from 'chalk'
2
-
3
- import { withErrnoException } from './withErrnoException'
4
- import { withError } from './withError'
5
-
6
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
- export const processEx = (ex: any) => {
8
- const error = typeof ex === 'string' ? Error(ex) : ex
9
- const exitCode =
10
- withErrnoException(error, (error) => {
11
- if (error.code === 'ENOENT') {
12
- console.error(chalk.red(`'${error.path}' not found.`))
13
- } else {
14
- console.error(chalk.red(`Errno: ${error.code}`))
15
- }
16
- return error.errno ?? -1
17
- }) ??
18
- withError(error, (error) => {
19
- console.error(chalk.red(`${error.name}: ${error.message}`))
20
- return -1
21
- }) ??
22
- (() => {
23
- console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))
24
- return -1
25
- })()
26
- //This allows us to use a previously set exit code
27
- process.exit(process.exitCode ?? exitCode)
28
- }