@xylabs/ts-scripts-react-yarn3 2.5.87 → 2.5.90
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/build-ci.js +1 -1
- package/dist/cjs/build-ci.js.map +1 -1
- package/dist/cjs/clean.js +0 -0
- package/dist/cjs/compile-cjs.js +0 -0
- package/dist/cjs/compile-esm.js +0 -0
- package/dist/cjs/compile.js +1 -0
- package/dist/cjs/compile.js.map +1 -1
- package/dist/cjs/copy-images-cjs.js +0 -0
- package/dist/cjs/copy-images-esm.js +0 -0
- package/dist/cjs/copy-images.js +0 -0
- package/dist/cjs/cycle.js +0 -1
- package/dist/cjs/cycle.js.map +1 -1
- package/dist/cjs/dead.js +0 -0
- package/dist/cjs/deploy-major.js +0 -0
- package/dist/cjs/deploy-minor.js +0 -0
- package/dist/cjs/deploy.js +1 -1
- package/dist/cjs/deploy.js.map +1 -1
- package/dist/cjs/deps.js +0 -0
- package/dist/cjs/fix.js +0 -0
- package/dist/cjs/gen-docs.js +18 -13
- package/dist/cjs/gen-docs.js.map +1 -1
- package/dist/cjs/gitlint-fix.js +0 -0
- package/dist/cjs/gitlint.js +0 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +5 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/runSteps.d.ts.map +1 -1
- package/dist/cjs/lib/runSteps.js.map +1 -1
- package/dist/cjs/license.js +0 -0
- package/dist/cjs/lint-fast.js +0 -0
- package/dist/cjs/lint-profile.js +0 -0
- package/dist/cjs/lint.js +0 -0
- package/dist/cjs/migrate.js +0 -0
- package/dist/cjs/rebuild.js +0 -0
- package/dist/cjs/reinstall.js +0 -0
- package/dist/cjs/relint.d.ts +3 -0
- package/dist/cjs/relint.d.ts.map +1 -0
- package/dist/cjs/relint.js +6 -0
- package/dist/cjs/relint.js.map +1 -0
- package/dist/cjs/sonar.js +0 -0
- package/dist/cjs/up.js +0 -0
- package/dist/cjs/up3.js +0 -0
- package/dist/cjs/updo.js +0 -0
- package/dist/cjs/updo3.js +0 -0
- package/dist/cjs/yarn3only.js +0 -0
- package/dist/docs.json +46 -0
- package/dist/esm/build-ci.js +1 -1
- package/dist/esm/build-ci.js.map +1 -1
- package/dist/esm/compile.js +1 -0
- package/dist/esm/compile.js.map +1 -1
- package/dist/esm/cycle.js +0 -1
- package/dist/esm/cycle.js.map +1 -1
- package/dist/esm/deploy.js +1 -1
- package/dist/esm/deploy.js.map +1 -1
- package/dist/esm/gen-docs.js +19 -14
- package/dist/esm/gen-docs.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/runSteps.d.ts.map +1 -1
- package/dist/esm/lib/runSteps.js +6 -1
- package/dist/esm/lib/runSteps.js.map +1 -1
- package/dist/esm/relint.d.ts +3 -0
- package/dist/esm/relint.d.ts.map +1 -0
- package/dist/esm/relint.js +4 -0
- package/dist/esm/relint.js.map +1 -0
- package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
- package/package.json +56 -4
- package/src/build-ci.ts +1 -1
- package/src/clean.ts +8 -0
- package/src/compile-cjs.ts +5 -0
- package/src/compile-esm.ts +5 -0
- package/src/compile.ts +11 -0
- package/src/copy-images-cjs.ts +24 -0
- package/src/copy-images-esm.ts +24 -0
- package/src/copy-images.ts +8 -0
- package/src/cycle.ts +7 -0
- package/src/dead.ts +5 -0
- package/src/deploy-major.ts +11 -0
- package/src/deploy-minor.ts +11 -0
- package/src/deploy.ts +12 -0
- package/src/deps.ts +14 -0
- package/src/fix.ts +5 -0
- package/src/gen-docs.ts +26 -0
- package/src/gitlint-fix.ts +29 -0
- package/src/gitlint.ts +49 -0
- package/src/index.ts +1 -0
- package/src/lib/runSteps.ts +6 -1
- package/src/lib/withError.ts +1 -1
- package/src/license.ts +32 -0
- package/src/lint-clean.ts +8 -0
- package/src/lint-fast.ts +9 -0
- package/src/lint-profile.ts +5 -0
- package/src/lint.ts +5 -0
- package/src/rebuild.ts +8 -0
- package/src/reinstall.ts +9 -0
- package/src/relint.ts +5 -0
- package/src/sonar.ts +4 -0
- package/src/up.ts +5 -0
- package/src/updo.ts +9 -0
- package/src/yarn3only.ts +9 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
|
|
4
|
+
|
|
5
|
+
const workspaces = yarnWorkspaces()
|
|
6
|
+
|
|
7
|
+
const steps = workspaces.map<ScriptStep>(({ location }) => [
|
|
8
|
+
'node',
|
|
9
|
+
[
|
|
10
|
+
'./node_modules/cpy-cli/cli.js',
|
|
11
|
+
`${location}/src/**/*.jpg`,
|
|
12
|
+
`${location}/src/**/*.png`,
|
|
13
|
+
`${location}/src/**/*.gif`,
|
|
14
|
+
`${location}/src/**/*.svg`,
|
|
15
|
+
`${location}/dist/cjs`,
|
|
16
|
+
],
|
|
17
|
+
])
|
|
18
|
+
|
|
19
|
+
runSteps(
|
|
20
|
+
'Copy Images [CJS]',
|
|
21
|
+
steps,
|
|
22
|
+
false,
|
|
23
|
+
workspaces.map(({ name }) => name),
|
|
24
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
|
|
4
|
+
|
|
5
|
+
const workspaces = yarnWorkspaces()
|
|
6
|
+
|
|
7
|
+
const steps = workspaces.map<ScriptStep>(({ location }) => [
|
|
8
|
+
'node',
|
|
9
|
+
[
|
|
10
|
+
'./node_modules/cpy-cli/cli.js',
|
|
11
|
+
`${location}/src/**/*.jpg`,
|
|
12
|
+
`${location}/src/**/*.png`,
|
|
13
|
+
`${location}/src/**/*.gif`,
|
|
14
|
+
`${location}/src/**/*.svg`,
|
|
15
|
+
`${location}/dist/esm`,
|
|
16
|
+
],
|
|
17
|
+
])
|
|
18
|
+
|
|
19
|
+
runSteps(
|
|
20
|
+
'Copy Images [ESM]',
|
|
21
|
+
steps,
|
|
22
|
+
false,
|
|
23
|
+
workspaces.map(({ name }) => name),
|
|
24
|
+
)
|
package/src/cycle.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runSteps } from './lib'
|
|
4
|
+
|
|
5
|
+
const rules = ['"\'import/no-cycle\': [1, { maxDepth: 6 }]"', "\"'import/no-internal-modules': ['off']\""]
|
|
6
|
+
|
|
7
|
+
runSteps('Cycle', [['node', ['./node_modules/eslint/bin/eslint.js', ...rules.map((rule) => ['--rule', rule]).flat(), '--cache', '.']]])
|
package/src/dead.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runSteps } from './lib'
|
|
4
|
+
|
|
5
|
+
runSteps('Deploy [Major]', [
|
|
6
|
+
['yarn', 'workspaces foreach --all version minor --deferred'],
|
|
7
|
+
['yarn', 'cycle'],
|
|
8
|
+
['yarn', 'build'],
|
|
9
|
+
['yarn', 'version apply --all'],
|
|
10
|
+
['yarn', 'workspaces foreach -pt npm publish'],
|
|
11
|
+
])
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runSteps } from './lib'
|
|
4
|
+
|
|
5
|
+
runSteps('Deploy [Minor]', [
|
|
6
|
+
['yarn', 'workspaces foreach --all version minor --deferred'],
|
|
7
|
+
['yarn', 'cycle'],
|
|
8
|
+
['yarn', 'build'],
|
|
9
|
+
['yarn', 'version apply --all'],
|
|
10
|
+
['yarn', 'workspaces foreach -pt npm publish'],
|
|
11
|
+
])
|
package/src/deploy.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runSteps } from './lib'
|
|
4
|
+
|
|
5
|
+
runSteps('Deploy [Patch]', [
|
|
6
|
+
['yarn', 'workspaces foreach --all version patch --deferred'],
|
|
7
|
+
['yarn', 'build'],
|
|
8
|
+
['yarn', 'cycle'],
|
|
9
|
+
['yarn', 'gen-docs'],
|
|
10
|
+
['yarn', 'version apply --all'],
|
|
11
|
+
['yarn', 'workspaces foreach -pt npm publish'],
|
|
12
|
+
])
|
package/src/deps.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
|
|
4
|
+
|
|
5
|
+
const workspaces = yarnWorkspaces()
|
|
6
|
+
|
|
7
|
+
const steps = workspaces.map<ScriptStep>(({ location }) => ['node', ['./node_modules/depcheck/bin/depcheck.js', `${location}/.`]])
|
|
8
|
+
|
|
9
|
+
runSteps(
|
|
10
|
+
'Deps',
|
|
11
|
+
steps,
|
|
12
|
+
false,
|
|
13
|
+
workspaces.map(({ name }) => name),
|
|
14
|
+
)
|
package/src/fix.ts
ADDED
package/src/gen-docs.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { cwd } from 'process'
|
|
4
|
+
|
|
5
|
+
import { runSteps } from './lib'
|
|
6
|
+
|
|
7
|
+
runSteps('Generate TypeDocs', [
|
|
8
|
+
[
|
|
9
|
+
'yarn',
|
|
10
|
+
[
|
|
11
|
+
'workspaces',
|
|
12
|
+
'foreach',
|
|
13
|
+
'-ptA',
|
|
14
|
+
'exec',
|
|
15
|
+
`${cwd()}/node_modules/typedoc/bin/typedoc`,
|
|
16
|
+
'--logLevel',
|
|
17
|
+
'Error',
|
|
18
|
+
'--tsconfig',
|
|
19
|
+
'./tsconfig.build.esm.json',
|
|
20
|
+
'--excludeExternals',
|
|
21
|
+
'./src/index.ts',
|
|
22
|
+
'--json',
|
|
23
|
+
'./dist/docs.json',
|
|
24
|
+
],
|
|
25
|
+
],
|
|
26
|
+
])
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import chalk from 'chalk'
|
|
3
|
+
import { execSync } from 'child_process'
|
|
4
|
+
import { sync } from 'parse-git-config'
|
|
5
|
+
|
|
6
|
+
import { safeExit } from './lib'
|
|
7
|
+
|
|
8
|
+
safeExit(() => {
|
|
9
|
+
console.log(`\nGitlint Fix Start [${process.cwd()}]\n`)
|
|
10
|
+
|
|
11
|
+
const gitConfig = sync()
|
|
12
|
+
|
|
13
|
+
if (gitConfig.core.ignorecase) {
|
|
14
|
+
execSync('git config core.ignorecase false', { stdio: 'inherit' })
|
|
15
|
+
console.warn(chalk.yellow('\nGitlint Fix: Updated core.ignorecase to be false\n'))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (gitConfig.core.autocrlf !== false) {
|
|
19
|
+
execSync('git config core.autocrlf false', { stdio: 'inherit' })
|
|
20
|
+
console.warn(chalk.yellow('\nGitlint Fix: Updated core.autocrlf to be false\n'))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (gitConfig.core.eol !== 'lf') {
|
|
24
|
+
execSync('git config core.eol lf', { stdio: 'inherit' })
|
|
25
|
+
console.warn(chalk.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return 1
|
|
29
|
+
})
|
package/src/gitlint.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import chalk from 'chalk'
|
|
3
|
+
import { sync } from 'parse-git-config'
|
|
4
|
+
|
|
5
|
+
import { safeExit } from './lib'
|
|
6
|
+
|
|
7
|
+
safeExit(() => {
|
|
8
|
+
console.log(`\nGitlint Start [${process.cwd()}]\n`)
|
|
9
|
+
let valid = 0
|
|
10
|
+
let warnings = 0
|
|
11
|
+
const errors = 0
|
|
12
|
+
const gitConfig = sync()
|
|
13
|
+
|
|
14
|
+
const warn = (message: string) => {
|
|
15
|
+
console.warn(chalk.yellow(`Warning: ${message}`))
|
|
16
|
+
warnings++
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (gitConfig.core.ignorecase) {
|
|
20
|
+
warn('Please set core.ignorecase to FALSE in .git/config file [run yarn gitlint-fix]')
|
|
21
|
+
} else {
|
|
22
|
+
valid++
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (gitConfig.core.autocrlf !== false) {
|
|
26
|
+
warn('Please set core.autocrlf to FALSE in .git/config file [run yarn gitlint-fix]')
|
|
27
|
+
} else {
|
|
28
|
+
valid++
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (gitConfig.core.eol !== 'lf') {
|
|
32
|
+
warn('Please set core.eol to "lf" in .git/config file [run yarn gitlint-fix]')
|
|
33
|
+
} else {
|
|
34
|
+
valid++
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const resultMessages: string[] = []
|
|
38
|
+
if (valid > 0) {
|
|
39
|
+
resultMessages.push(chalk.green(`Passed: ${valid}`))
|
|
40
|
+
}
|
|
41
|
+
if (warnings > 0) {
|
|
42
|
+
resultMessages.push(chalk.yellow(`Warnings: ${warnings}`))
|
|
43
|
+
}
|
|
44
|
+
if (errors > 0) {
|
|
45
|
+
resultMessages.push(chalk.red(` Errors: ${errors}`))
|
|
46
|
+
}
|
|
47
|
+
console.warn(`Gitlint Finish [ ${resultMessages.join(' | ')} ]\n`)
|
|
48
|
+
return warnings + errors === 0 ? 1 : 0
|
|
49
|
+
})
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const stub = 1
|
package/src/lib/runSteps.ts
CHANGED
|
@@ -15,7 +15,12 @@ export const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, m
|
|
|
15
15
|
if (messages?.[i]) {
|
|
16
16
|
console.log(chalk.gray(messages?.[i]))
|
|
17
17
|
}
|
|
18
|
-
const status = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {
|
|
18
|
+
const status = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {
|
|
19
|
+
...config,
|
|
20
|
+
encoding: 'utf8',
|
|
21
|
+
shell: true,
|
|
22
|
+
stdio: 'inherit',
|
|
23
|
+
}).status
|
|
19
24
|
if (status && exitOnFail) {
|
|
20
25
|
return status
|
|
21
26
|
}
|
package/src/lib/withError.ts
CHANGED
|
@@ -2,7 +2,7 @@ export const withError = <T extends Error = Error>(
|
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
3
|
ex: any,
|
|
4
4
|
closure: (error: T) => number,
|
|
5
|
-
predicate = (ex: T) => ex.name !== undefined && ex.message !== undefined
|
|
5
|
+
predicate = (ex: T) => ex.name !== undefined && ex.message !== undefined,
|
|
6
6
|
) => {
|
|
7
7
|
return predicate(ex as T) ? closure(ex as T) : undefined
|
|
8
8
|
}
|
package/src/license.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { runSteps, ScriptStep, yarnWorkspaces } from './lib'
|
|
4
|
+
|
|
5
|
+
const workspaces = yarnWorkspaces()
|
|
6
|
+
|
|
7
|
+
const exclude: string[] = [
|
|
8
|
+
'MIT',
|
|
9
|
+
'ISC',
|
|
10
|
+
'Apache-2.0',
|
|
11
|
+
'BSD',
|
|
12
|
+
'BSD-2-Clause',
|
|
13
|
+
'CC-BY-4.0',
|
|
14
|
+
'Unlicense',
|
|
15
|
+
'CC-BY-3.0',
|
|
16
|
+
'CC0-1.0',
|
|
17
|
+
'LGPL-3.0-only',
|
|
18
|
+
'LGPL-3.0',
|
|
19
|
+
'LGPL-3.0-or-later',
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
const steps = workspaces.map<ScriptStep>(({ location }) => [
|
|
23
|
+
'node',
|
|
24
|
+
['./node_modules/license-checker/bin/license-checker', '--start', `./${location}`, '--exclude', `'${exclude.join(', ')}'`, '--production'],
|
|
25
|
+
])
|
|
26
|
+
|
|
27
|
+
runSteps(
|
|
28
|
+
'License',
|
|
29
|
+
steps,
|
|
30
|
+
false,
|
|
31
|
+
workspaces.map(({ name }) => name),
|
|
32
|
+
)
|
package/src/lint-fast.ts
ADDED
package/src/lint.ts
ADDED
package/src/rebuild.ts
ADDED
package/src/reinstall.ts
ADDED
package/src/relint.ts
ADDED
package/src/sonar.ts
ADDED
package/src/up.ts
ADDED
package/src/updo.ts
ADDED
package/src/yarn3only.ts
ADDED