@xylabs/ts-scripts-yarn3 2.8.0-rc.9 → 2.8.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 (42) hide show
  1. package/dist/cjs/actions/compile.d.ts +3 -2
  2. package/dist/cjs/actions/compile.d.ts.map +1 -1
  3. package/dist/cjs/actions/compile.js +10 -8
  4. package/dist/cjs/actions/compile.js.map +1 -1
  5. package/dist/cjs/actions/tsconfig-gen-cjs.d.ts.map +1 -1
  6. package/dist/cjs/actions/tsconfig-gen-cjs.js +7 -1
  7. package/dist/cjs/actions/tsconfig-gen-cjs.js.map +1 -1
  8. package/dist/cjs/actions/tsconfig-gen-esm.d.ts.map +1 -1
  9. package/dist/cjs/actions/tsconfig-gen-esm.js +7 -1
  10. package/dist/cjs/actions/tsconfig-gen-esm.js.map +1 -1
  11. package/dist/cjs/actions/tsconfig-gen-test.d.ts.map +1 -1
  12. package/dist/cjs/actions/tsconfig-gen-test.js +7 -1
  13. package/dist/cjs/actions/tsconfig-gen-test.js.map +1 -1
  14. package/dist/cjs/lib/xy.d.ts +6 -2
  15. package/dist/cjs/lib/xy.d.ts.map +1 -1
  16. package/dist/cjs/lib/xy.js +7 -1
  17. package/dist/cjs/lib/xy.js.map +1 -1
  18. package/dist/esm/actions/compile.d.ts +3 -2
  19. package/dist/esm/actions/compile.d.ts.map +1 -1
  20. package/dist/esm/actions/compile.js +10 -8
  21. package/dist/esm/actions/compile.js.map +1 -1
  22. package/dist/esm/actions/tsconfig-gen-cjs.d.ts.map +1 -1
  23. package/dist/esm/actions/tsconfig-gen-cjs.js +7 -1
  24. package/dist/esm/actions/tsconfig-gen-cjs.js.map +1 -1
  25. package/dist/esm/actions/tsconfig-gen-esm.d.ts.map +1 -1
  26. package/dist/esm/actions/tsconfig-gen-esm.js +7 -1
  27. package/dist/esm/actions/tsconfig-gen-esm.js.map +1 -1
  28. package/dist/esm/actions/tsconfig-gen-test.d.ts.map +1 -1
  29. package/dist/esm/actions/tsconfig-gen-test.js +7 -1
  30. package/dist/esm/actions/tsconfig-gen-test.js.map +1 -1
  31. package/dist/esm/lib/xy.d.ts +6 -2
  32. package/dist/esm/lib/xy.d.ts.map +1 -1
  33. package/dist/esm/lib/xy.js +7 -1
  34. package/dist/esm/lib/xy.js.map +1 -1
  35. package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
  36. package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
  37. package/package.json +3 -4
  38. package/src/actions/compile.ts +13 -8
  39. package/src/actions/tsconfig-gen-cjs.ts +6 -1
  40. package/src/actions/tsconfig-gen-esm.ts +6 -1
  41. package/src/actions/tsconfig-gen-test.ts +6 -1
  42. package/src/lib/xy.ts +7 -1
@@ -29,7 +29,12 @@ export const tsconfigGenCjs = (pkg?: string) => {
29
29
  return workspaceList
30
30
  .map(({ location, name }) => {
31
31
  try {
32
- const currentConfig = readFileSync(`${location}/.tsconfig.build.cjs.json`, { encoding: 'utf8' })
32
+ let currentConfig: string | undefined
33
+ try {
34
+ currentConfig = readFileSync(`${location}/.tsconfig.build.cjs.json`, { encoding: 'utf8' })
35
+ } catch (ex) {
36
+ currentConfig = undefined
37
+ }
33
38
  if (currentConfig !== config) {
34
39
  console.log(chalk.gray(`Updating CJS tsconfig [${name}]`))
35
40
  writeFileSync(`${location}/.tsconfig.build.cjs.json`, config, { encoding: 'utf8' })
@@ -29,7 +29,12 @@ export const tsconfigGenEsm = (pkg?: string) => {
29
29
  return workspaceList
30
30
  .map(({ location, name }) => {
31
31
  try {
32
- const currentConfig = readFileSync(`${location}/.tsconfig.build.esm.json`, { encoding: 'utf8' })
32
+ let currentConfig: string | undefined
33
+ try {
34
+ currentConfig = readFileSync(`${location}/.tsconfig.build.esm.json`, { encoding: 'utf8' })
35
+ } catch (ex) {
36
+ currentConfig = undefined
37
+ }
33
38
  if (currentConfig !== config) {
34
39
  console.log(chalk.gray(`Updating ESM tsconfig [${name}]`))
35
40
  writeFileSync(`${location}/.tsconfig.build.esm.json`, config, { encoding: 'utf8' })
@@ -23,7 +23,12 @@ export const tsconfigGenTest = (pkg?: string) => {
23
23
  return workspaceList
24
24
  .map(({ location, name }) => {
25
25
  try {
26
- const currentConfig = readFileSync(`${location}/.tsconfig.build.test.json`, { encoding: 'utf8' })
26
+ let currentConfig: string | undefined
27
+ try {
28
+ currentConfig = readFileSync(`${location}/.tsconfig.build.test.json`, { encoding: 'utf8' })
29
+ } catch (ex) {
30
+ currentConfig = undefined
31
+ }
27
32
  if (currentConfig !== config) {
28
33
  console.log(chalk.gray(`Updating TEST tsconfig [${name}]`))
29
34
  writeFileSync(`${location}/.tsconfig.build.test.json`, config, { encoding: 'utf8' })
package/src/lib/xy.ts CHANGED
@@ -49,6 +49,12 @@ export const parseOptions = () => {
49
49
  description: 'Limit output to specific target',
50
50
  type: 'string',
51
51
  })
52
+ .option('incremental', {
53
+ alias: 'i',
54
+ default: false,
55
+ description: 'Attempt to perform the action only on changed packages',
56
+ type: 'boolean',
57
+ })
52
58
  .option('fix', {
53
59
  alias: 'f',
54
60
  default: false,
@@ -94,7 +100,7 @@ export const xy = () => {
94
100
  },
95
101
  (argv) => {
96
102
  if (argv.verbose) console.info(`Compiling: ${argv.package ?? 'all'}`)
97
- process.exitCode = compile({ pkg: argv.package as string, target: argv.target as 'esm' | 'cjs' })
103
+ process.exitCode = compile({ incremental: !!argv.incremental, pkg: argv.package as string, target: argv.target as 'esm' | 'cjs' })
98
104
  },
99
105
  )
100
106
  .command(