@xylabs/ts-scripts-yarn3 7.4.4 → 7.4.6
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-rules.mjs +113 -0
- package/dist/actions/claude-rules.mjs.map +1 -0
- package/dist/actions/index.mjs +232 -129
- package/dist/actions/index.mjs.map +1 -1
- package/dist/bin/xy.mjs +201 -84
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.mjs +266 -145
- package/dist/index.mjs.map +1 -1
- package/dist/lib/claudeMdTemplate.mjs +24 -0
- package/dist/lib/claudeMdTemplate.mjs.map +1 -0
- package/dist/lib/index.mjs +31 -9
- package/dist/lib/index.mjs.map +1 -1
- package/dist/xy/index.mjs +201 -84
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +201 -84
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyCommonCommands.mjs +137 -20
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/package.json +4 -3
- package/templates/CLAUDE-project.md +4 -0
- package/templates/rules/xylabs-architecture.md +11 -0
- package/templates/rules/xylabs-build.md +14 -0
- package/templates/rules/xylabs-dependencies.md +24 -0
- package/templates/rules/xylabs-error-handling.md +7 -0
- package/templates/rules/xylabs-frameworks.md +8 -0
- package/templates/rules/xylabs-git-workflow.md +9 -0
- package/templates/rules/xylabs-linting.md +55 -0
- package/templates/rules/xylabs-naming.md +10 -0
- package/templates/rules/xylabs-style.md +22 -0
- package/templates/rules/xylabs-typescript.md +11 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# XY Labs - Naming Conventions
|
|
2
|
+
|
|
3
|
+
> Auto-managed by `yarn xy claude-rules`. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
- Files: camelCase for modules (`myModule.ts`), PascalCase for components/classes (`MyComponent.tsx`)
|
|
6
|
+
- Variables/functions: camelCase
|
|
7
|
+
- Classes/interfaces/types: PascalCase
|
|
8
|
+
- Constants: UPPER_SNAKE_CASE (e.g. `MAX_RETRIES`, `DEFAULT_TIMEOUT`)
|
|
9
|
+
- Boolean variables: prefix with `is`, `has`, `should`, `can` (e.g. `isReady`, `hasError`)
|
|
10
|
+
- Event handlers: prefix with `on` (e.g. `onClick`, `onSubmit`)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# XY Labs - Style & Formatting
|
|
2
|
+
|
|
3
|
+
> Auto-managed by `yarn xy claude-rules`. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
- Use TypeScript strict mode for all source files
|
|
6
|
+
- Use ESM (`import`/`export`) exclusively - never use CommonJS (`require`/`module.exports`)
|
|
7
|
+
- Prefer `const` over `let`; never use `var`
|
|
8
|
+
- Use standard `function` declarations for all top-level functions, even short ones (e.g. `export function foo() { ... }`)
|
|
9
|
+
- Use arrow functions only for callbacks, inline arguments, and closures
|
|
10
|
+
- Use explicit return types on exported functions
|
|
11
|
+
- Use `interface` over `type` for object shapes when possible
|
|
12
|
+
- Prefer named exports over default exports
|
|
13
|
+
- Use template literals over string concatenation
|
|
14
|
+
- Use optional chaining (`?.`) and nullish coalescing (`??`) over manual checks
|
|
15
|
+
- Keep files focused and small - prefer many small files over few large ones
|
|
16
|
+
- Use `index.ts` barrel files for clean re-exports from directories
|
|
17
|
+
- No unused imports or variables - the linter will catch these
|
|
18
|
+
- Use default imports for Node.js built-in modules: `import PATH from 'node:path'`, `import FS from 'node:fs'` — not named imports like `import { resolve } from 'node:path'` (enforced by `unicorn/import-style`)
|
|
19
|
+
- String quotes: single quotes for code, backticks for interpolation
|
|
20
|
+
- Trailing commas: always (ES5+)
|
|
21
|
+
- Semicolons: never (rely on ASI)
|
|
22
|
+
- Indent with 2 spaces
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|