@xylabs/ts-scripts-yarn3 7.4.17 → 7.4.19
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/README.body.md +86 -0
- package/README.md +108 -0
- package/dist/actions/claude-commands.mjs +1 -1
- package/dist/actions/claude-commands.mjs.map +1 -1
- package/dist/actions/claude-rules.mjs +1 -1
- package/dist/actions/claude-rules.mjs.map +1 -1
- package/dist/actions/compile.mjs.map +1 -1
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/dead.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/checkPackage.mjs +3 -0
- package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/index.mjs +3 -0
- package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
- package/dist/actions/deplint/deplint.mjs +3 -0
- package/dist/actions/deplint/deplint.mjs.map +1 -1
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs +3 -0
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -1
- package/dist/actions/deplint/getImportsFromFile.mjs +3 -0
- package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -1
- package/dist/actions/deplint/index.mjs +3 -0
- package/dist/actions/deplint/index.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/fix.mjs.map +1 -1
- package/dist/actions/gen-docs.mjs.map +1 -1
- package/dist/actions/index.mjs +149 -41
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/knip.mjs.map +1 -1
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/publint.mjs.map +1 -1
- package/dist/actions/publish.mjs.map +1 -1
- package/dist/actions/readme-gen.mjs +136 -20
- package/dist/actions/readme-gen.mjs.map +1 -1
- package/dist/actions/readme-init.mjs +83 -0
- package/dist/actions/readme-init.mjs.map +1 -0
- package/dist/actions/rebuild.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 +2 -2
- package/dist/actions/retest.mjs.map +1 -1
- package/dist/actions/sonar.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/bin/xy.mjs +820 -576
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +42 -13
- package/dist/index.mjs +823 -573
- package/dist/index.mjs.map +1 -1
- package/dist/lib/claudeMdTemplate.mjs +1 -1
- package/dist/lib/claudeMdTemplate.mjs.map +1 -1
- package/dist/lib/generateReadmeFiles.mjs +118 -21
- package/dist/lib/generateReadmeFiles.mjs.map +1 -1
- package/dist/lib/index.mjs +120 -23
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/runSteps.mjs.map +1 -1
- package/dist/lib/runXy.mjs.map +1 -1
- package/dist/xy/build/buildCommand.mjs +161 -0
- package/dist/xy/build/buildCommand.mjs.map +1 -0
- package/dist/xy/build/compileCommand.mjs +174 -0
- package/dist/xy/build/compileCommand.mjs.map +1 -0
- package/dist/xy/build/compileOnlyCommand.mjs +175 -0
- package/dist/xy/build/compileOnlyCommand.mjs.map +1 -0
- package/dist/xy/build/copyAssetsCommand.mjs +84 -0
- package/dist/xy/build/copyAssetsCommand.mjs.map +1 -0
- package/dist/xy/{xyBuildCommands.mjs → build/index.mjs} +111 -93
- package/dist/xy/build/index.mjs.map +1 -0
- package/dist/xy/build/rebuildCommand.mjs +114 -0
- package/dist/xy/build/rebuildCommand.mjs.map +1 -0
- package/dist/xy/build/recompileCommand.mjs +204 -0
- package/dist/xy/build/recompileCommand.mjs.map +1 -0
- package/dist/xy/common/claude/commandsCommand.mjs +107 -0
- package/dist/xy/common/claude/commandsCommand.mjs.map +1 -0
- package/dist/xy/common/claude/index.mjs +332 -0
- package/dist/xy/common/claude/index.mjs.map +1 -0
- package/dist/xy/common/claude/initCommand.mjs +283 -0
- package/dist/xy/common/claude/initCommand.mjs.map +1 -0
- package/dist/xy/common/claude/rulesCommand.mjs +129 -0
- package/dist/xy/common/claude/rulesCommand.mjs.map +1 -0
- package/dist/xy/common/claude/settingsCommand.mjs +90 -0
- package/dist/xy/common/claude/settingsCommand.mjs.map +1 -0
- package/dist/xy/common/cleanDocsCommand.mjs +45 -0
- package/dist/xy/common/cleanDocsCommand.mjs.map +1 -0
- package/dist/xy/common/deadCommand.mjs +116 -0
- package/dist/xy/common/deadCommand.mjs.map +1 -0
- package/dist/xy/common/genDocsCommand.mjs +125 -0
- package/dist/xy/common/genDocsCommand.mjs.map +1 -0
- package/dist/xy/common/gitignoreGenCommand.mjs +98 -0
- package/dist/xy/common/gitignoreGenCommand.mjs.map +1 -0
- package/dist/xy/common/gitlintCommand.mjs +82 -0
- package/dist/xy/common/gitlintCommand.mjs.map +1 -0
- package/dist/xy/{xyCommonCommands.mjs → common/index.mjs} +451 -241
- package/dist/xy/common/index.mjs.map +1 -0
- package/dist/xy/common/licenseCommand.mjs +100 -0
- package/dist/xy/common/licenseCommand.mjs.map +1 -0
- package/dist/xy/common/npmignoreGenCommand.mjs +98 -0
- package/dist/xy/common/npmignoreGenCommand.mjs.map +1 -0
- package/dist/xy/common/readme/genCommand.mjs +321 -0
- package/dist/xy/common/readme/genCommand.mjs.map +1 -0
- package/dist/xy/common/readme/index.mjs +361 -0
- package/dist/xy/common/readme/index.mjs.map +1 -0
- package/dist/xy/common/readme/initCommand.mjs +103 -0
- package/dist/xy/common/readme/initCommand.mjs.map +1 -0
- package/dist/xy/common/retestCommand.mjs +111 -0
- package/dist/xy/common/retestCommand.mjs.map +1 -0
- package/dist/xy/common/testCommand.mjs +108 -0
- package/dist/xy/common/testCommand.mjs.map +1 -0
- package/dist/xy/common/upplugCommand.mjs +113 -0
- package/dist/xy/common/upplugCommand.mjs.map +1 -0
- package/dist/xy/common/upyarnCommand.mjs +108 -0
- package/dist/xy/common/upyarnCommand.mjs.map +1 -0
- package/dist/xy/common/yarn3OnlyCommand.mjs +70 -0
- package/dist/xy/common/yarn3OnlyCommand.mjs.map +1 -0
- package/dist/xy/deploy/deployCommand.mjs +139 -0
- package/dist/xy/deploy/deployCommand.mjs.map +1 -0
- package/dist/xy/deploy/deployMajorCommand.mjs +139 -0
- package/dist/xy/deploy/deployMajorCommand.mjs.map +1 -0
- package/dist/xy/deploy/deployMinorCommand.mjs +139 -0
- package/dist/xy/deploy/deployMinorCommand.mjs.map +1 -0
- package/dist/xy/deploy/deployNextCommand.mjs +139 -0
- package/dist/xy/deploy/deployNextCommand.mjs.map +1 -0
- package/dist/xy/{xyDeployCommands.mjs → deploy/index.mjs} +53 -53
- package/dist/xy/deploy/index.mjs.map +1 -0
- package/dist/xy/deploy/publishCommand.mjs +108 -0
- package/dist/xy/deploy/publishCommand.mjs.map +1 -0
- package/dist/xy/index.mjs +820 -576
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/install/cleanCommand.mjs +140 -0
- package/dist/xy/install/cleanCommand.mjs.map +1 -0
- package/dist/xy/install/dupdepsCommand.mjs +191 -0
- package/dist/xy/install/dupdepsCommand.mjs.map +1 -0
- package/dist/xy/{xyInstallCommands.mjs → install/index.mjs} +71 -68
- package/dist/xy/install/index.mjs.map +1 -0
- package/dist/xy/install/reinstallCommand.mjs +140 -0
- package/dist/xy/install/reinstallCommand.mjs.map +1 -0
- package/dist/xy/install/staticsCommand.mjs +191 -0
- package/dist/xy/install/staticsCommand.mjs.map +1 -0
- package/dist/{actions/clean-jest.mjs → xy/install/upCommand.mjs} +15 -6
- package/dist/xy/install/upCommand.mjs.map +1 -0
- package/dist/xy/install/updoCommand.mjs +112 -0
- package/dist/xy/install/updoCommand.mjs.map +1 -0
- package/dist/xy/lint/cycleCommand.mjs +163 -0
- package/dist/xy/lint/cycleCommand.mjs.map +1 -0
- package/dist/xy/lint/deplintCommand.mjs +814 -0
- package/dist/xy/lint/deplintCommand.mjs.map +1 -0
- package/dist/xy/lint/fixCommand.mjs +168 -0
- package/dist/xy/lint/fixCommand.mjs.map +1 -0
- package/dist/xy/{xyLintCommands.mjs → lint/index.mjs} +179 -145
- package/dist/xy/lint/index.mjs.map +1 -0
- package/dist/xy/lint/knipCommand.mjs +121 -0
- package/dist/xy/lint/knipCommand.mjs.map +1 -0
- package/dist/xy/lint/lintCommand.mjs +186 -0
- package/dist/xy/lint/lintCommand.mjs.map +1 -0
- package/dist/xy/lint/publintCommand.mjs +187 -0
- package/dist/xy/lint/publintCommand.mjs.map +1 -0
- package/dist/xy/lint/relintCommand.mjs +163 -0
- package/dist/xy/lint/relintCommand.mjs.map +1 -0
- package/dist/xy/lint/sonarCommand.mjs +121 -0
- package/dist/xy/lint/sonarCommand.mjs.map +1 -0
- package/dist/xy/xy.mjs +818 -574
- package/dist/xy/xy.mjs.map +1 -1
- package/package.json +2 -2
- package/templates/readme/README.body.md +11 -0
- package/templates/readme/README.template.md +22 -0
- package/dist/actions/clean-jest.mjs.map +0 -1
- package/dist/xy/xyBuildCommands.mjs.map +0 -1
- package/dist/xy/xyCommonCommands.mjs.map +0 -1
- package/dist/xy/xyDeployCommands.mjs.map +0 -1
- package/dist/xy/xyInstallCommands.mjs.map +0 -1
- package/dist/xy/xyLintCommands.mjs.map +0 -1
- /package/templates/{CLAUDE-project.md → claude/CLAUDE-project.md} +0 -0
- /package/templates/{commands → claude/commands}/xylabs-build.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-clean.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-compile.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-cycle.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-deplint.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-deploy-major.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-deploy-minor.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-deploy.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-fix.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-knip.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-lint.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-publint.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-rebuild.md +0 -0
- /package/templates/{commands → claude/commands}/xylabs-test.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-architecture.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-build.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-dependencies.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-error-handling.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-frameworks.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-git-workflow.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-linting.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-naming.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-style.md +0 -0
- /package/templates/{rules → claude/rules}/xylabs-typescript.md +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts","../../src/actions/gen-docs.ts"],"sourcesContent":["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' | '
|
|
1
|
+
{"version":3,"sources":["../../src/lib/checkResult.ts","../../src/lib/processEx.ts","../../src/lib/withError.ts","../../src/lib/withErrnoException.ts","../../src/lib/safeExit.ts","../../src/lib/runSteps.ts","../../src/actions/gen-docs.ts"],"sourcesContent":["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' | 'npm' | 'vitest', /* 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","import type { ScriptStep } from '../lib/index.ts'\nimport { runSteps } from '../lib/index.ts'\n\nexport interface GenDocsParams {\n incremental?: boolean\n pkg?: string\n}\n\nexport interface GenDocsPackageParams { pkg: string }\n\nexport const genDocs = ({ pkg, incremental }: GenDocsParams) => {\n return pkg ? genDocsPackage({ pkg }) : genDocsAll({ incremental })\n}\n\nexport const genDocsPackage = ({ pkg }: GenDocsPackageParams) => {\n const steps: ScriptStep[] = [['yarn', ['workspace', pkg, 'run', 'package-gen-docs']]]\n\n return runSteps(`GenDocs [${pkg}]`, [...steps])\n}\n\nexport const genDocsAll = ({ incremental }: GenDocsParams) => {\n const incrementalOptions = incremental ? ['--since', '-pA'] : ['-pA']\n const steps: ScriptStep[] = [['yarn', ['workspaces', 'foreach', ...incrementalOptions, 'run', 'package-gen-docs']]]\n\n return runSteps(`GenDocs [All${incremental ? '-Incremental' : ''}]`, [...steps])\n}\n"],"mappings":"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","names":["chalk","ex","ex","error","chalk","chalk","chalk"]}
|
package/dist/actions/index.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import { createRequire } from "module";
|
|
|
20
20
|
import PATH from "path";
|
|
21
21
|
var require2 = createRequire(import.meta.url);
|
|
22
22
|
var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
|
|
23
|
-
var templatesDir = PATH.resolve(packageRoot, "templates");
|
|
23
|
+
var templatesDir = PATH.resolve(packageRoot, "templates", "claude");
|
|
24
24
|
var XYLABS_RULES_PREFIX = "xylabs-";
|
|
25
25
|
var XYLABS_COMMANDS_PREFIX = "xylabs-";
|
|
26
26
|
var claudeMdRuleTemplates = () => {
|
|
@@ -323,10 +323,19 @@ var generateIgnoreFiles = (filename3, pkg) => {
|
|
|
323
323
|
|
|
324
324
|
// src/lib/generateReadmeFiles.ts
|
|
325
325
|
import { execSync as execSync2 } from "child_process";
|
|
326
|
-
import FS from "fs";
|
|
327
|
-
import {
|
|
326
|
+
import FS, { readFileSync as readFileSync3 } from "fs";
|
|
327
|
+
import {
|
|
328
|
+
mkdir,
|
|
329
|
+
readFile,
|
|
330
|
+
writeFile
|
|
331
|
+
} from "fs/promises";
|
|
332
|
+
import { createRequire as createRequire2 } from "module";
|
|
328
333
|
import PATH2 from "path";
|
|
334
|
+
import { createInterface } from "readline";
|
|
329
335
|
import chalk5 from "chalk";
|
|
336
|
+
var require3 = createRequire2(import.meta.url);
|
|
337
|
+
var packageRoot2 = PATH2.dirname(require3.resolve("@xylabs/ts-scripts-yarn3/package.json"));
|
|
338
|
+
var readmeTemplatesDir = PATH2.resolve(packageRoot2, "templates", "readme");
|
|
330
339
|
function fillTemplate(template, data) {
|
|
331
340
|
const additionalData = { ...data, safeName: data.name.replaceAll("/", "__").replaceAll("@", "") };
|
|
332
341
|
return template.replaceAll(/\{\{(.*?)\}\}/g, (_, key) => additionalData[key.trim()] ?? "");
|
|
@@ -416,37 +425,120 @@ ${indent}### ${item.name}
|
|
|
416
425
|
}
|
|
417
426
|
return content;
|
|
418
427
|
}
|
|
428
|
+
function askConfirmation(question) {
|
|
429
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
430
|
+
return new Promise((resolve) => {
|
|
431
|
+
rl.question(question, (answer) => {
|
|
432
|
+
rl.close();
|
|
433
|
+
resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
|
|
434
|
+
});
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
var DEFAULT_README_TEMPLATE = readFileSync3(PATH2.resolve(readmeTemplatesDir, "README.template.md"), "utf8");
|
|
438
|
+
var DEFAULT_README_BODY = readFileSync3(PATH2.resolve(readmeTemplatesDir, "README.body.md"), "utf8");
|
|
439
|
+
function applyLogoConfig(template, logoUrl, logoLinkUrl) {
|
|
440
|
+
let result = template;
|
|
441
|
+
if (logoUrl) {
|
|
442
|
+
result = result.replace(/\[logo]: .+/, `[logo]: ${logoUrl}`);
|
|
443
|
+
if (logoLinkUrl) {
|
|
444
|
+
result = result.replace(/\[!\[logo]\[]][^)]*\)/, `[![logo][]](${logoLinkUrl})`);
|
|
445
|
+
}
|
|
446
|
+
} else {
|
|
447
|
+
result = result.replace(/\[!\[logo]\[]][^\n]*\n*/, "");
|
|
448
|
+
result = result.replace(/\[logo]: [^\n]*\n?/, "");
|
|
449
|
+
}
|
|
450
|
+
return result;
|
|
451
|
+
}
|
|
452
|
+
function resolveTemplatePath(templatePath) {
|
|
453
|
+
const cwd5 = INIT_CWD() ?? ".";
|
|
454
|
+
return templatePath ?? PATH2.join(cwd5, ".xy", "README.template.md");
|
|
455
|
+
}
|
|
456
|
+
async function loadOrCreateTemplate(resolvedTemplatePath) {
|
|
457
|
+
try {
|
|
458
|
+
const template = await readFile(resolvedTemplatePath, "utf8");
|
|
459
|
+
return { created: false, template };
|
|
460
|
+
} catch {
|
|
461
|
+
console.log(chalk5.yellow(`Template not found: ${resolvedTemplatePath}`));
|
|
462
|
+
const shouldCreate = await askConfirmation("Would you like to create a stock template? (y/N) ");
|
|
463
|
+
if (!shouldCreate) {
|
|
464
|
+
throw new Error("Template creation declined");
|
|
465
|
+
}
|
|
466
|
+
const template = DEFAULT_README_TEMPLATE;
|
|
467
|
+
await scaffoldTemplate(resolvedTemplatePath, template);
|
|
468
|
+
return { created: true, template };
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
async function scaffoldTemplate(resolvedTemplatePath, template) {
|
|
472
|
+
const xyDir = PATH2.dirname(resolvedTemplatePath);
|
|
473
|
+
await mkdir(xyDir, { recursive: true });
|
|
474
|
+
await writeFile(resolvedTemplatePath, template);
|
|
475
|
+
console.log(chalk5.green(`Created template: ${resolvedTemplatePath}`));
|
|
476
|
+
const bodyPath = PATH2.join(xyDir, "README.body.md");
|
|
477
|
+
await writeFile(bodyPath, DEFAULT_README_BODY);
|
|
478
|
+
console.log(chalk5.green(`Created body template: ${bodyPath}`));
|
|
479
|
+
}
|
|
480
|
+
async function resolveBody(location, defaultBody) {
|
|
481
|
+
const localBodyPath = PATH2.join(location, "README.body.md");
|
|
482
|
+
try {
|
|
483
|
+
return await readFile(localBodyPath, "utf8");
|
|
484
|
+
} catch {
|
|
485
|
+
return defaultBody;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
async function generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose) {
|
|
489
|
+
try {
|
|
490
|
+
const pkgJsonPath = PATH2.join(location, "package.json");
|
|
491
|
+
const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
|
|
492
|
+
const body = await resolveBody(location, defaultBody);
|
|
493
|
+
const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
|
|
494
|
+
const readmeContent = fillTemplate(template, {
|
|
495
|
+
...pkgJson,
|
|
496
|
+
body,
|
|
497
|
+
typedoc: typedocContent
|
|
498
|
+
});
|
|
499
|
+
await writeFile(PATH2.join(location, "README.md"), readmeContent);
|
|
500
|
+
if (verbose) console.log(chalk5.green(` ${name}`));
|
|
501
|
+
return true;
|
|
502
|
+
} catch (ex) {
|
|
503
|
+
const error = ex;
|
|
504
|
+
console.warn(chalk5.yellow(` Skipped ${location}: ${error.message}`));
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
419
508
|
async function generateReadmeFiles({
|
|
509
|
+
logoLinkUrl,
|
|
510
|
+
logoUrl,
|
|
420
511
|
pkg,
|
|
421
512
|
templatePath,
|
|
422
513
|
typedoc = false,
|
|
423
|
-
verbose
|
|
514
|
+
verbose = false
|
|
424
515
|
}) {
|
|
425
516
|
console.log(chalk5.green("Generate README Files"));
|
|
426
|
-
const
|
|
427
|
-
const resolvedTemplatePath = templatePath ?? PATH2.join(cwd5, "scripts", "README.template.md");
|
|
517
|
+
const resolvedTemplatePath = resolveTemplatePath(templatePath);
|
|
428
518
|
let template;
|
|
519
|
+
let templateCreated;
|
|
429
520
|
try {
|
|
430
|
-
template = await
|
|
521
|
+
({ template, created: templateCreated } = await loadOrCreateTemplate(resolvedTemplatePath));
|
|
431
522
|
} catch {
|
|
432
|
-
console.error(chalk5.red(`Template not found: ${resolvedTemplatePath}`));
|
|
433
523
|
return 1;
|
|
434
524
|
}
|
|
435
|
-
|
|
525
|
+
template = applyLogoConfig(template, logoUrl, logoLinkUrl);
|
|
526
|
+
if (templateCreated) {
|
|
527
|
+
console.log(chalk5.green("Generating README files for all packages..."));
|
|
528
|
+
}
|
|
529
|
+
const xyDir = PATH2.dirname(resolvedTemplatePath);
|
|
530
|
+
const xyBodyPath = PATH2.join(xyDir, "README.body.md");
|
|
531
|
+
let defaultBody;
|
|
532
|
+
try {
|
|
533
|
+
defaultBody = await readFile(xyBodyPath, "utf8");
|
|
534
|
+
} catch {
|
|
535
|
+
defaultBody = DEFAULT_README_BODY;
|
|
536
|
+
}
|
|
537
|
+
const workspaces = pkg && !templateCreated ? [yarnWorkspace(pkg)] : yarnWorkspaces();
|
|
436
538
|
let failed = false;
|
|
437
539
|
for (const { location, name } of workspaces) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
|
|
441
|
-
const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
|
|
442
|
-
const readmeContent = fillTemplate(template, { ...pkgJson, typedoc: typedocContent });
|
|
443
|
-
await writeFile(PATH2.join(location, "README.md"), readmeContent);
|
|
444
|
-
if (verbose) console.log(chalk5.green(` ${name}`));
|
|
445
|
-
} catch (ex) {
|
|
446
|
-
const error = ex;
|
|
447
|
-
console.warn(chalk5.yellow(` Skipped ${location}: ${error.message}`));
|
|
448
|
-
failed = true;
|
|
449
|
-
}
|
|
540
|
+
const success = await generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose);
|
|
541
|
+
if (!success) failed = true;
|
|
450
542
|
}
|
|
451
543
|
return failed ? 1 : 0;
|
|
452
544
|
}
|
|
@@ -473,10 +565,10 @@ var loadConfig = async (params) => {
|
|
|
473
565
|
};
|
|
474
566
|
|
|
475
567
|
// src/lib/parsedPackageJSON.ts
|
|
476
|
-
import { readFileSync as
|
|
568
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
477
569
|
var parsedPackageJSON = (path14) => {
|
|
478
570
|
const pathToPackageJSON = path14 ?? process.env.npm_package_json ?? "";
|
|
479
|
-
const packageJSON =
|
|
571
|
+
const packageJSON = readFileSync4(pathToPackageJSON).toString();
|
|
480
572
|
return JSON.parse(packageJSON);
|
|
481
573
|
};
|
|
482
574
|
|
|
@@ -591,7 +683,7 @@ import {
|
|
|
591
683
|
existsSync as existsSync4,
|
|
592
684
|
mkdirSync,
|
|
593
685
|
readdirSync as readdirSync2,
|
|
594
|
-
readFileSync as
|
|
686
|
+
readFileSync as readFileSync5,
|
|
595
687
|
unlinkSync,
|
|
596
688
|
writeFileSync as writeFileSync2
|
|
597
689
|
} from "fs";
|
|
@@ -604,7 +696,7 @@ var syncCommandFiles = (commandsDir) => {
|
|
|
604
696
|
let created = 0;
|
|
605
697
|
for (const [filename3, content] of Object.entries(templates)) {
|
|
606
698
|
const targetPath = PATH3.resolve(commandsDir, filename3);
|
|
607
|
-
const existing = existsSync4(targetPath) ?
|
|
699
|
+
const existing = existsSync4(targetPath) ? readFileSync5(targetPath, "utf8") : void 0;
|
|
608
700
|
if (existing === content) continue;
|
|
609
701
|
writeFileSync2(targetPath, content, "utf8");
|
|
610
702
|
if (existing) {
|
|
@@ -661,7 +753,7 @@ import {
|
|
|
661
753
|
existsSync as existsSync5,
|
|
662
754
|
mkdirSync as mkdirSync2,
|
|
663
755
|
readdirSync as readdirSync3,
|
|
664
|
-
readFileSync as
|
|
756
|
+
readFileSync as readFileSync6,
|
|
665
757
|
unlinkSync as unlinkSync2,
|
|
666
758
|
writeFileSync as writeFileSync3
|
|
667
759
|
} from "fs";
|
|
@@ -674,7 +766,7 @@ var syncRuleFiles = (rulesDir) => {
|
|
|
674
766
|
let created = 0;
|
|
675
767
|
for (const [filename3, content] of Object.entries(templates)) {
|
|
676
768
|
const targetPath = PATH4.resolve(rulesDir, filename3);
|
|
677
|
-
const existing = existsSync5(targetPath) ?
|
|
769
|
+
const existing = existsSync5(targetPath) ? readFileSync6(targetPath, "utf8") : void 0;
|
|
678
770
|
if (existing === content) continue;
|
|
679
771
|
writeFileSync3(targetPath, content, "utf8");
|
|
680
772
|
if (existing) {
|
|
@@ -746,7 +838,7 @@ import {
|
|
|
746
838
|
writeFileSync as writeFileSync4
|
|
747
839
|
} from "fs";
|
|
748
840
|
import PATH5 from "path";
|
|
749
|
-
import { createInterface } from "readline";
|
|
841
|
+
import { createInterface as createInterface2 } from "readline";
|
|
750
842
|
import chalk12 from "chalk";
|
|
751
843
|
var DEFAULT_SETTINGS = {
|
|
752
844
|
permissions: {
|
|
@@ -781,8 +873,8 @@ var DEFAULT_SETTINGS = {
|
|
|
781
873
|
]
|
|
782
874
|
}
|
|
783
875
|
};
|
|
784
|
-
function
|
|
785
|
-
const rl =
|
|
876
|
+
function askConfirmation2(question) {
|
|
877
|
+
const rl = createInterface2({ input: process.stdin, output: process.stdout });
|
|
786
878
|
return new Promise((resolve) => {
|
|
787
879
|
rl.question(question, (answer) => {
|
|
788
880
|
rl.close();
|
|
@@ -796,7 +888,7 @@ async function claudeSettings() {
|
|
|
796
888
|
const settingsPath = PATH5.resolve(claudeDir, "settings.local.json");
|
|
797
889
|
mkdirSync3(claudeDir, { recursive: true });
|
|
798
890
|
if (existsSync6(settingsPath)) {
|
|
799
|
-
const confirmed = await
|
|
891
|
+
const confirmed = await askConfirmation2(
|
|
800
892
|
chalk12.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
|
|
801
893
|
);
|
|
802
894
|
if (!confirmed) {
|
|
@@ -1148,6 +1240,9 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
|
1148
1240
|
ts.forEachChild(node, visit);
|
|
1149
1241
|
}
|
|
1150
1242
|
visit(sourceFile);
|
|
1243
|
+
for (const ref of sourceFile.typeReferenceDirectives) {
|
|
1244
|
+
typeImports.push(ref.fileName);
|
|
1245
|
+
}
|
|
1151
1246
|
const importsStartsWithExcludes = [".", "#", "node:"];
|
|
1152
1247
|
const isValidImport = (imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc)) && !imp.includes("*") && !imp.includes("!");
|
|
1153
1248
|
const cleanedImports = imports.filter(isValidImport).map(getBasePackageName);
|
|
@@ -1719,11 +1814,11 @@ var deplint = async ({
|
|
|
1719
1814
|
};
|
|
1720
1815
|
|
|
1721
1816
|
// src/actions/deploy.ts
|
|
1722
|
-
import { readFileSync as
|
|
1817
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
1723
1818
|
var privatePackageExcludeList = () => {
|
|
1724
1819
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1725
1820
|
workspace,
|
|
1726
|
-
JSON.parse(
|
|
1821
|
+
JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1727
1822
|
]);
|
|
1728
1823
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1729
1824
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1743,11 +1838,11 @@ var deploy = () => {
|
|
|
1743
1838
|
};
|
|
1744
1839
|
|
|
1745
1840
|
// src/actions/deploy-major.ts
|
|
1746
|
-
import { readFileSync as
|
|
1841
|
+
import { readFileSync as readFileSync8 } from "fs";
|
|
1747
1842
|
var privatePackageExcludeList2 = () => {
|
|
1748
1843
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1749
1844
|
workspace,
|
|
1750
|
-
JSON.parse(
|
|
1845
|
+
JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1751
1846
|
]);
|
|
1752
1847
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1753
1848
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1767,11 +1862,11 @@ var deployMajor = () => {
|
|
|
1767
1862
|
};
|
|
1768
1863
|
|
|
1769
1864
|
// src/actions/deploy-minor.ts
|
|
1770
|
-
import { readFileSync as
|
|
1865
|
+
import { readFileSync as readFileSync9 } from "fs";
|
|
1771
1866
|
var privatePackageExcludeList3 = () => {
|
|
1772
1867
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1773
1868
|
workspace,
|
|
1774
|
-
JSON.parse(
|
|
1869
|
+
JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1775
1870
|
]);
|
|
1776
1871
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1777
1872
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1791,11 +1886,11 @@ var deployMinor = () => {
|
|
|
1791
1886
|
};
|
|
1792
1887
|
|
|
1793
1888
|
// src/actions/deploy-next.ts
|
|
1794
|
-
import { readFileSync as
|
|
1889
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
1795
1890
|
var privatePackageExcludeList4 = () => {
|
|
1796
1891
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1797
1892
|
workspace,
|
|
1798
|
-
JSON.parse(
|
|
1893
|
+
JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1799
1894
|
]);
|
|
1800
1895
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1801
1896
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -2839,7 +2934,10 @@ async function readmeGen({
|
|
|
2839
2934
|
typedoc,
|
|
2840
2935
|
verbose
|
|
2841
2936
|
}) {
|
|
2937
|
+
const config2 = await loadConfig();
|
|
2842
2938
|
return await generateReadmeFiles({
|
|
2939
|
+
logoLinkUrl: config2.readme?.logoLinkUrl,
|
|
2940
|
+
logoUrl: config2.readme?.logoUrl,
|
|
2843
2941
|
pkg,
|
|
2844
2942
|
templatePath,
|
|
2845
2943
|
typedoc,
|
|
@@ -2847,6 +2945,15 @@ async function readmeGen({
|
|
|
2847
2945
|
});
|
|
2848
2946
|
}
|
|
2849
2947
|
|
|
2948
|
+
// src/actions/readme-init.ts
|
|
2949
|
+
async function readmeInit({ templatePath }) {
|
|
2950
|
+
const config2 = await loadConfig();
|
|
2951
|
+
const template = applyLogoConfig(DEFAULT_README_TEMPLATE, config2.readme?.logoUrl, config2.readme?.logoLinkUrl);
|
|
2952
|
+
const resolvedTemplatePath = resolveTemplatePath(templatePath);
|
|
2953
|
+
await scaffoldTemplate(resolvedTemplatePath, template);
|
|
2954
|
+
return 0;
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2850
2957
|
// src/actions/rebuild.ts
|
|
2851
2958
|
var rebuild = ({ target }) => {
|
|
2852
2959
|
return runSteps("Rebuild", [
|
|
@@ -3003,8 +3110,8 @@ var relintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
|
3003
3110
|
// src/actions/retest.ts
|
|
3004
3111
|
var retest = () => {
|
|
3005
3112
|
return runSteps("Test", [
|
|
3006
|
-
["yarn", ["
|
|
3007
|
-
["yarn", ["
|
|
3113
|
+
["yarn", ["vitest", "--clearCache"]],
|
|
3114
|
+
["yarn", ["vitest", "."]]
|
|
3008
3115
|
]);
|
|
3009
3116
|
};
|
|
3010
3117
|
|
|
@@ -3119,6 +3226,7 @@ export {
|
|
|
3119
3226
|
publintPackage,
|
|
3120
3227
|
publish,
|
|
3121
3228
|
readmeGen,
|
|
3229
|
+
readmeInit,
|
|
3122
3230
|
rebuild,
|
|
3123
3231
|
recompile,
|
|
3124
3232
|
recompileAll,
|