tkeron 5.0.0 → 5.0.1
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/README.md +2 -2
- package/changelog.md +18 -0
- package/docs/best-practices.md +3 -6
- package/docs/cli-reference.md +11 -7
- package/docs/common-issues.md +20 -13
- package/docs/components-html.md +10 -8
- package/docs/components-markdown.md +5 -5
- package/docs/components-typescript.md +1 -1
- package/docs/getting-started.md +3 -2
- package/docs/overview.md +5 -3
- package/docs/pre-rendering.md +7 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -82,8 +82,8 @@ document.getElementById("quote").textContent = data.content;
|
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
84
|
tk init <name> # Initialize new project
|
|
85
|
-
tk build
|
|
86
|
-
tk dev [
|
|
85
|
+
tk build # Build project (websrc → web)
|
|
86
|
+
tk dev [port] [host] # Dev server with hot reload (default: localhost:3000)
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
**Aliases:** `tk i`, `tk b`, `tk d`
|
package/changelog.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# v5.0.1
|
|
2
|
+
|
|
3
|
+
## Documentation fixes and dependency updates
|
|
4
|
+
|
|
5
|
+
- Fix: `tk build` and `tk dev` CLI signatures corrected in README (removed wrong `[src] [out]` args, aligned with v5.0 breaking change)
|
|
6
|
+
- Fix: Component resolution docs updated to reflect actual glob search behavior (not limited to root `websrc/`)
|
|
7
|
+
- Fix: Build process docs updated to include `.com.md` processing step and iterative loop (up to 10 iterations)
|
|
8
|
+
- Fix: `tsconfig.json` example corrected to match real config (`lib: ["ESNext", "DOM"]`, removed `types: ["bun-types"]`)
|
|
9
|
+
- Fix: TypeScript compilation docs clarified — Bun transpiler does NOT type-check, only transpiles
|
|
10
|
+
- Fix: Broken link `tkeron.dev/docs` → `tkeron.com`
|
|
11
|
+
- Fix: `components-html.md` quick start used `<button>` (reserved HTML tag, no hyphen) — replaced with `<my-button>`
|
|
12
|
+
- Fix: `best-practices.md` Summary had orphaned/corrupted code fragment — removed
|
|
13
|
+
- Fix: Added `.com.md` to all feature lists, tables, and build process diagrams across all docs
|
|
14
|
+
- Fix: `package.json` description updated to reflect actual purpose
|
|
15
|
+
- Deps: `bun update --latest` — updated all dependencies
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
1
19
|
# v5.0.0
|
|
2
20
|
|
|
3
21
|
## Breaking: sourceDir and targetDir removed as CLI arguments
|
package/docs/best-practices.md
CHANGED
|
@@ -231,23 +231,20 @@ document.getElementById("stars").textContent = data.public_repos;
|
|
|
231
231
|
|
|
232
232
|
- HTML components: static markup
|
|
233
233
|
- TypeScript components: dynamic generation
|
|
234
|
+
- Markdown components: content in Markdown
|
|
234
235
|
- Pre-rendering: DOM manipulation at build time
|
|
235
236
|
- Browser code: regular TypeScript/JavaScript
|
|
236
237
|
- No bundling of npm packages
|
|
237
238
|
- No type checking (use `tsc --noEmit`)
|
|
238
239
|
- Powered by Bun
|
|
239
|
-
document.querySelectorAll('.my-button').forEach(btn => {
|
|
240
|
-
btn.addEventListener('click', handleClick);
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
240
|
|
|
244
|
-
|
|
241
|
+
---
|
|
245
242
|
|
|
246
243
|
```typescript
|
|
247
244
|
// ❌ Don't try to maintain state
|
|
248
245
|
let count = 0; // This is meaningless
|
|
249
246
|
com.innerHTML = `<button>Count: ${count}</button>`;
|
|
250
|
-
|
|
247
|
+
```
|
|
251
248
|
|
|
252
249
|
**Solution:** Use client-side JavaScript for stateful UI.
|
|
253
250
|
|
package/docs/cli-reference.md
CHANGED
|
@@ -75,16 +75,20 @@ tk b
|
|
|
75
75
|
1. Creates temporary directory as sibling to source
|
|
76
76
|
2. Copies source to temp directory
|
|
77
77
|
3. Runs `.pre.ts` files (pre-rendering)
|
|
78
|
-
4.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
4. Iterative component processing (up to 10 iterations):
|
|
79
|
+
- Processes `.com.ts` components (TypeScript components)
|
|
80
|
+
- Processes `.com.html` components (HTML components)
|
|
81
|
+
- Processes `.com.md` components (Markdown components)
|
|
82
|
+
- Repeats until no changes are detected
|
|
83
|
+
5. Compiles TypeScript to JavaScript
|
|
84
|
+
6. Copies result to target directory
|
|
85
|
+
7. Cleans up temporary directory
|
|
83
86
|
|
|
84
87
|
**Files Excluded from Output:**
|
|
85
88
|
|
|
86
89
|
- `*.com.html` - HTML components (inlined)
|
|
87
90
|
- `*.com.ts` - TypeScript components (inlined)
|
|
91
|
+
- `*.com.md` - Markdown components (inlined)
|
|
88
92
|
- `*.pre.ts` - Pre-rendering scripts (executed)
|
|
89
93
|
|
|
90
94
|
**Exit Codes:**
|
|
@@ -448,8 +452,8 @@ Tkeron doesn't require a `tsconfig.json`, but you can add one for editor support
|
|
|
448
452
|
"compilerOptions": {
|
|
449
453
|
"target": "ESNext",
|
|
450
454
|
"module": "ESNext",
|
|
455
|
+
"lib": ["ESNext", "DOM"],
|
|
451
456
|
"moduleResolution": "bundler",
|
|
452
|
-
"types": ["bun-types"],
|
|
453
457
|
"strict": true,
|
|
454
458
|
"skipLibCheck": true
|
|
455
459
|
},
|
|
@@ -635,7 +639,7 @@ tk
|
|
|
635
639
|
This document! Also available at:
|
|
636
640
|
|
|
637
641
|
- [GitHub Repository](https://github.com/tkeron/tkeron)
|
|
638
|
-
- [Documentation Site](https://tkeron.
|
|
642
|
+
- [Documentation Site](https://tkeron.com)
|
|
639
643
|
|
|
640
644
|
### Report Issues
|
|
641
645
|
|
package/docs/common-issues.md
CHANGED
|
@@ -125,9 +125,9 @@ blog-post.com.ts → <blog-post>
|
|
|
125
125
|
|
|
126
126
|
## TypeScript Compilation
|
|
127
127
|
|
|
128
|
-
### Issue: TypeScript Errors
|
|
128
|
+
### Issue: TypeScript Errors in Source
|
|
129
129
|
|
|
130
|
-
**Problem:**
|
|
130
|
+
**Problem:** TypeScript code has type errors
|
|
131
131
|
|
|
132
132
|
```typescript
|
|
133
133
|
// ❌ WRONG
|
|
@@ -135,18 +135,24 @@ const user = { name: "Alice" };
|
|
|
135
135
|
user.age = 30; // Error: Property 'age' does not exist
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
**Why this
|
|
138
|
+
**Why this matters:**
|
|
139
139
|
|
|
140
|
-
- Tkeron uses Bun's TypeScript transpiler
|
|
141
|
-
- Type errors
|
|
142
|
-
-
|
|
140
|
+
- Tkeron uses Bun's TypeScript transpiler, which **does NOT type-check** — it only transpiles
|
|
141
|
+
- Type errors won't prevent the build from running
|
|
142
|
+
- However, type errors may indicate real bugs in your code
|
|
143
|
+
- Missing types for global variables can confuse your IDE
|
|
143
144
|
|
|
144
145
|
**Solution:**
|
|
145
146
|
|
|
147
|
+
- Run `tsc --noEmit` separately to catch type errors before building
|
|
146
148
|
- Use `tkeron.d.ts` for global type declarations
|
|
147
|
-
- Fix type errors before building
|
|
148
149
|
- Use `any` strategically if types are complex
|
|
149
150
|
|
|
151
|
+
```bash
|
|
152
|
+
# Check types, then build
|
|
153
|
+
tsc --noEmit && tk build
|
|
154
|
+
```
|
|
155
|
+
|
|
150
156
|
```typescript
|
|
151
157
|
// ✅ CORRECT
|
|
152
158
|
const user: { name: string; age?: number } = { name: "Alice" };
|
|
@@ -166,16 +172,17 @@ user.age = 30; // OK
|
|
|
166
172
|
|
|
167
173
|
**Why this happens:**
|
|
168
174
|
|
|
169
|
-
- Tkeron searches in 2
|
|
175
|
+
- Tkeron searches in 2 ways:
|
|
170
176
|
1. Same directory as HTML file
|
|
171
|
-
2.
|
|
172
|
-
-
|
|
177
|
+
2. Glob search across the entire source tree
|
|
178
|
+
- If no match is found in either, the element remains unchanged
|
|
173
179
|
|
|
174
180
|
**Solution:**
|
|
175
|
-
|
|
181
|
+
Place the component file anywhere in the source tree — Tkeron will find it via glob search. For clarity, common locations:
|
|
176
182
|
|
|
177
|
-
- In `blog/user-card.com.html` (next to `post.html`)
|
|
178
|
-
-
|
|
183
|
+
- In `blog/user-card.com.html` (next to `post.html` — higher priority)
|
|
184
|
+
- In `websrc/user-card.com.html` (root)
|
|
185
|
+
- In `websrc/components/user-card.com.html` (organized in a subfolder)
|
|
179
186
|
|
|
180
187
|
## Build Performance
|
|
181
188
|
|
package/docs/components-html.md
CHANGED
|
@@ -7,7 +7,7 @@ HTML components (`.com.html` files) are the simplest way to create reusable piec
|
|
|
7
7
|
Create a file named with `.com.html` extension:
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
|
-
<!-- button.com.html -->
|
|
10
|
+
<!-- my-button.com.html -->
|
|
11
11
|
<button class="btn">Click me</button>
|
|
12
12
|
```
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ Use it with a matching custom element:
|
|
|
15
15
|
|
|
16
16
|
```html
|
|
17
17
|
<!-- index.html -->
|
|
18
|
-
<button></button>
|
|
18
|
+
<my-button></my-button>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Build, and the custom element is replaced with the component's content.
|
|
@@ -36,7 +36,7 @@ Component filenames must:
|
|
|
36
36
|
| -------------------- | -------------- | ------------------------- |
|
|
37
37
|
| `user-card.com.html` | `<user-card>` | ✅ Yes |
|
|
38
38
|
| `nav-menu.com.html` | `<nav-menu>` | ✅ Yes |
|
|
39
|
-
| `
|
|
39
|
+
| `card.com.html` | `<card>` | ❌ No (no hyphen) |
|
|
40
40
|
| `UserCard.com.html` | `<user-card>` | ✅ Yes (case-insensitive) |
|
|
41
41
|
|
|
42
42
|
### 2. Component Resolution
|
|
@@ -44,23 +44,25 @@ Component filenames must:
|
|
|
44
44
|
Tkeron looks for components in this order:
|
|
45
45
|
|
|
46
46
|
1. **Same directory** as the file using it
|
|
47
|
-
2. **
|
|
47
|
+
2. **Any directory** in the source tree (via glob search)
|
|
48
48
|
|
|
49
49
|
**Example structure:**
|
|
50
50
|
|
|
51
51
|
```
|
|
52
52
|
websrc/
|
|
53
53
|
├── index.html
|
|
54
|
-
├── header.com.html
|
|
54
|
+
├── site-header.com.html # Available to all files
|
|
55
|
+
├── components/
|
|
56
|
+
│ └── blog-comment.com.html # Also available to all files
|
|
55
57
|
├── blog/
|
|
56
58
|
│ ├── post.html
|
|
57
|
-
│ └── comment.com.html
|
|
59
|
+
│ └── blog-comment.com.html # Takes priority for blog/post.html
|
|
58
60
|
```
|
|
59
61
|
|
|
60
62
|
In `blog/post.html`:
|
|
61
63
|
|
|
62
|
-
- `<comment>` → Finds `blog/comment.com.html` first
|
|
63
|
-
- `<header>` →
|
|
64
|
+
- `<blog-comment>` → Finds `blog/blog-comment.com.html` first (same directory)
|
|
65
|
+
- `<site-header>` → Found via glob search in the source tree
|
|
64
66
|
|
|
65
67
|
### 3. Build Process
|
|
66
68
|
|
|
@@ -50,23 +50,23 @@ Component filenames must:
|
|
|
50
50
|
Tkeron looks for components in this order:
|
|
51
51
|
|
|
52
52
|
1. **Same directory** as the file using it
|
|
53
|
-
2. **
|
|
53
|
+
2. **Any directory** in the source tree (via glob search)
|
|
54
54
|
|
|
55
55
|
**Example structure:**
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
websrc/
|
|
59
59
|
├── index.html
|
|
60
|
-
├── site-intro.com.md
|
|
60
|
+
├── site-intro.com.md # Available to all files
|
|
61
61
|
├── blog/
|
|
62
62
|
│ ├── post.html
|
|
63
|
-
│ └── post-footer.com.md
|
|
63
|
+
│ └── post-footer.com.md # Takes priority for blog/post.html
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
In `blog/post.html`:
|
|
67
67
|
|
|
68
|
-
- `<post-footer>` → Finds `blog/post-footer.com.md` first
|
|
69
|
-
- `<site-intro>` →
|
|
68
|
+
- `<post-footer>` → Finds `blog/post-footer.com.md` first (same directory)
|
|
69
|
+
- `<site-intro>` → Found via glob search in the source tree
|
|
70
70
|
|
|
71
71
|
### 3. Component Priority
|
|
72
72
|
|
|
@@ -84,7 +84,7 @@ Custom elements in HTML must contain at least one hyphen to distinguish them fro
|
|
|
84
84
|
Same as HTML components:
|
|
85
85
|
|
|
86
86
|
1. **Same directory** as the file using it
|
|
87
|
-
2. **
|
|
87
|
+
2. **Any directory** in the source tree (via glob search)
|
|
88
88
|
|
|
89
89
|
### IDE Support & IntelliSense
|
|
90
90
|
|
package/docs/getting-started.md
CHANGED
|
@@ -88,7 +88,7 @@ web/
|
|
|
88
88
|
└── ... # Other processed files
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
Notice that `.com.html`, `.com.ts`, and `.pre.ts` files are **not** copied to output - they're processed and inlined.
|
|
91
|
+
Notice that `.com.html`, `.com.ts`, `.com.md`, and `.pre.ts` files are **not** copied to output - they're processed and inlined.
|
|
92
92
|
|
|
93
93
|
## Start Development Server
|
|
94
94
|
|
|
@@ -198,6 +198,7 @@ Open `web/index.html` in your browser. You'll see the greeting component inlined
|
|
|
198
198
|
| `.ts` / `.js` | Scripts for pages | ✅ Yes (compiled) |
|
|
199
199
|
| `.com.html` | HTML components | ❌ No (inlined) |
|
|
200
200
|
| `.com.ts` | TypeScript components | ❌ No (inlined) |
|
|
201
|
+
| `.com.md` | Markdown components | ❌ No (inlined) |
|
|
201
202
|
| `.pre.ts` | Pre-rendering scripts | ❌ No (executed) |
|
|
202
203
|
| `.css` | Stylesheets | ✅ Yes |
|
|
203
204
|
| Images, fonts, etc. | Static assets | ✅ Yes |
|
|
@@ -271,4 +272,4 @@ tk dev 3001
|
|
|
271
272
|
|
|
272
273
|
- Component names **must** contain a hyphen: `user-card`, not `usercard`
|
|
273
274
|
- File must be named exactly: `user-card.com.html`
|
|
274
|
-
- Component files
|
|
275
|
+
- Component files can be anywhere in the source tree — Tkeron searches the same directory first, then the entire source via glob
|
package/docs/overview.md
CHANGED
|
@@ -11,6 +11,7 @@ Powered by [Bun](https://bun.sh).
|
|
|
11
11
|
- Compiles TypeScript to JavaScript
|
|
12
12
|
- Inlines HTML components (`.com.html`)
|
|
13
13
|
- Executes TypeScript components (`.com.ts`) at build time
|
|
14
|
+
- Renders Markdown components (`.com.md`) at build time
|
|
14
15
|
- Runs pre-rendering scripts (`.pre.ts`)
|
|
15
16
|
- Copies assets
|
|
16
17
|
- Dev server with hot reload
|
|
@@ -107,11 +108,12 @@ websrc/ Build Steps web/
|
|
|
107
108
|
├── index.html → 1. .pre.ts → ├── index.html
|
|
108
109
|
├── index.ts 2. .com.ts ├── index.js
|
|
109
110
|
├── index.pre.ts 3. .com.html
|
|
110
|
-
├── nav.com.html 4.
|
|
111
|
-
|
|
111
|
+
├── nav.com.html 4. .com.md
|
|
112
|
+
├── card.com.ts 5. TypeScript
|
|
113
|
+
└── info.com.md 6. Assets
|
|
112
114
|
```
|
|
113
115
|
|
|
114
|
-
Component files (`.com.html`, `.com.ts`, `.pre.ts`) are not copied to output.
|
|
116
|
+
Component files (`.com.html`, `.com.ts`, `.com.md`, `.pre.ts`) are not copied to output.
|
|
115
117
|
|
|
116
118
|
---
|
|
117
119
|
|
package/docs/pre-rendering.md
CHANGED
|
@@ -71,10 +71,13 @@ This is the parsed DOM from the corresponding `.html` file.
|
|
|
71
71
|
|
|
72
72
|
```
|
|
73
73
|
1. Run .pre.ts files → Modify HTML documents
|
|
74
|
-
2.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
2. Iterative component processing (up to 10 iterations):
|
|
75
|
+
a. Process .com.ts → Replace TypeScript components
|
|
76
|
+
b. Process .com.html → Replace HTML components
|
|
77
|
+
c. Process .com.md → Replace Markdown components
|
|
78
|
+
d. Repeat until no changes
|
|
79
|
+
3. Compile .ts to .js → TypeScript compilation
|
|
80
|
+
4. Copy to output → Final build
|
|
78
81
|
```
|
|
79
82
|
|
|
80
83
|
Pre-rendering happens **first**, so you can inject components dynamically.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tkeron",
|
|
3
|
-
"version": "5.0.
|
|
4
|
-
"description": "CLI tool for
|
|
3
|
+
"version": "5.0.1",
|
|
4
|
+
"description": "CLI build tool for vanilla web development with TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
7
7
|
"exports": {
|