112112├── types.ts # TypeScript type definitions
113113├── constants/ # Node.js, npm, package manager constants
114114├── env/ # Typed environment variable access
115- ├── lib/ # Core utility functions
116- │ └── packages/ # Package management utilities
115+ ├── packages/ # Package management utilities
117116├── external/ # Vendored external dependencies
118117└── utils/ # Shared utilities
119118
@@ -125,19 +124,19 @@ scripts/ # Build and development scripts
125124test/ # Test files
126125```
127126
128- ** Path aliases** :
127+ ** Path aliases** (defined in ` .config/tsconfig.external-aliases.json ` ) :
129128```
130129#constants/* → src/constants/*
131130#env/* → src/env/*
132- #lib/* → src/lib/ *
133- #packages/* → src/lib/ packages/*
131+ #lib/* → src/*
132+ #packages/* → src/packages/*
134133#types → src/types
135134#utils/* → src/utils/*
136135```
137136
138137### Commands
139138- ** Build** : ` pnpm build ` (production build)
140- - ** Watch** : ` pnpm run build:watch ` or ` pnpm run dev` (development mode)
139+ - ** Watch** : ` pnpm run dev ` (development mode)
141140- ** Test** : ` pnpm test ` (run tests)
142141- ** Type check** : ` pnpm run check ` (TypeScript type checking)
143142- ** Lint** : ` pnpm run lint ` (Biome linting)
@@ -149,26 +148,29 @@ test/ # Test files
149148
150149#### Compilation
151150- ** Target** : TypeScript → CommonJS (ES2022)
152- - ** Builder** : esbuild via ` scripts/build- js.mjs `
151+ - ** Builder** : esbuild via ` scripts/build/ js.mjs `
153152- ** Type generation** : tsgo (TypeScript Native Preview)
154153- ** Output** : ` dist/ ` directory
155154
156155#### Build Scripts
157- All build scripts are Node.js modules (` .mjs ` ):
158- - ` build- js.mjs ` - Main JavaScript compilation
159- - ` build- externals.mjs ` - External dependency bundling
160- - ` fix- commonjs-exports.mjs ` - Post-build CommonJS export fixes
161- - ` fix-default- imports.mjs ` - Fix default import patterns
162- - ` generate-package-exports.mjs ` - Auto-generate package.json exports
156+ All build scripts are Node.js modules (` .mjs ` ) in ` scripts/ ` :
157+ - ` build/ js.mjs ` - Main JavaScript compilation
158+ - ` build/ externals.mjs ` - External dependency bundling
159+ - ` fix/ commonjs-exports.mjs ` - Post-build CommonJS export fixes
160+ - ` fix/external- imports.mjs ` - Fix external import patterns
161+ - ` fix/ generate-package-exports.mjs` - Auto-generate package.json exports
163162
164163🚨 ** FORBIDDEN** : Shell scripts (` .sh ` ) - Always use Node.js scripts
165164
166165#### Build Process
167- 1 . Clean previous build: ` pnpm run clean `
168- 2 . Compile JavaScript: ` pnpm run build:js `
169- 3 . Generate types: ` pnpm run build:types `
170- 4 . Bundle externals: ` pnpm run build:externals `
171- 5 . Fix exports: ` pnpm run fix:exports `
166+ The main build command (` pnpm build ` ) orchestrates via ` scripts/build/main.mjs ` :
167+ 1 . Clean previous build
168+ 2 . Build in parallel: source code, types, and externals
169+ 3 . Fix exports via ` scripts/fix/main.mjs `
170+
171+ Individual commands:
172+ - ` pnpm run clean ` - Clean build artifacts only
173+ - ` pnpm build ` - Full build (default)
172174
173175### Code Style - Lib-Specific
174176
@@ -250,8 +252,8 @@ Blank lines between groups, alphabetical within groups.
250252All modules are exported via ` package.json ` exports field:
251253- ** Constants** : ` ./constants/<name> ` → ` dist/constants/<name>.js `
252254- ** Environment** : ` ./env/<name> ` → ` dist/env/<name>.js `
253- - ** Libraries** : ` ./<name> ` → ` dist/lib/ <name>.js `
254- - ** Packages** : ` ./packages/<name> ` → ` dist/lib/ packages/<name>.js `
255+ - ** Libraries** : ` ./<name> ` → ` dist/<name>.js `
256+ - ** Packages** : ` ./packages/<name> ` → ` dist/packages/<name>.js `
255257- ** Types** : ` ./types ` → ` dist/types.js `
256258
257259#### Adding New Exports
@@ -351,7 +353,7 @@ path: |
3513533. `pnpm test` - Run tests (or `pnpm run cover` for coverage)
352354
353355# ### Watch Mode
354- Use `pnpm run build:watch` or `pnpm run dev` for development with automatic rebuilds.
356+ Use `pnpm run dev` for development with automatic rebuilds.
355357
356358# ### Adding New Utilities
3573591. Create utility in appropriate `src/` subdirectory
0 commit comments