@xylabs/ts-scripts-yarn3 2.17.16 → 2.18.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.
- package/dist/cjs/actions/build.js +1 -0
- package/dist/cjs/actions/build.js.map +1 -1
- package/dist/cjs/actions/clean-docs.js +16 -0
- package/dist/cjs/actions/clean-docs.js.map +1 -0
- package/dist/cjs/actions/clean.js +2 -1
- package/dist/cjs/actions/clean.js.map +1 -1
- package/dist/cjs/actions/gitignore-gen.js +8 -0
- package/dist/cjs/actions/gitignore-gen.js.map +1 -0
- package/dist/cjs/actions/index.js +3 -0
- package/dist/cjs/actions/index.js.map +1 -1
- package/dist/cjs/actions/npmignore-gen.js +8 -0
- package/dist/cjs/actions/npmignore-gen.js.map +1 -0
- package/dist/cjs/actions/package/recompile.js +2 -3
- package/dist/cjs/actions/package/recompile.js.map +1 -1
- package/dist/cjs/actions/rebuild.js +1 -2
- package/dist/cjs/actions/rebuild.js.map +1 -1
- package/dist/cjs/lib/file/ReadFileSyncOptions.js +5 -0
- package/dist/cjs/lib/file/ReadFileSyncOptions.js.map +1 -0
- package/dist/cjs/lib/file/constants.js +6 -0
- package/dist/cjs/lib/file/constants.js.map +1 -0
- package/dist/cjs/lib/file/fileLines.js +20 -0
- package/dist/cjs/lib/file/fileLines.js.map +1 -0
- package/dist/cjs/lib/file/index.js +8 -0
- package/dist/cjs/lib/file/index.js.map +1 -0
- package/dist/cjs/lib/file/tryReadFileSync.js +10 -0
- package/dist/cjs/lib/file/tryReadFileSync.js.map +1 -0
- package/dist/cjs/lib/generateIgnoreFiles.js +32 -0
- package/dist/cjs/lib/generateIgnoreFiles.js.map +1 -0
- package/dist/cjs/lib/index.js +4 -3
- package/dist/cjs/lib/index.js.map +1 -1
- package/dist/cjs/lib/string/empty.js +8 -0
- package/dist/cjs/lib/string/empty.js.map +1 -0
- package/dist/cjs/lib/string/index.js +6 -0
- package/dist/cjs/lib/string/index.js.map +1 -0
- package/dist/cjs/lib/string/union.js +6 -0
- package/dist/cjs/lib/string/union.js.map +1 -0
- package/dist/cjs/lib/xy/xyCommonCommands.js +19 -0
- package/dist/cjs/lib/xy/xyCommonCommands.js.map +1 -1
- package/dist/cjs/lib/yarn/index.js +7 -0
- package/dist/cjs/lib/yarn/index.js.map +1 -0
- package/dist/cjs/lib/yarn/isYarnVersionOrGreater.js.map +1 -0
- package/dist/cjs/lib/yarn/workspace/Workspace.js +3 -0
- package/dist/cjs/lib/yarn/workspace/Workspace.js.map +1 -0
- package/dist/cjs/lib/yarn/workspace/index.js +7 -0
- package/dist/cjs/lib/yarn/workspace/index.js.map +1 -0
- package/dist/cjs/lib/yarn/workspace/yarnWorkspace.js +12 -0
- package/dist/cjs/lib/yarn/workspace/yarnWorkspace.js.map +1 -0
- package/dist/cjs/lib/{yarnWorkspaces.js → yarn/workspace/yarnWorkspaces.js} +2 -0
- package/dist/cjs/lib/yarn/workspace/yarnWorkspaces.js.map +1 -0
- package/dist/cjs/lib/yarn/yarnInitCwd.js.map +1 -0
- package/dist/esm/actions/build.js +1 -0
- package/dist/esm/actions/build.js.map +1 -1
- package/dist/esm/actions/clean-docs.js +11 -0
- package/dist/esm/actions/clean-docs.js.map +1 -0
- package/dist/esm/actions/clean.js +2 -1
- package/dist/esm/actions/clean.js.map +1 -1
- package/dist/esm/actions/gitignore-gen.js +4 -0
- package/dist/esm/actions/gitignore-gen.js.map +1 -0
- package/dist/esm/actions/index.js +3 -0
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/npmignore-gen.js +4 -0
- package/dist/esm/actions/npmignore-gen.js.map +1 -0
- package/dist/esm/actions/package/recompile.js +2 -3
- package/dist/esm/actions/package/recompile.js.map +1 -1
- package/dist/esm/actions/rebuild.js +1 -2
- package/dist/esm/actions/rebuild.js.map +1 -1
- package/dist/esm/lib/file/ReadFileSyncOptions.js +2 -0
- package/dist/esm/lib/file/ReadFileSyncOptions.js.map +1 -0
- package/dist/esm/lib/file/constants.js +3 -0
- package/dist/esm/lib/file/constants.js.map +1 -0
- package/dist/esm/lib/file/fileLines.js +14 -0
- package/dist/esm/lib/file/fileLines.js.map +1 -0
- package/dist/esm/lib/file/index.js +5 -0
- package/dist/esm/lib/file/index.js.map +1 -0
- package/dist/esm/lib/file/tryReadFileSync.js +6 -0
- package/dist/esm/lib/file/tryReadFileSync.js.map +1 -0
- package/dist/esm/lib/generateIgnoreFiles.js +26 -0
- package/dist/esm/lib/generateIgnoreFiles.js.map +1 -0
- package/dist/esm/lib/index.js +4 -3
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/string/empty.js +3 -0
- package/dist/esm/lib/string/empty.js.map +1 -0
- package/dist/esm/lib/string/index.js +3 -0
- package/dist/esm/lib/string/index.js.map +1 -0
- package/dist/esm/lib/string/union.js +2 -0
- package/dist/esm/lib/string/union.js.map +1 -0
- package/dist/esm/lib/xy/xyCommonCommands.js +20 -1
- package/dist/esm/lib/xy/xyCommonCommands.js.map +1 -1
- package/dist/esm/lib/yarn/index.js +4 -0
- package/dist/esm/lib/yarn/index.js.map +1 -0
- package/dist/esm/lib/yarn/isYarnVersionOrGreater.js.map +1 -0
- package/dist/esm/lib/yarn/workspace/Workspace.js +2 -0
- package/dist/esm/lib/yarn/workspace/Workspace.js.map +1 -0
- package/dist/esm/lib/yarn/workspace/index.js +4 -0
- package/dist/esm/lib/yarn/workspace/index.js.map +1 -0
- package/dist/esm/lib/yarn/workspace/yarnWorkspace.js +8 -0
- package/dist/esm/lib/yarn/workspace/yarnWorkspace.js.map +1 -0
- package/dist/esm/lib/{yarnWorkspaces.js → yarn/workspace/yarnWorkspaces.js} +2 -0
- package/dist/esm/lib/yarn/workspace/yarnWorkspaces.js.map +1 -0
- package/dist/esm/lib/yarn/yarnInitCwd.js.map +1 -0
- package/dist/types/actions/build.d.ts.map +1 -1
- package/dist/types/actions/clean-docs.d.ts +2 -0
- package/dist/types/actions/clean-docs.d.ts.map +1 -0
- package/dist/types/actions/clean.d.ts.map +1 -1
- package/dist/types/actions/gitignore-gen.d.ts +2 -0
- package/dist/types/actions/gitignore-gen.d.ts.map +1 -0
- package/dist/types/actions/index.d.ts +3 -0
- package/dist/types/actions/index.d.ts.map +1 -1
- package/dist/types/actions/npmignore-gen.d.ts +2 -0
- package/dist/types/actions/npmignore-gen.d.ts.map +1 -0
- package/dist/types/actions/package/recompile.d.ts.map +1 -1
- package/dist/types/actions/rebuild.d.ts.map +1 -1
- package/dist/types/lib/file/ReadFileSyncOptions.d.ts +7 -0
- package/dist/types/lib/file/ReadFileSyncOptions.d.ts.map +1 -0
- package/dist/types/lib/file/constants.d.ts +3 -0
- package/dist/types/lib/file/constants.d.ts.map +1 -0
- package/dist/types/lib/file/fileLines.d.ts +6 -0
- package/dist/types/lib/file/fileLines.d.ts.map +1 -0
- package/dist/types/lib/file/index.d.ts +5 -0
- package/dist/types/lib/file/index.d.ts.map +1 -0
- package/dist/types/lib/file/tryReadFileSync.d.ts +4 -0
- package/dist/types/lib/file/tryReadFileSync.d.ts.map +1 -0
- package/dist/types/lib/generateIgnoreFiles.d.ts +2 -0
- package/dist/types/lib/generateIgnoreFiles.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +4 -3
- package/dist/types/lib/index.d.ts.map +1 -1
- package/dist/types/lib/string/empty.d.ts +3 -0
- package/dist/types/lib/string/empty.d.ts.map +1 -0
- package/dist/types/lib/string/index.d.ts +3 -0
- package/dist/types/lib/string/index.d.ts.map +1 -0
- package/dist/types/lib/string/union.d.ts +2 -0
- package/dist/types/lib/string/union.d.ts.map +1 -0
- package/dist/types/lib/xy/xyCommonCommands.d.ts.map +1 -1
- package/dist/types/lib/yarn/index.d.ts +4 -0
- package/dist/types/lib/yarn/index.d.ts.map +1 -0
- package/dist/types/lib/yarn/isYarnVersionOrGreater.d.ts.map +1 -0
- package/dist/types/lib/yarn/workspace/Workspace.d.ts +5 -0
- package/dist/types/lib/yarn/workspace/Workspace.d.ts.map +1 -0
- package/dist/types/lib/yarn/workspace/index.d.ts +4 -0
- package/dist/types/lib/yarn/workspace/index.d.ts.map +1 -0
- package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts +3 -0
- package/dist/types/lib/yarn/workspace/yarnWorkspace.d.ts.map +1 -0
- package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts +3 -0
- package/dist/types/lib/yarn/workspace/yarnWorkspaces.d.ts.map +1 -0
- package/dist/types/lib/yarn/yarnInitCwd.d.ts.map +1 -0
- package/package.json +10 -9
- package/src/actions/build.ts +1 -0
- package/src/actions/clean-docs.ts +12 -0
- package/src/actions/clean.ts +2 -1
- package/src/actions/gitignore-gen.ts +5 -0
- package/src/actions/index.ts +3 -0
- package/src/actions/npmignore-gen.ts +5 -0
- package/src/actions/package/recompile.ts +2 -3
- package/src/actions/rebuild.ts +1 -2
- package/src/lib/file/ReadFileSyncOptions.ts +3 -0
- package/src/lib/file/constants.ts +2 -0
- package/src/lib/file/fileLines.ts +18 -0
- package/src/lib/file/index.ts +4 -0
- package/src/lib/file/tryReadFileSync.ts +7 -0
- package/src/lib/generateIgnoreFiles.ts +27 -0
- package/src/lib/index.ts +4 -3
- package/src/lib/string/empty.ts +2 -0
- package/src/lib/string/index.ts +2 -0
- package/src/lib/string/union.ts +1 -0
- package/src/lib/xy/xyCommonCommands.ts +34 -0
- package/src/lib/yarn/index.ts +3 -0
- package/src/lib/yarn/workspace/Workspace.ts +4 -0
- package/src/lib/yarn/workspace/index.ts +3 -0
- package/src/lib/yarn/workspace/yarnWorkspace.ts +8 -0
- package/src/lib/{yarnWorkspaces.ts → yarn/workspace/yarnWorkspaces.ts} +3 -4
- package/.depcheckrc +0 -13
- package/.tsconfig.build.cjs.json +0 -30
- package/.tsconfig.build.esm.json +0 -30
- package/dist/.tsconfig.build.cjs.tsbuildinfo +0 -1
- package/dist/.tsconfig.build.esm.tsbuildinfo +0 -1
- package/dist/cjs/actions/package/tsconfig-gen-cjs.js +0 -37
- package/dist/cjs/actions/package/tsconfig-gen-cjs.js.map +0 -1
- package/dist/cjs/actions/package/tsconfig-gen-esm.js +0 -39
- package/dist/cjs/actions/package/tsconfig-gen-esm.js.map +0 -1
- package/dist/cjs/actions/tsconfig-gen-cjs.js +0 -43
- package/dist/cjs/actions/tsconfig-gen-cjs.js.map +0 -1
- package/dist/cjs/actions/tsconfig-gen-clean.js +0 -27
- package/dist/cjs/actions/tsconfig-gen-clean.js.map +0 -1
- package/dist/cjs/actions/tsconfig-gen-esm.js +0 -43
- package/dist/cjs/actions/tsconfig-gen-esm.js.map +0 -1
- package/dist/cjs/actions/tsconfig-gen-test.js +0 -43
- package/dist/cjs/actions/tsconfig-gen-test.js.map +0 -1
- package/dist/cjs/actions/tsconfig-gen.js +0 -18
- package/dist/cjs/actions/tsconfig-gen.js.map +0 -1
- package/dist/cjs/bin/package/tsconfig-gen-cjs.js +0 -6
- package/dist/cjs/bin/package/tsconfig-gen-cjs.js.map +0 -1
- package/dist/cjs/bin/package/tsconfig-gen-esm.js +0 -6
- package/dist/cjs/bin/package/tsconfig-gen-esm.js.map +0 -1
- package/dist/cjs/bin/package/tsconfig-gen.js +0 -7
- package/dist/cjs/bin/package/tsconfig-gen.js.map +0 -1
- package/dist/cjs/bin/tsconfig-gen-clean.js +0 -6
- package/dist/cjs/bin/tsconfig-gen-clean.js.map +0 -1
- package/dist/cjs/bin/tsconfig-gen.js +0 -6
- package/dist/cjs/bin/tsconfig-gen.js.map +0 -1
- package/dist/cjs/lib/isYarnVersionOrGreater.js.map +0 -1
- package/dist/cjs/lib/yarnInitCwd.js.map +0 -1
- package/dist/cjs/lib/yarnWorkspaces.js.map +0 -1
- package/dist/esm/actions/package/tsconfig-gen-cjs.js +0 -31
- package/dist/esm/actions/package/tsconfig-gen-cjs.js.map +0 -1
- package/dist/esm/actions/package/tsconfig-gen-esm.js +0 -33
- package/dist/esm/actions/package/tsconfig-gen-esm.js.map +0 -1
- package/dist/esm/actions/tsconfig-gen-cjs.js +0 -38
- package/dist/esm/actions/tsconfig-gen-cjs.js.map +0 -1
- package/dist/esm/actions/tsconfig-gen-clean.js +0 -23
- package/dist/esm/actions/tsconfig-gen-clean.js.map +0 -1
- package/dist/esm/actions/tsconfig-gen-esm.js +0 -38
- package/dist/esm/actions/tsconfig-gen-esm.js.map +0 -1
- package/dist/esm/actions/tsconfig-gen-test.js +0 -38
- package/dist/esm/actions/tsconfig-gen-test.js.map +0 -1
- package/dist/esm/actions/tsconfig-gen.js +0 -14
- package/dist/esm/actions/tsconfig-gen.js.map +0 -1
- package/dist/esm/bin/package/tsconfig-gen-cjs.js +0 -4
- package/dist/esm/bin/package/tsconfig-gen-cjs.js.map +0 -1
- package/dist/esm/bin/package/tsconfig-gen-esm.js +0 -4
- package/dist/esm/bin/package/tsconfig-gen-esm.js.map +0 -1
- package/dist/esm/bin/package/tsconfig-gen.js +0 -5
- package/dist/esm/bin/package/tsconfig-gen.js.map +0 -1
- package/dist/esm/bin/tsconfig-gen-clean.js +0 -4
- package/dist/esm/bin/tsconfig-gen-clean.js.map +0 -1
- package/dist/esm/bin/tsconfig-gen.js +0 -4
- package/dist/esm/bin/tsconfig-gen.js.map +0 -1
- package/dist/esm/lib/isYarnVersionOrGreater.js.map +0 -1
- package/dist/esm/lib/yarnInitCwd.js.map +0 -1
- package/dist/esm/lib/yarnWorkspaces.js.map +0 -1
- package/dist/tsconfig.build.cjs.tsbuildinfo +0 -1
- package/dist/tsconfig.build.esm.tsbuildinfo +0 -1
- package/dist/types/actions/package/tsconfig-gen-cjs.d.ts +0 -2
- package/dist/types/actions/package/tsconfig-gen-cjs.d.ts.map +0 -1
- package/dist/types/actions/package/tsconfig-gen-esm.d.ts +0 -2
- package/dist/types/actions/package/tsconfig-gen-esm.d.ts.map +0 -1
- package/dist/types/actions/tsconfig-gen-cjs.d.ts +0 -2
- package/dist/types/actions/tsconfig-gen-cjs.d.ts.map +0 -1
- package/dist/types/actions/tsconfig-gen-clean.d.ts +0 -2
- package/dist/types/actions/tsconfig-gen-clean.d.ts.map +0 -1
- package/dist/types/actions/tsconfig-gen-esm.d.ts +0 -2
- package/dist/types/actions/tsconfig-gen-esm.d.ts.map +0 -1
- package/dist/types/actions/tsconfig-gen-test.d.ts +0 -2
- package/dist/types/actions/tsconfig-gen-test.d.ts.map +0 -1
- package/dist/types/actions/tsconfig-gen.d.ts +0 -6
- package/dist/types/actions/tsconfig-gen.d.ts.map +0 -1
- package/dist/types/bin/package/tsconfig-gen-cjs.d.ts +0 -3
- package/dist/types/bin/package/tsconfig-gen-cjs.d.ts.map +0 -1
- package/dist/types/bin/package/tsconfig-gen-esm.d.ts +0 -3
- package/dist/types/bin/package/tsconfig-gen-esm.d.ts.map +0 -1
- package/dist/types/bin/package/tsconfig-gen.d.ts +0 -3
- package/dist/types/bin/package/tsconfig-gen.d.ts.map +0 -1
- package/dist/types/bin/tsconfig-gen-clean.d.ts +0 -3
- package/dist/types/bin/tsconfig-gen-clean.d.ts.map +0 -1
- package/dist/types/bin/tsconfig-gen.d.ts +0 -3
- package/dist/types/bin/tsconfig-gen.d.ts.map +0 -1
- package/dist/types/lib/isYarnVersionOrGreater.d.ts.map +0 -1
- package/dist/types/lib/yarnInitCwd.d.ts.map +0 -1
- package/dist/types/lib/yarnWorkspaces.d.ts +0 -6
- package/dist/types/lib/yarnWorkspaces.d.ts.map +0 -1
- package/src/actions/package/tsconfig-gen-cjs.ts +0 -32
- package/src/actions/package/tsconfig-gen-esm.ts +0 -34
- package/src/actions/tsconfig-gen-cjs.ts +0 -40
- package/src/actions/tsconfig-gen-clean.ts +0 -24
- package/src/actions/tsconfig-gen-esm.ts +0 -39
- package/src/actions/tsconfig-gen-test.ts +0 -44
- package/src/actions/tsconfig-gen.ts +0 -19
- package/src/bin/package/tsconfig-gen-cjs.ts +0 -5
- package/src/bin/package/tsconfig-gen-esm.ts +0 -5
- package/src/bin/package/tsconfig-gen.ts +0 -6
- package/src/bin/tsconfig-gen-clean.ts +0 -5
- package/src/bin/tsconfig-gen.ts +0 -5
- package/tsconfig.build.cjs.json +0 -29
- package/tsconfig.build.esm.json +0 -29
- package/tsconfig.json +0 -9
- package/tsconfig.test.json +0 -4
- /package/dist/cjs/lib/{isYarnVersionOrGreater.js → yarn/isYarnVersionOrGreater.js} +0 -0
- /package/dist/cjs/lib/{yarnInitCwd.js → yarn/yarnInitCwd.js} +0 -0
- /package/dist/esm/lib/{isYarnVersionOrGreater.js → yarn/isYarnVersionOrGreater.js} +0 -0
- /package/dist/esm/lib/{yarnInitCwd.js → yarn/yarnInitCwd.js} +0 -0
- /package/dist/types/lib/{isYarnVersionOrGreater.d.ts → yarn/isYarnVersionOrGreater.d.ts} +0 -0
- /package/dist/types/lib/{yarnInitCwd.d.ts → yarn/yarnInitCwd.d.ts} +0 -0
- /package/src/lib/{isYarnVersionOrGreater.ts → yarn/isYarnVersionOrGreater.ts} +0 -0
- /package/src/lib/{yarnInitCwd.ts → yarn/yarnInitCwd.ts} +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
|
-
import { readFileSync, writeFileSync } from 'fs'
|
|
3
|
-
|
|
4
|
-
import { createBuildConfig } from '../../lib'
|
|
5
|
-
|
|
6
|
-
export const packageTsconfigGenCjs = () => {
|
|
7
|
-
const pkg = process.env.INIT_CWD ?? './'
|
|
8
|
-
const pkgName = process.env.npm_package_name
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
const configObject = createBuildConfig(pkg, 'CommonJS', 'ES6', 'cjs')
|
|
12
|
-
if (configObject) {
|
|
13
|
-
const config = JSON.stringify(configObject, null, 2)
|
|
14
|
-
|
|
15
|
-
let currentConfig: string | undefined
|
|
16
|
-
try {
|
|
17
|
-
currentConfig = readFileSync(`${pkg}/.tsconfig.build.cjs.json`, { encoding: 'utf8' })
|
|
18
|
-
} catch (ex) {
|
|
19
|
-
currentConfig = undefined
|
|
20
|
-
}
|
|
21
|
-
if (currentConfig !== config) {
|
|
22
|
-
console.log(chalk.gray(`Updating CJS tsconfig [${pkgName}]`))
|
|
23
|
-
writeFileSync(`${pkg}/.tsconfig.build.cjs.json`, config, { encoding: 'utf8' })
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return 0
|
|
27
|
-
} catch (ex) {
|
|
28
|
-
const error = ex as Error
|
|
29
|
-
console.error(`tsconfig (CJS) generate failed [${pkgName}] [${error.message}]`)
|
|
30
|
-
return 1
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
|
-
import { readFileSync, writeFileSync } from 'fs'
|
|
3
|
-
|
|
4
|
-
import { createBuildConfig } from '../../lib'
|
|
5
|
-
|
|
6
|
-
export const packageTsconfigGenEsm = (quiet = false) => {
|
|
7
|
-
const pkg = process.env.INIT_CWD ?? './'
|
|
8
|
-
const pkgName = process.env.npm_package_name
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
const configObject = createBuildConfig(pkg, 'ESNext', 'ESNext', 'esm')
|
|
12
|
-
if (configObject) {
|
|
13
|
-
const config = JSON.stringify(configObject, null, 2)
|
|
14
|
-
|
|
15
|
-
let currentConfig: string | undefined
|
|
16
|
-
try {
|
|
17
|
-
currentConfig = readFileSync(`${pkg}/.tsconfig.build.esm.json`, { encoding: 'utf8' })
|
|
18
|
-
} catch (ex) {
|
|
19
|
-
currentConfig = undefined
|
|
20
|
-
}
|
|
21
|
-
if (currentConfig !== config) {
|
|
22
|
-
if (!quiet) {
|
|
23
|
-
console.log(chalk.gray(`Updating ESM tsconfig [${pkgName}]`))
|
|
24
|
-
}
|
|
25
|
-
writeFileSync(`${pkg}/.tsconfig.build.esm.json`, config, { encoding: 'utf8' })
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return 0
|
|
29
|
-
} catch (ex) {
|
|
30
|
-
const error = ex as Error
|
|
31
|
-
console.error(`tsconfig (ESM) generate failed [${pkgName}] [${error.message}]`)
|
|
32
|
-
return 1
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
|
-
import { readFileSync, writeFileSync } from 'fs'
|
|
3
|
-
|
|
4
|
-
import { createBuildConfig, yarnWorkspaces } from '../lib'
|
|
5
|
-
|
|
6
|
-
export const tsconfigGenCjs = (pkg?: string) => {
|
|
7
|
-
const workspaces = yarnWorkspaces()
|
|
8
|
-
const workspaceList = workspaces.filter(({ name }) => {
|
|
9
|
-
return pkg === undefined || name === pkg
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
console.log(chalk.green('Generate Configs [CJS]'))
|
|
13
|
-
|
|
14
|
-
return workspaceList
|
|
15
|
-
.map(({ location, name }) => {
|
|
16
|
-
try {
|
|
17
|
-
const configObject = createBuildConfig(location, 'CommonJS', 'ES6', 'cjs')
|
|
18
|
-
if (configObject) {
|
|
19
|
-
const config = JSON.stringify(createBuildConfig(location, 'CommonJS', 'ES6', 'cjs'), null, 2)
|
|
20
|
-
|
|
21
|
-
let currentConfig: string | undefined
|
|
22
|
-
try {
|
|
23
|
-
currentConfig = readFileSync(`${location}/.tsconfig.build.cjs.json`, { encoding: 'utf8' })
|
|
24
|
-
} catch (ex) {
|
|
25
|
-
currentConfig = undefined
|
|
26
|
-
}
|
|
27
|
-
if (currentConfig !== config) {
|
|
28
|
-
console.log(chalk.gray(`Updating CJS tsconfig [${name}]`))
|
|
29
|
-
writeFileSync(`${location}/.tsconfig.build.cjs.json`, config, { encoding: 'utf8' })
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return 0
|
|
33
|
-
} catch (ex) {
|
|
34
|
-
const error = ex as Error
|
|
35
|
-
console.error(`tsconfig (CJS) generate failed [${name}] [${error.message}]`)
|
|
36
|
-
return 1
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
.reduce((prev, value) => prev || value, 0)
|
|
40
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { rmSync } from 'fs'
|
|
2
|
-
|
|
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)
|
|
24
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
|
-
import { readFileSync, writeFileSync } from 'fs'
|
|
3
|
-
|
|
4
|
-
import { createBuildConfig, yarnWorkspaces } from '../lib'
|
|
5
|
-
|
|
6
|
-
export const tsconfigGenEsm = (pkg?: string) => {
|
|
7
|
-
const workspaces = yarnWorkspaces()
|
|
8
|
-
const workspaceList = workspaces.filter(({ name }) => {
|
|
9
|
-
return pkg === undefined || name === pkg
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
console.log(chalk.green('Generate Configs [ESM]'))
|
|
13
|
-
|
|
14
|
-
return workspaceList
|
|
15
|
-
.map(({ location, name }) => {
|
|
16
|
-
try {
|
|
17
|
-
const configObject = createBuildConfig(location, 'ESNext', 'ESNext', 'esm')
|
|
18
|
-
if (configObject) {
|
|
19
|
-
const config = JSON.stringify(configObject, null, 2)
|
|
20
|
-
let currentConfig: string | undefined
|
|
21
|
-
try {
|
|
22
|
-
currentConfig = readFileSync(`${location}/.tsconfig.build.esm.json`, { encoding: 'utf8' })
|
|
23
|
-
} catch (ex) {
|
|
24
|
-
currentConfig = undefined
|
|
25
|
-
}
|
|
26
|
-
if (currentConfig !== config) {
|
|
27
|
-
console.log(chalk.gray(`Updating ESM tsconfig [${name}]`))
|
|
28
|
-
writeFileSync(`${location}/.tsconfig.build.esm.json`, config, { encoding: 'utf8' })
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return 0
|
|
32
|
-
} catch (ex) {
|
|
33
|
-
const error = ex as Error
|
|
34
|
-
console.error(`tsconfig (ESM) generate failed [${name}] [${error.message}]`)
|
|
35
|
-
return 1
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
.reduce((prev, value) => prev || value, 0)
|
|
39
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk'
|
|
2
|
-
import { readFileSync, writeFileSync } from 'fs'
|
|
3
|
-
|
|
4
|
-
import { yarnWorkspaces } from '../lib'
|
|
5
|
-
|
|
6
|
-
export const tsconfigGenTest = (pkg?: string) => {
|
|
7
|
-
const workspaces = yarnWorkspaces()
|
|
8
|
-
const workspaceList = workspaces.filter(({ name }) => {
|
|
9
|
-
return pkg === undefined || name === pkg
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
console.log(chalk.green('Generate Configs [Test]'))
|
|
13
|
-
|
|
14
|
-
const config = JSON.stringify(
|
|
15
|
-
{
|
|
16
|
-
extends: './tsconfig.json',
|
|
17
|
-
include: ['src/**/*.spec.ts'],
|
|
18
|
-
},
|
|
19
|
-
null,
|
|
20
|
-
2,
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
return workspaceList
|
|
24
|
-
.map(({ location, name }) => {
|
|
25
|
-
try {
|
|
26
|
-
let currentConfig: string | undefined
|
|
27
|
-
try {
|
|
28
|
-
currentConfig = readFileSync(`${location}/.tsconfig.build.test.json`, { encoding: 'utf8' })
|
|
29
|
-
} catch (ex) {
|
|
30
|
-
currentConfig = undefined
|
|
31
|
-
}
|
|
32
|
-
if (currentConfig !== config) {
|
|
33
|
-
console.log(chalk.gray(`Updating TEST tsconfig [${name}]`))
|
|
34
|
-
writeFileSync(`${location}/.tsconfig.build.test.json`, config, { encoding: 'utf8' })
|
|
35
|
-
}
|
|
36
|
-
return 0
|
|
37
|
-
} catch (ex) {
|
|
38
|
-
const error = ex as Error
|
|
39
|
-
console.error(`tsconfig (TEST) generate failed [${name}] [${error.message}]`)
|
|
40
|
-
return 1
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
.reduce((prev, value) => prev || value, 0)
|
|
44
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { tsconfigGenCjs } from './tsconfig-gen-cjs'
|
|
2
|
-
import { tsconfigGenEsm } from './tsconfig-gen-esm'
|
|
3
|
-
import { tsconfigGenTest } from './tsconfig-gen-test'
|
|
4
|
-
|
|
5
|
-
export interface TsconfigGenParams {
|
|
6
|
-
pkg?: string
|
|
7
|
-
target?: 'esm' | 'cjs'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const tsconfigGen = ({ target, pkg }: TsconfigGenParams) => {
|
|
11
|
-
switch (target) {
|
|
12
|
-
case 'esm':
|
|
13
|
-
return tsconfigGenEsm(pkg) || tsconfigGenTest(pkg)
|
|
14
|
-
case 'cjs':
|
|
15
|
-
return tsconfigGenCjs(pkg) || tsconfigGenTest(pkg)
|
|
16
|
-
default:
|
|
17
|
-
return tsconfigGenEsm(pkg) || tsconfigGenCjs(pkg) || tsconfigGenTest(pkg)
|
|
18
|
-
}
|
|
19
|
-
}
|
package/src/bin/tsconfig-gen.ts
DELETED
package/tsconfig.build.cjs.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"composite": true,
|
|
4
|
-
"declarationDir": "./dist/types",
|
|
5
|
-
"module": "CommonJS",
|
|
6
|
-
"outDir": "./dist/cjs",
|
|
7
|
-
"rootDir": "src",
|
|
8
|
-
"rootDirs": [
|
|
9
|
-
"package.json"
|
|
10
|
-
],
|
|
11
|
-
"target": "ES6",
|
|
12
|
-
"typeRoots": []
|
|
13
|
-
},
|
|
14
|
-
"exclude": [
|
|
15
|
-
"**/build",
|
|
16
|
-
"**/dist",
|
|
17
|
-
"**/node_modules",
|
|
18
|
-
"**/*.spec.*",
|
|
19
|
-
"**/*.spec",
|
|
20
|
-
"**/*.stories.*",
|
|
21
|
-
"**/*.example.*",
|
|
22
|
-
"**/spec/*",
|
|
23
|
-
"**/stories/*"
|
|
24
|
-
],
|
|
25
|
-
"extends": "@xylabs/tsconfig",
|
|
26
|
-
"include": [
|
|
27
|
-
"src"
|
|
28
|
-
]
|
|
29
|
-
}
|
package/tsconfig.build.esm.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"composite": true,
|
|
4
|
-
"declarationDir": "./dist/types",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"outDir": "./dist/esm",
|
|
7
|
-
"rootDir": "src",
|
|
8
|
-
"rootDirs": [
|
|
9
|
-
"package.json"
|
|
10
|
-
],
|
|
11
|
-
"target": "ESNext",
|
|
12
|
-
"typeRoots": []
|
|
13
|
-
},
|
|
14
|
-
"exclude": [
|
|
15
|
-
"**/build",
|
|
16
|
-
"**/dist",
|
|
17
|
-
"**/node_modules",
|
|
18
|
-
"**/*.spec.*",
|
|
19
|
-
"**/*.spec",
|
|
20
|
-
"**/*.stories.*",
|
|
21
|
-
"**/*.example.*",
|
|
22
|
-
"**/spec/*",
|
|
23
|
-
"**/stories/*"
|
|
24
|
-
],
|
|
25
|
-
"extends": "@xylabs/tsconfig",
|
|
26
|
-
"include": [
|
|
27
|
-
"src"
|
|
28
|
-
]
|
|
29
|
-
}
|
package/tsconfig.json
DELETED
package/tsconfig.test.json
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|