@xylabs/ts-scripts-yarn3 7.4.20 → 7.4.22

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.
Files changed (109) hide show
  1. package/dist/actions/claude-clean.mjs +71 -0
  2. package/dist/actions/claude-clean.mjs.map +1 -0
  3. package/dist/actions/claude-commands.mjs +11 -2
  4. package/dist/actions/claude-commands.mjs.map +1 -1
  5. package/dist/actions/claude-rules.mjs +27 -7
  6. package/dist/actions/claude-rules.mjs.map +1 -1
  7. package/dist/actions/claude-skills.mjs.map +1 -1
  8. package/dist/actions/dupdeps.mjs +3 -2
  9. package/dist/actions/dupdeps.mjs.map +1 -1
  10. package/dist/actions/gitignore.mjs +152 -0
  11. package/dist/actions/gitignore.mjs.map +1 -0
  12. package/dist/actions/index.mjs +392 -206
  13. package/dist/actions/index.mjs.map +1 -1
  14. package/dist/bin/xy.mjs +432 -226
  15. package/dist/bin/xy.mjs.map +1 -1
  16. package/dist/index.d.ts +11 -3
  17. package/dist/index.mjs +495 -282
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/lib/claudeMdTemplate.mjs +5 -1
  20. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  21. package/dist/lib/gitignoreTemplate.mjs +12 -0
  22. package/dist/lib/gitignoreTemplate.mjs.map +1 -0
  23. package/dist/lib/index.mjs +17 -3
  24. package/dist/lib/index.mjs.map +1 -1
  25. package/dist/xy/build/buildCommand.mjs +161 -0
  26. package/dist/xy/build/buildCommand.mjs.map +1 -0
  27. package/dist/xy/build/compileCommand.mjs +174 -0
  28. package/dist/xy/build/compileCommand.mjs.map +1 -0
  29. package/dist/xy/build/compileOnlyCommand.mjs +175 -0
  30. package/dist/xy/build/compileOnlyCommand.mjs.map +1 -0
  31. package/dist/xy/build/copyAssetsCommand.mjs +84 -0
  32. package/dist/xy/build/copyAssetsCommand.mjs.map +1 -0
  33. package/dist/xy/{build-commands → build}/index.mjs +45 -40
  34. package/dist/xy/build/index.mjs.map +1 -0
  35. package/dist/xy/build/rebuildCommand.mjs +114 -0
  36. package/dist/xy/build/rebuildCommand.mjs.map +1 -0
  37. package/dist/xy/build/recompileCommand.mjs +204 -0
  38. package/dist/xy/build/recompileCommand.mjs.map +1 -0
  39. package/dist/xy/common/claude/cleanCommand.mjs +79 -0
  40. package/dist/xy/common/claude/cleanCommand.mjs.map +1 -0
  41. package/dist/xy/common/claude/commandsCommand.mjs +11 -2
  42. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -1
  43. package/dist/xy/common/claude/index.mjs +171 -69
  44. package/dist/xy/common/claude/index.mjs.map +1 -1
  45. package/dist/xy/common/claude/initCommand.mjs +38 -115
  46. package/dist/xy/common/claude/initCommand.mjs.map +1 -1
  47. package/dist/xy/common/claude/rulesCommand.mjs +27 -7
  48. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -1
  49. package/dist/xy/common/claude/skillsCommand.mjs.map +1 -1
  50. package/dist/xy/common/gitignoreCommand.mjs +158 -0
  51. package/dist/xy/common/gitignoreCommand.mjs.map +1 -0
  52. package/dist/xy/common/index.mjs +304 -109
  53. package/dist/xy/common/index.mjs.map +1 -1
  54. package/dist/xy/index.mjs +432 -226
  55. package/dist/xy/index.mjs.map +1 -1
  56. package/dist/xy/install/dupdepsCommand.mjs +3 -2
  57. package/dist/xy/install/dupdepsCommand.mjs.map +1 -1
  58. package/dist/xy/install/index.mjs +3 -2
  59. package/dist/xy/install/index.mjs.map +1 -1
  60. package/dist/xy/xy.mjs +432 -226
  61. package/dist/xy/xy.mjs.map +1 -1
  62. package/package.json +2 -2
  63. package/templates/claude/CLAUDE-local.md +4 -0
  64. package/templates/claude/commands/xy-dead.md +5 -0
  65. package/templates/claude/{rules/xylabs-dependencies.md → commands/xy-deps.md} +7 -7
  66. package/templates/claude/commands/xy-dupdeps.md +5 -0
  67. package/templates/claude/commands/xy-gen-docs.md +5 -0
  68. package/templates/claude/commands/xy-gitignore.md +5 -0
  69. package/templates/claude/commands/xy-gitlint.md +5 -0
  70. package/templates/claude/commands/xy-license.md +5 -0
  71. package/templates/claude/commands/xy-lint-rules.md +44 -0
  72. package/templates/claude/commands/xy-recompile.md +5 -0
  73. package/templates/claude/commands/xy-reinstall.md +5 -0
  74. package/templates/claude/commands/xy-relint.md +5 -0
  75. package/templates/claude/commands/xy-retest.md +5 -0
  76. package/templates/claude/commands/xy-sonar.md +5 -0
  77. package/templates/claude/commands/xy-up.md +7 -0
  78. package/templates/claude/rules/xylabs-architecture.md +4 -7
  79. package/templates/claude/rules/xylabs-build.md +6 -11
  80. package/templates/claude/rules/xylabs-git-workflow.md +3 -5
  81. package/templates/claude/rules/xylabs-naming.md +4 -7
  82. package/templates/claude/rules/xylabs-style.md +14 -19
  83. package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +16 -2
  84. package/templates/gitignore/template.gitignore +40 -0
  85. package/dist/actions/gitignore-gen.mjs +0 -88
  86. package/dist/actions/gitignore-gen.mjs.map +0 -1
  87. package/dist/xy/build-commands/build.mjs +0 -502
  88. package/dist/xy/build-commands/build.mjs.map +0 -1
  89. package/dist/xy/build-commands/index.mjs.map +0 -1
  90. package/dist/xy/common/gitignoreGenCommand.mjs +0 -98
  91. package/dist/xy/common/gitignoreGenCommand.mjs.map +0 -1
  92. package/templates/claude/commands/xylabs-deploy-major.md +0 -7
  93. package/templates/claude/commands/xylabs-deploy-minor.md +0 -7
  94. package/templates/claude/commands/xylabs-deploy.md +0 -7
  95. package/templates/claude/rules/xylabs-error-handling.md +0 -7
  96. package/templates/claude/rules/xylabs-frameworks.md +0 -8
  97. package/templates/claude/rules/xylabs-linting.md +0 -55
  98. package/templates/claude/rules/xylabs-typescript.md +0 -11
  99. /package/templates/claude/commands/{xylabs-build.md → xy-build.md} +0 -0
  100. /package/templates/claude/commands/{xylabs-clean.md → xy-clean.md} +0 -0
  101. /package/templates/claude/commands/{xylabs-compile.md → xy-compile.md} +0 -0
  102. /package/templates/claude/commands/{xylabs-cycle.md → xy-cycle.md} +0 -0
  103. /package/templates/claude/commands/{xylabs-deplint.md → xy-deplint.md} +0 -0
  104. /package/templates/claude/commands/{xylabs-fix.md → xy-fix.md} +0 -0
  105. /package/templates/claude/commands/{xylabs-knip.md → xy-knip.md} +0 -0
  106. /package/templates/claude/commands/{xylabs-lint.md → xy-lint.md} +0 -0
  107. /package/templates/claude/commands/{xylabs-publint.md → xy-publint.md} +0 -0
  108. /package/templates/claude/commands/{xylabs-rebuild.md → xy-rebuild.md} +0 -0
  109. /package/templates/claude/commands/{xylabs-test.md → xy-test.md} +0 -0
