@xylabs/ts-scripts-yarn3 2.8.0-rc.3 → 2.8.0-rc.6
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.
- package/dist/cjs/actions/build.d.ts.map +1 -1
- package/dist/cjs/actions/build.js +1 -0
- package/dist/cjs/actions/build.js.map +1 -1
- package/dist/cjs/actions/compile.d.ts +7 -1
- package/dist/cjs/actions/compile.d.ts.map +1 -1
- package/dist/cjs/actions/compile.js +28 -6
- package/dist/cjs/actions/compile.js.map +1 -1
- package/dist/cjs/actions/index.d.ts +1 -0
- package/dist/cjs/actions/index.d.ts.map +1 -1
- package/dist/cjs/actions/index.js +1 -0
- package/dist/cjs/actions/index.js.map +1 -1
- package/dist/cjs/actions/upplug.d.ts +2 -0
- package/dist/cjs/actions/upplug.d.ts.map +1 -0
- package/dist/cjs/actions/upplug.js +14 -0
- package/dist/cjs/actions/upplug.js.map +1 -0
- package/dist/cjs/bin/upplug.d.ts +3 -0
- package/dist/cjs/bin/upplug.d.ts.map +1 -0
- package/dist/cjs/bin/upplug.js +6 -0
- package/dist/cjs/bin/upplug.js.map +1 -0
- package/dist/cjs/lib/xy.d.ts.map +1 -1
- package/dist/cjs/lib/xy.js +11 -4
- package/dist/cjs/lib/xy.js.map +1 -1
- package/dist/esm/actions/build.d.ts.map +1 -1
- package/dist/esm/actions/build.js +1 -0
- package/dist/esm/actions/build.js.map +1 -1
- package/dist/esm/actions/compile.d.ts +7 -1
- package/dist/esm/actions/compile.d.ts.map +1 -1
- package/dist/esm/actions/compile.js +24 -4
- package/dist/esm/actions/compile.js.map +1 -1
- package/dist/esm/actions/index.d.ts +1 -0
- package/dist/esm/actions/index.d.ts.map +1 -1
- package/dist/esm/actions/index.js +1 -0
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/upplug.d.ts +2 -0
- package/dist/esm/actions/upplug.d.ts.map +1 -0
- package/dist/esm/actions/upplug.js +10 -0
- package/dist/esm/actions/upplug.js.map +1 -0
- package/dist/esm/bin/upplug.d.ts +3 -0
- package/dist/esm/bin/upplug.d.ts.map +1 -0
- package/dist/esm/bin/upplug.js +4 -0
- package/dist/esm/bin/upplug.js.map +1 -0
- package/dist/esm/lib/xy.d.ts.map +1 -1
- package/dist/esm/lib/xy.js +11 -4
- package/dist/esm/lib/xy.js.map +1 -1
- package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
- package/package.json +12 -33
- package/src/actions/build.ts +1 -0
- package/src/actions/compile.ts +35 -4
- package/src/actions/index.ts +1 -0
- package/src/actions/upplug.ts +10 -0
- package/src/bin/upplug.ts +5 -0
- package/src/lib/xy.ts +15 -3
package/src/actions/compile.ts
CHANGED
|
@@ -5,12 +5,43 @@ export interface CompileParams {
|
|
|
5
5
|
pkg?: string
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export interface CompilePackageParams {
|
|
9
|
+
target?: 'esm' | 'cjs'
|
|
10
|
+
pkg: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const compile = ({ target, pkg }: CompileParams) => {
|
|
14
|
+
return pkg ? compilePackage({ pkg, target }) : compileAll({ target })
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const compilePackage = ({ target, pkg }: CompilePackageParams) => {
|
|
18
|
+
const cjsSteps: ScriptStep[] =
|
|
19
|
+
!target || target === 'cjs'
|
|
20
|
+
? [
|
|
21
|
+
['yarn', ['tsconfig-gen', '-t', 'cjs']],
|
|
22
|
+
['yarn', ['workspace', pkg, 'run', 'package-compile-cjs']],
|
|
23
|
+
['yarn', ['xy', 'copy-assets', '-t', 'cjs']],
|
|
24
|
+
]
|
|
25
|
+
: []
|
|
26
|
+
|
|
27
|
+
const esmSteps: ScriptStep[] =
|
|
28
|
+
!target || target === 'esm'
|
|
29
|
+
? [
|
|
30
|
+
['yarn', ['tsconfig-gen', '-t', 'esm']],
|
|
31
|
+
['yarn', ['workspace', pkg, 'run', 'package-compile-esm']],
|
|
32
|
+
['yarn', ['xy', 'copy-assets', '-t', 'esm']],
|
|
33
|
+
]
|
|
34
|
+
: []
|
|
35
|
+
|
|
36
|
+
return runSteps(`Compile [${pkg}]`, [...esmSteps]) || runSteps('Compile', [...cjsSteps])
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const compileAll = ({ target }: CompileParams) => {
|
|
9
40
|
const cjsSteps: ScriptStep[] =
|
|
10
41
|
!target || target === 'cjs'
|
|
11
42
|
? [
|
|
12
43
|
['yarn', ['tsconfig-gen', '-t', 'cjs']],
|
|
13
|
-
['yarn', 'workspaces foreach -ptA
|
|
44
|
+
['yarn', 'workspaces foreach -ptA run package-compile-cjs'],
|
|
14
45
|
['yarn', ['xy', 'copy-assets', '-t', 'cjs']],
|
|
15
46
|
]
|
|
16
47
|
: []
|
|
@@ -19,10 +50,10 @@ export const compile = ({ target }: CompileParams) => {
|
|
|
19
50
|
!target || target === 'esm'
|
|
20
51
|
? [
|
|
21
52
|
['yarn', ['tsconfig-gen', '-t', 'esm']],
|
|
22
|
-
['yarn', 'workspaces foreach -ptA
|
|
53
|
+
['yarn', 'workspaces foreach -ptA run package-compile-esm'],
|
|
23
54
|
['yarn', ['xy', 'copy-assets', '-t', 'esm']],
|
|
24
55
|
]
|
|
25
56
|
: []
|
|
26
57
|
|
|
27
|
-
return runSteps('Compile', [...esmSteps]) || runSteps('Compile
|
|
58
|
+
return runSteps('Compile [All]', [...esmSteps]) || runSteps('Compile [All]', [...cjsSteps])
|
|
28
59
|
}
|
package/src/actions/index.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { runSteps } from '../lib'
|
|
2
|
+
|
|
3
|
+
export const updateYarnPlugins = () => {
|
|
4
|
+
return runSteps('Update Yarn Plugins [Outdated]', [
|
|
5
|
+
['yarn', ['plugin', 'import', '@yarnpkg/plugin-outdated']],
|
|
6
|
+
['yarn', ['plugin', 'import', '@yarnpkg/plugin-version']],
|
|
7
|
+
['yarn', ['plugin', 'import', '@yarnpkg/plugin-interactive-tools']],
|
|
8
|
+
['yarn', ['plugin', 'import', '@yarnpkg/plugin-workspace-tools']],
|
|
9
|
+
])
|
|
10
|
+
}
|
package/src/lib/xy.ts
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
tsconfigGen,
|
|
31
31
|
tsconfigGenClean,
|
|
32
32
|
up,
|
|
33
|
+
updateYarnPlugins,
|
|
33
34
|
updo,
|
|
34
35
|
yarn3Only,
|
|
35
36
|
} from '../actions'
|
|
@@ -80,7 +81,7 @@ export const xy = () => {
|
|
|
80
81
|
},
|
|
81
82
|
(argv) => {
|
|
82
83
|
if (argv.verbose) console.info(`Building: ${argv.package ?? 'all'}`)
|
|
83
|
-
process.exitCode = build({ target: argv.target as 'esm' | 'cjs' })
|
|
84
|
+
process.exitCode = build({ pkg: argv.package as string, target: argv.target as 'esm' | 'cjs' })
|
|
84
85
|
},
|
|
85
86
|
)
|
|
86
87
|
.command(
|
|
@@ -91,9 +92,9 @@ export const xy = () => {
|
|
|
91
92
|
describe: 'Specific package to compile',
|
|
92
93
|
})
|
|
93
94
|
},
|
|
94
|
-
|
|
95
|
+
(argv) => {
|
|
95
96
|
if (argv.verbose) console.info(`Compiling: ${argv.package ?? 'all'}`)
|
|
96
|
-
process.exitCode =
|
|
97
|
+
process.exitCode = compile({ pkg: argv.package as string, target: argv.target as 'esm' | 'cjs' })
|
|
97
98
|
},
|
|
98
99
|
)
|
|
99
100
|
.command(
|
|
@@ -373,6 +374,17 @@ export const xy = () => {
|
|
|
373
374
|
process.exitCode = updo()
|
|
374
375
|
},
|
|
375
376
|
)
|
|
377
|
+
.command(
|
|
378
|
+
'upplug',
|
|
379
|
+
'Upplug - Update Yarn Plugins',
|
|
380
|
+
(yargs) => {
|
|
381
|
+
return yargs
|
|
382
|
+
},
|
|
383
|
+
(argv) => {
|
|
384
|
+
if (argv.verbose) console.info('Upplug')
|
|
385
|
+
process.exitCode = updateYarnPlugins()
|
|
386
|
+
},
|
|
387
|
+
)
|
|
376
388
|
.command(
|
|
377
389
|
'yarn3only',
|
|
378
390
|
'Yarn3Only - Check if using Yarn v3',
|