Skip to content

Commit 85fdb6e

Browse files
committed
chore: small changes
1 parent ce21a92 commit 85fdb6e

4 files changed

Lines changed: 120 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Licia - Project Guide for Code Agents
2+
3+
## Overview
4+
5+
Licia is a zero-dependency JavaScript utility library containing 455+ individual utility modules. Each module is independent and can be used standalone via the eustia build tool.
6+
7+
## Tech Stack
8+
9+
- **Language**: JavaScript (ES6+), TypeScript (type declarations)
10+
- **Build Tool**: eustia (custom module bundler via `licia` CLI)
11+
- **Test Framework**: Mocha + Chai (Node), Karma (Browser)
12+
- **Coverage**: nyc + istanbul
13+
- **Linter**: ESLint 8
14+
- **Formatter**: Prettier
15+
- **Transpiler**: Babel (for ES5 output)
16+
- **Type Checking**: TypeScript 5.x (for `.d.ts` validation)
17+
- **Node Types**: @types/node 20
18+
19+
## Project Structure
20+
21+
```
22+
src/ # 455+ utility module source files (one file per module)
23+
test/ # Test files (mirrors src/ structure, one test per module)
24+
lib/ # Build scripts and tooling (build, test, lint, format, etc.)
25+
bin/ # CLI entry point (licia command)
26+
benchmark/ # Performance benchmarks
27+
demo/ # Demo files
28+
i18n/ # Internationalization
29+
index.json # Module metadata (dependencies, env, description)
30+
tsconfig.json # TypeScript config (for test:ts)
31+
eslint.src.js # ESLint config for source/lib
32+
eslint.release.js # ESLint config for release builds
33+
```
34+
35+
## Module Format
36+
37+
Each module in `src/` follows this structure:
38+
39+
```javascript
40+
/* Description and API documentation (markdown table format) */
41+
42+
/* example
43+
* usage examples
44+
*/
45+
46+
/* module
47+
* env: all|node|browser
48+
*/
49+
50+
/* typescript
51+
* type declarations
52+
*/
53+
54+
_('dependency1 dependency2'); // declare dependencies on other licia modules
55+
56+
exports = function(...) { ... }; // module export
57+
```
58+
59+
## Licia CLI (Global Link)
60+
61+
This repo is globally linked via `npm link`, providing the `licia` command. The CLI supports per-module operations, which is the preferred way to develop and test individual modules:
62+
63+
```bash
64+
# Format a single module (runs prettier + comment formatting)
65+
licia format <moduleName>
66+
67+
# Lint a single module (eslint --fix on src and test file)
68+
licia lint <moduleName>
69+
70+
# Test a single module in Node.js (-s for silent)
71+
licia test <moduleName> -s
72+
73+
# Test a single module in browser
74+
licia test <moduleName> -bs
75+
76+
# Test with TypeScript declaration check
77+
licia test <moduleName> -s --ts
78+
79+
# Build a single module
80+
licia build <moduleName>
81+
82+
# Run benchmark for a single module
83+
licia benchmark <moduleName>
84+
```
85+
86+
Without a module name, these commands operate on all modules.
87+
88+
### CLI Flags
89+
90+
| Flag | Short | Description |
91+
|------|-------|-------------|
92+
| --browser | -b | Run browser tests (Karma) |
93+
| --silent | -s | Suppress verbose output |
94+
| --all | -a | Include all modules |
95+
| --sauce | | Use Sauce Labs for browser tests |
96+
| --ts | | Include TypeScript declaration test |
97+
| --release | -r | Test release build |
98+
| --docker | -d | Use Docker environment |
99+
100+
## npm Scripts (Full Suite)
101+
102+
- `npm run test:node` - Run all Node.js tests
103+
- `npm run test:browser` - Run all browser tests (Karma + Chrome)
104+
- `npm run test:ts` - Validate all TypeScript declarations
105+
- `npm test` - Run all tests (node + browser + release + ts)
106+
- `npm run lint` - Lint source and lib files
107+
- `npm run build` - Build release packages
108+
- `npm run format` - Format all code with Prettier + licia format
109+
110+
## Notes
111+
112+
- Dependencies between modules are declared via `_('moduleName')` syntax, not npm packages.
113+
- `index.json` contains the full dependency graph and metadata for all modules.
114+
- The `.licia/` directory is a build output directory (generated, not committed).
115+
- Each module targets a specific environment: `all`, `node`, or `browser` (declared in the module header).

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
"@babel/plugin-transform-parameters": "^7.4.4",
4949
"@babel/plugin-transform-shorthand-properties": "^7.2.0",
5050
"@babel/plugin-transform-template-literals": "^7.4.4",
51-
"@types/node": "^12.7.2",
51+
"@types/node": "^20.19.40",
5252
"babel-plugin-istanbul": "^6.0.0",
5353
"chai": "^4.2.0",
5454
"copyfiles": "^2.1.1",
5555
"cspell": "^4.0.55",
5656
"es-check": "^6.2.1",
57-
"eslint": "^6.2.2",
57+
"eslint": "^8.57.1",
5858
"eustia": "^0.9.0",
5959
"eustia-component": "^0.0.3",
6060
"execa": "^5.1.1",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"compilerOptions": {
33
"outDir": ".licia/testTsOut",
4-
"lib": ["es2017", "dom"]
4+
"lib": ["es2017", "dom"],
5+
"skipLibCheck": true
56
},
67
"include": [
78
".licia/testTs/**/*"

0 commit comments

Comments
 (0)