tkeron 4.0.0 → 4.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/bun.lock +2 -2
- package/changelog.md +26 -0
- package/docs/components-typescript.md +6 -6
- package/package.json +2 -2
- package/src/banner.ts +2 -2
- package/src/build.ts +2 -2
- package/src/buildDir.ts +2 -2
- package/src/buildEntrypoints.ts +2 -2
- package/src/buildWrapper.ts +2 -2
- package/src/cleanupOrphanedTempDirs.ts +1 -1
- package/src/develop.ts +2 -2
- package/src/getBuildResult.ts +2 -2
- package/src/index.ts +1 -1
- package/src/init.ts +2 -2
- package/src/initWrapper.ts +2 -2
- package/src/processCom.ts +2 -2
- package/src/processComTs.ts +2 -2
- package/src/processPre.ts +2 -2
- package/tests/test-helpers.ts +2 -2
- package/src/createTestLogger.ts +0 -24
- package/src/logger.ts +0 -4
- package/src/loggerObj.ts +0 -13
- package/src/silentLogger.ts +0 -8
package/bun.lock
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
9
9
|
"@tkeron/commands": "0.4.6",
|
|
10
10
|
"@tkeron/html-parser": "1.5.5",
|
|
11
|
-
"@tkeron/tools": "^0.
|
|
11
|
+
"@tkeron/tools": "^0.4.0",
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/bun": "^1.3.9",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
"@tkeron/html-parser": ["@tkeron/html-parser@1.5.5", "", { "peerDependencies": { "typescript": "^5.9.3" } }, "sha512-GSmlscPWxb2XqlmGNvtQ9ArETIPQmt3vIFlUgpTftLglkcCVgsA/pVZNW9AKJ8OZMfy8Jfmq+tf8QpbUWBVnsQ=="],
|
|
28
28
|
|
|
29
|
-
"@tkeron/tools": ["@tkeron/tools@0.
|
|
29
|
+
"@tkeron/tools": ["@tkeron/tools@0.4.0", "", { "peerDependencies": { "typescript": "^5.9.3" } }, "sha512-lceNx2BGfEvL0U79BgLAb9ObGMwqeXoFYTdwbks1fDrxHaIinE1XWsQzF4k6jOSw00GFD++byUQMKgpiUilY5w=="],
|
|
30
30
|
|
|
31
31
|
"@types/bun": ["@types/bun@1.3.9", "", { "dependencies": { "bun-types": "1.3.9" } }, "sha512-KQ571yULOdWJiMH+RIWIOZ7B2RXQGpL1YQrBtLIV3FqDcCu6FsbFUBwhdKUlCKUpS3PJDsHlJ1QKlpxoVR+xtw=="],
|
|
32
32
|
|
package/changelog.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# v4.0.1
|
|
2
|
+
|
|
3
|
+
## Logger System Migration
|
|
4
|
+
|
|
5
|
+
### Dependencies
|
|
6
|
+
|
|
7
|
+
- **Updated**: `@tkeron/tools` 0.3.0 → 0.4.0 (published to npm)
|
|
8
|
+
- Migrated Logger system to @tkeron/tools package
|
|
9
|
+
- Logger now includes improved handling for undefined and Error objects
|
|
10
|
+
|
|
11
|
+
### Refactoring
|
|
12
|
+
|
|
13
|
+
- **Removed**: Local Logger implementation files (logger.ts, loggerObj.ts, silentLogger.ts, createTestLogger.ts)
|
|
14
|
+
- **Removed**: Duplicate Logger tests (15 tests) - now tested in @tkeron/tools
|
|
15
|
+
- **Changed**: All Logger imports now use `@tkeron/tools` instead of local files
|
|
16
|
+
- **Impact**: No breaking changes - Logger interface remains identical
|
|
17
|
+
- **Benefit**: Shared Logger implementation across tkeron ecosystem
|
|
18
|
+
|
|
19
|
+
### Code Quality
|
|
20
|
+
|
|
21
|
+
- **Reduced**: -158 lines (43 from src, 115 from tests)
|
|
22
|
+
- **Tests**: 278 tests passing (focused on tkeron functionality)
|
|
23
|
+
- **Rationale**: Logger tests belong in @tkeron/tools (109 tests there), not in tkeron
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
1
27
|
# v4.0.0
|
|
2
28
|
|
|
3
29
|
## Stable Release
|
|
@@ -68,12 +68,12 @@ Component filenames must:
|
|
|
68
68
|
|
|
69
69
|
**Examples:**
|
|
70
70
|
|
|
71
|
-
| Filename
|
|
72
|
-
|
|
|
73
|
-
| `user-card.com.ts`
|
|
74
|
-
| `nav-menu.com.ts`
|
|
75
|
-
| `greeting.com.ts`
|
|
76
|
-
| `UserCard.com.ts`
|
|
71
|
+
| Filename | Custom Element | Valid? |
|
|
72
|
+
| ------------------ | -------------- | ------------------------- |
|
|
73
|
+
| `user-card.com.ts` | `<user-card>` | ✅ Yes |
|
|
74
|
+
| `nav-menu.com.ts` | `<nav-menu>` | ✅ Yes |
|
|
75
|
+
| `greeting.com.ts` | `<greeting>` | ❌ No (no hyphen) |
|
|
76
|
+
| `UserCard.com.ts` | `<user-card>` | ✅ Yes (case-insensitive) |
|
|
77
77
|
|
|
78
78
|
**Why hyphens are required:**
|
|
79
79
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tkeron",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "CLI tool for backend-driven frontend development with TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
35
35
|
"@tkeron/commands": "0.4.6",
|
|
36
36
|
"@tkeron/html-parser": "1.5.5",
|
|
37
|
-
"@tkeron/tools": "^0.
|
|
37
|
+
"@tkeron/tools": "^0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/bun": "^1.3.9",
|
package/src/banner.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Logger } from "
|
|
2
|
-
import { logger as defaultLogger } from "
|
|
1
|
+
import type { Logger } from "@tkeron/tools";
|
|
2
|
+
import { logger as defaultLogger } from "@tkeron/tools";
|
|
3
3
|
|
|
4
4
|
export const showBanner = async (log: Logger = defaultLogger) => {
|
|
5
5
|
const packageJson = await import("../package.json");
|
package/src/build.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { processPre } from "./processPre";
|
|
|
4
4
|
import { processCom } from "./processCom";
|
|
5
5
|
import { processComTs } from "./processComTs";
|
|
6
6
|
import { rm, exists, mkdir, cp } from "fs/promises";
|
|
7
|
-
import type { Logger } from "
|
|
8
|
-
import { silentLogger } from "
|
|
7
|
+
import type { Logger } from "@tkeron/tools";
|
|
8
|
+
import { silentLogger } from "@tkeron/tools";
|
|
9
9
|
import {
|
|
10
10
|
cleanupOrphanedTempDirs,
|
|
11
11
|
TEMP_DIR_PREFIX,
|
package/src/buildDir.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getPaths } from "@tkeron/tools";
|
|
2
2
|
import { join } from "path";
|
|
3
3
|
import { buildEntrypoints } from "./buildEntrypoints";
|
|
4
|
-
import type { Logger } from "
|
|
5
|
-
import { silentLogger } from "
|
|
4
|
+
import type { Logger } from "@tkeron/tools";
|
|
5
|
+
import { silentLogger } from "@tkeron/tools";
|
|
6
6
|
|
|
7
7
|
export interface BuildDirOptions {
|
|
8
8
|
logger?: Logger;
|
package/src/buildEntrypoints.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalize } from "path";
|
|
2
|
-
import type { Logger } from "
|
|
3
|
-
import { silentLogger } from "
|
|
2
|
+
import type { Logger } from "@tkeron/tools";
|
|
3
|
+
import { silentLogger } from "@tkeron/tools";
|
|
4
4
|
|
|
5
5
|
export interface BuildEntrypointsOptions {
|
|
6
6
|
logger?: Logger;
|
package/src/buildWrapper.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { build } from "./build";
|
|
2
|
-
import type { Logger } from "
|
|
3
|
-
import { logger as defaultLogger } from "
|
|
2
|
+
import type { Logger } from "@tkeron/tools";
|
|
3
|
+
import { logger as defaultLogger } from "@tkeron/tools";
|
|
4
4
|
|
|
5
5
|
export interface BuildWrapperOptions {
|
|
6
6
|
sourceDir?: string;
|
package/src/develop.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolve, dirname } from "path";
|
|
2
2
|
import { watch } from "fs";
|
|
3
3
|
import { build } from "./build";
|
|
4
|
-
import type { Logger } from "
|
|
5
|
-
import { logger as defaultLogger } from "
|
|
4
|
+
import type { Logger } from "@tkeron/tools";
|
|
5
|
+
import { logger as defaultLogger } from "@tkeron/tools";
|
|
6
6
|
import { setupSigintHandler } from "./setupSigintHandler";
|
|
7
7
|
|
|
8
8
|
export interface TkeronDevOptions {
|
package/src/getBuildResult.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { rm, stat } from "fs/promises";
|
|
|
3
3
|
import { getFilePaths } from "@tkeron/tools";
|
|
4
4
|
import { parseHTML } from "@tkeron/html-parser";
|
|
5
5
|
import { build } from "./build.js";
|
|
6
|
-
import type { Logger } from "
|
|
7
|
-
import { silentLogger } from "
|
|
6
|
+
import type { Logger } from "@tkeron/tools";
|
|
7
|
+
import { silentLogger } from "@tkeron/tools";
|
|
8
8
|
|
|
9
9
|
export interface GetBuildResultOptions {
|
|
10
10
|
logger?: Logger;
|
package/src/index.ts
CHANGED
package/src/init.ts
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
rmSync,
|
|
8
8
|
} from "fs";
|
|
9
9
|
import { join, resolve, basename } from "path";
|
|
10
|
-
import type { Logger } from "
|
|
11
|
-
import { silentLogger } from "
|
|
10
|
+
import type { Logger } from "@tkeron/tools";
|
|
11
|
+
import { silentLogger } from "@tkeron/tools";
|
|
12
12
|
import { promptUser } from "./promptUser";
|
|
13
13
|
|
|
14
14
|
export interface InitOptions {
|
package/src/initWrapper.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init } from "./init";
|
|
2
|
-
import type { Logger } from "
|
|
3
|
-
import { logger as defaultLogger } from "
|
|
2
|
+
import type { Logger } from "@tkeron/tools";
|
|
3
|
+
import { logger as defaultLogger } from "@tkeron/tools";
|
|
4
4
|
|
|
5
5
|
export interface InitWrapperOptions {
|
|
6
6
|
projectName?: string;
|
package/src/processCom.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseHTML } from "@tkeron/html-parser";
|
|
2
2
|
import { getFilePaths } from "@tkeron/tools";
|
|
3
3
|
import { join, dirname } from "path";
|
|
4
|
-
import type { Logger } from "
|
|
5
|
-
import { silentLogger } from "
|
|
4
|
+
import type { Logger } from "@tkeron/tools";
|
|
5
|
+
import { silentLogger } from "@tkeron/tools";
|
|
6
6
|
|
|
7
7
|
const DOCTYPE = "<!doctype html>\n";
|
|
8
8
|
|
package/src/processComTs.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseHTML } from "@tkeron/html-parser";
|
|
2
2
|
import { getFilePaths } from "@tkeron/tools";
|
|
3
3
|
import { join, dirname } from "path";
|
|
4
|
-
import type { Logger } from "
|
|
5
|
-
import { silentLogger } from "
|
|
4
|
+
import type { Logger } from "@tkeron/tools";
|
|
5
|
+
import { silentLogger } from "@tkeron/tools";
|
|
6
6
|
|
|
7
7
|
const DOCTYPE = "<!doctype html>\n";
|
|
8
8
|
|
package/src/processPre.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join, dirname } from "path";
|
|
2
2
|
import { getFilePaths } from "@tkeron/tools";
|
|
3
|
-
import type { Logger } from "
|
|
4
|
-
import { silentLogger } from "
|
|
3
|
+
import type { Logger } from "@tkeron/tools";
|
|
4
|
+
import { silentLogger } from "@tkeron/tools";
|
|
5
5
|
|
|
6
6
|
const packageJsonPath = join(import.meta.dir, "..", "package.json");
|
|
7
7
|
const packageJson = await Bun.file(packageJsonPath).json();
|
package/tests/test-helpers.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tmpdir } from "os";
|
|
2
2
|
import { join } from "path";
|
|
3
|
-
import { createTestLogger, silentLogger } from "
|
|
4
|
-
import type { Logger } from "
|
|
3
|
+
import { createTestLogger, silentLogger } from "@tkeron/tools";
|
|
4
|
+
import type { Logger } from "@tkeron/tools";
|
|
5
5
|
|
|
6
6
|
export { createTestLogger, silentLogger };
|
|
7
7
|
export type { Logger };
|
package/src/createTestLogger.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Logger } from "./loggerObj";
|
|
2
|
-
|
|
3
|
-
export const createTestLogger = () => {
|
|
4
|
-
const logs: string[] = [];
|
|
5
|
-
const errors: string[] = [];
|
|
6
|
-
const warns: string[] = [];
|
|
7
|
-
const infos: string[] = [];
|
|
8
|
-
|
|
9
|
-
const format = (args: unknown[]) =>
|
|
10
|
-
args.map((a) => (typeof a === "string" ? a : JSON.stringify(a))).join(" ");
|
|
11
|
-
|
|
12
|
-
return {
|
|
13
|
-
logger: {
|
|
14
|
-
log: (...args: unknown[]) => logs.push(format(args)),
|
|
15
|
-
error: (...args: unknown[]) => errors.push(format(args)),
|
|
16
|
-
warn: (...args: unknown[]) => warns.push(format(args)),
|
|
17
|
-
info: (...args: unknown[]) => infos.push(format(args)),
|
|
18
|
-
} as Logger,
|
|
19
|
-
logs,
|
|
20
|
-
errors,
|
|
21
|
-
warns,
|
|
22
|
-
infos,
|
|
23
|
-
};
|
|
24
|
-
};
|
package/src/logger.ts
DELETED
package/src/loggerObj.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface Logger {
|
|
2
|
-
log: (...args: unknown[]) => void;
|
|
3
|
-
error: (...args: unknown[]) => void;
|
|
4
|
-
warn: (...args: unknown[]) => void;
|
|
5
|
-
info: (...args: unknown[]) => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const logger: Logger = {
|
|
9
|
-
log: (...args: unknown[]) => console.log(...args),
|
|
10
|
-
error: (...args: unknown[]) => console.error(...args),
|
|
11
|
-
warn: (...args: unknown[]) => console.warn(...args),
|
|
12
|
-
info: (...args: unknown[]) => console.info(...args),
|
|
13
|
-
};
|