@xylabs/ts-scripts-yarn3 7.4.21 → 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.
- package/dist/actions/claude-clean.mjs +71 -0
- package/dist/actions/claude-clean.mjs.map +1 -0
- package/dist/actions/claude-commands.mjs +11 -2
- package/dist/actions/claude-commands.mjs.map +1 -1
- package/dist/actions/claude-rules.mjs +27 -7
- package/dist/actions/claude-rules.mjs.map +1 -1
- package/dist/actions/claude-skills.mjs.map +1 -1
- package/dist/actions/dupdeps.mjs +3 -2
- package/dist/actions/dupdeps.mjs.map +1 -1
- package/dist/actions/gitignore.mjs +152 -0
- package/dist/actions/gitignore.mjs.map +1 -0
- package/dist/actions/index.mjs +392 -206
- package/dist/actions/index.mjs.map +1 -1
- package/dist/bin/xy.mjs +432 -226
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.mjs +495 -282
- package/dist/index.mjs.map +1 -1
- package/dist/lib/claudeMdTemplate.mjs +5 -1
- package/dist/lib/claudeMdTemplate.mjs.map +1 -1
- package/dist/lib/gitignoreTemplate.mjs +12 -0
- package/dist/lib/gitignoreTemplate.mjs.map +1 -0
- package/dist/lib/index.mjs +17 -3
- package/dist/lib/index.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/{build-commands → build}/index.mjs +45 -40
- 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/cleanCommand.mjs +79 -0
- package/dist/xy/common/claude/cleanCommand.mjs.map +1 -0
- package/dist/xy/common/claude/commandsCommand.mjs +11 -2
- package/dist/xy/common/claude/commandsCommand.mjs.map +1 -1
- package/dist/xy/common/claude/index.mjs +171 -69
- package/dist/xy/common/claude/index.mjs.map +1 -1
- package/dist/xy/common/claude/initCommand.mjs +38 -115
- package/dist/xy/common/claude/initCommand.mjs.map +1 -1
- package/dist/xy/common/claude/rulesCommand.mjs +27 -7
- package/dist/xy/common/claude/rulesCommand.mjs.map +1 -1
- package/dist/xy/common/claude/skillsCommand.mjs.map +1 -1
- package/dist/xy/common/gitignoreCommand.mjs +158 -0
- package/dist/xy/common/gitignoreCommand.mjs.map +1 -0
- package/dist/xy/common/index.mjs +304 -109
- package/dist/xy/common/index.mjs.map +1 -1
- package/dist/xy/index.mjs +432 -226
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/install/dupdepsCommand.mjs +3 -2
- package/dist/xy/install/dupdepsCommand.mjs.map +1 -1
- package/dist/xy/install/index.mjs +3 -2
- package/dist/xy/install/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +432 -226
- package/dist/xy/xy.mjs.map +1 -1
- package/package.json +2 -2
- package/templates/claude/CLAUDE-local.md +4 -0
- package/templates/claude/commands/xy-dead.md +5 -0
- package/templates/claude/{rules/xylabs-dependencies.md → commands/xy-deps.md} +7 -7
- package/templates/claude/commands/xy-dupdeps.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-license.md +5 -0
- package/templates/claude/commands/xy-lint-rules.md +44 -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-up.md +7 -0
- package/templates/claude/rules/xylabs-architecture.md +4 -7
- package/templates/claude/rules/xylabs-build.md +6 -11
- package/templates/claude/rules/xylabs-git-workflow.md +3 -5
- package/templates/claude/rules/xylabs-naming.md +4 -7
- package/templates/claude/rules/xylabs-style.md +14 -19
- package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +17 -4
- package/templates/gitignore/template.gitignore +40 -0
- package/dist/actions/gitignore-gen.mjs +0 -88
- package/dist/actions/gitignore-gen.mjs.map +0 -1
- package/dist/xy/build-commands/build.mjs +0 -502
- package/dist/xy/build-commands/build.mjs.map +0 -1
- package/dist/xy/build-commands/index.mjs.map +0 -1
- package/dist/xy/common/gitignoreGenCommand.mjs +0 -98
- package/dist/xy/common/gitignoreGenCommand.mjs.map +0 -1
- package/templates/claude/commands/xylabs-deploy-major.md +0 -7
- package/templates/claude/commands/xylabs-deploy-minor.md +0 -7
- package/templates/claude/commands/xylabs-deploy.md +0 -7
- package/templates/claude/rules/xylabs-error-handling.md +0 -7
- package/templates/claude/rules/xylabs-frameworks.md +0 -8
- package/templates/claude/rules/xylabs-linting.md +0 -55
- package/templates/claude/rules/xylabs-typescript.md +0 -11
- /package/templates/claude/commands/{xylabs-build.md → xy-build.md} +0 -0
- /package/templates/claude/commands/{xylabs-clean.md → xy-clean.md} +0 -0
- /package/templates/claude/commands/{xylabs-compile.md → xy-compile.md} +0 -0
- /package/templates/claude/commands/{xylabs-cycle.md → xy-cycle.md} +0 -0
- /package/templates/claude/commands/{xylabs-deplint.md → xy-deplint.md} +0 -0
- /package/templates/claude/commands/{xylabs-fix.md → xy-fix.md} +0 -0
- /package/templates/claude/commands/{xylabs-knip.md → xy-knip.md} +0 -0
- /package/templates/claude/commands/{xylabs-lint.md → xy-lint.md} +0 -0
- /package/templates/claude/commands/{xylabs-publint.md → xy-publint.md} +0 -0
- /package/templates/claude/commands/{xylabs-rebuild.md → xy-rebuild.md} +0 -0
- /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":";AAAO,IAAM,wBAAwB;AAC9B,IAAM,yBAAyB;;;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ACT,UAAU;AAAA,EACV,SAAS,CAAC,SAAS;AACjB,QAAI,KAAK,QAAS,SAAQ,IAAI,eAAe;AAC7C,YAAQ,WAAW,aAAa;AAAA,EAClC;AACF;","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,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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|