@xylabs/ts-scripts-react-yarn3 2.7.0-rc.31 → 2.7.0-rc.34

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 (111) hide show
  1. package/dist/cjs/actions/analyze.js +1 -1
  2. package/dist/cjs/actions/build-ci.d.ts +3 -0
  3. package/dist/cjs/actions/build-ci.d.ts.map +1 -0
  4. package/dist/cjs/actions/build-ci.js +15 -0
  5. package/dist/cjs/actions/build-ci.js.map +1 -0
  6. package/dist/cjs/actions/build.d.ts +3 -0
  7. package/dist/cjs/actions/build.d.ts.map +1 -0
  8. package/dist/cjs/actions/build.js +13 -0
  9. package/dist/cjs/actions/build.js.map +1 -0
  10. package/dist/cjs/actions/eject.d.ts +3 -0
  11. package/dist/cjs/actions/eject.d.ts.map +1 -0
  12. package/dist/cjs/actions/eject.js +10 -0
  13. package/dist/cjs/actions/eject.js.map +1 -0
  14. package/dist/cjs/actions/index.d.ts +6 -0
  15. package/dist/cjs/actions/index.d.ts.map +1 -1
  16. package/dist/cjs/actions/index.js +6 -0
  17. package/dist/cjs/actions/index.js.map +1 -1
  18. package/dist/cjs/actions/sitemap.d.ts +3 -0
  19. package/dist/cjs/actions/sitemap.d.ts.map +1 -0
  20. package/dist/cjs/actions/sitemap.js +10 -0
  21. package/dist/cjs/actions/sitemap.js.map +1 -0
  22. package/dist/cjs/actions/start.d.ts +3 -0
  23. package/dist/cjs/actions/start.d.ts.map +1 -0
  24. package/dist/cjs/actions/start.js +10 -0
  25. package/dist/cjs/actions/start.js.map +1 -0
  26. package/dist/cjs/actions/test.d.ts +3 -0
  27. package/dist/cjs/actions/test.d.ts.map +1 -0
  28. package/dist/cjs/actions/test.js +10 -0
  29. package/dist/cjs/actions/test.js.map +1 -0
  30. package/dist/cjs/bin/analyze.js +2 -2
  31. package/dist/cjs/bin/analyze.js.map +1 -1
  32. package/dist/cjs/bin/build-ci.js +1 -6
  33. package/dist/cjs/bin/build-ci.js.map +1 -1
  34. package/dist/cjs/bin/build.js +1 -4
  35. package/dist/cjs/bin/build.js.map +1 -1
  36. package/dist/cjs/bin/eject.js +1 -1
  37. package/dist/cjs/bin/eject.js.map +1 -1
  38. package/dist/cjs/bin/sitemap.js +1 -1
  39. package/dist/cjs/bin/sitemap.js.map +1 -1
  40. package/dist/cjs/bin/start.js +1 -1
  41. package/dist/cjs/bin/start.js.map +1 -1
  42. package/dist/cjs/bin/test.js +1 -1
  43. package/dist/cjs/bin/test.js.map +1 -1
  44. package/dist/cjs/lib/xyReact.d.ts.map +1 -1
  45. package/dist/cjs/lib/xyReact.js +47 -2
  46. package/dist/cjs/lib/xyReact.js.map +1 -1
  47. package/dist/esm/actions/analyze.js +1 -1
  48. package/dist/esm/actions/build-ci.d.ts +3 -0
  49. package/dist/esm/actions/build-ci.d.ts.map +1 -0
  50. package/dist/esm/actions/build-ci.js +11 -0
  51. package/dist/esm/actions/build-ci.js.map +1 -0
  52. package/dist/esm/actions/build.d.ts +3 -0
  53. package/dist/esm/actions/build.d.ts.map +1 -0
  54. package/dist/esm/actions/build.js +9 -0
  55. package/dist/esm/actions/build.js.map +1 -0
  56. package/dist/esm/actions/eject.d.ts +3 -0
  57. package/dist/esm/actions/eject.d.ts.map +1 -0
  58. package/dist/esm/actions/eject.js +6 -0
  59. package/dist/esm/actions/eject.js.map +1 -0
  60. package/dist/esm/actions/index.d.ts +6 -0
  61. package/dist/esm/actions/index.d.ts.map +1 -1
  62. package/dist/esm/actions/index.js +6 -0
  63. package/dist/esm/actions/index.js.map +1 -1
  64. package/dist/esm/actions/sitemap.d.ts +3 -0
  65. package/dist/esm/actions/sitemap.d.ts.map +1 -0
  66. package/dist/esm/actions/sitemap.js +6 -0
  67. package/dist/esm/actions/sitemap.js.map +1 -0
  68. package/dist/esm/actions/start.d.ts +3 -0
  69. package/dist/esm/actions/start.d.ts.map +1 -0
  70. package/dist/esm/actions/start.js +6 -0
  71. package/dist/esm/actions/start.js.map +1 -0
  72. package/dist/esm/actions/test.d.ts +3 -0
  73. package/dist/esm/actions/test.d.ts.map +1 -0
  74. package/dist/esm/actions/test.js +6 -0
  75. package/dist/esm/actions/test.js.map +1 -0
  76. package/dist/esm/bin/analyze.js +2 -2
  77. package/dist/esm/bin/analyze.js.map +1 -1
  78. package/dist/esm/bin/build-ci.js +2 -7
  79. package/dist/esm/bin/build-ci.js.map +1 -1
  80. package/dist/esm/bin/build.js +2 -5
  81. package/dist/esm/bin/build.js.map +1 -1
  82. package/dist/esm/bin/eject.js +2 -2
  83. package/dist/esm/bin/eject.js.map +1 -1
  84. package/dist/esm/bin/sitemap.js +2 -2
  85. package/dist/esm/bin/sitemap.js.map +1 -1
  86. package/dist/esm/bin/start.js +2 -2
  87. package/dist/esm/bin/start.js.map +1 -1
  88. package/dist/esm/bin/test.js +2 -2
  89. package/dist/esm/bin/test.js.map +1 -1
  90. package/dist/esm/lib/xyReact.d.ts.map +1 -1
  91. package/dist/esm/lib/xyReact.js +48 -3
  92. package/dist/esm/lib/xyReact.js.map +1 -1
  93. package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
  94. package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
  95. package/package.json +4 -4
  96. package/src/actions/analyze.ts +1 -1
  97. package/src/actions/build-ci.ts +11 -0
  98. package/src/actions/build.ts +9 -0
  99. package/src/actions/eject.ts +6 -0
  100. package/src/actions/index.ts +6 -0
  101. package/src/actions/sitemap.ts +6 -0
  102. package/src/actions/start.ts +6 -0
  103. package/src/actions/test.ts +6 -0
  104. package/src/bin/analyze.ts +2 -2
  105. package/src/bin/build-ci.ts +2 -7
  106. package/src/bin/build.ts +2 -5
  107. package/src/bin/eject.ts +2 -2
  108. package/src/bin/sitemap.ts +2 -2
  109. package/src/bin/start.ts +2 -2
  110. package/src/bin/test.ts +2 -2
  111. package/src/lib/xyReact.ts +72 -3
