devflare 1.0.0-next.41 → 1.0.0-next.42
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/bin/devflare.js +9 -1
- package/dist/_chunks/{build-C0pZGUL7.js → build-D1l6a5Il.js} +1 -1
- package/dist/_chunks/{build-artifacts-CGdnp2BT.js → build-artifacts-BUaq16e4.js} +2 -2
- package/dist/_chunks/{cli-DPeh2U50.js → cli-CgFqrDZd.js} +4 -4
- package/dist/_chunks/{deploy-C2siy20T.js → deploy-DIDoW5u1.js} +2 -2
- package/dist/_chunks/{dev-CvRHmRFZ.js → dev-BTSSETUX.js} +2 -2
- package/dist/_chunks/{resolve-package-Y84HB3Nt.js → resolve-package-qizBfCIm.js} +22 -3
- package/dist/_chunks/{routes-C3FqES2W.js → routes-BWi7h2xb.js} +1 -1
- package/dist/_chunks/{types-OrLbzv4I.js → types-BgA5Hb4B.js} +1 -1
- package/dist/_chunks/{vite-CsI0E-uV.js → vite-BszZvrKL.js} +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/test/index.js +1 -1
- package/dist/utils/resolve-package.d.ts.map +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
package/bin/devflare.js
CHANGED
|
@@ -6,7 +6,15 @@ import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
|
6
6
|
const currentDir = dirname(fileURLToPath(import.meta.url))
|
|
7
7
|
const sourceCliEntryPath = resolve(currentDir, '../src/cli/index.ts')
|
|
8
8
|
const distCliEntryPath = resolve(currentDir, '../dist/cli/index.js')
|
|
9
|
-
|
|
9
|
+
// Only the bun runtime can execute the TypeScript source directly (it tolerates
|
|
10
|
+
// `.ts` + extensionless relative imports); under node — the default shebang and
|
|
11
|
+
// what published consumers use — always run the built dist. In the monorepo
|
|
12
|
+
// this means `devflare <cmd>` under node needs a prior build, which the
|
|
13
|
+
// build/CI pipeline guarantees. A published install has no `src/`, so it falls
|
|
14
|
+
// through to dist under any runtime.
|
|
15
|
+
const runningBun = Boolean(process.versions.bun)
|
|
16
|
+
const cliEntryPath =
|
|
17
|
+
runningBun && existsSync(sourceCliEntryPath) ? sourceCliEntryPath : distCliEntryPath
|
|
10
18
|
|
|
11
19
|
const { runCli } = await import(pathToFileURL(cliEntryPath).href)
|
|
12
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as cyanBold, f as logLine, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
2
|
-
import { t as prepareBuildArtifacts } from "./build-artifacts-
|
|
2
|
+
import { t as prepareBuildArtifacts } from "./build-artifacts-BUaq16e4.js";
|
|
3
3
|
//#region src/cli/commands/build.ts
|
|
4
4
|
async function runBuildCommand(parsed, logger, options) {
|
|
5
5
|
const theme = createCliTheme(parsed.options);
|
|
@@ -3,8 +3,8 @@ import { r as loadConfig, u as resolveConfigForEnvironment } from "./loader-DLXO
|
|
|
3
3
|
import { c as writeWranglerConfig, i as isolateViteBuildOutputPaths$1, o as rebaseWranglerConfigPaths, t as compileBuildConfig } from "./compiler-uoyAQ8zW.js";
|
|
4
4
|
import { f as logLine } from "./ui-BUoZApvE.js";
|
|
5
5
|
import { n as getPackageVersion } from "./package-metadata-DjHBLB-z.js";
|
|
6
|
-
import { t as resolvePackageSpecifier } from "./resolve-package-
|
|
7
|
-
import { i as writeGeneratedViteConfig, l as prepareComposedWorkerEntrypoint, n as resolveEffectiveViteProject } from "./vite-
|
|
6
|
+
import { t as resolvePackageSpecifier } from "./resolve-package-qizBfCIm.js";
|
|
7
|
+
import { i as writeGeneratedViteConfig, l as prepareComposedWorkerEntrypoint, n as resolveEffectiveViteProject } from "./vite-BszZvrKL.js";
|
|
8
8
|
import { t as bundleWorkerEntry } from "./worker-bundler-dTTnYU3n.js";
|
|
9
9
|
import { t as detectViteProject } from "./vite-utils-OVLMV605.js";
|
|
10
10
|
import { t as getDependencies } from "./dependencies-C2oxFjU_.js";
|
|
@@ -1062,22 +1062,22 @@ async function runInit(parsed, logger, options) {
|
|
|
1062
1062
|
return runInitCommand(parsed, logger, options);
|
|
1063
1063
|
}
|
|
1064
1064
|
async function runDev(parsed, logger, options) {
|
|
1065
|
-
const { runDevCommand } = await import("./dev-
|
|
1065
|
+
const { runDevCommand } = await import("./dev-BTSSETUX.js");
|
|
1066
1066
|
return runDevCommand(parsed, logger, options);
|
|
1067
1067
|
}
|
|
1068
1068
|
async function runBuild(parsed, logger, options) {
|
|
1069
|
-
const { runBuildCommand } = await import("./build-
|
|
1069
|
+
const { runBuildCommand } = await import("./build-D1l6a5Il.js");
|
|
1070
1070
|
return runBuildCommand(parsed, logger, options);
|
|
1071
1071
|
}
|
|
1072
1072
|
async function runDeploy(parsed, logger, options) {
|
|
1073
|
-
const { runDeployCommand } = await import("./deploy-
|
|
1073
|
+
const { runDeployCommand } = await import("./deploy-DIDoW5u1.js");
|
|
1074
1074
|
return runDeployCommand(parsed, logger, {
|
|
1075
1075
|
...options,
|
|
1076
1076
|
requireExplicitDeployTarget: true
|
|
1077
1077
|
});
|
|
1078
1078
|
}
|
|
1079
1079
|
async function runTypes(parsed, logger, options) {
|
|
1080
|
-
const { runTypesCommand } = await import("./types-
|
|
1080
|
+
const { runTypesCommand } = await import("./types-BgA5Hb4B.js");
|
|
1081
1081
|
return runTypesCommand(parsed, logger, options);
|
|
1082
1082
|
}
|
|
1083
1083
|
async function runDoctor(parsed, logger, options) {
|
|
@@ -5,9 +5,9 @@ import { d as getPrimaryAccount, n as getEffectiveAccountId } from "./preference
|
|
|
5
5
|
import { D as listWorkerVersions, E as listWorkerDeployments, O as listWorkers, T as getWorkersSubdomain, c as reconcilePreviewRegistry, w as getWorkerVersionDetail, x as formatWorkersDevUrl } from "./preview-registry-ClAbLTHH.js";
|
|
6
6
|
import { _ as yellowBold, d as green, f as logLine, g as yellow, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
7
7
|
import { n as getPackageVersion } from "./package-metadata-DjHBLB-z.js";
|
|
8
|
-
import { t as resolvePackageSpecifier } from "./resolve-package-
|
|
8
|
+
import { t as resolvePackageSpecifier } from "./resolve-package-qizBfCIm.js";
|
|
9
9
|
import { t as asOptionalString } from "./command-utils-BsfkmTqh.js";
|
|
10
|
-
import { a as createBuildManifest, i as compareManifests, n as applyDeploymentStrategy, o as formatDriftWarning, r as describeDeploymentStrategy, s as readBuildManifest, t as prepareBuildArtifacts } from "./build-artifacts-
|
|
10
|
+
import { a as createBuildManifest, i as compareManifests, n as applyDeploymentStrategy, o as formatDriftWarning, r as describeDeploymentStrategy, s as readBuildManifest, t as prepareBuildArtifacts } from "./build-artifacts-BUaq16e4.js";
|
|
11
11
|
import { t as getDependencies } from "./dependencies-C2oxFjU_.js";
|
|
12
12
|
import { n as preparePreviewScopedResourcesForDeploy } from "./preview-resources-DdXj8LMM.js";
|
|
13
13
|
import { mkdir, open, readFile, rm, writeFile } from "node:fs/promises";
|
|
@@ -4,10 +4,10 @@ import { n as getLocalKVNamespaceIdentifier, r as getSingleBrowserBindingName, t
|
|
|
4
4
|
import { t as applyLocalDevVarsToConfig } from "./local-dev-vars-CTSa-wvF.js";
|
|
5
5
|
import { a as cyanBold, f as logLine, g as yellow, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
6
6
|
import { clearLocalSendEmailBindings, setLocalSendEmailBindings } from "../utils/send-email.js";
|
|
7
|
-
import { C as buildWorkerLoadersConfig, S as buildVersionMetadataConfig, _ as buildQueueConsumers, b as buildSecretsStoreConfig, c as buildAiSearchInstancesConfig, d as buildDispatchNamespacesConfig, f as buildHyperdrivesConfig, g as buildPipelinesConfig, h as buildMtlsCertificatesConfig, l as buildAiSearchNamespacesConfig, m as buildMediaConfig, n as getRouteDirectoryCandidate, p as buildImagesConfig, s as resolveServiceBindings, t as discoverRoutes, u as buildArtifactsConfig, v as buildQueueProducers, w as buildWorkflowsConfig, x as buildSendEmailConfig, y as buildRateLimitsConfig } from "./routes-
|
|
7
|
+
import { C as buildWorkerLoadersConfig, S as buildVersionMetadataConfig, _ as buildQueueConsumers, b as buildSecretsStoreConfig, c as buildAiSearchInstancesConfig, d as buildDispatchNamespacesConfig, f as buildHyperdrivesConfig, g as buildPipelinesConfig, h as buildMtlsCertificatesConfig, l as buildAiSearchNamespacesConfig, m as buildMediaConfig, n as getRouteDirectoryCandidate, p as buildImagesConfig, s as resolveServiceBindings, t as discoverRoutes, u as buildArtifactsConfig, v as buildQueueProducers, w as buildWorkflowsConfig, x as buildSendEmailConfig, y as buildRateLimitsConfig } from "./routes-BWi7h2xb.js";
|
|
8
8
|
import { r as transformDurableObject } from "./durable-object-DMtH0XYX.js";
|
|
9
9
|
import { i as findFiles } from "./glob-CmQOvunB.js";
|
|
10
|
-
import { d as DEFAULT_FETCH_ENTRY_FILES, f as DEFAULT_QUEUE_ENTRY_FILES, g as discoverDurableObjectFiles, h as resolveWorkerSurfacePaths, i as writeGeneratedViteConfig, l as prepareComposedWorkerEntrypoint, m as hasWorkerSurfacePaths, n as resolveEffectiveViteProject, p as DEFAULT_SCHEDULED_ENTRY_FILES, u as DEFAULT_EMAIL_ENTRY_FILES } from "./vite-
|
|
10
|
+
import { d as DEFAULT_FETCH_ENTRY_FILES, f as DEFAULT_QUEUE_ENTRY_FILES, g as discoverDurableObjectFiles, h as resolveWorkerSurfacePaths, i as writeGeneratedViteConfig, l as prepareComposedWorkerEntrypoint, m as hasWorkerSurfacePaths, n as resolveEffectiveViteProject, p as DEFAULT_SCHEDULED_ENTRY_FILES, u as DEFAULT_EMAIL_ENTRY_FILES } from "./vite-BszZvrKL.js";
|
|
11
11
|
import { a as createWorkerdBundlerDefaults, i as writeWorkerCompatibleBundle, n as ensureDebugShim, r as resolveWorkerCompatibleRolldownConfig, t as bundleWorkerEntry } from "./worker-bundler-dTTnYU3n.js";
|
|
12
12
|
import { t as bundleWorkflowEntrypointScript } from "./local-workflow-entrypoints-Wip3o1u8.js";
|
|
13
13
|
import { n as buildLocalSecretWrappedBindingConfig } from "./local-secrets-DMmEOygL.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as findFilesSync, i as findFiles, n as DEFAULT_ENTRYPOINT_PATTERN } from "./glob-CmQOvunB.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
4
4
|
import { dirname, resolve } from "pathe";
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
6
|
import { readFileSync as readFileSync$1 } from "fs";
|
|
@@ -70,13 +70,32 @@ async function discoverEntrypointsAsync(cwd, pattern = DEFAULT_ENTRYPOINT_PATTER
|
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/utils/resolve-package.ts
|
|
73
|
-
const NOT_FOUND_CODES = new Set([
|
|
73
|
+
const NOT_FOUND_CODES = new Set([
|
|
74
|
+
"MODULE_NOT_FOUND",
|
|
75
|
+
"ERR_MODULE_NOT_FOUND",
|
|
76
|
+
"ERR_PACKAGE_PATH_NOT_EXPORTED"
|
|
77
|
+
]);
|
|
74
78
|
function isNotFoundError(error) {
|
|
75
79
|
if (!error || typeof error !== "object") return false;
|
|
76
80
|
const code = error.code;
|
|
77
81
|
return typeof code === "string" && NOT_FOUND_CODES.has(code);
|
|
78
82
|
}
|
|
79
83
|
/**
|
|
84
|
+
* Find a package's own `package.json` by walking `node_modules` up the tree,
|
|
85
|
+
* exactly like Node's directory resolution — and crucially WITHOUT consulting
|
|
86
|
+
* the package's `exports` map (a package need not expose `./package.json`).
|
|
87
|
+
*/
|
|
88
|
+
function findPackageJsonByWalk(packageName, fromDir) {
|
|
89
|
+
let dir = resolve(fromDir);
|
|
90
|
+
while (true) {
|
|
91
|
+
const candidate = resolve(dir, "node_modules", packageName, "package.json");
|
|
92
|
+
if (existsSync(candidate)) return realpathSync(candidate);
|
|
93
|
+
const parent = dirname(dir);
|
|
94
|
+
if (parent === dir) return null;
|
|
95
|
+
dir = parent;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
80
99
|
* Resolve `specifier` from `fromDir` using ESM-first resolution.
|
|
81
100
|
*
|
|
82
101
|
* Chain:
|
|
@@ -114,7 +133,7 @@ function resolvePackageSpecifier(specifier, fromDir) {
|
|
|
114
133
|
if (specifier.startsWith(".") || specifier.startsWith("/") || /^[A-Za-z]:/.test(specifier)) return resolve(fromDir, specifier);
|
|
115
134
|
const parts = specifier.startsWith("@") ? specifier.split("/").slice(0, 2).join("/") : specifier.split("/")[0];
|
|
116
135
|
const subpath = specifier.startsWith("@") ? specifier.split("/").slice(2).join("/") : specifier.split("/").slice(1).join("/");
|
|
117
|
-
const pkgJsonPath = resolveSpecifier(`${parts}/package.json`, fromDir);
|
|
136
|
+
const pkgJsonPath = findPackageJsonByWalk(parts, fromDir) ?? resolveSpecifier(`${parts}/package.json`, fromDir);
|
|
118
137
|
if (!pkgJsonPath) return resolve(fromDir, specifier);
|
|
119
138
|
const pkgDir = dirname(pkgJsonPath);
|
|
120
139
|
if (subpath) {
|
|
@@ -3,7 +3,7 @@ import { c as normalizeHyperdriveBinding, d as normalizeMediaBinding, f as norma
|
|
|
3
3
|
import { n as findDurableObjectClasses } from "./durable-object-DMtH0XYX.js";
|
|
4
4
|
import { r as SUPPORTED_WORKER_EXTENSIONS, t as transformWorkerEntrypoint } from "./worker-entrypoint-CQW77lG8.js";
|
|
5
5
|
import { a as findFilesSync, i as findFiles, t as DEFAULT_DO_PATTERN } from "./glob-CmQOvunB.js";
|
|
6
|
-
import { r as discoverEntrypointsSync, t as resolvePackageSpecifier } from "./resolve-package-
|
|
6
|
+
import { r as discoverEntrypointsSync, t as resolvePackageSpecifier } from "./resolve-package-qizBfCIm.js";
|
|
7
7
|
import { relative, resolve } from "pathe";
|
|
8
8
|
import { existsSync, readFileSync } from "fs";
|
|
9
9
|
import { dirname as dirname$1, join as join$1, resolve as resolve$1 } from "path";
|
|
@@ -3,7 +3,7 @@ import { o as normalizeDOBinding } from "./schema-normalization-DWVleVxo.js";
|
|
|
3
3
|
import { n as bold, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
4
4
|
import { n as findDurableObjectClasses } from "./durable-object-DMtH0XYX.js";
|
|
5
5
|
import { i as findFiles, n as DEFAULT_ENTRYPOINT_PATTERN, t as DEFAULT_DO_PATTERN } from "./glob-CmQOvunB.js";
|
|
6
|
-
import { n as discoverEntrypointsAsync, t as resolvePackageSpecifier } from "./resolve-package-
|
|
6
|
+
import { n as discoverEntrypointsAsync, t as resolvePackageSpecifier } from "./resolve-package-qizBfCIm.js";
|
|
7
7
|
import { t as getDependencies } from "./dependencies-C2oxFjU_.js";
|
|
8
8
|
import { r as resolveConfigCandidatePath } from "./config-path-DCPto4XB.js";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
@@ -2,7 +2,7 @@ import { d as resolveConfigEnvVars } from "./preview-BhqDmq8I.js";
|
|
|
2
2
|
import { i as resolveConfigPath, o as loadResolvedConfig, r as loadConfig, s as resolveResources, u as resolveConfigForEnvironment } from "./loader-DLXO60RO.js";
|
|
3
3
|
import { o as normalizeDOBinding } from "./schema-normalization-DWVleVxo.js";
|
|
4
4
|
import { c as writeWranglerConfig, i as isolateViteBuildOutputPaths, n as compileConfig, o as rebaseWranglerConfigPaths, r as compileToProgrammaticConfig, t as compileBuildConfig } from "./compiler-uoyAQ8zW.js";
|
|
5
|
-
import { s as resolveServiceBindings, t as discoverRoutes } from "./routes-
|
|
5
|
+
import { s as resolveServiceBindings, t as discoverRoutes } from "./routes-BWi7h2xb.js";
|
|
6
6
|
import { n as findDurableObjectClasses } from "./durable-object-DMtH0XYX.js";
|
|
7
7
|
import { r as SUPPORTED_WORKER_EXTENSIONS } from "./worker-entrypoint-CQW77lG8.js";
|
|
8
8
|
import { i as findFiles, t as DEFAULT_DO_PATTERN } from "./glob-CmQOvunB.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as runCli, t as parseArgs } from "../_chunks/cli-
|
|
1
|
+
import { n as runCli, t as parseArgs } from "../_chunks/cli-CgFqrDZd.js";
|
|
2
2
|
export { parseArgs, runCli };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,6 @@ import { a as ConfigResourceResolutionError, d as configSchema, n as ConfigValid
|
|
|
4
4
|
import { n as compileConfig, s as stringifyConfig } from "./_chunks/compiler-uoyAQ8zW.js";
|
|
5
5
|
import { t as workerName } from "./_chunks/workerName-CFJsLZA-.js";
|
|
6
6
|
import { n as getDurableObjectOptions, t as durableObject } from "./_chunks/decorators-QmV57ixr.js";
|
|
7
|
-
import { n as runCli, t as parseArgs } from "./_chunks/cli-
|
|
7
|
+
import { n as runCli, t as parseArgs } from "./_chunks/cli-CgFqrDZd.js";
|
|
8
8
|
import { i as vars, r as env } from "./_chunks/env-S0_nMVz1.js";
|
|
9
9
|
export { ConfigNotFoundError, ConfigResourceResolutionError, ConfigValidationError, compileConfig, configSchema, defineConfig as default, defineConfig, durableObject, env, getDurableObjectOptions, loadConfig, loadResolvedConfig, parseArgs, preview, ref, runCli, stringifyConfig, vars, workerName };
|
package/dist/test/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { createLocalSendEmailBinding, wrapEnvSendEmailBindings } from "../utils/
|
|
|
9
9
|
import { n as __setTestContext, r as env, t as __clearTestContext } from "../_chunks/env-S0_nMVz1.js";
|
|
10
10
|
import { d as invokeFetchModule, m as resolveFetchHandler, r as matchFetchRoute, t as createRouteResolve } from "../_chunks/runtime-FvXvfuZ2.js";
|
|
11
11
|
import { i as extractBindingHints, n as createLocalWorkerLoaderBinding, r as disposeLocalWorkerLoaderBindings, t as createLocalHyperdrive } from "../_chunks/local-hyperdrive-CJ90j46O.js";
|
|
12
|
-
import { a as hasServiceBindings, f as buildHyperdrivesConfig, i as hasCrossWorkerDOs, o as resolveDOBindings, r as clearBundleCache, s as resolveServiceBindings, t as discoverRoutes } from "../_chunks/routes-
|
|
12
|
+
import { a as hasServiceBindings, f as buildHyperdrivesConfig, i as hasCrossWorkerDOs, o as resolveDOBindings, r as clearBundleCache, s as resolveServiceBindings, t as discoverRoutes } from "../_chunks/routes-BWi7h2xb.js";
|
|
13
13
|
import { i as findFiles, t as DEFAULT_DO_PATTERN } from "../_chunks/glob-CmQOvunB.js";
|
|
14
14
|
import { a as isRemoteModeActive, i as getRemoteModeStatus } from "../_chunks/remote-config-D39BY9ji.js";
|
|
15
15
|
import { t as bundleWorkflowEntrypointScript } from "../_chunks/local-workflow-entrypoints-Wip3o1u8.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-package.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-package.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-package.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-package.ts"],"names":[],"mappings":"AA2FA;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA2DlF"}
|
package/dist/vite/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as devflarePlugin, c as getDevflareConfigs, i as writeGeneratedViteConfig, n as resolveEffectiveViteProject, o as getPluginContext, r as resolveViteUserConfig, s as getCloudflareConfig, t as hasInlineViteConfig } from "../_chunks/vite-
|
|
1
|
+
import { a as devflarePlugin, c as getDevflareConfigs, i as writeGeneratedViteConfig, n as resolveEffectiveViteProject, o as getPluginContext, r as resolveViteUserConfig, s as getCloudflareConfig, t as hasInlineViteConfig } from "../_chunks/vite-BszZvrKL.js";
|
|
2
2
|
export { devflarePlugin as default, devflarePlugin, getCloudflareConfig, getDevflareConfigs, getPluginContext, hasInlineViteConfig, resolveEffectiveViteProject, resolveViteUserConfig, writeGeneratedViteConfig };
|
package/package.json
CHANGED