elit 3.2.6 → 3.2.7
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/dist/build.d.ts.map +1 -1
- package/dist/build.js +3 -6
- package/dist/build.mjs +3 -6
- package/dist/cli.js +9 -18
- package/dist/database.d.mts +16 -32
- package/dist/database.d.ts +16 -31
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +232 -376
- package/dist/database.mjs +231 -373
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +5 -11
- package/dist/server.mjs +5 -11
- package/package.json +1 -1
- package/src/build.ts +3 -6
- package/src/database.ts +306 -203
- package/src/server.ts +5 -11
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA2EzD,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA2EzD,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAuPvE;AAUD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/build.js
CHANGED
|
@@ -503,12 +503,9 @@ async function build(options) {
|
|
|
503
503
|
build2.onResolve({ filter: /^(chokidar|esbuild|mime-types|open|ws|fs\/promises)$/ }, () => {
|
|
504
504
|
return { path: "server-dep", external: true, sideEffects: false };
|
|
505
505
|
});
|
|
506
|
-
build2.onLoad({ filter: /
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
loader: "js"
|
|
510
|
-
};
|
|
511
|
-
});
|
|
506
|
+
build2.onLoad({ filter: /server|config|cli/ }, () => ({
|
|
507
|
+
contents: "export default {};"
|
|
508
|
+
}));
|
|
512
509
|
}
|
|
513
510
|
};
|
|
514
511
|
try {
|
package/dist/build.mjs
CHANGED
|
@@ -475,12 +475,9 @@ async function build(options) {
|
|
|
475
475
|
build2.onResolve({ filter: /^(chokidar|esbuild|mime-types|open|ws|fs\/promises)$/ }, () => {
|
|
476
476
|
return { path: "server-dep", external: true, sideEffects: false };
|
|
477
477
|
});
|
|
478
|
-
build2.onLoad({ filter: /
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
loader: "js"
|
|
482
|
-
};
|
|
483
|
-
});
|
|
478
|
+
build2.onLoad({ filter: /server|config|cli/ }, () => ({
|
|
479
|
+
contents: "export default {};"
|
|
480
|
+
}));
|
|
484
481
|
}
|
|
485
482
|
};
|
|
486
483
|
try {
|
package/dist/cli.js
CHANGED
|
@@ -1435,7 +1435,7 @@ var require_package = __commonJS({
|
|
|
1435
1435
|
"package.json"(exports2, module2) {
|
|
1436
1436
|
module2.exports = {
|
|
1437
1437
|
name: "elit",
|
|
1438
|
-
version: "3.2.
|
|
1438
|
+
version: "3.2.7",
|
|
1439
1439
|
description: "Optimized lightweight library for creating DOM elements with reactive state",
|
|
1440
1440
|
main: "dist/index.js",
|
|
1441
1441
|
module: "dist/index.mjs",
|
|
@@ -3831,21 +3831,15 @@ export default css;
|
|
|
3831
3831
|
});
|
|
3832
3832
|
transpiled = transpiler.transformSync(content.toString());
|
|
3833
3833
|
} else {
|
|
3834
|
-
const {
|
|
3835
|
-
const
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
loader: ext === ".tsx" ? "tsx" : "ts",
|
|
3839
|
-
resolveDir: resolve(resolvedPath, ".."),
|
|
3840
|
-
sourcefile: resolvedPath
|
|
3841
|
-
},
|
|
3834
|
+
const { transformSync } = await import("esbuild");
|
|
3835
|
+
const loader = ext === ".tsx" ? "tsx" : "ts";
|
|
3836
|
+
const result = transformSync(content.toString(), {
|
|
3837
|
+
loader,
|
|
3842
3838
|
format: "esm",
|
|
3843
3839
|
target: "es2020",
|
|
3844
|
-
write: false,
|
|
3845
|
-
bundle: false,
|
|
3846
3840
|
sourcemap: "inline"
|
|
3847
3841
|
});
|
|
3848
|
-
transpiled = result.
|
|
3842
|
+
transpiled = result.code;
|
|
3849
3843
|
}
|
|
3850
3844
|
transpiled = transpiled.replace(
|
|
3851
3845
|
/from\s+["']([^"']+)\.ts(x?)["']/g,
|
|
@@ -4175,12 +4169,9 @@ async function build(options) {
|
|
|
4175
4169
|
build2.onResolve({ filter: /^(chokidar|esbuild|mime-types|open|ws|fs\/promises)$/ }, () => {
|
|
4176
4170
|
return { path: "server-dep", external: true, sideEffects: false };
|
|
4177
4171
|
});
|
|
4178
|
-
build2.onLoad({ filter: /
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
loader: "js"
|
|
4182
|
-
};
|
|
4183
|
-
});
|
|
4172
|
+
build2.onLoad({ filter: /server|config|cli/ }, () => ({
|
|
4173
|
+
contents: "export default {};"
|
|
4174
|
+
}));
|
|
4184
4175
|
}
|
|
4185
4176
|
};
|
|
4186
4177
|
try {
|
package/dist/database.d.mts
CHANGED
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface DatabaseConfig {
|
|
4
|
-
dir?: string;
|
|
1
|
+
interface VMOptions {
|
|
5
2
|
language?: 'ts' | 'js';
|
|
6
3
|
registerModules?: {
|
|
7
4
|
[key: string]: any;
|
|
8
5
|
};
|
|
6
|
+
dir?: string;
|
|
9
7
|
}
|
|
8
|
+
declare function create(dbName: string, code: string | Function): void;
|
|
9
|
+
declare function read(dbName: string): string;
|
|
10
|
+
declare function remove(dbName: string, fnName: string): string | false;
|
|
11
|
+
declare function rename(oldName: string, newName: string): string;
|
|
12
|
+
declare function save(dbName: string, code: string | Function | any): void;
|
|
13
|
+
declare function update(dbName: string, fnName: string, code: string | Function): string;
|
|
10
14
|
declare class Database {
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private register;
|
|
19
|
-
plugin(moduleName: string, moduleContent: any): void;
|
|
20
|
-
private resolvePath;
|
|
21
|
-
private moduleLinker;
|
|
22
|
-
private vmRun;
|
|
23
|
-
/**
|
|
24
|
-
* Execute database code and return results
|
|
25
|
-
*/
|
|
26
|
-
execute(code: string | Function, options?: vm.RunningCodeOptions | string): Promise<{
|
|
27
|
-
namespace: Object;
|
|
15
|
+
private vm;
|
|
16
|
+
constructor(options?: VMOptions);
|
|
17
|
+
register(context: {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}): void;
|
|
20
|
+
execute(code: string): Promise<{
|
|
21
|
+
namespace: any;
|
|
28
22
|
logs: any[];
|
|
29
23
|
}>;
|
|
30
24
|
}
|
|
31
|
-
declare function database(): Database;
|
|
32
|
-
interface DatabaseConsole extends Console {
|
|
33
|
-
create?(dbName: string, code: string | Function): void;
|
|
34
|
-
read(dbName: string): string;
|
|
35
|
-
remove(dbName: string, fnName: string): any;
|
|
36
|
-
rename(oldName: string, newName: string): string;
|
|
37
|
-
save(dbName: string, code: string | Function | any): void;
|
|
38
|
-
update(dbName: string, fnName: string, code: string | Function): any;
|
|
39
|
-
}
|
|
40
|
-
declare const dbConsole: DatabaseConsole;
|
|
41
25
|
|
|
42
|
-
export { Database,
|
|
26
|
+
export { Database, create, read, remove, rename, save, update };
|
package/dist/database.d.ts
CHANGED
|
@@ -1,41 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
export interface DatabaseConfig {
|
|
3
|
-
dir?: string;
|
|
1
|
+
interface VMOptions {
|
|
4
2
|
language?: 'ts' | 'js';
|
|
5
3
|
registerModules?: {
|
|
6
4
|
[key: string]: any;
|
|
7
5
|
};
|
|
6
|
+
dir?: string;
|
|
8
7
|
}
|
|
8
|
+
declare function create(dbName: string, code: string | Function): void;
|
|
9
|
+
declare function read(dbName: string): string;
|
|
10
|
+
declare function remove(dbName: string, fnName: string): string | false;
|
|
11
|
+
declare function rename(oldName: string, newName: string): string;
|
|
12
|
+
declare function save(dbName: string, code: string | Function | any): void;
|
|
13
|
+
declare function update(dbName: string, fnName: string, code: string | Function): string;
|
|
9
14
|
export declare class Database {
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
private register;
|
|
18
|
-
plugin(moduleName: string, moduleContent: any): void;
|
|
19
|
-
private resolvePath;
|
|
20
|
-
private moduleLinker;
|
|
21
|
-
private vmRun;
|
|
22
|
-
/**
|
|
23
|
-
* Execute database code and return results
|
|
24
|
-
*/
|
|
25
|
-
execute(code: string | Function, options?: vm.RunningCodeOptions | string): Promise<{
|
|
26
|
-
namespace: Object;
|
|
15
|
+
private vm;
|
|
16
|
+
constructor(options?: VMOptions);
|
|
17
|
+
register(context: {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}): void;
|
|
20
|
+
execute(code: string): Promise<{
|
|
21
|
+
namespace: any;
|
|
27
22
|
logs: any[];
|
|
28
23
|
}>;
|
|
29
24
|
}
|
|
30
|
-
export
|
|
31
|
-
export interface DatabaseConsole extends Console {
|
|
32
|
-
create?(dbName: string, code: string | Function): void;
|
|
33
|
-
read(dbName: string): string;
|
|
34
|
-
remove(dbName: string, fnName: string): any;
|
|
35
|
-
rename(oldName: string, newName: string): string;
|
|
36
|
-
save(dbName: string, code: string | Function | any): void;
|
|
37
|
-
update(dbName: string, fnName: string, code: string | Function): any;
|
|
38
|
-
}
|
|
39
|
-
export declare const dbConsole: DatabaseConsole;
|
|
40
|
-
export default database;
|
|
25
|
+
export { create, read, remove, rename, save, update };
|
|
41
26
|
//# sourceMappingURL=database.d.ts.map
|
package/dist/database.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAKA,UAAU,SAAS;IACf,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAwUD,iBAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAO7D;AAED,iBAAS,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAWpC;AAED,iBAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBA+F7C;AAED,iBAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBxD;AAED,iBAAS,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,GAAG,GAAG,IAAI,CASjE;AAED,iBAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,UAyItE;AAgFD,qBAAa,QAAQ;IACjB,OAAO,CAAC,EAAE,CAAK;gBACH,OAAO,CAAC,EAAE,SAAS;IAO/B,QAAQ,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAIlC,OAAO,CAAC,IAAI,EAAE,MAAM;;;;CAG7B;AAGD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC"}
|