package/package.json CHANGED
@@ -43,8 +43,8 @@
43
43
  "@babel/preset-env": "^7.18.10",
44
44
  "@types/jest": "^29.0.0",
45
45
  "@types/node": "^18.7.14",
46
- "@xylabs/eslint-config": "^2.7.0-rc.31",
47
- "@xylabs/ts-scripts-yarn3": "^2.7.0-rc.30",
46
+ "@xylabs/eslint-config": "^2.7.0-rc.34",
47
+ "@xylabs/ts-scripts-yarn3": "^2.7.0-rc.33",
48
48
  "chalk": "^4",
49
49
  "cpy": "^8",
50
50
  "depcheck": "^1.4.3",
@@ -76,7 +76,7 @@
76
76
  "description": "TypeScript project scripts",
77
77
  "devDependencies": {
78
78
  "@types/node": "^18.7.14",
79
- "@xylabs/tsconfig": "^2.7.0-rc.31"
79
+ "@xylabs/tsconfig": "^2.7.0-rc.34"
80
80
  },
81
81
  "homepage": "https://xylabs.com",
82
82
  "keywords": [
@@ -96,6 +96,6 @@
96
96
  "node": ">=14.16"
97
97
  },
98
98
  "sideEffects": false,
99
- "version": "2.7.0-rc.31",
99
+ "version": "2.7.0-rc.34",
100
100
  "stableVersion": "2.6.0"
101
101
  }
@@ -1,5 +1,5 @@
1
1
  import { runSteps } from '@xylabs/ts-scripts-yarn3'
2
2
 
3
3
  export const analyze = () => {
4
- return runSteps('Analyze', [['yarn', ['./node_modules/source-map-explorer/bin/cli.js', 'build/static/js/*.js']]])
4
+ return runSteps('Analyze', [['node', ['./node_modules/source-map-explorer/bin/cli.js', 'build/static/js/*.js']]])
5
5
  }
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+
4
+ export const buildci = () => {
5
+ return runSteps('Build', [
6
+ ['yarn', 'react-scripts build'],
7
+ ['yarn', 'lint'],
8
+ ['yarn', 'deps'],
9
+ ['yarn', 'sitemap'],
10
+ ])
11
+ }
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+
4
+ export const build = () => {
5
+ return runSteps('Build', [
6
+ ['yarn', 'version patch --deferred'],
7
+ ['yarn', 'build-ci'],
8
+ ])
9
+ }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+
4
+ export const eject = () => {
5
+ return runSteps('Eject', [['yarn', 'react-scripts eject']])
6
+ }
@@ -1,2 +1,8 @@
1
1
  export * from './analyze'