@@ -1,98 +0,0 @@
1
- // src/lib/file/constants.ts
2
- var WINDOWS_NEWLINE_REGEX = /\r\n/g;
3
- var CROSS_PLATFORM_NEWLINE = "\n";
4
-
5
- // src/lib/file/fileLines.ts
6
- import {
7
- existsSync,
8
- readFileSync,
9
- writeFileSync
10
- } from "fs";
11
-
12
- // src/lib/string/empty.ts
13
- var empty = (value) => value?.trim().length === 0;
14
- var notEmpty = (value) => !empty(value);
15
-
16
- // src/lib/string/union.ts
17
- var union = (a, b) => /* @__PURE__ */ new Set([...new Set(a), ...new Set(b)]);
18
-
19
- // src/lib/file/ReadFileSyncOptions.ts
20
- var defaultReadFileSyncOptions = { encoding: "utf8" };
21
-
22
- // src/lib/file/fileLines.ts
23
- var readLines = (uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
24
- var readNonEmptyLines = (uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty);
25
- var writeLines = (uri, lines, options = defaultReadFileSyncOptions) => {
26
- const existing = existsSync(uri) ? readFileSync(uri, options) : void 0;
27
- const desired = lines.join(CROSS_PLATFORM_NEWLINE);
28
- if (existing !== desired) writeFileSync(uri, desired, options);
29
- };
30
-
31
- // src/lib/generateIgnoreFiles.ts
32
- import chalk from "chalk";
33
-
34
- // src/lib/yarn/workspace/yarnWorkspaces.ts
35
- import { spawnSync } from "child_process";
36
- var yarnWorkspaces = () => {
37
- const result = spawnSync("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
38
- if (result.error) {
39
- throw result.error;
40
- }
41
- return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
42
- return JSON.parse(item);
43
- });
44
- };
45
-
46
- // src/lib/yarn/workspace/yarnWorkspace.ts
47
- var yarnWorkspace = (pkg) => {
48
- const workspace = yarnWorkspaces().find(({ name }) => name === pkg);
49
- if (!workspace) throw new Error(`Workspace ${pkg} not found`);
50
- return workspace;
51
- };
52
-
53
- // src/lib/yarn/yarnInitCwd.ts
54
- var INIT_CWD = () => {
55
- if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
56
- return process.env.INIT_CWD;
57
- };
58
-
59
- // src/lib/generateIgnoreFiles.ts
60
- var localeCompare = (a, b) => a.localeCompare(b);
61
- var mergeEntries = (a, b) => [...union(a, b)].toSorted(localeCompare);
62
- var generateIgnoreFiles = (filename2, pkg) => {
63
- console.log(chalk.green(`Generate ${filename2} Files`));
64
- const cwd = INIT_CWD() ?? ".";
65
- const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
66
- const readEntries = (location) => readNonEmptyLines(`${location}/${filename2}`);
67
- const writeEntries = (location, entries) => writeLines(`${location}/${filename2}`, entries);
68
- const results = workspaces.map(({ location, name }) => {
69
- try {
70
- writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)));
71
- return 0;
72
- } catch (ex) {
73
- const error = ex;
74
- console.error(`Generate ${filename2} Files [${name}] [${error.message}]`);
75
- return 1;
76
- }
77
- });
78
- const succeeded = results.every((result) => result === 0);
79
- return succeeded ? 0 : 1;
80
- };
81
-
82
- // src/actions/gitignore-gen.ts
83
- var filename = ".gitignore";
84
- var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
85
-
86
- // src/xy/common/gitignoreGenCommand.ts
87
- var gitignoreGenCommand = {
88
- command: "gitignore-gen",
89
- describe: "GitIgnore Gen - Generate .gitignore files",
90
- handler: (argv) => {
91
- if (argv.verbose) console.log("GitIgnore Gen");
92
- process.exitCode = gitignoreGen();
93
- }
94
- };
95
- export {
96
- gitignoreGenCommand
97
- };
98
- //# sourceMappingURL=gitignoreGenCommand.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/file/constants.ts","../../../src/lib/file/fileLines.ts","../../../src/lib/string/empty.ts","../../../src/lib/string/union.ts","../../../src/lib/file/ReadFileSyncOptions.ts","../../../src/lib/generateIgnoreFiles.ts","../../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../../src/lib/yarn/workspace/yarnWorkspace.ts","../../../src/lib/yarn/yarnInitCwd.ts","../../../src/actions/gitignore-gen.ts","../../../src/xy/common/gitignoreGenCommand.ts"],"sourcesContent":["export const WINDOWS_NEWLINE_REGEX = /\\r\\n/g\nexport const CROSS_PLATFORM_NEWLINE = '\\n'\n","import type { PathLike, WriteFileOptions } from 'node:fs'\nimport {\n existsSync, readFileSync,\n writeFileSync,\n} from 'node:fs'\n\nimport { notEmpty } from '../string/index.ts'\nimport { CROSS_PLATFORM_NEWLINE, WINDOWS_NEWLINE_REGEX } from './constants.ts'\nimport type { ReadFileSyncOptions } from './ReadFileSyncOptions.ts'\nimport { defaultReadFileSyncOptions } from './ReadFileSyncOptions.ts'\n\nexport const readLines = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string[] =>\n existsSync(uri)\n ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE)\n : []\n\nexport const readNonEmptyLines = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string[] =>\n readLines(uri, options).filter(notEmpty)\n\nexport const writeLines = (uri: PathLike, lines: string[], options: WriteFileOptions = defaultReadFileSyncOptions) => {\n const existing = existsSync(uri) ? readFileSync(uri, options) : undefined\n const desired = lines.join(CROSS_PLATFORM_NEWLINE)\n // Check if the file is different before writing\n if (existing !== desired) writeFileSync(uri, desired, options)\n}\n","export const empty = (value?: string | undefined): boolean => value?.trim().length === 0\nexport const notEmpty = (value?: string | undefined): boolean => !empty(value)\n","export const union = (a: string[], b: string[]): Set<string> => new Set([...new Set(a), ...new Set(b)])\n","export type ReadFileSyncOptions = BufferEncoding | {\n encoding: BufferEncoding\n flags?: string\n}\n\nexport const defaultReadFileSyncOptions: ReadFileSyncOptions = { encoding: 'utf8' }\n","import chalk from 'chalk'\n\nimport { readNonEmptyLines, writeLines } from './file/index.ts'\nimport { union } from './string/index.ts'\nimport {\n INIT_CWD, yarnWorkspace, yarnWorkspaces,\n} from './yarn/index.ts'\n\nconst localeCompare = (a: string, b: string) => a.localeCompare(b)\n\nconst mergeEntries = (a: string[], b: string[]): string[] => [...union(a, b)].toSorted(localeCompare)\n\nexport const generateIgnoreFiles = (filename: string, pkg?: string) => {\n console.log(chalk.green(`Generate ${filename} Files`))\n const cwd = INIT_CWD() ?? '.'\n const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces()\n const readEntries = (location: string): string[] => readNonEmptyLines(`${location}/${filename}`)\n const writeEntries = (location: string, entries: string[]) => writeLines(`${location}/${filename}`, entries)\n const results = workspaces.map(({ location, name }) => {\n try {\n writeEntries(location, mergeEntries(readEntries(cwd), readEntries(location)))\n return 0\n } catch (ex) {\n const error = ex as Error\n console.error(`Generate ${filename} Files [${name}] [${error.message}]`)\n return 1\n }\n })\n const succeeded = results.every(result => result === 0)\n return succeeded ? 0 : 1\n}\n","import { spawnSync } from 'node:child_process'\n\nimport type { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","import type { Workspace } from './Workspace.ts'\nimport { yarnWorkspaces } from './yarnWorkspaces.ts'\n\nexport const yarnWorkspace = (pkg: string): Workspace => {\n const workspace = yarnWorkspaces().find(({ name }) => name === pkg)\n if (!workspace) throw new Error(`Workspace ${pkg} not found`)\n return workspace\n}\n","export const INIT_CWD = () => {\n if (!process.env.INIT_CWD) console.error('Missing INIT_CWD')\n return process.env.INIT_CWD\n}\n","import { generateIgnoreFiles } from '../lib/index.ts'\n\nconst filename = '.gitignore'\n\nexport const gitignoreGen = (pkg?: string) => generateIgnoreFiles(filename, pkg)\n","import type { CommandModule } from 'yargs'\n\nimport { gitignoreGen } from '../../actions/index.ts'\n\nexport const gitignoreGenCommand: CommandModule = {\n command: 'gitignore-gen',\n describe: 'GitIgnore Gen - Generate .gitignore files',\n handler: (argv) => {\n if (argv.verbose) console.log('GitIgnore Gen')\n process.exitCode = gitignoreGen()\n },\n}\n"],"mappings":"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","names":["filename"]}
@@ -1,7 +0,0 @@
1
- Deploy a major version of the current project using `yarn xy deploy-major`. This bumps the major version number and publishes.
2
-
3
- **Important:** Confirm with the user before running this command, as it publishes to npm and indicates breaking changes.
4
-
5
- ```bash
6
- yarn xy deploy-major
7
- ```
@@ -1,7 +0,0 @@
1
- Deploy a minor version of the current project using `yarn xy deploy-minor`. This bumps the minor version number and publishes.
2
-
3
- **Important:** Confirm with the user before running this command, as it publishes to npm.
4
-
5
- ```bash
6
- yarn xy deploy-minor
7
- ```
@@ -1,7 +0,0 @@
1
- Deploy a patch version of the current project using `yarn xy deploy`. This bumps the patch version number and publishes.
2
-
3
- **Important:** Confirm with the user before running this command, as it publishes to npm.
4
-
5
- ```bash
6
- yarn xy deploy
7
- ```
@@ -1,7 +0,0 @@
1
- # XY Labs - Error Handling
2
-
3
- > Auto-managed by `yarn xy claude-rules`. Do not edit manually.
4
-
5
- - Use typed errors extending a base error class
6
- - Never swallow errors silently - at minimum log them
7
- - Use `try/catch` at service boundaries, not around every call
@@ -1,8 +0,0 @@
1
- # XY Labs - Preferred Frameworks
2
-
3
- > Auto-managed by `yarn xy claude-rules`. Do not edit manually.
4
-
5
- - **React** for all frontend applications
6
- - **Express** for backend APIs
7
- - **Vitest** for unit and integration testing
8
- - **Playwright** for E2E testing when needed
@@ -1,55 +0,0 @@
1
- # XY Labs - Linting & ESLint Gotchas
2
-
3
- > Auto-managed by `yarn xy claude-rules`. Do not edit manually.
4
-
5
- ## Post-change linting
6
-
7
- After making significant code changes, run `yarn xy lint` to verify compliance
8
- and fix any violations before considering the task complete.
9
-
10
- ## Non-obvious ESLint rules to follow
11
-
12
- These are the rules most likely to be violated by generated code:
13
-
14
- ### Complexity limits
15
- - **`max-statements: 32`** — functions must have 32 or fewer statements. Break large functions into smaller helpers.
16
- - **`complexity: 18`** — max cyclomatic complexity of 18 per function
17
- - **`max-lines: 512`** — files must not exceed 512 lines (blank lines excluded)
18
- - **`max-depth: 6`** — max nesting depth of 6 levels
19
-
20
- ### Import style
21
- - **`unicorn/import-style`** — use default imports for Node.js built-ins: `import PATH from 'node:path'`, not `import { resolve } from 'node:path'`
22
- - **`no-restricted-imports`** — never import from barrel `index.ts` files (e.g. `'./index.ts'`, `'../index.ts'`). Import from the specific module file instead.
23
-
24
- ### Object formatting
25
- - **`@stylistic/object-curly-newline`** — objects, imports, and destructuring with 3+ properties must use multi-line formatting:
26
- ```typescript
27
- // wrong
28
- const { created, templateNames, updated } = syncRuleFiles(rulesDir)
29
-
30
- // correct
31
- const {
32
- created, templateNames, updated,
33
- } = syncRuleFiles(rulesDir)
34
- ```
35
- - **`@stylistic/object-curly-spacing`** — always use spaces inside braces: `{ foo }` not `{foo}`
36
-
37
- ### Expressions
38
- - **`@typescript-eslint/no-unused-expressions`** — no standalone ternaries as statements. Use `if/else` instead of `condition ? a++ : b++`
39
- - **`@typescript-eslint/no-unused-vars`** — prefix intentionally unused variables with `_` (e.g. `_unused`)
40
-
41
- ### Enums are disallowed
42
- - **`no-restricted-syntax`** — do not use TypeScript `enum`. Use a union of string literals or a `const` object instead:
43
- ```typescript
44
- // wrong
45
- enum Status { Active, Inactive }
46
-
47
- // correct
48
- type Status = 'active' | 'inactive'
49
- ```
50
-
51
- ### Class member ordering
52
- - **`@typescript-eslint/member-ordering`** — class members must be ordered: fields, constructor, accessors, methods. Within each group, order alphabetically.
53
-
54
- ### JSX
55
- - **`@stylistic/jsx-curly-brace-presence`** — no unnecessary braces in JSX props: `prop="value"` not `prop={"value"}`
@@ -1,11 +0,0 @@
1
- # XY Labs - TypeScript Specifics
2
-
3
- > Auto-managed by `yarn xy claude-rules`. Do not edit manually.
4
-
5
- - Enable `strict: true` in all tsconfig files
6
- - Avoid `any` - use `unknown` when the type is truly unknown
7
- - Avoid type assertions (`as`) - prefer type guards and narrowing
8
- - Use `satisfies` for type checking without widening
9
- - Prefer `Record<string, T>` over index signatures
10
- - Use discriminated unions for state machines and variant types
11
- - When a function uses `await`, its return type must be `Promise<T>` — never `Promise<Promisable<T>>`. If converting a `Promisable<T>` return type to async, replace it with `Promise<T>`, do not wrap it