@xylabs/ts-scripts-yarn3 6.3.3 → 6.3.5
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/cycle.mjs +42 -44
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/fix.mjs +5 -1
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/index.mjs +107 -105
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/lint.mjs +5 -1
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/bin/xy.mjs +92 -90
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +120 -118
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +92 -90
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +92 -90
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +67 -65
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +9 -9
package/dist/actions/lint.mjs
CHANGED
|
@@ -128,11 +128,15 @@ var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix } = {}) => {
|
|
|
128
128
|
var lintAllPackages = /* @__PURE__ */ __name(({ fix = false } = {}) => {
|
|
129
129
|
console.log(chalk4.gray(`${fix ? "Fix" : "Lint"} [All-Packages]`));
|
|
130
130
|
const start = Date.now();
|
|
131
|
+
const fixOptions = fix ? [
|
|
132
|
+
"--fix"
|
|
133
|
+
] : [];
|
|
131
134
|
const result = runSteps(`${fix ? "Fix" : "Lint"} [All-Packages]`, [
|
|
132
135
|
[
|
|
133
136
|
"yarn",
|
|
134
137
|
[
|
|
135
|
-
"eslint"
|
|
138
|
+
"eslint",
|
|
139
|
+
...fixOptions
|
|
136
140
|
]
|
|
137
141
|
]
|
|
138
142
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/actions/lint.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { runSteps } from '../lib/index.ts'\n\nexport interface LintParams {\n fix?: boolean\n incremental?: boolean\n pkg?: string\n verbose?: boolean\n}\n\nexport interface LintPackageParams {\n pkg: string\n verbose?: boolean\n}\n\nexport const lintPackage = ({ pkg, fix }: LintParams & Required<Pick<LintParams, 'pkg'>>) => {\n console.log(chalk.gray(`${fix ? 'Fix' : 'Lint'} [${pkg}]`))\n const start = Date.now()\n\n const result = runSteps(`${fix ? 'Fix' : 'Lint'} [${pkg}]`, [\n ['yarn', ['workspace',\n pkg,\n 'run',\n fix ? 'package-fix' : 'package-lint',\n ]],\n ])\n console.log(chalk.gray(`${fix ? 'Fixed in' : 'Linted in'} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`))\n return result\n}\n\nexport const lint = ({\n pkg, verbose, incremental, fix,\n}: LintParams = {}) => {\n return pkg\n ? lintPackage({ pkg, fix })\n : lintAllPackages({\n verbose, incremental, fix,\n })\n}\n\nexport const lintAllPackages = ({ fix = false }: LintParams = {}) => {\n console.log(chalk.gray(`${fix ? 'Fix' : 'Lint'} [All-Packages]`))\n const start = Date.now()\n // const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']\n // const incrementalOptions = incremental ? ['--since', '-Ap'] : ['--parallel', '-Ap']\n\n const result = runSteps(`${fix ? 'Fix' : 'Lint'} [All-Packages]`, [\n ['yarn', ['eslint']],\n ])\n console.log(chalk.gray(`${fix ? 'Fixed in' : 'Linted in'} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`))\n return result\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n"],"mappings":";;;;AAAA,OAAOA,YAAW;;;ACAlB,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAAQ;AACV,UAAMG,UAAUD,aAAa,sBAAsB;AACnD,UAAME,YAAYH,UAAU,UAAUI,MAAMC,MAAMD,MAAME;AACxDC,YAAQP,KAAAA,EAAOG,UAAU,GAAGL,IAAAA,QAAYC,MAAAA,aAAmBG,OAAAA,EAAS,CAAA;AACpE,QAAID,YAAY;AACdO,cAAQC,KAAKV,MAAAA;IACf;EACF;AACF,GAT2B;;;ACF3B,OAAOW,YAAW;;;ACAX,IAAMC,YAAY,wBAEvBC,IACAC,SACAC,YAAY,CAACF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AAYD,GAAAA,KAAQ;IAC3D;MAAC;MAAQ;QAAC;QACRA;QACA;QACAC,MAAM,gBAAgB;;;GAEzB;AACDC,UAAQC,IAAIC,OAAMC,KAAK,GAAGJ,MAAM,aAAa,WAAA,KAAgBG,OAAMO,UAAUJ,KAAKC,IAAG,IAAKF,SAAS,KAAMM,QAAQ,CAAA,CAAA,CAAA,KAAQR,OAAMC,KAAK,SAAA,CAAA,EAAY,CAAA;AAChJ,SAAOI;AACT,GAb2B;AAepB,IAAMI,OAAO,wBAAC,EACnBb,KAAKc,SAASC,aAAad,IAAG,IAChB,CAAC,MAAC;AAChB,SAAOD,MACHD,YAAY;IAAEC;IAAKC;EAAI,CAAA,IACvBe,gBAAgB;IACdF;IAASC;IAAad;EACxB,CAAA;AACN,GARoB;AAUb,IAAMe,kBAAkB,wBAAC,EAAEf,MAAM,MAAK,IAAiB,CAAC,MAAC;AAC9DC,UAAQC,IAAIC,OAAMC,KAAK,GAAGJ,MAAM,QAAQ,MAAA,iBAAuB,CAAA;AAC/D,QAAMK,QAAQC,KAAKC,IAAG;AAItB,QAAMC,SAASC,SAAS,GAAGT,MAAM,QAAQ,MAAA,oBAA0B;IACjE;MAAC;MAAQ;QAAC;;;GACX;AACDC,UAAQC,IAAIC,OAAMC,KAAK,GAAGJ,MAAM,aAAa,WAAA,KAAgBG,OAAMO,UAAUJ,KAAKC,IAAG,IAAKF,SAAS,KAAMM,QAAQ,CAAA,CAAA,CAAA,KAAQR,OAAMC,KAAK,SAAA,CAAA,EAAY,CAAA;AAChJ,SAAOI;AACT,GAX+B;","names":["chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","spawnSync","existsSync","chalk","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","lintPackage","pkg","fix","console","log","chalk","gray","start","Date","now","result","runSteps","magenta","toFixed","lint","verbose","incremental","lintAllPackages"]}
|
|
1
|
+
{"version":3,"sources":["../../src/actions/lint.ts","../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts"],"sourcesContent":["import chalk from 'chalk'\n\nimport { runSteps } from '../lib/index.ts'\n\nexport interface LintParams {\n fix?: boolean\n incremental?: boolean\n pkg?: string\n verbose?: boolean\n}\n\nexport interface LintPackageParams {\n pkg: string\n verbose?: boolean\n}\n\nexport const lintPackage = ({ pkg, fix }: LintParams & Required<Pick<LintParams, 'pkg'>>) => {\n console.log(chalk.gray(`${fix ? 'Fix' : 'Lint'} [${pkg}]`))\n const start = Date.now()\n\n const result = runSteps(`${fix ? 'Fix' : 'Lint'} [${pkg}]`, [\n ['yarn', ['workspace',\n pkg,\n 'run',\n fix ? 'package-fix' : 'package-lint',\n ]],\n ])\n console.log(chalk.gray(`${fix ? 'Fixed in' : 'Linted in'} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`))\n return result\n}\n\nexport const lint = ({\n pkg, verbose, incremental, fix,\n}: LintParams = {}) => {\n return pkg\n ? lintPackage({ pkg, fix })\n : lintAllPackages({\n verbose, incremental, fix,\n })\n}\n\nexport const lintAllPackages = ({ fix = false }: LintParams = {}) => {\n console.log(chalk.gray(`${fix ? 'Fix' : 'Lint'} [All-Packages]`))\n const start = Date.now()\n // const verboseOptions = verbose ? ['--verbose'] : ['--no-verbose']\n // const incrementalOptions = incremental ? ['--since', '-Ap'] : ['--parallel', '-Ap']\n const fixOptions = fix ? ['--fix'] : []\n\n const result = runSteps(`${fix ? 'Fix' : 'Lint'} [All-Packages]`, [\n ['yarn', ['eslint', ...fixOptions]],\n ])\n console.log(chalk.gray(`${fix ? 'Fixed in' : 'Linted in'} [${chalk.magenta(((Date.now() - start) / 1000).toFixed(2))}] ${chalk.gray('seconds')}`))\n return result\n}\n","import chalk from 'chalk'\n\nexport const checkResult = (name: string, result: number, level: 'error' | 'warn' = 'error', exitOnFail = false) => {\n if (result) {\n const exiting = exitOnFail ? '[Exiting Process]' : '[Continuing]'\n const chalkFunc = level === 'error' ? chalk.red : chalk.yellow\n console[level](chalkFunc(`${name} had ${result} failures ${exiting}`))\n if (exitOnFail) {\n process.exit(result)\n }\n }\n}\n","import chalk from 'chalk'\n\nimport { withErrnoException } from './withErrnoException.ts'\nimport { withError } from './withError.ts'\n\nexport const processEx = (ex: unknown) => {\n const error = typeof ex === 'string' ? new Error(ex) : ex\n const exitCode\n = withErrnoException(error, (error) => {\n if (error.code === 'ENOENT') {\n console.error(chalk.red(`'${error.path}' not found.`))\n } else {\n console.error(chalk.red(`Errno: ${error.code}`))\n }\n return error.errno ?? -1\n })\n ?? withError(error, (error) => {\n console.error(chalk.red(`${error.name}: ${error.message}`))\n return -1\n })\n ?? (() => {\n console.error(chalk.red(`Unexpected Error: ${JSON.stringify(ex, null, 2)}`))\n return -1\n })()\n // This allows us to use a previously set exit code\n process.exit(process.exitCode ?? exitCode)\n}\n","export const withError = <T extends Error = Error>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ex: any,\n closure: (error: T) => number,\n predicate = (ex: T) => (!!ex.name && !!ex.message),\n) => {\n return predicate(ex as T) ? closure(ex as T) : undefined\n}\n","import { withError } from './withError.ts'\n\nexport const withErrnoException = <T extends NodeJS.ErrnoException = NodeJS.ErrnoException>(\n ex: unknown, closure: (error: T) => number,\n) => {\n return withError<T>(ex, closure, (ex: unknown) => (ex as NodeJS.ErrnoException).errno !== undefined)\n}\n","/** Catch child process a crash and returns the code */\n\nimport { processEx } from './processEx.ts'\n\nconst safeExit = (func: () => number, exitOnFail = true): number => {\n try {\n const result = func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nconst safeExitAsync = async (func: () => Promise<number>, exitOnFail = true): Promise<number> => {\n try {\n const result = await func()\n if (result && exitOnFail) {\n process.exit(result)\n }\n return result\n } catch (ex) {\n return processEx(ex)\n }\n}\n\nexport { safeExit, safeExitAsync }\n","import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process'\nimport { spawnSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport { checkResult } from './checkResult.ts'\nimport { safeExit } from './safeExit.ts'\n\nexport type ScriptStep =\n | [/* command */ 'yarn' | 'node' | 'ts-node-script' | 'tsc' | 'jest', /* arg */ string | string[]]\n | [/* command */ string, /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding]\n\nexport const runSteps = (name: string, steps: ScriptStep[], exitOnFail = true, messages?: string[]): number => {\n return safeExit(() => {\n const pkgName = process.env.npm_package_name\n console.log(chalk.green(`${name} [${pkgName}]`))\n let totalStatus = 0\n for (const [i, [command, args, config]] of steps.entries()) {\n if (messages?.[i]) {\n console.log(chalk.gray(messages?.[i]))\n }\n const argList = Array.isArray(args) ? args : args.split(' ')\n if (command === 'node' && !existsSync(argList[0])) {\n throw new Error(`File not found [${argList[0]}]`)\n }\n const status\n = spawnSync(command, Array.isArray(args) ? args : args.split(' '), {\n ...config,\n encoding: 'utf8',\n env: { FORCE_COLOR: '3', ...process.env },\n shell: true,\n stdio: 'inherit',\n }).status ?? 0\n checkResult(name, status, 'error', exitOnFail)\n totalStatus += status ?? 0\n }\n return totalStatus\n }, !!exitOnFail)\n}\n"],"mappings":";;;;AAAA,OAAOA,YAAW;;;ACAlB,OAAOC,WAAW;AAEX,IAAMC,cAAc,wBAACC,MAAcC,QAAgBC,QAA0B,SAASC,aAAa,UAAK;AAC7G,MAAIF,QAA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,IAAG,IAAKF,SAAS,KAAMM,QAAQ,CAAA,CAAA,CAAA,KAAQR,OAAMC,KAAK,SAAA,CAAA,EAAY,CAAA;AAChJ,SAAOI;AACT,GAZ+B;","names":["chalk","chalk","checkResult","name","result","level","exitOnFail","exiting","chalkFunc","chalk","red","yellow","console","process","exit","chalk","withError","ex","closure","predicate","name","message","undefined","withErrnoException","ex","closure","withError","errno","undefined","processEx","ex","error","Error","exitCode","withErrnoException","code","console","chalk","red","path","errno","withError","name","message","JSON","stringify","process","exit","safeExit","func","exitOnFail","result","process","exit","ex","processEx","spawnSync","existsSync","chalk","runSteps","name","steps","exitOnFail","messages","safeExit","pkgName","process","env","npm_package_name","console","log","chalk","green","totalStatus","i","command","args","config","entries","gray","argList","Array","isArray","split","existsSync","Error","status","spawnSync","encoding","FORCE_COLOR","shell","stdio","checkResult","lintPackage","pkg","fix","console","log","chalk","gray","start","Date","now","result","runSteps","magenta","toFixed","lint","verbose","incremental","lintAllPackages","fixOptions"]}
|
package/dist/bin/xy.mjs
CHANGED
|
@@ -3,7 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
|
|
5
5
|
// src/xy/xy.ts
|
|
6
|
-
import
|
|
6
|
+
import chalk21 from "chalk";
|
|
7
7
|
|
|
8
8
|
// src/actions/build.ts
|
|
9
9
|
import chalk7 from "chalk";
|
|
@@ -760,15 +760,13 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
760
760
|
}, "copyAssets");
|
|
761
761
|
|
|
762
762
|
// src/actions/cycle.ts
|
|
763
|
-
import
|
|
764
|
-
var cycle = /* @__PURE__ */ __name(({ verbose, pkg
|
|
763
|
+
import { cruise } from "dependency-cruiser";
|
|
764
|
+
var cycle = /* @__PURE__ */ __name(async ({ verbose, pkg } = {}) => {
|
|
765
765
|
return pkg ? cyclePackage({
|
|
766
766
|
pkg,
|
|
767
767
|
verbose
|
|
768
|
-
}) : cycleAll({
|
|
769
|
-
|
|
770
|
-
verbose,
|
|
771
|
-
jobs
|
|
768
|
+
}) : await cycleAll({
|
|
769
|
+
verbose
|
|
772
770
|
});
|
|
773
771
|
}, "cycle");
|
|
774
772
|
var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
@@ -790,45 +788,45 @@ var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
|
790
788
|
]
|
|
791
789
|
]);
|
|
792
790
|
}, "cyclePackage");
|
|
793
|
-
var cycleAll = /* @__PURE__ */ __name(({
|
|
794
|
-
const
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
];
|
|
808
|
-
const jobsOptions = jobs ? [
|
|
809
|
-
"-j",
|
|
810
|
-
`${jobs}`
|
|
811
|
-
] : [];
|
|
812
|
-
if (jobs) {
|
|
813
|
-
console.log(chalk12.blue(`Jobs set to [${jobs}]`));
|
|
814
|
-
}
|
|
815
|
-
const result = runSteps(`Cycle${incremental ? "-Incremental" : ""} [All]`, [
|
|
816
|
-
[
|
|
817
|
-
"yarn",
|
|
818
|
-
[
|
|
819
|
-
"workspaces",
|
|
820
|
-
"foreach",
|
|
821
|
-
...incrementalOptions,
|
|
822
|
-
...jobsOptions,
|
|
823
|
-
...verboseOptions,
|
|
824
|
-
"run",
|
|
825
|
-
"package-cycle",
|
|
826
|
-
...verboseOptions
|
|
791
|
+
var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
792
|
+
const pkgName = process.env.npm_package_name;
|
|
793
|
+
const cruiseOptions = {
|
|
794
|
+
ruleSet: {
|
|
795
|
+
forbidden: [
|
|
796
|
+
{
|
|
797
|
+
name: "no-circular",
|
|
798
|
+
severity: "error",
|
|
799
|
+
comment: "This dependency creates a circular reference",
|
|
800
|
+
from: {},
|
|
801
|
+
to: {
|
|
802
|
+
circular: true
|
|
803
|
+
}
|
|
804
|
+
}
|
|
827
805
|
]
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
806
|
+
},
|
|
807
|
+
exclude: "node_modules|packages/.*/packages",
|
|
808
|
+
validate: true,
|
|
809
|
+
doNotFollow: {
|
|
810
|
+
path: "node_modules|packages/.*/packages"
|
|
811
|
+
},
|
|
812
|
+
tsPreCompilationDeps: false,
|
|
813
|
+
combinedDependencies: true,
|
|
814
|
+
outputType: verbose ? "text" : "err"
|
|
815
|
+
};
|
|
816
|
+
const target = "**/src";
|
|
817
|
+
console.log(`Checking for circular dependencies in ${target}...`);
|
|
818
|
+
const result = await cruise([
|
|
819
|
+
target
|
|
820
|
+
], cruiseOptions);
|
|
821
|
+
if (result.output) {
|
|
822
|
+
console.log(result.output);
|
|
823
|
+
}
|
|
824
|
+
if (result.exitCode === 0) {
|
|
825
|
+
console.log(`${pkgName} \u2705 No dependency violations`);
|
|
826
|
+
} else {
|
|
827
|
+
console.error(`${pkgName} \u274C Dependency violations found`);
|
|
828
|
+
}
|
|
829
|
+
return result.exitCode;
|
|
832
830
|
}, "cycleAll");
|
|
833
831
|
|
|
834
832
|
// src/actions/dead.ts
|
|
@@ -950,18 +948,18 @@ var deployNext = /* @__PURE__ */ __name(() => {
|
|
|
950
948
|
}, "deployNext");
|
|
951
949
|
|
|
952
950
|
// src/actions/dupdeps.ts
|
|
953
|
-
import
|
|
951
|
+
import chalk12 from "chalk";
|
|
954
952
|
var dupdeps = /* @__PURE__ */ __name(() => {
|
|
955
|
-
console.log(
|
|
953
|
+
console.log(chalk12.green("Checking all Dependencies for Duplicates"));
|
|
956
954
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
957
955
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
958
956
|
return detectDuplicateDependencies(dependencies);
|
|
959
957
|
}, "dupdeps");
|
|
960
958
|
|
|
961
959
|
// src/actions/lint.ts
|
|
962
|
-
import
|
|
960
|
+
import chalk13 from "chalk";
|
|
963
961
|
var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
964
|
-
console.log(
|
|
962
|
+
console.log(chalk13.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
965
963
|
const start = Date.now();
|
|
966
964
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
967
965
|
[
|
|
@@ -974,7 +972,7 @@ var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
|
974
972
|
]
|
|
975
973
|
]
|
|
976
974
|
]);
|
|
977
|
-
console.log(
|
|
975
|
+
console.log(chalk13.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`));
|
|
978
976
|
return result;
|
|
979
977
|
}, "lintPackage");
|
|
980
978
|
var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
@@ -988,17 +986,21 @@ var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}
|
|
|
988
986
|
});
|
|
989
987
|
}, "lint");
|
|
990
988
|
var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
991
|
-
console.log(
|
|
989
|
+
console.log(chalk13.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
992
990
|
const start = Date.now();
|
|
991
|
+
const fixOptions = fix2 ? [
|
|
992
|
+
"--fix"
|
|
993
|
+
] : [];
|
|
993
994
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
994
995
|
[
|
|
995
996
|
"yarn",
|
|
996
997
|
[
|
|
997
|
-
"eslint"
|
|
998
|
+
"eslint",
|
|
999
|
+
...fixOptions
|
|
998
1000
|
]
|
|
999
1001
|
]
|
|
1000
1002
|
]);
|
|
1001
|
-
console.log(
|
|
1003
|
+
console.log(chalk13.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`));
|
|
1002
1004
|
return result;
|
|
1003
1005
|
}, "lintAllPackages");
|
|
1004
1006
|
|
|
@@ -1063,7 +1065,7 @@ var filename = ".gitignore";
|
|
|
1063
1065
|
var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
|
|
1064
1066
|
|
|
1065
1067
|
// src/actions/gitlint.ts
|
|
1066
|
-
import
|
|
1068
|
+
import chalk14 from "chalk";
|
|
1067
1069
|
import ParseGitConfig from "parse-git-config";
|
|
1068
1070
|
var gitlint = /* @__PURE__ */ __name(() => {
|
|
1069
1071
|
console.log(`
|
|
@@ -1074,7 +1076,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1074
1076
|
const errors = 0;
|
|
1075
1077
|
const gitConfig = ParseGitConfig.sync();
|
|
1076
1078
|
const warn = /* @__PURE__ */ __name((message) => {
|
|
1077
|
-
console.warn(
|
|
1079
|
+
console.warn(chalk14.yellow(`Warning: ${message}`));
|
|
1078
1080
|
warnings++;
|
|
1079
1081
|
}, "warn");
|
|
1080
1082
|
if (gitConfig.core.ignorecase) {
|
|
@@ -1094,13 +1096,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
1094
1096
|
}
|
|
1095
1097
|
const resultMessages = [];
|
|
1096
1098
|
if (valid > 0) {
|
|
1097
|
-
resultMessages.push(
|
|
1099
|
+
resultMessages.push(chalk14.green(`Passed: ${valid}`));
|
|
1098
1100
|
}
|
|
1099
1101
|
if (warnings > 0) {
|
|
1100
|
-
resultMessages.push(
|
|
1102
|
+
resultMessages.push(chalk14.yellow(`Warnings: ${warnings}`));
|
|
1101
1103
|
}
|
|
1102
1104
|
if (errors > 0) {
|
|
1103
|
-
resultMessages.push(
|
|
1105
|
+
resultMessages.push(chalk14.red(` Errors: ${errors}`));
|
|
1104
1106
|
}
|
|
1105
1107
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1106
1108
|
`);
|
|
@@ -1109,7 +1111,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1109
1111
|
|
|
1110
1112
|
// src/actions/gitlint-fix.ts
|
|
1111
1113
|
import { execSync as execSync2 } from "node:child_process";
|
|
1112
|
-
import
|
|
1114
|
+
import chalk15 from "chalk";
|
|
1113
1115
|
import ParseGitConfig2 from "parse-git-config";
|
|
1114
1116
|
var gitlintFix = /* @__PURE__ */ __name(() => {
|
|
1115
1117
|
console.log(`
|
|
@@ -1120,19 +1122,19 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
1120
1122
|
execSync2("git config core.ignorecase false", {
|
|
1121
1123
|
stdio: "inherit"
|
|
1122
1124
|
});
|
|
1123
|
-
console.warn(
|
|
1125
|
+
console.warn(chalk15.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1124
1126
|
}
|
|
1125
1127
|
if (gitConfig.core.autocrlf !== false) {
|
|
1126
1128
|
execSync2("git config core.autocrlf false", {
|
|
1127
1129
|
stdio: "inherit"
|
|
1128
1130
|
});
|
|
1129
|
-
console.warn(
|
|
1131
|
+
console.warn(chalk15.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1130
1132
|
}
|
|
1131
1133
|
if (gitConfig.core.eol !== "lf") {
|
|
1132
1134
|
execSync2("git config core.eol lf", {
|
|
1133
1135
|
stdio: "inherit"
|
|
1134
1136
|
});
|
|
1135
|
-
console.warn(
|
|
1137
|
+
console.warn(chalk15.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1136
1138
|
}
|
|
1137
1139
|
return 1;
|
|
1138
1140
|
}, "gitlintFix");
|
|
@@ -1152,7 +1154,7 @@ var knip = /* @__PURE__ */ __name(() => {
|
|
|
1152
1154
|
}, "knip");
|
|
1153
1155
|
|
|
1154
1156
|
// src/actions/license.ts
|
|
1155
|
-
import
|
|
1157
|
+
import chalk16 from "chalk";
|
|
1156
1158
|
import { init } from "license-checker";
|
|
1157
1159
|
var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
1158
1160
|
const workspaces = yarnWorkspaces();
|
|
@@ -1177,7 +1179,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1177
1179
|
"LGPL-3.0-or-later",
|
|
1178
1180
|
"Python-2.0"
|
|
1179
1181
|
]);
|
|
1180
|
-
console.log(
|
|
1182
|
+
console.log(chalk16.green("License Checker"));
|
|
1181
1183
|
return (await Promise.all(workspaceList.map(({ location, name }) => {
|
|
1182
1184
|
return new Promise((resolve) => {
|
|
1183
1185
|
init({
|
|
@@ -1185,12 +1187,12 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1185
1187
|
start: location
|
|
1186
1188
|
}, (error, packages) => {
|
|
1187
1189
|
if (error) {
|
|
1188
|
-
console.error(
|
|
1189
|
-
console.error(
|
|
1190
|
+
console.error(chalk16.red(`License Checker [${name}] Error`));
|
|
1191
|
+
console.error(chalk16.gray(error));
|
|
1190
1192
|
console.log("\n");
|
|
1191
1193
|
resolve(1);
|
|
1192
1194
|
} else {
|
|
1193
|
-
console.log(
|
|
1195
|
+
console.log(chalk16.green(`License Checker [${name}]`));
|
|
1194
1196
|
let count = 0;
|
|
1195
1197
|
for (const [name2, info] of Object.entries(packages)) {
|
|
1196
1198
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [
|
|
@@ -1208,7 +1210,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1208
1210
|
}
|
|
1209
1211
|
if (!orLicenseFound) {
|
|
1210
1212
|
count++;
|
|
1211
|
-
console.warn(
|
|
1213
|
+
console.warn(chalk16.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1212
1214
|
}
|
|
1213
1215
|
}
|
|
1214
1216
|
}
|
|
@@ -1283,7 +1285,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
|
1283
1285
|
}, "rebuild");
|
|
1284
1286
|
|
|
1285
1287
|
// src/actions/recompile.ts
|
|
1286
|
-
import
|
|
1288
|
+
import chalk17 from "chalk";
|
|
1287
1289
|
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
1288
1290
|
return pkg ? await recompilePackage({
|
|
1289
1291
|
pkg,
|
|
@@ -1338,7 +1340,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
1338
1340
|
`${jobs}`
|
|
1339
1341
|
] : [];
|
|
1340
1342
|
if (jobs) {
|
|
1341
|
-
console.log(
|
|
1343
|
+
console.log(chalk17.blue(`Jobs set to [${jobs}]`));
|
|
1342
1344
|
}
|
|
1343
1345
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
1344
1346
|
[
|
|
@@ -1368,7 +1370,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
1368
1370
|
]
|
|
1369
1371
|
]
|
|
1370
1372
|
]);
|
|
1371
|
-
console.log(`${
|
|
1373
|
+
console.log(`${chalk17.gray("Recompiled in")} [${chalk17.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk17.gray("seconds")}`);
|
|
1372
1374
|
return result;
|
|
1373
1375
|
}, "recompileAll");
|
|
1374
1376
|
|
|
@@ -1402,9 +1404,9 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
1402
1404
|
}, "reinstall");
|
|
1403
1405
|
|
|
1404
1406
|
// src/actions/relint.ts
|
|
1405
|
-
import
|
|
1407
|
+
import chalk18 from "chalk";
|
|
1406
1408
|
var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
1407
|
-
console.log(
|
|
1409
|
+
console.log(chalk18.gray(`${"Relint"} [All-Packages]`));
|
|
1408
1410
|
const start = Date.now();
|
|
1409
1411
|
const result = runSteps("Relint [All-Packages]", [
|
|
1410
1412
|
[
|
|
@@ -1417,7 +1419,7 @@ var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
|
1417
1419
|
]
|
|
1418
1420
|
]
|
|
1419
1421
|
]);
|
|
1420
|
-
console.log(
|
|
1422
|
+
console.log(chalk18.gray(`${"Relinted in"} [${chalk18.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk18.gray("seconds")}`));
|
|
1421
1423
|
return result;
|
|
1422
1424
|
}, "relintPackage");
|
|
1423
1425
|
var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
@@ -1429,7 +1431,7 @@ var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
|
1429
1431
|
});
|
|
1430
1432
|
}, "relint");
|
|
1431
1433
|
var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
|
|
1432
|
-
console.log(
|
|
1434
|
+
console.log(chalk18.gray(`${"Relint"} [All-Packages]`));
|
|
1433
1435
|
const start = Date.now();
|
|
1434
1436
|
const verboseOptions = verbose ? [
|
|
1435
1437
|
"--verbose"
|
|
@@ -1456,7 +1458,7 @@ var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental }
|
|
|
1456
1458
|
]
|
|
1457
1459
|
]
|
|
1458
1460
|
]);
|
|
1459
|
-
console.log(
|
|
1461
|
+
console.log(chalk18.gray(`Relinted in [${chalk18.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk18.gray("seconds")}`));
|
|
1460
1462
|
return result;
|
|
1461
1463
|
}, "relintAllPackages");
|
|
1462
1464
|
|
|
@@ -1496,7 +1498,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
1496
1498
|
}, "sonar");
|
|
1497
1499
|
|
|
1498
1500
|
// src/actions/statics.ts
|
|
1499
|
-
import
|
|
1501
|
+
import chalk19 from "chalk";
|
|
1500
1502
|
var DefaultDependencies = [
|
|
1501
1503
|
"axios",
|
|
1502
1504
|
"@xylabs/pixel",
|
|
@@ -1507,7 +1509,7 @@ var DefaultDependencies = [
|
|
|
1507
1509
|
"@mui/system"
|
|
1508
1510
|
];
|
|
1509
1511
|
var statics = /* @__PURE__ */ __name(() => {
|
|
1510
|
-
console.log(
|
|
1512
|
+
console.log(chalk19.green("Check Required Static Dependencies"));
|
|
1511
1513
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
1512
1514
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
1513
1515
|
}, "statics");
|
|
@@ -1853,17 +1855,17 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
|
|
|
1853
1855
|
}, "xyInstallCommands");
|
|
1854
1856
|
|
|
1855
1857
|
// src/xy/xyLintCommands.ts
|
|
1856
|
-
import
|
|
1858
|
+
import chalk20 from "chalk";
|
|
1857
1859
|
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
1858
1860
|
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
1859
1861
|
return packagePositionalParam(yargs2);
|
|
1860
|
-
}, (argv) => {
|
|
1862
|
+
}, async (argv) => {
|
|
1861
1863
|
const start = Date.now();
|
|
1862
1864
|
if (argv.verbose) console.log("Cycle");
|
|
1863
|
-
process.exitCode = cycle({
|
|
1865
|
+
process.exitCode = await cycle({
|
|
1864
1866
|
pkg: argv.package
|
|
1865
1867
|
});
|
|
1866
|
-
console.log(
|
|
1868
|
+
console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
|
|
1867
1869
|
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
1868
1870
|
return packagePositionalParam(yargs2);
|
|
1869
1871
|
}, (argv) => {
|
|
@@ -1874,21 +1876,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
1874
1876
|
}) : lint({
|
|
1875
1877
|
pkg: argv.package
|
|
1876
1878
|
});
|
|
1877
|
-
console.log(
|
|
1879
|
+
console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
|
|
1878
1880
|
}).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
|
|
1879
1881
|
return packagePositionalParam(yargs2);
|
|
1880
1882
|
}, (argv) => {
|
|
1881
1883
|
const start = Date.now();
|
|
1882
1884
|
if (argv.verbose) console.log("Fix");
|
|
1883
1885
|
process.exitCode = fix();
|
|
1884
|
-
console.log(
|
|
1886
|
+
console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
|
|
1885
1887
|
}).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
|
|
1886
1888
|
return packagePositionalParam(yargs2);
|
|
1887
1889
|
}, (argv) => {
|
|
1888
1890
|
if (argv.verbose) console.log("Relinting");
|
|
1889
1891
|
const start = Date.now();
|
|
1890
1892
|
process.exitCode = relint();
|
|
1891
|
-
console.log(
|
|
1893
|
+
console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
|
|
1892
1894
|
}).command("publint [package]", "Publint - Run Publint", (yargs2) => {
|
|
1893
1895
|
return packagePositionalParam(yargs2);
|
|
1894
1896
|
}, async (argv) => {
|
|
@@ -1898,21 +1900,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
1898
1900
|
pkg: argv.package,
|
|
1899
1901
|
verbose: !!argv.verbose
|
|
1900
1902
|
});
|
|
1901
|
-
console.log(
|
|
1903
|
+
console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
|
|
1902
1904
|
}).command("knip", "Knip - Run Knip", (yargs2) => {
|
|
1903
1905
|
return packagePositionalParam(yargs2);
|
|
1904
1906
|
}, (argv) => {
|
|
1905
1907
|
if (argv.verbose) console.log("Knip");
|
|
1906
1908
|
const start = Date.now();
|
|
1907
1909
|
process.exitCode = knip();
|
|
1908
|
-
console.log(
|
|
1910
|
+
console.log(chalk20.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
1909
1911
|
}).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
|
|
1910
1912
|
return packagePositionalParam(yargs2);
|
|
1911
1913
|
}, (argv) => {
|
|
1912
1914
|
const start = Date.now();
|
|
1913
1915
|
if (argv.verbose) console.log("Sonar Check");
|
|
1914
1916
|
process.exitCode = sonar();
|
|
1915
|
-
console.log(
|
|
1917
|
+
console.log(chalk20.blue(`Finished in ${Date.now() - start}ms`));
|
|
1916
1918
|
});
|
|
1917
1919
|
}, "xyLintCommands");
|
|
1918
1920
|
|
|
@@ -1974,8 +1976,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
1974
1976
|
var xy = /* @__PURE__ */ __name(async () => {
|
|
1975
1977
|
const options = xyParseOptions();
|
|
1976
1978
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
1977
|
-
console.error(
|
|
1978
|
-
console.log(
|
|
1979
|
+
console.error(chalk21.yellow(`Command not found [${chalk21.magenta(process.argv[2])}]`));
|
|
1980
|
+
console.log(chalk21.gray("Try 'yarn xy --help' for list of commands"));
|
|
1979
1981
|
}).version().help().argv;
|
|
1980
1982
|
}, "xy");
|
|
1981
1983
|
|