@xylabs/ts-scripts-yarn3 4.0.0-rc.28 → 4.0.0-rc.30
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/actions/build.mjs.map +1 -1
- package/dist/actions/clean-docs.mjs.map +1 -1
- package/dist/actions/clean-eslint.mjs.map +1 -1
- package/dist/actions/clean-jest.mjs.map +1 -1
- package/dist/actions/clean.mjs.map +1 -1
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/copy-assets.mjs.map +1 -1
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/dead.mjs.map +1 -1
- package/dist/actions/deploy-major.mjs.map +1 -1
- package/dist/actions/deploy-minor.mjs.map +1 -1
- package/dist/actions/deploy-next.mjs.map +1 -1
- package/dist/actions/deploy.mjs.map +1 -1
- package/dist/actions/deps.mjs.map +1 -1
- package/dist/actions/dupdeps.mjs.map +1 -1
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/gen-docs.mjs.map +1 -1
- package/dist/actions/gitignore-gen.mjs.map +1 -1
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/license.mjs.map +1 -1
- package/dist/actions/lint-clean.mjs.map +1 -1
- package/dist/actions/lint-profile.mjs.map +1 -1
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/npmignore-gen.mjs.map +1 -1
- package/dist/actions/package/clean-outputs.mjs.map +1 -1
- package/dist/actions/package/clean-typescript.mjs.map +1 -1
- package/dist/actions/package/clean.mjs.map +1 -1
- package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/inputs.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/deps.mjs.map +1 -1
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/actions/publint.mjs.map +1 -1
- package/dist/actions/rebuild.mjs.map +1 -1
- package/dist/actions/recompile.mjs.map +1 -1
- package/dist/actions/reinstall.mjs.map +1 -1
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/actions/retest.mjs.map +1 -1
- package/dist/actions/sonar.mjs.map +1 -1
- package/dist/actions/statics.mjs.map +1 -1
- package/dist/actions/test.mjs.map +1 -1
- package/dist/actions/up.mjs.map +1 -1
- package/dist/actions/updo.mjs.map +1 -1
- package/dist/actions/upplug.mjs.map +1 -1
- package/dist/actions/upyarn.mjs.map +1 -1
- package/dist/actions/yarn3only.mjs.map +1 -1
- package/dist/bin/package/clean-outputs.mjs.map +1 -1
- package/dist/bin/package/clean-typescript.mjs.map +1 -1
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/deps.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/lib/deleteGlob.mjs.map +1 -1
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -1
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -1
- package/dist/lib/dependencies/index.mjs.map +1 -1
- package/dist/lib/generateIgnoreFiles.mjs.map +1 -1
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/runSteps.mjs.map +1 -1
- package/dist/lib/runStepsAsync.mjs.map +1 -1
- package/dist/lib/runXy.mjs.map +1 -1
- package/dist/lib/yarn/index.mjs.map +1 -1
- package/dist/lib/yarn/isYarnVersionOrGreater.mjs.map +1 -1
- package/dist/lib/yarn/workspace/index.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspace.mjs.map +1 -1
- package/dist/lib/yarn/workspace/yarnWorkspaces.mjs.map +1 -1
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/dist/xy/xyDeployCommands.mjs.map +1 -1
- package/dist/xy/xyInstallCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +6 -6
- package/src/actions/clean-docs.ts +1 -3
- package/src/actions/clean.ts +2 -6
- package/src/actions/compile.ts +1 -3
- package/src/actions/copy-assets.ts +2 -6
- package/src/actions/cycle.ts +1 -3
- package/src/actions/deps.ts +1 -3
- package/src/actions/dupdeps.ts +1 -3
- package/src/actions/gen-docs.ts +1 -3
- package/src/actions/license.ts +2 -6
- package/src/actions/lint-clean.ts +2 -6
- package/src/actions/lint-profile.ts +1 -5
- package/src/actions/lint.ts +1 -3
- package/src/actions/package/compile/copyTypeFiles.ts +1 -3
- package/src/actions/package/compile/inputs.ts +2 -6
- package/src/actions/package/compile/packageCompileTsc.ts +1 -3
- package/src/actions/package/compile/packageCompileTsup.ts +2 -6
- package/src/actions/package/deps.ts +3 -9
- package/src/actions/publint.ts +3 -9
- package/src/actions/reinstall.ts +3 -9
- package/src/actions/relint.ts +3 -9
- package/src/actions/statics.ts +1 -3
- package/src/actions/yarn3only.ts +1 -3
- package/src/bin/package/compile-only.ts +1 -3
- package/src/lib/deleteGlob.ts +1 -3
- package/src/lib/dependencies/DuplicateDetector.ts +1 -3
- package/src/lib/generateIgnoreFiles.ts +1 -3
- package/src/lib/runSteps.ts +1 -3
- package/src/lib/runStepsAsync.ts +1 -3
- package/src/lib/yarn/isYarnVersionOrGreater.ts +1 -3
- package/src/lib/yarn/workspace/yarnWorkspaces.ts +1 -3
- package/src/xy/xyCommonCommands.ts +1 -3
- package/src/xy/xyLintCommands.ts +1 -3
package/src/actions/publint.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runSteps, runStepsAsync,
|
|
3
|
-
} from '../lib/index.ts'
|
|
1
|
+
import { runSteps, runStepsAsync } from '../lib/index.ts'
|
|
4
2
|
|
|
5
3
|
export interface PublintParams {
|
|
6
4
|
pkg?: string
|
|
@@ -12,13 +10,9 @@ export interface PublintPackageParams {
|
|
|
12
10
|
verbose?: boolean
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
export const publint = async ({
|
|
16
|
-
verbose, pkg,
|
|
17
|
-
}: PublintParams) => {
|
|
13
|
+
export const publint = async ({ verbose, pkg }: PublintParams) => {
|
|
18
14
|
return pkg
|
|
19
|
-
? await publintPackage({
|
|
20
|
-
pkg, verbose,
|
|
21
|
-
})
|
|
15
|
+
? await publintPackage({ pkg, verbose })
|
|
22
16
|
: publintAll({ verbose })
|
|
23
17
|
}
|
|
24
18
|
|
package/src/actions/reinstall.ts
CHANGED
|
@@ -2,9 +2,7 @@ import {
|
|
|
2
2
|
closeSync, openSync, rmSync,
|
|
3
3
|
} from 'node:fs'
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
runSteps, yarnWorkspaces,
|
|
7
|
-
} from '../lib/index.ts'
|
|
5
|
+
import { runSteps, yarnWorkspaces } from '../lib/index.ts'
|
|
8
6
|
|
|
9
7
|
export const reinstall = () => {
|
|
10
8
|
console.log('Reinstall [Clear Lock File]')
|
|
@@ -13,14 +11,10 @@ export const reinstall = () => {
|
|
|
13
11
|
console.log('Reinstall [Clear Node Modules]')
|
|
14
12
|
const workspaces = yarnWorkspaces()
|
|
15
13
|
const result = workspaces
|
|
16
|
-
.map(({
|
|
17
|
-
location, name,
|
|
18
|
-
}) => {
|
|
14
|
+
.map(({ location, name }) => {
|
|
19
15
|
const dist = `${location}/node_modules`
|
|
20
16
|
try {
|
|
21
|
-
rmSync(dist, {
|
|
22
|
-
force: true, recursive: true,
|
|
23
|
-
})
|
|
17
|
+
rmSync(dist, { force: true, recursive: true })
|
|
24
18
|
return 0
|
|
25
19
|
} catch (ex) {
|
|
26
20
|
const error = ex as Error
|
package/src/actions/relint.ts
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { rmSync } from 'node:fs'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
runSteps, yarnWorkspaces,
|
|
5
|
-
} from '../lib/index.ts'
|
|
3
|
+
import { runSteps, yarnWorkspaces } from '../lib/index.ts'
|
|
6
4
|
|
|
7
5
|
export const relint = () => {
|
|
8
6
|
console.log('Relint - Cleaning [.eslintcache]')
|
|
9
7
|
const workspaces = yarnWorkspaces()
|
|
10
8
|
const result = workspaces
|
|
11
|
-
.map(({
|
|
12
|
-
location, name,
|
|
13
|
-
}) => {
|
|
9
|
+
.map(({ location, name }) => {
|
|
14
10
|
const dist = `${location}/.eslintcache`
|
|
15
11
|
try {
|
|
16
|
-
rmSync(dist, {
|
|
17
|
-
force: true, recursive: true,
|
|
18
|
-
})
|
|
12
|
+
rmSync(dist, { force: true, recursive: true })
|
|
19
13
|
return 0
|
|
20
14
|
} catch (ex) {
|
|
21
15
|
const error = ex as Error
|
package/src/actions/statics.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
detectDuplicateDependencies, parsedPackageJSON,
|
|
5
|
-
} from '../lib/index.ts'
|
|
3
|
+
import { detectDuplicateDependencies, parsedPackageJSON } from '../lib/index.ts'
|
|
6
4
|
|
|
7
5
|
const DefaultDependencies = ['axios', '@xylabs/pixel', 'react', 'graphql', 'react-router', '@mui/material', '@mui/system']
|
|
8
6
|
|
package/src/actions/yarn3only.ts
CHANGED
|
@@ -4,9 +4,7 @@ import chalk from 'chalk'
|
|
|
4
4
|
|
|
5
5
|
import { packageCompile } from '../../actions/index.ts'
|
|
6
6
|
|
|
7
|
-
packageCompile({
|
|
8
|
-
verbose: true, publint: false,
|
|
9
|
-
})
|
|
7
|
+
packageCompile({ verbose: true, publint: false })
|
|
10
8
|
.then(value => (process.exitCode = value))
|
|
11
9
|
.catch((reason) => {
|
|
12
10
|
console.error(chalk.red(reason))
|
package/src/lib/deleteGlob.ts
CHANGED
|
@@ -32,9 +32,7 @@ const trimObjectDependencyVirtualMeta = (obj: Record<string, ChildFields>): Reco
|
|
|
32
32
|
|
|
33
33
|
const trimDependencyVirtualMeta = (dependencies: DependencyEntries): DependencyEntries => {
|
|
34
34
|
return dependencies.map((dependency) => {
|
|
35
|
-
return {
|
|
36
|
-
children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value),
|
|
37
|
-
}
|
|
35
|
+
return { children: trimObjectDependencyVirtualMeta(dependency.children), value: trimVirtualMeta(dependency.value) }
|
|
38
36
|
})
|
|
39
37
|
}
|
|
40
38
|
|
|
@@ -14,9 +14,7 @@ export const generateIgnoreFiles = (filename: string, pkg?: string) => {
|
|
|
14
14
|
const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces()
|
|
15
15
|
const readEntries = (location: string): string[] => readNonEmptyLines(`${location}/${filename}`)
|
|
16
16
|
const writeEntries = (location: string, entries: string[]) => writeLines(`${location}/${filename}`, entries)
|
|
17
|
-
const results = workspaces.map(({
|
|
18
|
-
location, name,
|
|
19
|
-
}) => {
|
|
17
|
+
const results = workspaces.map(({ location, name }) => {
|
|
20
18
|
try {
|
|
21
19
|
writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)))
|
|
22
20
|
return 0
|
package/src/lib/runSteps.ts
CHANGED
|
@@ -28,9 +28,7 @@ export const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, m
|
|
|
28
28
|
= spawnSync(command, Array.isArray(args) ? args : args.split(' '), {
|
|
29
29
|
...config,
|
|
30
30
|
encoding: 'utf8',
|
|
31
|
-
env: {
|
|
32
|
-
FORCE_COLOR: '3', ...process.env,
|
|
33
|
-
},
|
|
31
|
+
env: { FORCE_COLOR: '3', ...process.env },
|
|
34
32
|
shell: true,
|
|
35
33
|
stdio: 'inherit',
|
|
36
34
|
}).status ?? 0
|
package/src/lib/runStepsAsync.ts
CHANGED
|
@@ -19,9 +19,7 @@ export const runStepAsync = (name: string, step: ScriptStep, exitOnFail = true,
|
|
|
19
19
|
}
|
|
20
20
|
spawn(command, Array.isArray(args) ? args : args.split(' '), {
|
|
21
21
|
...config,
|
|
22
|
-
env: {
|
|
23
|
-
FORCE_COLOR: '3', ...process.env,
|
|
24
|
-
},
|
|
22
|
+
env: { FORCE_COLOR: '3', ...process.env },
|
|
25
23
|
shell: true,
|
|
26
24
|
stdio: 'inherit',
|
|
27
25
|
}).on('close', (code) => {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process'
|
|
2
2
|
|
|
3
3
|
export const isYarnVersionOrGreater = (major: number, minor?: number, patch?: number): [boolean, string] => {
|
|
4
|
-
const result = spawnSync('yarn', ['-v'], {
|
|
5
|
-
encoding: 'utf8', shell: true,
|
|
6
|
-
})
|
|
4
|
+
const result = spawnSync('yarn', ['-v'], { encoding: 'utf8', shell: true })
|
|
7
5
|
const version = result.stdout.toString().replaceAll('\n', '')
|
|
8
6
|
const versionNumbers = version.split('.').map(ver => Number.parseInt(ver))
|
|
9
7
|
const majorDelta = versionNumbers[0] - major
|
|
@@ -3,9 +3,7 @@ import { spawnSync } from 'node:child_process'
|
|
|
3
3
|
import type { Workspace } from './Workspace.ts'
|
|
4
4
|
|
|
5
5
|
export const yarnWorkspaces = (): Workspace[] => {
|
|
6
|
-
const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], {
|
|
7
|
-
encoding: 'utf8', shell: true,
|
|
8
|
-
})
|
|
6
|
+
const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })
|
|
9
7
|
if (result.error) {
|
|
10
8
|
throw result.error
|
|
11
9
|
}
|
|
@@ -64,9 +64,7 @@ export const xyCommonCommands = (args: Argv) => {
|
|
|
64
64
|
},
|
|
65
65
|
(argv) => {
|
|
66
66
|
if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? 'all'}`)
|
|
67
|
-
process.exitCode = genDocs({
|
|
68
|
-
incremental: !!argv.incremental, pkg: argv.package as string,
|
|
69
|
-
})
|
|
67
|
+
process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package as string })
|
|
70
68
|
},
|
|
71
69
|
)
|
|
72
70
|
.command(
|
package/src/xy/xyLintCommands.ts
CHANGED
|
@@ -74,9 +74,7 @@ export const xyLintCommands = (args: Argv) => {
|
|
|
74
74
|
async (argv) => {
|
|
75
75
|
if (argv.verbose) console.log('Publint')
|
|
76
76
|
const start = Date.now()
|
|
77
|
-
process.exitCode = await publint({
|
|
78
|
-
pkg: argv.package as string, verbose: !!argv.verbose,
|
|
79
|
-
})
|
|
77
|
+
process.exitCode = await publint({ pkg: argv.package as string, verbose: !!argv.verbose })
|
|
80
78
|
console.log(chalk.blue(`Finished in ${Date.now() - start}ms`))
|
|
81
79
|
},
|
|
82
80
|
)
|