tw-framework 1.0.3 → 1.0.4
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/tw.mjs +21 -9
- package/package.json +1 -1
package/dist/tw.mjs
CHANGED
|
@@ -16449,7 +16449,7 @@ var init_types4 = __esm({
|
|
|
16449
16449
|
var TW_VERSION, TW_GENERATOR_META;
|
|
16450
16450
|
var init_version = __esm({
|
|
16451
16451
|
"../../packages/compiler/tw/codegen/version.ts"() {
|
|
16452
|
-
TW_VERSION = "1.0.
|
|
16452
|
+
TW_VERSION = "1.0.4";
|
|
16453
16453
|
TW_GENERATOR_META = `<meta name="generator" content="TW Framework ${TW_VERSION}">`;
|
|
16454
16454
|
}
|
|
16455
16455
|
});
|
|
@@ -53407,11 +53407,13 @@ async function devCommand() {
|
|
|
53407
53407
|
const _fu = import.meta.url.replace("file://", "");
|
|
53408
53408
|
const _srcDir = _fu.substring(0, _fu.lastIndexOf("/"));
|
|
53409
53409
|
const _bd = globalThis.__TW_BUNDLE_DIR;
|
|
53410
|
-
const
|
|
53411
|
-
|
|
53412
|
-
|
|
53413
|
-
|
|
53414
|
-
|
|
53410
|
+
const runtimeCandidates = _bd ? [resolve5(_bd, "hydration-runtime.js"), resolve5(_srcDir, "../../../..", "packages/runtime/tw/client/hydration-runtime.js")] : [resolve5(_srcDir, "../../../..", "packages/runtime/tw/client/hydration-runtime.js")];
|
|
53411
|
+
for (const runtimePath of runtimeCandidates) {
|
|
53412
|
+
if (existsSync15(runtimePath)) {
|
|
53413
|
+
return new Response(readFileSync9(runtimePath, "utf-8"), {
|
|
53414
|
+
headers: { "Content-Type": "application/javascript; charset=utf-8" }
|
|
53415
|
+
});
|
|
53416
|
+
}
|
|
53415
53417
|
}
|
|
53416
53418
|
return new Response("// runtime not found", { status: 404 });
|
|
53417
53419
|
}
|
|
@@ -53734,8 +53736,8 @@ async function serveCommand() {
|
|
|
53734
53736
|
const envPath = join17(rootDir, ".env");
|
|
53735
53737
|
if (existsSync18(envPath)) {
|
|
53736
53738
|
try {
|
|
53737
|
-
const { readFileSync:
|
|
53738
|
-
for (const line of
|
|
53739
|
+
const { readFileSync: readFileSync16 } = await import("node:fs");
|
|
53740
|
+
for (const line of readFileSync16(envPath, "utf-8").split("\n")) {
|
|
53739
53741
|
const m = /^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)\s*$/.exec(line);
|
|
53740
53742
|
if (m && !(m[1] in process.env)) {
|
|
53741
53743
|
process.env[m[1]] = m[2].replace(/^["']|["']$/g, "");
|
|
@@ -54549,7 +54551,17 @@ var helpText = `
|
|
|
54549
54551
|
|
|
54550
54552
|
// tw/commands/index.ts
|
|
54551
54553
|
await init_build();
|
|
54552
|
-
|
|
54554
|
+
import { readFileSync as readFileSync15 } from "node:fs";
|
|
54555
|
+
import { join as join26 } from "node:path";
|
|
54556
|
+
var VERSION = (() => {
|
|
54557
|
+
try {
|
|
54558
|
+
const bd = globalThis.__TW_BUNDLE_DIR;
|
|
54559
|
+
const pj = bd ? join26(bd, "..", "package.json") : new URL("../../package.json", import.meta.url).pathname;
|
|
54560
|
+
return JSON.parse(readFileSync15(pj, "utf-8")).version ?? "0.0.0";
|
|
54561
|
+
} catch {
|
|
54562
|
+
return "0.0.0";
|
|
54563
|
+
}
|
|
54564
|
+
})();
|
|
54553
54565
|
var commands = {
|
|
54554
54566
|
create: createCommand,
|
|
54555
54567
|
dev: devCommand,
|
package/package.json
CHANGED