2
+ export * from './build'
3
+ export * from './build-ci'
2
4
  export * from './clean'
5
+ export * from './eject'
6
+ export * from './sitemap'
7
+ export * from './start'
8
+ export * from './test'
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+
4
+ export const sitemap = () => {
5
+ return runSteps('Sitemap', [['ts-node-script', './scripts/sitemap.ts']])
6
+ }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+
4
+ export const start = () => {
5
+ return runSteps('Start', [['yarn', 'react-scripts start']])
6
+ }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+
4
+ export const test = () => {
5
+ return runSteps('Test', [['yarn', 'react-scripts test']])
6
+ }
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { analyze } from '../actions'
3
+ import { runXy } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- analyze()
5
+ runXy('analyze')
@@ -1,10 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+ import { runXy } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Build CI', [
6
- ['yarn', 'react-scripts build'],
7
- ['yarn', 'lint'],
8
- ['yarn', 'deps'],
9
- ['yarn', 'sitemap'],
10
- ])
5
+ runXy('build-ci')
package/src/bin/build.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+ import { runXy } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Build', [
6
- ['yarn', 'version patch --deferred'],
7
- ['yarn', 'build-ci'],
8
- ])
5
+ runXy('build')
package/src/bin/eject.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+ import { runXy } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Eject', [['yarn', 'react-scripts eject']])
5
+ runXy('eject')
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+ import { runXy } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Sitemap', [['ts-node-script', './scripts/sitemap.ts']])
5
+ runXy('sitemap')
package/src/bin/start.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+ import { runXy } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Start', [['yarn', 'react-scripts start']])
5
+ runXy('start')
package/src/bin/test.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runSteps } from '@xylabs/ts-scripts-yarn3'
3
+ import { runXy } from '@xylabs/ts-scripts-yarn3'
4
4
 
5
- runSteps('Test', [['yarn', 'react-scripts test']])
5
+ runXy('test')
@@ -2,13 +2,16 @@
2
2
 
3
3
  import { parseOptions, xy } from '@xylabs/ts-scripts-yarn3'
4
4
  import { Argv } from 'yargs'
5
+ // eslint-disable-next-line import/no-internal-modules
6
+ import { hideBin } from 'yargs/helpers'
5
7
 
6
- import { analyze, clean } from '../actions'
8
+ import { analyze, build, buildci, clean, eject, sitemap, start, test } from '../actions'
7
9
 
8
10
  export const xyReact = () =>
9
11
  xy(async (yargs: Argv) => {
10
- const options = await parseOptions(yargs)
11
- return yargs
12
+ const yargsInstance = yargs(hideBin(process.argv))
13
+ const options = await parseOptions()
14
+ return yargsInstance
12
15
  .command(
13
16
  'clean [package]',
14
17
  'Clean - Remove intermediate files',
@@ -33,4 +36,70 @@ export const xyReact = () =>
33
36
  process.exitCode = analyze()
34
37
  },
35
38
  )
39
+ .command(
40
+ 'build',
41
+ 'Build - Build React project',
42
+ (yargs) => {
43
+ return yargs
44
+ },
45
+ () => {
46
+ if (options.verbose) console.info('Building')
47
+ process.exitCode = build()
48
+ },
49
+ )
50
+ .command(
51
+ 'build-ci',
52
+ 'Build CI - Build React project for continuous integration',
53
+ (yargs) => {
54
+ return yargs
55
+ },
56
+ () => {
57
+ if (options.verbose) console.info('Building CI')
58
+ process.exitCode = buildci()
59
+ },
60
+ )
61
+ .command(
62
+ 'eject',
63
+ 'Eject - Eject React project',
64
+ (yargs) => {
65
+ return yargs
66
+ },
67
+ () => {
68
+ if (options.verbose) console.info('Ejecting')
69
+ process.exitCode = eject()
70
+ },
71
+ )
72
+ .command(
73
+ 'sitemap',
74
+ 'Sitemap - Generate sitemap for the project',
75
+ (yargs) => {
76
+ return yargs
77
+ },
78
+ () => {
79
+ if (options.verbose) console.info('Generating Sitemap')
80
+ process.exitCode = sitemap()
81
+ },
82
+ )
83
+ .command(
84
+ 'start',
85
+ 'Start - Start project in browser',
86
+ (yargs) => {
87
+ return yargs
88
+ },
89
+ () => {
90
+ if (options.verbose) console.info('Starting')
91
+ process.exitCode = start()
92
+ },
93
+ )
94
+ .command(
95
+ 'test',
96
+ 'Test - Run all unit tests',
97
+ (yargs) => {
98
+ return yargs
99
+ },
100
+ () => {
101
+ if (options.verbose) console.info('Testing')
102
+ process.exitCode = test()
103
+ },
104
+ )
36
105
  })