@xylabs/ts-scripts-react-yarn3 2.5.88 → 2.5.91

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 (99) hide show
  1. package/dist/cjs/build-ci.js +1 -1
  2. package/dist/cjs/build-ci.js.map +1 -1
  3. package/dist/cjs/build.js +1 -1
  4. package/dist/cjs/build.js.map +1 -1
  5. package/dist/cjs/clean.js +0 -0
  6. package/dist/cjs/compile-cjs.js +0 -0
  7. package/dist/cjs/compile-esm.js +0 -0
  8. package/dist/cjs/compile.js +1 -0
  9. package/dist/cjs/compile.js.map +1 -1
  10. package/dist/cjs/copy-images-cjs.js +0 -0
  11. package/dist/cjs/copy-images-esm.js +0 -0
  12. package/dist/cjs/copy-images.js +0 -0
  13. package/dist/cjs/cycle.js +0 -1
  14. package/dist/cjs/cycle.js.map +1 -1
  15. package/dist/cjs/dead.js +0 -0
  16. package/dist/cjs/deploy-major.js +0 -0
  17. package/dist/cjs/deploy-minor.js +0 -0
  18. package/dist/cjs/deploy.js +1 -1
  19. package/dist/cjs/deploy.js.map +1 -1
  20. package/dist/cjs/deps.js +0 -0
  21. package/dist/cjs/fix.js +0 -0
  22. package/dist/cjs/gen-docs.js +18 -13
  23. package/dist/cjs/gen-docs.js.map +1 -1
  24. package/dist/cjs/gitlint-fix.js +0 -0
  25. package/dist/cjs/gitlint.js +0 -0
  26. package/dist/cjs/lib/runSteps.d.ts.map +1 -1
  27. package/dist/cjs/lib/runSteps.js.map +1 -1
  28. package/dist/cjs/license.js +0 -0
  29. package/dist/cjs/lint-fast.js +0 -0
  30. package/dist/cjs/lint-profile.js +0 -0
  31. package/dist/cjs/lint.js +0 -0
  32. package/dist/cjs/migrate.js +0 -0
  33. package/dist/cjs/rebuild.js +0 -0
  34. package/dist/cjs/reinstall.js +0 -0
  35. package/dist/cjs/relint.d.ts +3 -0
  36. package/dist/cjs/relint.d.ts.map +1 -0
  37. package/dist/cjs/relint.js +6 -0
  38. package/dist/cjs/relint.js.map +1 -0
  39. package/dist/cjs/sonar.js +0 -0
  40. package/dist/cjs/up.js +0 -0
  41. package/dist/cjs/up3.js +0 -0
  42. package/dist/cjs/updo.js +0 -0
  43. package/dist/cjs/updo3.js +0 -0
  44. package/dist/cjs/yarn3only.js +0 -0
  45. package/dist/esm/build-ci.js +1 -1
  46. package/dist/esm/build-ci.js.map +1 -1
  47. package/dist/esm/build.js +1 -1
  48. package/dist/esm/build.js.map +1 -1
  49. package/dist/esm/compile.js +1 -0
  50. package/dist/esm/compile.js.map +1 -1
  51. package/dist/esm/cycle.js +0 -1
  52. package/dist/esm/cycle.js.map +1 -1
  53. package/dist/esm/deploy.js +1 -1
  54. package/dist/esm/deploy.js.map +1 -1
  55. package/dist/esm/gen-docs.js +19 -14
  56. package/dist/esm/gen-docs.js.map +1 -1
  57. package/dist/esm/lib/runSteps.d.ts.map +1 -1
  58. package/dist/esm/lib/runSteps.js +6 -1
  59. package/dist/esm/lib/runSteps.js.map +1 -1
  60. package/dist/esm/relint.d.ts +3 -0
  61. package/dist/esm/relint.d.ts.map +1 -0
  62. package/dist/esm/relint.js +4 -0
  63. package/dist/esm/relint.js.map +1 -0
  64. package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
  65. package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
  66. package/package.json +56 -4
  67. package/src/build-ci.ts +1 -1
  68. package/src/build.ts +1 -1
  69. package/src/clean.ts +8 -0
  70. package/src/compile-cjs.ts +5 -0
  71. package/src/compile-esm.ts +5 -0
  72. package/src/compile.ts +11 -0
  73. package/src/copy-images-cjs.ts +24 -0
  74. package/src/copy-images-esm.ts +24 -0
  75. package/src/copy-images.ts +8 -0
  76. package/src/cycle.ts +7 -0
  77. package/src/dead.ts +5 -0
  78. package/src/deploy-major.ts +11 -0
  79. package/src/deploy-minor.ts +11 -0
  80. package/src/deploy.ts +12 -0
  81. package/src/deps.ts +14 -0
  82. package/src/fix.ts +5 -0
  83. package/src/gen-docs.ts +26 -0
  84. package/src/gitlint-fix.ts +29 -0
  85. package/src/gitlint.ts +49 -0
  86. package/src/lib/runSteps.ts +6 -1
  87. package/src/lib/withError.ts +1 -1
  88. package/src/license.ts +32 -0
  89. package/src/lint-clean.ts +8 -0
  90. package/src/lint-fast.ts +9 -0
  91. package/src/lint-profile.ts +5 -0
  92. package/src/lint.ts +5 -0
  93. package/src/rebuild.ts +8 -0
  94. package/src/reinstall.ts +9 -0
  95. package/src/relint.ts +5 -0
  96. package/src/sonar.ts +4 -0
  97. package/src/up.ts +5 -0
  98. package/src/updo.ts +9 -0
  99. package/src/yarn3only.ts +9 -0
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
4
+
5
+ const workspaces = yarnWorkspaces()
6
+
7
+ const steps = workspaces.map<ScriptStep>(({ location }) => [
8
+ 'node',
9
+ [
10
+ './node_modules/cpy-cli/cli.js',
11
+ `${location}/src/**/*.jpg`,
12
+ `${location}/src/**/*.png`,
13
+ `${location}/src/**/*.gif`,
14
+ `${location}/src/**/*.svg`,
15
+ `${location}/dist/cjs`,
16
+ ],
17
+ ])
18
+
19
+ runSteps(
20
+ 'Copy Images [CJS]',
21
+ steps,
22
+ false,
23
+ workspaces.map(({ name }) => name),
24
+ )
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
4
+
5
+ const workspaces = yarnWorkspaces()
6
+
7
+ const steps = workspaces.map<ScriptStep>(({ location }) => [
8
+ 'node',
9
+ [
10
+ './node_modules/cpy-cli/cli.js',
11
+ `${location}/src/**/*.jpg`,
12
+ `${location}/src/**/*.png`,
13
+ `${location}/src/**/*.gif`,
14
+ `${location}/src/**/*.svg`,
15
+ `${location}/dist/esm`,
16
+ ],
17
+ ])
18
+
19
+ runSteps(
20
+ 'Copy Images [ESM]',
21
+ steps,
22
+ false,
23
+ workspaces.map(({ name }) => name),
24
+ )
@@ -0,0 +1,8 @@
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
+ ])
package/src/cycle.ts ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
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', '.']]])
package/src/dead.ts ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Dead', [['yarn', 'ts-prune']])
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Deploy [Major]', [
6
+ ['yarn', 'workspaces foreach --all version minor --deferred'],
7
+ ['yarn', 'cycle'],
8
+ ['yarn', 'build'],
9
+ ['yarn', 'version apply --all'],
10
+ ['yarn', 'workspaces foreach -pt npm publish'],
11
+ ])
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Deploy [Minor]', [
6
+ ['yarn', 'workspaces foreach --all version minor --deferred'],
7
+ ['yarn', 'cycle'],
8
+ ['yarn', 'build'],
9
+ ['yarn', 'version apply --all'],
10
+ ['yarn', 'workspaces foreach -pt npm publish'],
11
+ ])
package/src/deploy.ts ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Deploy [Patch]', [
6
+ ['yarn', 'workspaces foreach --all version patch --deferred'],
7
+ ['yarn', 'build'],
8
+ ['yarn', 'cycle'],
9
+ ['yarn', 'gen-docs'],
10
+ ['yarn', 'version apply --all'],
11
+ ['yarn', 'workspaces foreach -pt npm publish'],
12
+ ])
package/src/deps.ts ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
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
+ )
package/src/fix.ts ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Fix', [['node', ['./node_modules/eslint/bin/eslint.js', '.', '--fix', '--cache']]])
@@ -0,0 +1,26 @@
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
+ ])
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ import chalk from 'chalk'
3
+ import { execSync } from 'child_process'
4
+ import { sync } from 'parse-git-config'
5
+
6
+ import { safeExit } from './lib'
7
+
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
+ })
package/src/gitlint.ts ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+ import chalk from 'chalk'
3
+ import { sync } from 'parse-git-config'
4
+
5
+ import { safeExit } from './lib'
6
+
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
+ })
@@ -15,7 +15,12 @@ export const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, m
15
15
  if (messages?.[i]) {
16
16
  console.log(chalk.gray(messages?.[i]))
17
17
  }
