devflare 1.0.0-next.11 → 1.0.0-next.12
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/LLM.md +67 -73
- package/README.md +11 -9
- package/dist/{build-ezksv2dd.js → build-rfh8cgh3.js} +39 -10
- package/dist/bundler/index.d.ts +1 -0
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/worker-bundler.d.ts +14 -0
- package/dist/bundler/worker-bundler.d.ts.map +1 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/deploy.d.ts.map +1 -1
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/config/compiler.d.ts.map +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +3 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/{deploy-jdpy21t6.js → deploy-k0fcgt3d.js} +39 -10
- package/dist/{dev-9mq7zhww.js → dev-d4wabqyf.js} +64 -461
- package/dist/dev-server/server.d.ts.map +1 -1
- package/dist/index-1xqeptt2.js +623 -0
- package/dist/{index-51s1hkw4.js → index-rfhx0yd5.js} +10 -6
- package/dist/{index-xqfbd9fx.js → index-twpgq9k9.js} +4 -4
- package/dist/index-zbvmtcn2.js +795 -0
- package/dist/src/browser.js +1 -1
- package/dist/src/cli/index.js +1 -1
- package/dist/src/index.js +10 -11
- package/dist/src/sveltekit/index.js +2 -3
- package/dist/src/test/index.js +4 -5
- package/dist/src/vite/index.js +19 -399
- package/dist/{types-nq5acrwh.js → types-sffr9681.js} +5 -6
- package/dist/vite/config-file.d.ts +25 -0
- package/dist/vite/config-file.d.ts.map +1 -0
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/worker-entry/composed-worker.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-k7r18na8.js +0 -0
- package/dist/index-ws68xvq2.js +0 -311
- package/dist/{index-53xcakh8.js → index-0kzg8wed.js} +3 -3
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bundleWorkerEntry
|
|
3
|
+
} from "./index-1xqeptt2.js";
|
|
1
4
|
import {
|
|
2
5
|
detectViteProject
|
|
3
6
|
} from "./index-y1d8za14.js";
|
|
@@ -5,21 +8,26 @@ import {
|
|
|
5
8
|
getDependencies
|
|
6
9
|
} from "./index-1xpj0m4r.js";
|
|
7
10
|
import {
|
|
8
|
-
prepareComposedWorkerEntrypoint
|
|
9
|
-
|
|
11
|
+
prepareComposedWorkerEntrypoint,
|
|
12
|
+
resolveEffectiveViteProject,
|
|
13
|
+
writeGeneratedViteConfig
|
|
14
|
+
} from "./index-zbvmtcn2.js";
|
|
10
15
|
import"./index-1p814k7s.js";
|
|
11
16
|
import"./index-rbht7m9r.js";
|
|
17
|
+
import"./index-9wt9x09k.js";
|
|
12
18
|
import {
|
|
13
19
|
compileConfig,
|
|
14
20
|
stringifyConfig,
|
|
15
21
|
writeWranglerConfig
|
|
16
|
-
} from "./index-
|
|
22
|
+
} from "./index-rfhx0yd5.js";
|
|
17
23
|
import {
|
|
18
24
|
loadConfig
|
|
19
25
|
} from "./index-wyf3s77s.js";
|
|
26
|
+
import"./index-v8vvsn9x.js";
|
|
20
27
|
import"./index-37x76zdn.js";
|
|
21
28
|
|
|
22
29
|
// src/cli/commands/deploy.ts
|
|
30
|
+
import { relative, resolve } from "pathe";
|
|
23
31
|
async function runDeployCommand(parsed, logger, options) {
|
|
24
32
|
const cwd = options.cwd || process.cwd();
|
|
25
33
|
const configPath = parsed.options.config;
|
|
@@ -31,9 +39,26 @@ async function runDeployCommand(parsed, logger, options) {
|
|
|
31
39
|
logger.info(`Deploying: ${config.name}`);
|
|
32
40
|
const composedMainEntry = await prepareComposedWorkerEntrypoint(cwd, config, environment);
|
|
33
41
|
const wranglerConfig = compileConfig(config, environment);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
const deps = await getDependencies();
|
|
43
|
+
const viteProject = resolveEffectiveViteProject(await detectViteProject(cwd, deps.fs), config, environment);
|
|
44
|
+
if (viteProject.shouldStartVite) {
|
|
45
|
+
if (composedMainEntry) {
|
|
46
|
+
wranglerConfig.main = composedMainEntry;
|
|
47
|
+
logger.info(`Generated composed worker entry: ${composedMainEntry}`);
|
|
48
|
+
}
|
|
49
|
+
} else if (composedMainEntry) {
|
|
50
|
+
const bundledMainEntryPath = await bundleWorkerEntry({
|
|
51
|
+
cwd,
|
|
52
|
+
inputFile: resolve(cwd, composedMainEntry),
|
|
53
|
+
outFile: resolve(cwd, ".devflare", "worker-entrypoints", "main.js"),
|
|
54
|
+
rolldownOptions: config.rolldown?.options,
|
|
55
|
+
sourcemap: config.rolldown?.sourcemap,
|
|
56
|
+
minify: config.rolldown?.minify,
|
|
57
|
+
target: config.rolldown?.target,
|
|
58
|
+
logger
|
|
59
|
+
});
|
|
60
|
+
wranglerConfig.main = relative(cwd, bundledMainEntryPath).replace(/\\/g, "/");
|
|
61
|
+
logger.info(`Generated bundled worker entry: ${wranglerConfig.main}`);
|
|
37
62
|
}
|
|
38
63
|
if (dryRun) {
|
|
39
64
|
logger.info("Dry run - skipping actual deployment");
|
|
@@ -43,11 +68,15 @@ async function runDeployCommand(parsed, logger, options) {
|
|
|
43
68
|
}
|
|
44
69
|
await writeWranglerConfig(cwd, wranglerConfig);
|
|
45
70
|
logger.debug("Generated wrangler.jsonc");
|
|
46
|
-
const deps = await getDependencies();
|
|
47
|
-
const viteProject = await detectViteProject(cwd, deps.fs);
|
|
48
71
|
if (viteProject.shouldStartVite) {
|
|
72
|
+
const generatedViteConfigPath = await writeGeneratedViteConfig({
|
|
73
|
+
cwd,
|
|
74
|
+
configPath,
|
|
75
|
+
environment,
|
|
76
|
+
localConfigPath: viteProject.viteConfigPath
|
|
77
|
+
});
|
|
49
78
|
logger.info("Building...");
|
|
50
|
-
const buildProc = await deps.exec.exec("bunx", ["vite", "build"], {
|
|
79
|
+
const buildProc = await deps.exec.exec("bunx", ["vite", "build", "--config", generatedViteConfigPath], {
|
|
51
80
|
cwd,
|
|
52
81
|
stdio: "inherit"
|
|
53
82
|
});
|
|
@@ -56,7 +85,7 @@ async function runDeployCommand(parsed, logger, options) {
|
|
|
56
85
|
return { exitCode: 1 };
|
|
57
86
|
}
|
|
58
87
|
} else {
|
|
59
|
-
logger.info("Skipping Vite build (no
|
|
88
|
+
logger.info("Skipping Vite build (no effective Vite config found for this package)");
|
|
60
89
|
}
|
|
61
90
|
logger.info("Deploying with wrangler...");
|
|
62
91
|
const wranglerArgs = ["wrangler", "deploy"];
|