@xylabs/ts-scripts-yarn3 2.8.0-rc.7 → 2.8.0-rc.8

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 (55) hide show
  1. package/dist/cjs/actions/compile.js +4 -4
  2. package/dist/cjs/actions/compile.js.map +1 -1
  3. package/dist/cjs/actions/tsconfig-gen-cjs.d.ts +1 -1
  4. package/dist/cjs/actions/tsconfig-gen-cjs.d.ts.map +1 -1
  5. package/dist/cjs/actions/tsconfig-gen-cjs.js +17 -5
  6. package/dist/cjs/actions/tsconfig-gen-cjs.js.map +1 -1
  7. package/dist/cjs/actions/tsconfig-gen-clean.d.ts +1 -1
  8. package/dist/cjs/actions/tsconfig-gen-clean.d.ts.map +1 -1
  9. package/dist/cjs/actions/tsconfig-gen-clean.js +20 -2
  10. package/dist/cjs/actions/tsconfig-gen-clean.js.map +1 -1
  11. package/dist/cjs/actions/tsconfig-gen-esm.d.ts +1 -1
  12. package/dist/cjs/actions/tsconfig-gen-esm.d.ts.map +1 -1
  13. package/dist/cjs/actions/tsconfig-gen-esm.js +17 -5
  14. package/dist/cjs/actions/tsconfig-gen-esm.js.map +1 -1
  15. package/dist/cjs/actions/tsconfig-gen-test.d.ts +1 -1
  16. package/dist/cjs/actions/tsconfig-gen-test.d.ts.map +1 -1
  17. package/dist/cjs/actions/tsconfig-gen-test.js +5 -2
  18. package/dist/cjs/actions/tsconfig-gen-test.js.map +1 -1
  19. package/dist/cjs/actions/tsconfig-gen.d.ts +1 -1
  20. package/dist/cjs/actions/tsconfig-gen.d.ts.map +1 -1
  21. package/dist/cjs/actions/tsconfig-gen.js +4 -4
  22. package/dist/cjs/actions/tsconfig-gen.js.map +1 -1
  23. package/dist/cjs/lib/xy.d.ts +2 -2
  24. package/dist/esm/actions/compile.js +4 -4
  25. package/dist/esm/actions/compile.js.map +1 -1
  26. package/dist/esm/actions/tsconfig-gen-cjs.d.ts +1 -1
  27. package/dist/esm/actions/tsconfig-gen-cjs.d.ts.map +1 -1
  28. package/dist/esm/actions/tsconfig-gen-cjs.js +17 -5
  29. package/dist/esm/actions/tsconfig-gen-cjs.js.map +1 -1
  30. package/dist/esm/actions/tsconfig-gen-clean.d.ts +1 -1
  31. package/dist/esm/actions/tsconfig-gen-clean.d.ts.map +1 -1
  32. package/dist/esm/actions/tsconfig-gen-clean.js +21 -3
  33. package/dist/esm/actions/tsconfig-gen-clean.js.map +1 -1
  34. package/dist/esm/actions/tsconfig-gen-esm.d.ts +1 -1
  35. package/dist/esm/actions/tsconfig-gen-esm.d.ts.map +1 -1
  36. package/dist/esm/actions/tsconfig-gen-esm.js +17 -5
  37. package/dist/esm/actions/tsconfig-gen-esm.js.map +1 -1
  38. package/dist/esm/actions/tsconfig-gen-test.d.ts +1 -1
  39. package/dist/esm/actions/tsconfig-gen-test.d.ts.map +1 -1
  40. package/dist/esm/actions/tsconfig-gen-test.js +5 -2
  41. package/dist/esm/actions/tsconfig-gen-test.js.map +1 -1
  42. package/dist/esm/actions/tsconfig-gen.d.ts +1 -1
  43. package/dist/esm/actions/tsconfig-gen.d.ts.map +1 -1
  44. package/dist/esm/actions/tsconfig-gen.js +4 -4
  45. package/dist/esm/actions/tsconfig-gen.js.map +1 -1
  46. package/dist/esm/lib/xy.d.ts +2 -2
  47. package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
  48. package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
  49. package/package.json +3 -3
  50. package/src/actions/compile.ts +4 -4
  51. package/src/actions/tsconfig-gen-cjs.ts +16 -5
  52. package/src/actions/tsconfig-gen-clean.ts +22 -3
  53. package/src/actions/tsconfig-gen-esm.ts +16 -5
  54. package/src/actions/tsconfig-gen-test.ts +5 -2
  55. package/src/actions/tsconfig-gen.ts +4 -4
@@ -3,8 +3,11 @@ import { writeFileSync } from 'fs'
3
3
 
4
4
  import { yarnWorkspaces } from '../lib'
5
5
 
