tkeron 3.3.0 → 3.5.0
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/changelog.md +12 -0
- package/dist/cmdDev.d.ts +0 -1
- package/dist/createTsConfigFile.js +6 -2
- package/dist/generateItems.js +4 -4
- package/dist/getFilesRecursive.js +1 -2
- package/dist/jsDom/crypto.d.ts +1 -1
- package/dist/mod.d.ts +1 -7
- package/dist/random.js +2 -2
- package/dist/runOncePerTime.d.ts +1 -1
- package/package.json +10 -10
- package/tkeron_library/addChilds.ts +12 -0
- package/tkeron_library/element.ts +8 -0
- /package/{README.md → readme.md} +0 -0
package/changelog.md
CHANGED
package/dist/cmdDev.d.ts
CHANGED
|
@@ -14,9 +14,13 @@ const createTsConfigFile = async () => {
|
|
|
14
14
|
"moduleResolution": "Node",
|
|
15
15
|
"declaration": false,
|
|
16
16
|
"skipLibCheck": true,
|
|
17
|
+
"baseUrl": ".",
|
|
17
18
|
"paths": {
|
|
18
|
-
"@comps": [
|
|
19
|
-
"./${sourceDir}/comps",
|
|
19
|
+
"@comps/*": [
|
|
20
|
+
"./${sourceDir}/comps/*",
|
|
21
|
+
],
|
|
22
|
+
"@src/*": [
|
|
23
|
+
"./${sourceDir}/*",
|
|
20
24
|
],
|
|
21
25
|
"@tkeron": [
|
|
22
26
|
"./.tkeron/tkeron_library"
|
package/dist/generateItems.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validItems = exports.pageItem = exports.componentItem = void 0;
|
|
4
4
|
const componentItem = (name) => ({
|
|
5
|
-
ts: `import {
|
|
5
|
+
ts: `import { addCss, tk, TkeronElement } from "@tkeron";\nimport css from "./${name}.css";\n\n\nexport const ${name} = (): TkeronElement => {\n const com = tk.addClass("${name}");\n\n return com;\n};\n\naddCss(css);\n`,
|
|
6
6
|
css: `.${name} {\n \n}\n`,
|
|
7
7
|
});
|
|
8
8
|
exports.componentItem = componentItem;
|
|
9
9
|
const pageItem = (name) => ({
|
|
10
|
-
html: `<!DOCTYPE html>\n<html lang="en">\n
|
|
11
|
-
ts: `import {
|
|
12
|
-
back: `import {
|
|
10
|
+
html: `<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="UTF-8" />\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>${name}</title>\n</head>\n\n<body></body>\n\n</html>`,
|
|
11
|
+
ts: `import { tk } from "@tkeron";\n\n\ntk("h1").setText("h1 rendered in front (browser)").appendIn.body;\n`,
|
|
12
|
+
back: `import { addCss, tk } from "@tkeron";\nimport css from "./${name}.page.css";\n\n\naddCss(css);\n\ntk("h1").setText("h1 rendered in back (pre rendered)").appendIn.body;\n`,
|
|
13
13
|
css: `html, body {\n margin: 0;\n padding: 0;\n}\n`,
|
|
14
14
|
});
|
|
15
15
|
exports.pageItem = pageItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFilesRecursive =
|
|
3
|
+
exports.getFilesRecursive = getFilesRecursive;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const pathToUrlResource_1 = require("./pathToUrlResource");
|
|
@@ -55,4 +55,3 @@ function* getFilesRecursive(directory, options) {
|
|
|
55
55
|
yield returnNamesOnly ? file.name : (0, path_1.join)(directory, file.name);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
exports.getFilesRecursive = getFilesRecursive;
|
package/dist/jsDom/crypto.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DOMWindow } from "jsdom";
|
|
2
|
-
export declare const getRandomValues: (a: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Float32Array | Float64Array | Uint8ClampedArray) => Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array
|
|
2
|
+
export declare const getRandomValues: (a: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Float32Array | Float64Array | Uint8ClampedArray) => Int8Array<ArrayBuffer> | Uint8Array<ArrayBuffer> | Uint8ClampedArray<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Float32Array<ArrayBuffer> | Float64Array<ArrayBuffer>;
|
|
3
3
|
export declare const ext_crypto: (window: DOMWindow) => void;
|
package/dist/mod.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export declare const build: ({ sourceDir, outputDir }?: {
|
|
3
2
|
sourceDir: string;
|
|
4
3
|
outputDir: string;
|
|
@@ -7,12 +6,7 @@ export declare const init: ({ sourceDir, outputDir }?: {
|
|
|
7
6
|
sourceDir: string;
|
|
8
7
|
outputDir: string;
|
|
9
8
|
}) => Promise<void>;
|
|
10
|
-
export declare const dev: (args?: {
|
|
11
|
-
sourceDir: string;
|
|
12
|
-
outputDir: string;
|
|
13
|
-
port: string;
|
|
14
|
-
addr: string;
|
|
15
|
-
}) => Promise<{
|
|
9
|
+
export declare const dev: (args?: import("./cmdDev").CmdDevType) => Promise<{
|
|
16
10
|
closeWatcher: () => void;
|
|
17
11
|
closeServer: () => import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
18
12
|
}>;
|
package/dist/random.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rnd = exports.getPseudoRnd =
|
|
3
|
+
exports.rnd = exports.getPseudoRnd = void 0;
|
|
4
|
+
exports.pseudoRnd = pseudoRnd;
|
|
4
5
|
function* pseudoRnd(seed = 0, limit = 0) {
|
|
5
6
|
let current = 0;
|
|
6
7
|
while (true) {
|
|
@@ -14,7 +15,6 @@ function* pseudoRnd(seed = 0, limit = 0) {
|
|
|
14
15
|
break;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
|
-
exports.pseudoRnd = pseudoRnd;
|
|
18
18
|
const getPseudoRnd = (seed = 0) => {
|
|
19
19
|
const rnd = pseudoRnd(seed);
|
|
20
20
|
return () => rnd.next().value || seed;
|
package/dist/runOncePerTime.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const runOncePerTime: (msec: number) => (fn: any) => void;
|
|
1
|
+
export declare const runOncePerTime: (msec: number) => ((fn: any) => void);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tkeron",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Micro framework for developing web user interfaces with typescript.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"tkeron": "dist/index.js",
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
"author": "tkeron",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tkeron/commands": "
|
|
21
|
+
"@tkeron/commands": "0.2.1",
|
|
22
22
|
"colorette": "^2.0.19",
|
|
23
|
-
"esbuild": "^0.
|
|
24
|
-
"express": "^4.
|
|
25
|
-
"jsdom": "^
|
|
23
|
+
"esbuild": "^0.24.0",
|
|
24
|
+
"express": "^4.21.1",
|
|
25
|
+
"jsdom": "^25.0.1",
|
|
26
26
|
"node-watch": "^0.7.3",
|
|
27
27
|
"rxjs": "^7.6.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/express": "^
|
|
30
|
+
"@types/express": "^5.0.0",
|
|
31
31
|
"@types/jest": "^29.2.4",
|
|
32
|
-
"@types/jsdom": "^
|
|
32
|
+
"@types/jsdom": "^21.1.7",
|
|
33
33
|
"jest": "^29.3.1",
|
|
34
|
-
"prettier": "^3.
|
|
35
|
-
"ts-jest": "^29.
|
|
36
|
-
"typescript": "
|
|
34
|
+
"prettier": "^3.4.1",
|
|
35
|
+
"ts-jest": "^29.2.5",
|
|
36
|
+
"typescript": "5.7.2"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
39
39
|
"cli",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TkeronElement } from "./element";
|
|
2
|
+
|
|
3
|
+
export const addChilds = (com: TkeronElement) => {
|
|
4
|
+
com.addChilds = (...elements) => {
|
|
5
|
+
for (const element of elements) {
|
|
6
|
+
com.childs.push(element);
|
|
7
|
+
com.htmlElement.appendChild(element.htmlElement);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return com;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -2,6 +2,7 @@ import { appendIn } from "./appendIn";
|
|
|
2
2
|
import { setAttribute } from "./setAttribute";
|
|
3
3
|
import { setHtml, setText } from "./setHtml_setText";
|
|
4
4
|
import { addClass, removeClass } from "./addClass_removeClass";
|
|
5
|
+
import { addChilds } from "./addChilds";
|
|
5
6
|
|
|
6
7
|
export interface TkeronElement {
|
|
7
8
|
htmlElement: HTMLElement;
|
|
@@ -15,6 +16,8 @@ export interface TkeronElement {
|
|
|
15
16
|
setAttribute: (attribute: string, value: string) => TkeronElement;
|
|
16
17
|
addClass: (...className) => TkeronElement;
|
|
17
18
|
removeClass: (...className) => TkeronElement;
|
|
19
|
+
childs: TkeronElement[];
|
|
20
|
+
addChilds: (...childs: TkeronElement[]) => TkeronElement;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export interface TkeronElementArguments {
|
|
@@ -41,6 +44,7 @@ export const tk = <TkeronElementAuto>((
|
|
|
41
44
|
|
|
42
45
|
const com = <TkeronElement>{
|
|
43
46
|
htmlElement: document.createElement(tag),
|
|
47
|
+
childs: childs || [],
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
//init chaining methods
|
|
@@ -50,9 +54,11 @@ export const tk = <TkeronElementAuto>((
|
|
|
50
54
|
setAttribute(com);
|
|
51
55
|
addClass(com);
|
|
52
56
|
removeClass(com);
|
|
57
|
+
addChilds(com);
|
|
53
58
|
|
|
54
59
|
if (childs)
|
|
55
60
|
for (const child of childs) {
|
|
61
|
+
com.childs.push(child);
|
|
56
62
|
com.htmlElement.appendChild(child.htmlElement);
|
|
57
63
|
}
|
|
58
64
|
|
|
@@ -67,6 +73,8 @@ for (const attribute of [
|
|
|
67
73
|
"setAttribute",
|
|
68
74
|
"addClass",
|
|
69
75
|
"removeClass",
|
|
76
|
+
"childs",
|
|
77
|
+
"addChilds"
|
|
70
78
|
]) {
|
|
71
79
|
Object.defineProperty(tk, attribute, {
|
|
72
80
|
get() {
|
/package/{README.md → readme.md}
RENAMED
|
File without changes
|