elit 3.2.4 → 3.2.6
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.mts +1 -1
- package/dist/cli.js +32 -5
- package/dist/config.d.mts +38 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +990 -0
- package/dist/config.mjs +966 -0
- package/dist/database.d.mts +1 -0
- package/dist/database.d.ts +1 -0
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +29 -5
- package/dist/database.mjs +29 -5
- package/dist/{server-DTsu88db.d.ts → server-Dyam9FBy.d.ts} +33 -1
- package/dist/{server-SjfPJEWf.d.mts → server-U0JYnJFs.d.mts} +33 -1
- package/dist/server.d.mts +1 -1
- package/package.json +1 -1
- package/src/config.ts +39 -11
- package/src/database.ts +35 -6
package/dist/build.d.mts
CHANGED
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.6",
|
|
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",
|
|
@@ -1698,10 +1698,30 @@ async function loadConfigFile(configPath) {
|
|
|
1698
1698
|
} else if (ext === "ts") {
|
|
1699
1699
|
try {
|
|
1700
1700
|
const { build: build2 } = await import("esbuild");
|
|
1701
|
-
const { tmpdir } = await import("os");
|
|
1702
1701
|
const { join: join2, dirname: dirname2 } = await Promise.resolve().then(() => (init_path(), path_exports));
|
|
1703
|
-
const tempFile = join2(tmpdir(), `elit-config-${Date.now()}.mjs`);
|
|
1704
1702
|
const configDir = dirname2(configPath);
|
|
1703
|
+
const tempFile = join2(configDir, `.elit-config-${Date.now()}.mjs`);
|
|
1704
|
+
const externalAllPlugin = {
|
|
1705
|
+
name: "external-all",
|
|
1706
|
+
setup(build3) {
|
|
1707
|
+
build3.onResolve({ filter: /.*/ }, (args) => {
|
|
1708
|
+
if (args.path.startsWith("./") || args.path.startsWith("../")) {
|
|
1709
|
+
return void 0;
|
|
1710
|
+
}
|
|
1711
|
+
if (args.path.includes("node_modules") || args.resolveDir?.includes("node_modules")) {
|
|
1712
|
+
return { path: args.path, external: true };
|
|
1713
|
+
}
|
|
1714
|
+
const knownPackages = ["esbuild", "elit", "fs", "path", "os", "vm", "crypto", "http", "https", "url", "bun"];
|
|
1715
|
+
if (knownPackages.some((pkg) => args.path === pkg || args.path.startsWith(pkg + "/"))) {
|
|
1716
|
+
return { path: args.path, external: true };
|
|
1717
|
+
}
|
|
1718
|
+
if (args.resolveDir?.includes("elit/dist") || args.path.includes("elit/dist")) {
|
|
1719
|
+
return { path: args.path, external: true };
|
|
1720
|
+
}
|
|
1721
|
+
return void 0;
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
};
|
|
1705
1725
|
await build2({
|
|
1706
1726
|
entryPoints: [configPath],
|
|
1707
1727
|
bundle: true,
|
|
@@ -1710,10 +1730,17 @@ async function loadConfigFile(configPath) {
|
|
|
1710
1730
|
outfile: tempFile,
|
|
1711
1731
|
write: true,
|
|
1712
1732
|
target: "es2020",
|
|
1713
|
-
|
|
1714
|
-
//
|
|
1733
|
+
plugins: [externalAllPlugin],
|
|
1734
|
+
// External Node.js built-ins and runtime-specific packages
|
|
1715
1735
|
external: [
|
|
1716
1736
|
"node:*",
|
|
1737
|
+
"fs",
|
|
1738
|
+
"path",
|
|
1739
|
+
"os",
|
|
1740
|
+
"vm",
|
|
1741
|
+
"crypto",
|
|
1742
|
+
"http",
|
|
1743
|
+
"https",
|
|
1717
1744
|
"bun",
|
|
1718
1745
|
"bun:*",
|
|
1719
1746
|
"deno",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { D as DevServerOptions, B as BuildOptions, P as PreviewOptions } from './server-U0JYnJFs.mjs';
|
|
2
|
+
import './http.mjs';
|
|
3
|
+
import 'node:events';
|
|
4
|
+
import './ws.mjs';
|
|
5
|
+
import 'events';
|
|
6
|
+
import 'http';
|
|
7
|
+
import 'ws';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Config loader for elit.config.{ts,js,json}
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface ElitConfig {
|
|
14
|
+
/** Development server configuration */
|
|
15
|
+
dev?: DevServerOptions;
|
|
16
|
+
/** Build configuration - supports single build or multiple builds */
|
|
17
|
+
build?: BuildOptions | BuildOptions[];
|
|
18
|
+
/** Preview server configuration */
|
|
19
|
+
preview?: PreviewOptions;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Helper function for type-safe config definition
|
|
23
|
+
*/
|
|
24
|
+
declare function defineConfig(config: ElitConfig): ElitConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Load environment variables from .env files
|
|
27
|
+
*/
|
|
28
|
+
declare function loadEnv(mode?: string, cwd?: string): Record<string, string>;
|
|
29
|
+
/**
|
|
30
|
+
* Load elit config from current directory
|
|
31
|
+
*/
|
|
32
|
+
declare function loadConfig(cwd?: string): Promise<ElitConfig | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Merge CLI args with config file
|
|
35
|
+
*/
|
|
36
|
+
declare function mergeConfig<T extends Record<string, any>>(config: T | undefined, cliArgs: Partial<T>): T;
|
|
37
|
+
|
|
38
|
+
export { type ElitConfig, defineConfig, loadConfig, loadEnv, mergeConfig };
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2C9E,MAAM,WAAW,UAAU;IACvB,uCAAuC;IACvC,GAAG,CAAC,EAAE,g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