18
- const status = spawnSync(command, Array.isArray(args) ? args : args.split(' '), { ...config, encoding: 'utf8', shell: true, stdio: 'inherit' }).status
18
+ const status = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {
19
+ ...config,
20
+ encoding: 'utf8',
21
+ shell: true,
22
+ stdio: 'inherit',
23
+ }).status
19
24
  if (status && exitOnFail) {
20
25
  return status
21
26
  }
@@ -2,7 +2,7 @@ export const withError = <T extends Error = Error>(
2
2
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
3
  ex: any,
4
4
  closure: (error: T) => number,
5
- predicate = (ex: T) => ex.name !== undefined && ex.message !== undefined
5
+ predicate = (ex: T) => ex.name !== undefined && ex.message !== undefined,
6
6
  ) => {
7
7
  return predicate(ex as T) ? closure(ex as T) : undefined
8
8
  }
package/src/license.ts ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
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
+ )
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Lint [Clean]', [
6
+ ['node', ['./node_modules/rimraf/bin.js', '.eslintcache']],
7
+ ['node', ['./node_modules/eslint/bin/eslint.js', '.', '--cache']],
8
+ ])
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ import chalk from 'chalk'
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']]])
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Lint Profile', [['node', ['./node_modules/eslint/bin/eslint.js', '.'], { env: { ...process.env, TIMING: '1' } }]])
package/src/lint.ts ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Lint [Caching]', [['node', ['./node_modules/eslint/bin/eslint.js', '.', '--cache']]])
package/src/rebuild.ts ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Rebuild', [
6
+ ['yarn', 'clean'],
7
+ ['yarn', 'build'],
8
+ ])
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
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
+ ])
package/src/relint.ts ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Relint [Caching]', [['node', ['./node_modules/eslint/bin/eslint.js', '.']]])
package/src/sonar.ts ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { runSteps } from './lib'
3
+
4
+ runSteps('Sonar', [['node', ['./node_modules/eslint/bin/eslint.js', '-c', 'sonar.eslintrc', '.']]])
package/src/up.ts ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Up', [['yarn', 'outdated']])
package/src/updo.ts ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runSteps } from './lib'
4
+
5
+ runSteps('Updo', [
6
+ ['yarn', 'install'],
7
+ ['yarn', 'upgrade-interactive'],
8
+ ['yarn', 'dedupe'],
9
+ ])
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
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
+ })