6
- export const tsconfigGenCjs = () => {
6
+ export const tsconfigGenCjs = (pkg?: string) => {
7
7
  const workspaces = yarnWorkspaces()
8
+ const workspaceList = workspaces.filter(({ name }) => {
9
+ return pkg === undefined || name === pkg
10
+ })
8
11
 
9
12
  console.log(chalk.green('Generate Configs [CJS]'))
10
13
 
@@ -23,8 +26,16 @@ export const tsconfigGenCjs = () => {
23
26
  2,
24
27
  )
25
28
 
26
- workspaces.forEach(({ location }) => {
27
- writeFileSync(`${location}/.tsconfig.build.cjs.json`, config)
28
- })
29
- return 0
29
+ return workspaceList
30
+ .map(({ location, name }) => {
31
+ try {
32
+ writeFileSync(`${location}/.tsconfig.build.cjs.json`, config)
33
+ return 0
34
+ } catch (ex) {
35
+ const error = ex as Error
36
+ console.error(`tsconfig (CJS) generate failed [${name}] [${error.message}]`)
37
+ return 1
38
+ }
39
+ })
40
+ .reduce((prev, value) => prev || value, 0)
30
41
  }
@@ -1,5 +1,24 @@
1
- import { runSteps } from '../lib'
1
+ import { rmSync } from 'fs'
2
2
 
3
- export const tsconfigGenClean = () => {
4
- return runSteps('Clean Configs', [['node', ['./node_modules/rimraf/bin.js', '-q', '**/.tsconfig*']]])
3
+ import { yarnWorkspaces } from '../lib'
4
+
5
+ export const tsconfigGenClean = (pkg?: string) => {
6
+ const workspaces = yarnWorkspaces()
7
+ const workspaceList = workspaces.filter(({ name }) => {
8
+ return pkg === undefined || name === pkg
9
+ })
10
+
11
+ return workspaceList
12
+ .map(({ location, name }) => {
13
+ const dist = `${location}/**/.tsconfig*`
14
+ try {
15
+ rmSync(dist, { force: true, recursive: true })
16
+ return 0
17
+ } catch (ex) {
18
+ const error = ex as Error
19
+ console.error(`Clean Failed [${name}, ${error.message}]`)
20
+ return 1
21
+ }
22
+ })
23
+ .reduce((prev, result) => prev || result, 0)
5
24
  }
@@ -3,8 +3,11 @@ import { writeFileSync } from 'fs'
3
3
 
4
4
  import { yarnWorkspaces } from '../lib'
5
5
 
6
- export const tsconfigGenEsm = () => {
6
+ export const tsconfigGenEsm = (pkg?: string) => {
7
7
  const workspaces = yarnWorkspaces()
8
+ const workspaceList = workspaces.filter(({ name }) => {
9
+ return pkg === undefined || name === pkg
10
+ })
8
11
 
9
12
  console.log(chalk.green('Generate Configs [ESM]'))
10
13
 
@@ -23,8 +26,16 @@ export const tsconfigGenEsm = () => {
23
26
  2,
24
27
  )
25
28
 
26
- workspaces.forEach(({ location }) => {
27
- writeFileSync(`${location}/.tsconfig.build.esm.json`, config)
28
- })
29
- return 0
29
+ return workspaceList
30
+ .map(({ location, name }) => {
31
+ try {
32
+ writeFileSync(`${location}/.tsconfig.build.esm.json`, config)
33
+ return 0
34
+ } catch (ex) {
35
+ const error = ex as Error
36
+ console.error(`tsconfig (ESM) generate failed [${name}] [${error.message}]`)
37
+ return 1
38
+ }
39
+ })
40
+ .reduce((prev, value) => prev || value, 0)
30
41
  }
@@ -3,8 +3,11 @@ import { writeFileSync } from 'fs'
3
3
 
4
4
  import { yarnWorkspaces } from '../lib'
5
5
 
6
- export const tsconfigGenTest = () => {
6
+ export const tsconfigGenTest = (pkg?: string) => {
7
7
  const workspaces = yarnWorkspaces()
8
+ const workspaceList = workspaces.filter(({ name }) => {
9
+ return pkg === undefined || name === pkg
10
+ })
8
11
 
9
12
  console.log(chalk.green('Generate Configs [Test]'))
10
13
 
@@ -17,7 +20,7 @@ export const tsconfigGenTest = () => {
17
20
  2,
18
21
  )
19
22
 
20
- workspaces.forEach(({ location }) => {
23
+ workspaceList.forEach(({ location }) => {
21
24
  writeFileSync(`${location}/.tsconfig.build.test.json`, config)
22
25
  })
23
26
  return 0
@@ -7,13 +7,13 @@ export interface TsconfigGenParams {
7
7
  pkg?: string
8
8
  }
9
9
 
10
- export const tsconfigGen = ({ target }: TsconfigGenParams) => {
10
+ export const tsconfigGen = ({ target, pkg }: TsconfigGenParams) => {
11
11
  switch (target) {
12
12
  case 'esm':
13
- return tsconfigGenEsm() || tsconfigGenTest()
13
+ return tsconfigGenEsm(pkg) || tsconfigGenTest(pkg)
14
14
  case 'cjs':
15
- return tsconfigGenCjs() || tsconfigGenTest()
15
+ return tsconfigGenCjs(pkg) || tsconfigGenTest(pkg)
16
16
  default:
17
- return tsconfigGenEsm() || tsconfigGenCjs() || tsconfigGenTest()
17
+ return tsconfigGenEsm(pkg) || tsconfigGenCjs(pkg) || tsconfigGenTest(pkg)
18
18
  }
19
19
  }