@xylabs/ts-scripts-common 7.5.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/actions/build.mjs +161 -0
- package/dist/actions/build.mjs.map +1 -0
- package/dist/actions/claude-clean.mjs +71 -0
- package/dist/actions/claude-clean.mjs.map +1 -0
- package/dist/actions/claude-commands.mjs +112 -0
- package/dist/actions/claude-commands.mjs.map +1 -0
- package/dist/actions/claude-rules.mjs +137 -0
- package/dist/actions/claude-rules.mjs.map +1 -0
- package/dist/actions/claude-settings.mjs +85 -0
- package/dist/actions/claude-settings.mjs.map +1 -0
- package/dist/actions/claude-skills.mjs +120 -0
- package/dist/actions/claude-skills.mjs.map +1 -0
- package/dist/actions/clean-docs.mjs +45 -0
- package/dist/actions/clean-docs.mjs.map +1 -0
- package/dist/actions/clean-eslint.mjs +26 -0
- package/dist/actions/clean-eslint.mjs.map +1 -0
- package/dist/actions/clean.mjs +145 -0
- package/dist/actions/clean.mjs.map +1 -0
- package/dist/actions/compile.mjs +172 -0
- package/dist/actions/compile.mjs.map +1 -0
- package/dist/actions/copy-assets.mjs +81 -0
- package/dist/actions/copy-assets.mjs.map +1 -0
- package/dist/actions/cycle.mjs +165 -0
- package/dist/actions/cycle.mjs.map +1 -0
- package/dist/actions/dead.mjs +98 -0
- package/dist/actions/dead.mjs.map +1 -0
- package/dist/actions/deplint/checkPackage/checkPackage.mjs +672 -0
- package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -0
- package/dist/actions/deplint/checkPackage/checkPackageTypes.mjs +1 -0
- package/dist/actions/deplint/checkPackage/checkPackageTypes.mjs.map +1 -0
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs +48 -0
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs.map +1 -0
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs +33 -0
- package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs.map +1 -0
- package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +30 -0
- package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -0
- package/dist/actions/deplint/checkPackage/getUnusedDevDependencies.mjs +309 -0
- package/dist/actions/deplint/checkPackage/getUnusedDevDependencies.mjs.map +1 -0
- package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs +26 -0
- package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs.map +1 -0
- package/dist/actions/deplint/checkPackage/index.mjs +672 -0
- package/dist/actions/deplint/checkPackage/index.mjs.map +1 -0
- package/dist/actions/deplint/deplint.mjs +770 -0
- package/dist/actions/deplint/deplint.mjs.map +1 -0
- package/dist/actions/deplint/findFiles.mjs +39 -0
- package/dist/actions/deplint/findFiles.mjs.map +1 -0
- package/dist/actions/deplint/findFilesByGlob.mjs +14 -0
- package/dist/actions/deplint/findFilesByGlob.mjs.map +1 -0
- package/dist/actions/deplint/getBasePackageName.mjs +13 -0
- package/dist/actions/deplint/getBasePackageName.mjs.map +1 -0
- package/dist/actions/deplint/getCliReferencedPackagesFromFiles.mjs +140 -0
- package/dist/actions/deplint/getCliReferencedPackagesFromFiles.mjs.map +1 -0
- package/dist/actions/deplint/getDependenciesFromPackageJson.mjs +20 -0
- package/dist/actions/deplint/getDependenciesFromPackageJson.mjs.map +1 -0
- package/dist/actions/deplint/getExtendsFromTsconfigs.mjs +44 -0
- package/dist/actions/deplint/getExtendsFromTsconfigs.mjs.map +1 -0
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs +122 -0
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -0
- package/dist/actions/deplint/getImportsFromFile.mjs +85 -0
- package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -0
- package/dist/actions/deplint/getRequiredPeerDependencies.mjs +36 -0
- package/dist/actions/deplint/getRequiredPeerDependencies.mjs.map +1 -0
- package/dist/actions/deplint/getScriptReferencedPackages.mjs +83 -0
- package/dist/actions/deplint/getScriptReferencedPackages.mjs.map +1 -0
- package/dist/actions/deplint/implicitDevDependencies.mjs +80 -0
- package/dist/actions/deplint/implicitDevDependencies.mjs.map +1 -0
- package/dist/actions/deplint/index.mjs +770 -0
- package/dist/actions/deplint/index.mjs.map +1 -0
- package/dist/actions/dupdeps.mjs +205 -0
- package/dist/actions/dupdeps.mjs.map +1 -0
- package/dist/actions/fix.mjs +163 -0
- package/dist/actions/fix.mjs.map +1 -0
- package/dist/actions/gen-docs.mjs +130 -0
- package/dist/actions/gen-docs.mjs.map +1 -0
- package/dist/actions/gitignore.mjs +160 -0
- package/dist/actions/gitignore.mjs.map +1 -0
- package/dist/actions/gitlint-fix.mjs +27 -0
- package/dist/actions/gitlint-fix.mjs.map +1 -0
- package/dist/actions/gitlint.mjs +48 -0
- package/dist/actions/gitlint.mjs.map +1 -0
- package/dist/actions/index.mjs +4129 -0
- package/dist/actions/index.mjs.map +1 -0
- package/dist/actions/knip.mjs +98 -0
- package/dist/actions/knip.mjs.map +1 -0
- package/dist/actions/license.mjs +92 -0
- package/dist/actions/license.mjs.map +1 -0
- package/dist/actions/lint.mjs +160 -0
- package/dist/actions/lint.mjs.map +1 -0
- package/dist/actions/lintlint.mjs +230 -0
- package/dist/actions/lintlint.mjs.map +1 -0
- package/dist/actions/npmignore-gen.mjs +91 -0
- package/dist/actions/npmignore-gen.mjs.map +1 -0
- package/dist/actions/package/clean-outputs.mjs +29 -0
- package/dist/actions/package/clean-outputs.mjs.map +1 -0
- package/dist/actions/package/clean-typescript.mjs +29 -0
- package/dist/actions/package/clean-typescript.mjs.map +1 -0
- package/dist/actions/package/clean.mjs +48 -0
- package/dist/actions/package/clean.mjs.map +1 -0
- package/dist/actions/package/compile/XyConfig.mjs +1 -0
- package/dist/actions/package/compile/XyConfig.mjs.map +1 -0
- package/dist/actions/package/compile/buildEntries.mjs +53 -0
- package/dist/actions/package/compile/buildEntries.mjs.map +1 -0
- package/dist/actions/package/compile/compile.mjs +433 -0
- package/dist/actions/package/compile/compile.mjs.map +1 -0
- package/dist/actions/package/compile/copyTypeFiles.mjs +34 -0
- package/dist/actions/package/compile/copyTypeFiles.mjs.map +1 -0
- package/dist/actions/package/compile/deepMerge.mjs +26 -0
- package/dist/actions/package/compile/deepMerge.mjs.map +1 -0
- package/dist/actions/package/compile/getCompilerOptions.mjs +12 -0
- package/dist/actions/package/compile/getCompilerOptions.mjs.map +1 -0
- package/dist/actions/package/compile/index.mjs +436 -0
- package/dist/actions/package/compile/index.mjs.map +1 -0
- package/dist/actions/package/compile/inputs.mjs +22 -0
- package/dist/actions/package/compile/inputs.mjs.map +1 -0
- package/dist/actions/package/compile/packageCompileTsc.mjs +94 -0
- package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -0
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +92 -0
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -0
- package/dist/actions/package/compile/packageCompileTsup.mjs +402 -0
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -0
- package/dist/actions/package/copy-assets.mjs +46 -0
- package/dist/actions/package/copy-assets.mjs.map +1 -0
- package/dist/actions/package/cycle.mjs +39 -0
- package/dist/actions/package/cycle.mjs.map +1 -0
- package/dist/actions/package/gen-docs.mjs +114 -0
- package/dist/actions/package/gen-docs.mjs.map +1 -0
- package/dist/actions/package/index.mjs +825 -0
- package/dist/actions/package/index.mjs.map +1 -0
- package/dist/actions/package/lint.mjs +80 -0
- package/dist/actions/package/lint.mjs.map +1 -0
- package/dist/actions/package/publint.mjs +66 -0
- package/dist/actions/package/publint.mjs.map +1 -0
- package/dist/actions/package/recompile.mjs +483 -0
- package/dist/actions/package/recompile.mjs.map +1 -0
- package/dist/actions/package-lint.mjs +186 -0
- package/dist/actions/package-lint.mjs.map +1 -0
- package/dist/actions/packman/convert.mjs +387 -0
- package/dist/actions/packman/convert.mjs.map +1 -0
- package/dist/actions/packman/convertToPnpm.mjs +149 -0
- package/dist/actions/packman/convertToPnpm.mjs.map +1 -0
- package/dist/actions/packman/convertToYarn.mjs +171 -0
- package/dist/actions/packman/convertToYarn.mjs.map +1 -0
- package/dist/actions/packman/index.mjs +389 -0
- package/dist/actions/packman/index.mjs.map +1 -0
- package/dist/actions/packman/rewriteScripts.mjs +52 -0
- package/dist/actions/packman/rewriteScripts.mjs.map +1 -0
- package/dist/actions/publint.mjs +187 -0
- package/dist/actions/publint.mjs.map +1 -0
- package/dist/actions/readme-gen.mjs +292 -0
- package/dist/actions/readme-gen.mjs.map +1 -0
- package/dist/actions/readme-init.mjs +83 -0
- package/dist/actions/readme-init.mjs.map +1 -0
- package/dist/actions/rebuild.mjs +122 -0
- package/dist/actions/rebuild.mjs.map +1 -0
- package/dist/actions/recompile.mjs +188 -0
- package/dist/actions/recompile.mjs.map +1 -0
- package/dist/actions/relint.mjs +160 -0
- package/dist/actions/relint.mjs.map +1 -0
- package/dist/actions/retest.mjs +129 -0
- package/dist/actions/retest.mjs.map +1 -0
- package/dist/actions/sonar.mjs +98 -0
- package/dist/actions/sonar.mjs.map +1 -0
- package/dist/actions/statics.mjs +204 -0
- package/dist/actions/statics.mjs.map +1 -0
- package/dist/actions/test.mjs +123 -0
- package/dist/actions/test.mjs.map +1 -0
- package/dist/bin/package/build-only.mjs +445 -0
- package/dist/bin/package/build-only.mjs.map +1 -0
- package/dist/bin/package/build.mjs +445 -0
- package/dist/bin/package/build.mjs.map +1 -0
- package/dist/bin/package/clean-outputs.mjs +29 -0
- package/dist/bin/package/clean-outputs.mjs.map +1 -0
- package/dist/bin/package/clean-typescript.mjs +29 -0
- package/dist/bin/package/clean-typescript.mjs.map +1 -0
- package/dist/bin/package/clean.mjs +53 -0
- package/dist/bin/package/clean.mjs.map +1 -0
- package/dist/bin/package/compile-only.mjs +441 -0
- package/dist/bin/package/compile-only.mjs.map +1 -0
- package/dist/bin/package/compile-tsup.mjs +409 -0
- package/dist/bin/package/compile-tsup.mjs.map +1 -0
- package/dist/bin/package/compile.mjs +445 -0
- package/dist/bin/package/compile.mjs.map +1 -0
- package/dist/bin/package/copy-assets-cjs.mjs +54 -0
- package/dist/bin/package/copy-assets-cjs.mjs.map +1 -0
- package/dist/bin/package/copy-assets-esm.mjs +54 -0
- package/dist/bin/package/copy-assets-esm.mjs.map +1 -0
- package/dist/bin/package/cycle.mjs +51 -0
- package/dist/bin/package/cycle.mjs.map +1 -0
- package/dist/bin/package/fix.mjs +92 -0
- package/dist/bin/package/fix.mjs.map +1 -0
- package/dist/bin/package/gen-docs.mjs +121 -0
- package/dist/bin/package/gen-docs.mjs.map +1 -0
- package/dist/bin/package/lint-verbose.mjs +92 -0
- package/dist/bin/package/lint-verbose.mjs.map +1 -0
- package/dist/bin/package/lint.mjs +92 -0
- package/dist/bin/package/lint.mjs.map +1 -0
- package/dist/bin/package/publint.mjs +75 -0
- package/dist/bin/package/publint.mjs.map +1 -0
- package/dist/bin/package/recompile.mjs +489 -0
- package/dist/bin/package/recompile.mjs.map +1 -0
- package/dist/bin/package/relint.mjs +92 -0
- package/dist/bin/package/relint.mjs.map +1 -0
- package/dist/bin/xy.mjs +3826 -0
- package/dist/bin/xy.mjs.map +1 -0
- package/dist/index.d.ts +564 -0
- package/dist/index.mjs +4979 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/checkResult.mjs +16 -0
- package/dist/lib/checkResult.mjs.map +1 -0
- package/dist/lib/claudeMdTemplate.mjs +65 -0
- package/dist/lib/claudeMdTemplate.mjs.map +1 -0
- package/dist/lib/createBuildConfig.mjs +55 -0
- package/dist/lib/createBuildConfig.mjs.map +1 -0
- package/dist/lib/defaultBuildConfig.mjs +23 -0
- package/dist/lib/defaultBuildConfig.mjs.map +1 -0
- package/dist/lib/deleteGlob.mjs +13 -0
- package/dist/lib/deleteGlob.mjs.map +1 -0
- package/dist/lib/dependencies/DuplicateDetector.mjs +81 -0
- package/dist/lib/dependencies/DuplicateDetector.mjs.map +1 -0
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs +185 -0
- package/dist/lib/dependencies/detectDuplicateDependencies.mjs.map +1 -0
- package/dist/lib/dependencies/index.mjs +186 -0
- package/dist/lib/dependencies/index.mjs.map +1 -0
- package/dist/lib/file/ReadFileSyncOptions.mjs +6 -0
- package/dist/lib/file/ReadFileSyncOptions.mjs.map +1 -0
- package/dist/lib/file/constants.mjs +8 -0
- package/dist/lib/file/constants.mjs.map +1 -0
- package/dist/lib/file/fileLines.mjs +32 -0
- package/dist/lib/file/fileLines.mjs.map +1 -0
- package/dist/lib/file/index.mjs +42 -0
- package/dist/lib/file/index.mjs.map +1 -0
- package/dist/lib/file/tryReadFileSync.mjs +14 -0
- package/dist/lib/file/tryReadFileSync.mjs.map +1 -0
- package/dist/lib/generateIgnoreFiles.mjs +87 -0
- package/dist/lib/generateIgnoreFiles.mjs.map +1 -0
- package/dist/lib/generateReadmeFiles.mjs +260 -0
- package/dist/lib/generateReadmeFiles.mjs.map +1 -0
- package/dist/lib/gitignoreTemplate.mjs +12 -0
- package/dist/lib/gitignoreTemplate.mjs.map +1 -0
- package/dist/lib/index.mjs +834 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/initCwd.mjs +9 -0
- package/dist/lib/initCwd.mjs.map +1 -0
- package/dist/lib/jsonFormatters.mjs +11 -0
- package/dist/lib/jsonFormatters.mjs.map +1 -0
- package/dist/lib/loadConfig.mjs +24 -0
- package/dist/lib/loadConfig.mjs.map +1 -0
- package/dist/lib/parsedPackageJSON.mjs +11 -0
- package/dist/lib/parsedPackageJSON.mjs.map +1 -0
- package/dist/lib/processEx.mjs +36 -0
- package/dist/lib/processEx.mjs.map +1 -0
- package/dist/lib/runSteps.mjs +95 -0
- package/dist/lib/runSteps.mjs.map +1 -0
- package/dist/lib/runStepsAsync.mjs +113 -0
- package/dist/lib/runStepsAsync.mjs.map +1 -0
- package/dist/lib/runXy.mjs +124 -0
- package/dist/lib/runXy.mjs.map +1 -0
- package/dist/lib/runXyWithWarning.mjs +36 -0
- package/dist/lib/runXyWithWarning.mjs.map +1 -0
- package/dist/lib/safeExit.mjs +61 -0
- package/dist/lib/safeExit.mjs.map +1 -0
- package/dist/lib/string/empty.mjs +8 -0
- package/dist/lib/string/empty.mjs.map +1 -0
- package/dist/lib/string/index.mjs +12 -0
- package/dist/lib/string/index.mjs.map +1 -0
- package/dist/lib/string/union.mjs +6 -0
- package/dist/lib/string/union.mjs.map +1 -0
- package/dist/lib/tryRunLocalScript.mjs +56 -0
- package/dist/lib/tryRunLocalScript.mjs.map +1 -0
- package/dist/lib/withErrnoException.mjs +13 -0
- package/dist/lib/withErrnoException.mjs.map +1 -0
- package/dist/lib/withError.mjs +8 -0
- package/dist/lib/withError.mjs.map +1 -0
- package/dist/loadPackageConfig.mjs +11 -0
- package/dist/loadPackageConfig.mjs.map +1 -0
- package/dist/pm/PackageManager.mjs +1 -0
- package/dist/pm/PackageManager.mjs.map +1 -0
- package/dist/pm/detectPackageManager.mjs +10 -0
- package/dist/pm/detectPackageManager.mjs.map +1 -0
- package/dist/pm/index.mjs +28 -0
- package/dist/pm/index.mjs.map +1 -0
- package/dist/pm/registry.mjs +27 -0
- package/dist/pm/registry.mjs.map +1 -0
- package/dist/types.d.mjs +1 -0
- package/dist/types.d.mjs.map +1 -0
- package/dist/xy/build/buildCommand.mjs +182 -0
- package/dist/xy/build/buildCommand.mjs.map +1 -0
- package/dist/xy/build/compileCommand.mjs +189 -0
- package/dist/xy/build/compileCommand.mjs.map +1 -0
- package/dist/xy/build/compileOnlyCommand.mjs +190 -0
- package/dist/xy/build/compileOnlyCommand.mjs.map +1 -0
- package/dist/xy/build/copyAssetsCommand.mjs +92 -0
- package/dist/xy/build/copyAssetsCommand.mjs.map +1 -0
- package/dist/xy/build/index.mjs +493 -0
- package/dist/xy/build/index.mjs.map +1 -0
- package/dist/xy/build/rebuildCommand.mjs +135 -0
- package/dist/xy/build/rebuildCommand.mjs.map +1 -0
- package/dist/xy/build/recompileCommand.mjs +205 -0
- package/dist/xy/build/recompileCommand.mjs.map +1 -0
- package/dist/xy/common/claude/cleanCommand.mjs +79 -0
- package/dist/xy/common/claude/cleanCommand.mjs.map +1 -0
- package/dist/xy/common/claude/commandsCommand.mjs +120 -0
- package/dist/xy/common/claude/commandsCommand.mjs.map +1 -0
- package/dist/xy/common/claude/index.mjs +546 -0
- package/dist/xy/common/claude/index.mjs.map +1 -0
- package/dist/xy/common/claude/initCommand.mjs +319 -0
- package/dist/xy/common/claude/initCommand.mjs.map +1 -0
- package/dist/xy/common/claude/rulesCommand.mjs +153 -0
- package/dist/xy/common/claude/rulesCommand.mjs.map +1 -0
- package/dist/xy/common/claude/settingsCommand.mjs +93 -0
- package/dist/xy/common/claude/settingsCommand.mjs.map +1 -0
- package/dist/xy/common/claude/skillsCommand.mjs +129 -0
- package/dist/xy/common/claude/skillsCommand.mjs.map +1 -0
- package/dist/xy/common/cleanDocsCommand.mjs +53 -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 +146 -0
- package/dist/xy/common/genDocsCommand.mjs.map +1 -0
- package/dist/xy/common/gitignoreCommand.mjs +166 -0
- package/dist/xy/common/gitignoreCommand.mjs.map +1 -0
- package/dist/xy/common/gitlintCommand.mjs +82 -0
- package/dist/xy/common/gitlintCommand.mjs.map +1 -0
- package/dist/xy/common/index.mjs +1874 -0
- package/dist/xy/common/index.mjs.map +1 -0
- package/dist/xy/common/licenseCommand.mjs +108 -0
- package/dist/xy/common/licenseCommand.mjs.map +1 -0
- package/dist/xy/common/npmignoreGenCommand.mjs +101 -0
- package/dist/xy/common/npmignoreGenCommand.mjs.map +1 -0
- package/dist/xy/common/packmanCommand.mjs +415 -0
- package/dist/xy/common/packmanCommand.mjs.map +1 -0
- package/dist/xy/common/readme/genCommand.mjs +324 -0
- package/dist/xy/common/readme/genCommand.mjs.map +1 -0
- package/dist/xy/common/readme/index.mjs +364 -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 +142 -0
- package/dist/xy/common/retestCommand.mjs.map +1 -0
- package/dist/xy/common/testCommand.mjs +136 -0
- package/dist/xy/common/testCommand.mjs.map +1 -0
- package/dist/xy/index.mjs +3823 -0
- package/dist/xy/index.mjs.map +1 -0
- package/dist/xy/lint/cycleCommand.mjs +184 -0
- package/dist/xy/lint/cycleCommand.mjs.map +1 -0
- package/dist/xy/lint/deplintCommand.mjs +820 -0
- package/dist/xy/lint/deplintCommand.mjs.map +1 -0
- package/dist/xy/lint/fixCommand.mjs +184 -0
- package/dist/xy/lint/fixCommand.mjs.map +1 -0
- package/dist/xy/lint/index.mjs +1691 -0
- 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 +202 -0
- package/dist/xy/lint/lintCommand.mjs.map +1 -0
- package/dist/xy/lint/lintlintCommand.mjs +250 -0
- package/dist/xy/lint/lintlintCommand.mjs.map +1 -0
- package/dist/xy/lint/packageLintCommand.mjs +201 -0
- package/dist/xy/lint/packageLintCommand.mjs.map +1 -0
- package/dist/xy/lint/publintCommand.mjs +208 -0
- package/dist/xy/lint/publintCommand.mjs.map +1 -0
- package/dist/xy/lint/relintCommand.mjs +179 -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/param.mjs +8 -0
- package/dist/xy/param.mjs.map +1 -0
- package/dist/xy/xy.mjs +3819 -0
- package/dist/xy/xy.mjs.map +1 -0
- package/dist/xy/xyParseOptions.mjs +91 -0
- package/dist/xy/xyParseOptions.mjs.map +1 -0
- package/package.json +108 -0
- package/templates/claude/CLAUDE-local.md +4 -0
- package/templates/claude/CLAUDE-project.md +4 -0
- package/templates/claude/commands/xy-build.md +5 -0
- package/templates/claude/commands/xy-clean.md +5 -0
- package/templates/claude/commands/xy-compile.md +5 -0
- package/templates/claude/commands/xy-cycle.md +5 -0
- package/templates/claude/commands/xy-dead.md +5 -0
- package/templates/claude/commands/xy-deplint.md +5 -0
- package/templates/claude/commands/xy-deps.md +24 -0
- package/templates/claude/commands/xy-dupdeps.md +5 -0
- package/templates/claude/commands/xy-fix.md +5 -0
- package/templates/claude/commands/xy-gen-docs.md +5 -0
- package/templates/claude/commands/xy-gitignore.md +5 -0
- package/templates/claude/commands/xy-gitlint.md +5 -0
- package/templates/claude/commands/xy-knip.md +5 -0
- package/templates/claude/commands/xy-license.md +5 -0
- package/templates/claude/commands/xy-lint-rules.md +44 -0
- package/templates/claude/commands/xy-lint.md +5 -0
- package/templates/claude/commands/xy-publint.md +5 -0
- package/templates/claude/commands/xy-rebuild.md +5 -0
- package/templates/claude/commands/xy-recompile.md +5 -0
- package/templates/claude/commands/xy-reinstall.md +5 -0
- package/templates/claude/commands/xy-relint.md +5 -0
- package/templates/claude/commands/xy-retest.md +5 -0
- package/templates/claude/commands/xy-sonar.md +5 -0
- package/templates/claude/commands/xy-test.md +5 -0
- package/templates/claude/commands/xy-up.md +7 -0
- package/templates/claude/rules/xylabs-architecture.md +8 -0
- package/templates/claude/rules/xylabs-build.md +9 -0
- package/templates/claude/rules/xylabs-git-workflow.md +7 -0
- package/templates/claude/rules/xylabs-naming.md +7 -0
- package/templates/claude/rules/xylabs-style.md +17 -0
- package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +223 -0
- package/templates/gitignore/template.gitignore +51 -0
- package/templates/readme/README.body.md +11 -0
- package/templates/readme/README.template.md +22 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// src/xy/xyParseOptions.ts
|
|
2
|
+
import yargs from "yargs";
|
|
3
|
+
import { hideBin } from "yargs/helpers";
|
|
4
|
+
|
|
5
|
+
// src/pm/detectPackageManager.ts
|
|
6
|
+
import { existsSync } from "fs";
|
|
7
|
+
function detectPackageManager() {
|
|
8
|
+
if (existsSync("pnpm-lock.yaml") || existsSync("pnpm-workspace.yaml")) return "pnpm";
|
|
9
|
+
return "yarn";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// src/pm/registry.ts
|
|
13
|
+
var implementations = /* @__PURE__ */ new Map();
|
|
14
|
+
function getPackageManager(name) {
|
|
15
|
+
const pmName = name ?? detectPackageManager();
|
|
16
|
+
const pm = implementations.get(pmName);
|
|
17
|
+
if (!pm) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`No package manager implementation registered for "${pmName}". Install @xylabs/ts-scripts-${pmName === "yarn" ? "yarn3" : pmName} and ensure it is imported.`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return pm;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/lib/tryRunLocalScript.ts
|
|
26
|
+
import { spawnSync } from "child_process";
|
|
27
|
+
import { readFileSync } from "fs";
|
|
28
|
+
import PATH from "path";
|
|
29
|
+
import chalk from "chalk";
|
|
30
|
+
function tryRunLocalScript(commandName) {
|
|
31
|
+
if (process.env.XY_LOCAL_SCRIPT === "1") return void 0;
|
|
32
|
+
const rootPkgPath = PATH.resolve(process.cwd(), "package.json");
|
|
33
|
+
let rootPkg;
|
|
34
|
+
try {
|
|
35
|
+
rootPkg = JSON.parse(readFileSync(rootPkgPath, "utf8"));
|
|
36
|
+
} catch {
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
if (!rootPkg.scripts?.[commandName]) return void 0;
|
|
40
|
+
console.log(chalk.blue(`Delegating "${commandName}" to local script`));
|
|
41
|
+
const pm = getPackageManager();
|
|
42
|
+
const result = spawnSync(pm.command, ["run", commandName], {
|
|
43
|
+
cwd: process.cwd(),
|
|
44
|
+
encoding: "utf8",
|
|
45
|
+
env: {
|
|
46
|
+
FORCE_COLOR: "3",
|
|
47
|
+
...process.env,
|
|
48
|
+
XY_LOCAL_SCRIPT: "1"
|
|
49
|
+
},
|
|
50
|
+
shell: true,
|
|
51
|
+
stdio: "inherit"
|
|
52
|
+
});
|
|
53
|
+
return result.status ?? 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/xy/xyParseOptions.ts
|
|
57
|
+
var xyParseOptions = () => {
|
|
58
|
+
return yargs(hideBin(process.argv)).scriptName("yarn xy").middleware((argv) => {
|
|
59
|
+
const commandName = argv._[0];
|
|
60
|
+
if (commandName && argv._.length <= 1) {
|
|
61
|
+
const result = tryRunLocalScript(commandName);
|
|
62
|
+
if (result !== void 0) {
|
|
63
|
+
process.exit(result);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, true).option("jobs", {
|
|
67
|
+
alias: "j",
|
|
68
|
+
default: void 0,
|
|
69
|
+
description: "Max parallel jobs",
|
|
70
|
+
type: "number"
|
|
71
|
+
}).option("verbose", {
|
|
72
|
+
alias: "v",
|
|
73
|
+
default: false,
|
|
74
|
+
description: "Run with verbose logging",
|
|
75
|
+
type: "boolean"
|
|
76
|
+
}).option("incremental", {
|
|
77
|
+
alias: "i",
|
|
78
|
+
default: false,
|
|
79
|
+
description: "Attempt to perform the action only on changed packages",
|
|
80
|
+
type: "boolean"
|
|
81
|
+
}).option("profile", {
|
|
82
|
+
alias: "p",
|
|
83
|
+
default: false,
|
|
84
|
+
description: "Profile action",
|
|
85
|
+
type: "boolean"
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
xyParseOptions
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=xyParseOptions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/xy/xyParseOptions.ts","../../src/pm/detectPackageManager.ts","../../src/pm/registry.ts","../../src/lib/tryRunLocalScript.ts"],"sourcesContent":["import type { Argv } from 'yargs'\nimport yargs from 'yargs'\nimport { hideBin } from 'yargs/helpers'\n\nimport { tryRunLocalScript } from '../lib/index.ts'\n\nexport const xyParseOptions = (): Argv => {\n return yargs(hideBin(process.argv))\n .scriptName('yarn xy')\n .middleware((argv) => {\n const commandName = argv._[0] as string\n if (commandName && argv._.length <= 1) {\n const result = tryRunLocalScript(commandName)\n if (result !== undefined) {\n process.exit(result)\n }\n }\n }, true)\n .option('jobs', {\n alias: 'j',\n default: undefined,\n description: 'Max parallel jobs',\n type: 'number',\n })\n .option('verbose', {\n alias: 'v',\n default: false,\n description: 'Run with verbose logging',\n type: 'boolean',\n })\n .option('incremental', {\n alias: 'i',\n default: false,\n description: 'Attempt to perform the action only on changed packages',\n type: 'boolean',\n })\n .option('profile', {\n alias: 'p',\n default: false,\n description: 'Profile action',\n type: 'boolean',\n })\n}\n","import { existsSync } from 'node:fs'\n\nexport type PackageManagerName = 'pnpm' | 'yarn'\n\nexport function detectPackageManager(): PackageManagerName {\n if (existsSync('pnpm-lock.yaml') || existsSync('pnpm-workspace.yaml')) return 'pnpm'\n return 'yarn'\n}\n","import type { PackageManagerName } from './detectPackageManager.ts'\nimport { detectPackageManager } from './detectPackageManager.ts'\nimport type { PackageManager } from './PackageManager.ts'\n\nconst implementations = new Map<PackageManagerName, PackageManager>()\n\nexport function registerPackageManager(pm: PackageManager): void {\n implementations.set(pm.name, pm)\n}\n\nexport function getPackageManager(name?: PackageManagerName): PackageManager {\n const pmName = name ?? detectPackageManager()\n const pm = implementations.get(pmName)\n if (!pm) {\n throw new Error(\n `No package manager implementation registered for \"${pmName}\". `\n + `Install @xylabs/ts-scripts-${pmName === 'yarn' ? 'yarn3' : pmName} and ensure it is imported.`,\n )\n }\n return pm\n}\n","import { spawnSync } from 'node:child_process'\nimport { readFileSync } from 'node:fs'\nimport PATH from 'node:path'\n\nimport chalk from 'chalk'\n\nimport { getPackageManager } from '../pm/index.ts'\n\n/**\n * Attempts to run a local root package.json script instead of the built-in\n * xy command. Returns the exit code if the override ran, or undefined if\n * no override applies (no matching script or recursion guard).\n */\nexport function tryRunLocalScript(commandName: string): number | undefined {\n // Prevent infinite recursion if the local script calls yarn xy\n if (process.env.XY_LOCAL_SCRIPT === '1') return undefined\n\n // Check if root package.json has a matching script\n const rootPkgPath = PATH.resolve(process.cwd(), 'package.json')\n let rootPkg: { scripts?: Record<string, string> }\n try {\n rootPkg = JSON.parse(readFileSync(rootPkgPath, 'utf8'))\n } catch {\n return undefined\n }\n\n if (!rootPkg.scripts?.[commandName]) return undefined\n\n console.log(chalk.blue(`Delegating \"${commandName}\" to local script`))\n const pm = getPackageManager()\n const result = spawnSync(pm.command, ['run', commandName], {\n cwd: process.cwd(),\n encoding: 'utf8',\n env: {\n FORCE_COLOR: '3', ...process.env, XY_LOCAL_SCRIPT: '1',\n },\n shell: true,\n stdio: 'inherit',\n })\n return result.status ?? 1\n}\n"],"mappings":";AACA,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACFxB,SAAS,kBAAkB;AAIpB,SAAS,uBAA2C;AACzD,MAAI,WAAW,gBAAgB,KAAK,WAAW,qBAAqB,EAAG,QAAO;AAC9E,SAAO;AACT;;;ACHA,IAAM,kBAAkB,oBAAI,IAAwC;AAM7D,SAAS,kBAAkB,MAA2C;AAC3E,QAAM,SAAS,QAAQ,qBAAqB;AAC5C,QAAM,KAAK,gBAAgB,IAAI,MAAM;AACrC,MAAI,CAAC,IAAI;AACP,UAAM,IAAI;AAAA,MACR,qDAAqD,MAAM,iCAC3B,WAAW,SAAS,UAAU,MAAM;AAAA,IACtE;AAAA,EACF;AACA,SAAO;AACT;;;ACpBA,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,OAAO,UAAU;AAEjB,OAAO,WAAW;AASX,SAAS,kBAAkB,aAAyC;AAEzE,MAAI,QAAQ,IAAI,oBAAoB,IAAK,QAAO;AAGhD,QAAM,cAAc,KAAK,QAAQ,QAAQ,IAAI,GAAG,cAAc;AAC9D,MAAI;AACJ,MAAI;AACF,cAAU,KAAK,MAAM,aAAa,aAAa,MAAM,CAAC;AAAA,EACxD,QAAQ;AACN,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ,UAAU,WAAW,EAAG,QAAO;AAE5C,UAAQ,IAAI,MAAM,KAAK,eAAe,WAAW,mBAAmB,CAAC;AACrE,QAAM,KAAK,kBAAkB;AAC7B,QAAM,SAAS,UAAU,GAAG,SAAS,CAAC,OAAO,WAAW,GAAG;AAAA,IACzD,KAAK,QAAQ,IAAI;AAAA,IACjB,UAAU;AAAA,IACV,KAAK;AAAA,MACH,aAAa;AAAA,MAAK,GAAG,QAAQ;AAAA,MAAK,iBAAiB;AAAA,IACrD;AAAA,IACA,OAAO;AAAA,IACP,OAAO;AAAA,EACT,CAAC;AACD,SAAO,OAAO,UAAU;AAC1B;;;AHlCO,IAAM,iBAAiB,MAAY;AACxC,SAAO,MAAM,QAAQ,QAAQ,IAAI,CAAC,EAC/B,WAAW,SAAS,EACpB,WAAW,CAAC,SAAS;AACpB,UAAM,cAAc,KAAK,EAAE,CAAC;AAC5B,QAAI,eAAe,KAAK,EAAE,UAAU,GAAG;AACrC,YAAM,SAAS,kBAAkB,WAAW;AAC5C,UAAI,WAAW,QAAW;AACxB,gBAAQ,KAAK,MAAM;AAAA,MACrB;AAAA,IACF;AAAA,EACF,GAAG,IAAI,EACN,OAAO,QAAQ;AAAA,IACd,OAAO;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,CAAC,EACA,OAAO,WAAW;AAAA,IACjB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,CAAC,EACA,OAAO,eAAe;AAAA,IACrB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,CAAC,EACA,OAAO,WAAW;AAAA,IACjB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,CAAC;AACL;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xylabs/ts-scripts-common",
|
|
3
|
+
"version": "7.5.0",
|
|
4
|
+
"description": "Shared PM-agnostic TypeScript project scripts for XY Labs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"xylabs",
|
|
7
|
+
"utility",
|
|
8
|
+
"typescript"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://xylabs.com",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "git+https://github.com/xylabs/config/issues",
|
|
13
|
+
"email": "support@xylabs.com"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/xylabs/config.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "LGPL-3.0-only",
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "XY Labs Development Team",
|
|
22
|
+
"email": "support@xylabs.com",
|
|
23
|
+
"url": "https://xylabs.com"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.mjs"
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"module": "dist/index.mjs",
|
|
35
|
+
"types": "dist/index.d.ts",
|
|
36
|
+
"bin": {
|
|
37
|
+
"package-build": "dist/bin/package/build.mjs",
|
|
38
|
+
"package-build-only": "dist/bin/package/build-only.mjs",
|
|
39
|
+
"package-clean": "dist/bin/package/clean.mjs",
|
|
40
|
+
"package-compile": "dist/bin/package/compile.mjs",
|
|
41
|
+
"package-compile-only": "dist/bin/package/compile-only.mjs",
|
|
42
|
+
"package-copy-assets-cjs": "dist/bin/package/copy-assets-cjs.mjs",
|
|
43
|
+
"package-copy-assets-esm": "dist/bin/package/copy-assets-esm.mjs",
|
|
44
|
+
"package-cycle": "dist/bin/package/cycle.mjs",
|
|
45
|
+
"package-fix": "dist/bin/package/fix.mjs",
|
|
46
|
+
"package-gen-docs": "dist/bin/package/gen-docs.mjs",
|
|
47
|
+
"package-lint": "dist/bin/package/lint.mjs",
|
|
48
|
+
"package-lint-verbose": "dist/bin/package/lint-verbose.mjs",
|
|
49
|
+
"package-publint": "dist/bin/package/publint.mjs",
|
|
50
|
+
"package-recompile": "dist/bin/package/recompile.mjs",
|
|
51
|
+
"package-relint": "dist/bin/package/relint.mjs"
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"dist",
|
|
55
|
+
"templates"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"package-clean": "echo Not cleaning...",
|
|
59
|
+
"package-compile": "tsup && publint",
|
|
60
|
+
"package-recompile": "tsup && publint"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"async-mutex": "~0.5.0",
|
|
64
|
+
"chalk": "~5.6.2",
|
|
65
|
+
"cosmiconfig": "~9.0.1",
|
|
66
|
+
"cosmiconfig-typescript-loader": "~6.2.0",
|
|
67
|
+
"cpy": "~13.2.1",
|
|
68
|
+
"deepmerge": "~4.3.1",
|
|
69
|
+
"dependency-cruiser": "~17.3.9",
|
|
70
|
+
"eslint": "^10.1.0",
|
|
71
|
+
"find-up": "~8.0.0",
|
|
72
|
+
"get-tsconfig": "~4.13.7",
|
|
73
|
+
"glob": "~13.0.6",
|
|
74
|
+
"license-checker": "~25.0.1",
|
|
75
|
+
"parse-git-config": "~3.0.0",
|
|
76
|
+
"picomatch": "~4.0.3",
|
|
77
|
+
"publint": "~0.3.18",
|
|
78
|
+
"rollup": "~4.60.0",
|
|
79
|
+
"rollup-plugin-dts": "~6.4.1",
|
|
80
|
+
"rollup-plugin-node-externals": "~8.1.2",
|
|
81
|
+
"sort-package-json": "~3.6.1",
|
|
82
|
+
"tsc-prog": "~2.3.0",
|
|
83
|
+
"tsup": "~8.5.1",
|
|
84
|
+
"typedoc": "~0.28.18",
|
|
85
|
+
"types-package-json": "~2.0.39",
|
|
86
|
+
"yargs": "~18.0.0"
|
|
87
|
+
},
|
|
88
|
+
"devDependencies": {
|
|
89
|
+
"@types/eslint": "~9.6.1",
|
|
90
|
+
"@types/license-checker": "~25.0.6",
|
|
91
|
+
"@types/node": "~25.5.0",
|
|
92
|
+
"@types/parse-git-config": "~3.0.4",
|
|
93
|
+
"@types/picomatch": "~4.0.2",
|
|
94
|
+
"@types/yargs": "~17.0.35",
|
|
95
|
+
"@xylabs/tsconfig": "~7.5.0",
|
|
96
|
+
"esbuild": "0.27.4",
|
|
97
|
+
"typescript": "^5.9.3"
|
|
98
|
+
},
|
|
99
|
+
"peerDependencies": {
|
|
100
|
+
"typescript": "~5"
|
|
101
|
+
},
|
|
102
|
+
"engines": {
|
|
103
|
+
"node": ">=18.17.1"
|
|
104
|
+
},
|
|
105
|
+
"publishConfig": {
|
|
106
|
+
"access": "public"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Check dependency declarations in the current project using `yarn xy deplint`. This verifies that all imports have corresponding entries in package.json dependencies. Review the output for missing or extraneous dependencies and fix them.
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
yarn xy deplint
|
|
5
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Reference for preferred dependencies in XY Labs projects. Consult this when adding a new dependency.
|
|
2
|
+
|
|
3
|
+
| Purpose | Package |
|
|
4
|
+
|---|---|
|
|
5
|
+
| HTTP client | `axios` |
|
|
6
|
+
| Schema validation | `zod` |
|
|
7
|
+
| Logging | `@xylabs/logger` |
|
|
8
|
+
| Assert/invariants | `@xylabs/assert` |
|
|
9
|
+
| Async utilities | `@xylabs/promise` |
|
|
10
|
+
| Lodash replacements | `@xylabs/lodash` |
|
|
11
|
+
| React state | React hooks + context (avoid Redux) |
|
|
12
|
+
| React UI components | `@mui/material` (Material UI) |
|
|
13
|
+
| Styling | MUI `sx` prop and `styled()` — no CSS-in-JS libraries or raw CSS |
|
|
14
|
+
| Testing | `vitest` |
|
|
15
|
+
| Bundling | `tsup` (libraries), `webpack` (apps) |
|
|
16
|
+
| Linting | `eslint` with `@xylabs/eslint-config-flat` |
|
|
17
|
+
| Shared XY Labs utilities | `@xylabs/sdk-js` |
|
|
18
|
+
| XYO application code | `@xyo-network/sdk-js` |
|
|
19
|
+
| XYO Layer 1 Protocol | `@xyo-network/xl1-sdk` |
|
|
20
|
+
| XYO Layer 1 Chain | `@xyo-network/chain-sdk` |
|
|
21
|
+
|
|
22
|
+
**Notes:**
|
|
23
|
+
- `zod` must be a `peerDependency`, never a direct `dependency`
|
|
24
|
+
- `sideEffects: false` required on every published package
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Reference for non-obvious ESLint rules enforced by `@xylabs/eslint-config-flat`. Consult this before writing code to avoid common violations.
|
|
2
|
+
|
|
3
|
+
## Complexity limits
|
|
4
|
+
- `max-statements: 32` — break large functions into smaller helpers
|
|
5
|
+
- `complexity: 18` — max cyclomatic complexity per function
|
|
6
|
+
- `max-lines: 512` — per file (blank lines excluded)
|
|
7
|
+
- `max-depth: 6` — max nesting depth
|
|
8
|
+
|
|
9
|
+
## Import style
|
|
10
|
+
- `unicorn/import-style` — default imports for Node built-ins: `import PATH from 'node:path'`
|
|
11
|
+
- `no-restricted-imports` — never import from barrel `index.ts` files
|
|
12
|
+
|
|
13
|
+
## Object formatting
|
|
14
|
+
- Objects/imports/destructuring with 3+ properties must use multi-line:
|
|
15
|
+
```typescript
|
|
16
|
+
// wrong
|
|
17
|
+
const { created, templateNames, updated } = syncRuleFiles(rulesDir)
|
|
18
|
+
|
|
19
|
+
// correct
|
|
20
|
+
const {
|
|
21
|
+
created, templateNames, updated,
|
|
22
|
+
} = syncRuleFiles(rulesDir)
|
|
23
|
+
```
|
|
24
|
+
- Always use spaces inside braces: `{ foo }` not `{foo}`
|
|
25
|
+
|
|
26
|
+
## Expressions
|
|
27
|
+
- No standalone ternaries as statements — use `if/else`
|
|
28
|
+
- Prefix unused variables with `_`
|
|
29
|
+
|
|
30
|
+
## Enums are disallowed
|
|
31
|
+
- Use string literal unions or `const` objects:
|
|
32
|
+
```typescript
|
|
33
|
+
// wrong
|
|
34
|
+
enum Status { Active, Inactive }
|
|
35
|
+
|
|
36
|
+
// correct
|
|
37
|
+
type Status = 'active' | 'inactive'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Class member ordering
|
|
41
|
+
- Order: fields, constructor, accessors, methods (alphabetical within groups)
|
|
42
|
+
|
|
43
|
+
## JSX
|
|
44
|
+
- No unnecessary braces in props: `prop="value"` not `prop={"value"}`
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# XY Labs - Architecture
|
|
2
|
+
|
|
3
|
+
> Auto-managed by `yarn xy claude-rules`. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
- Yarn workspaces monorepo; all packages share a single version
|
|
6
|
+
- Each package compiles to ESM via `tsup` (output to `dist/`)
|
|
7
|
+
- Prefer composition over inheritance; depend on abstractions
|
|
8
|
+
- Vitest for testing; React + MUI for frontend; Express for backend
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# XY Labs - Build
|
|
2
|
+
|
|
3
|
+
> Auto-managed by `yarn xy claude-rules`. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
- Run all `yarn xy` commands from the repo root, never from inside a package directory
|
|
6
|
+
- Single-package: `yarn xy lint <package-name>` (use the name from package.json, not the path)
|
|
7
|
+
- Run `yarn xy lint` after significant changes to verify compliance
|
|
8
|
+
- Run `yarn xy build` before pushing
|
|
9
|
+
- Never edit package version fields manually — use `yarn xy deploy`
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# XY Labs - Naming
|
|
2
|
+
|
|
3
|
+
> Auto-managed by `yarn xy claude-rules`. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
- Files: camelCase for modules, PascalCase for components/classes
|
|
6
|
+
- Variables/functions: camelCase; Classes/interfaces/types: PascalCase
|
|
7
|
+
- Constants: UPPER_SNAKE_CASE; Booleans: `is`/`has`/`should`/`can` prefix
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# XY Labs - Code Style
|
|
2
|
+
|
|
3
|
+
> Auto-managed by `yarn xy claude-rules`. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
- ESM only — no CommonJS (`require`/`module.exports`)
|
|
6
|
+
- No semicolons, single quotes, trailing commas, 2-space indent
|
|
7
|
+
- `const` over `let`; never `var`
|
|
8
|
+
- `function` declarations for top-level; arrows only for callbacks/closures
|
|
9
|
+
- Explicit return types on exported functions
|
|
10
|
+
- `interface` over `type` for object shapes; named exports over default exports
|
|
11
|
+
- Default imports for Node built-ins: `import PATH from 'node:path'` (not named imports)
|
|
12
|
+
- No `enum` — use string literal unions or `const` objects
|
|
13
|
+
- No `any` — use `unknown`; avoid `as`, prefer type guards
|
|
14
|
+
- No `import * as X`; no importing from barrel `index.ts` files
|
|
15
|
+
- Prefix unused variables with `_`
|
|
16
|
+
- Objects/imports/destructuring with 3+ properties must use multi-line formatting
|
|
17
|
+
- When a function uses `await`, return `Promise<T>` — never `Promise<Promisable<T>>`
|