@dbx-tools/core 0.9.121 → 0.9.123
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/README.md +17 -6
- package/index.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/src/config-utils.d.ts +2 -10
- package/lib/src/config-utils.js +7 -16
- package/lib/src/exec.d.ts +29 -39
- package/lib/src/exec.js +264 -79
- package/package.json +2 -2
- package/src/config-utils.ts +8 -18
- package/src/exec.ts +364 -132
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typescript": "^5.9.3"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@dbx-tools/shared-core": "^0.9.
|
|
28
|
+
"@dbx-tools/shared-core": "^0.9.123",
|
|
29
29
|
"extract-zip": "^2.0.1",
|
|
30
30
|
"proper-lockfile": "^4.1.2",
|
|
31
31
|
"semver": "^7.7.3",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"./package.json": "./package.json"
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
|
-
"version": "0.9.
|
|
94
|
+
"version": "0.9.123",
|
|
95
95
|
"types": "./lib/index.d.ts",
|
|
96
96
|
"dbxToolsConfig": {
|
|
97
97
|
"tags": [
|
package/src/config-utils.ts
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* read after the bundle source also missed.
|
|
12
12
|
*
|
|
13
13
|
* Inside a deployed Databricks App all three file sources are skipped by default
|
|
14
|
-
* ({@link isDatabricksAppEnv}): the platform has already turned
|
|
14
|
+
* ({@link environmentUtils.isDatabricksAppEnv}): the platform has already turned
|
|
15
|
+
* them into real
|
|
15
16
|
* environment variables, there is no bundle to validate, and the `databricks`
|
|
16
17
|
* CLI is not on the image. Boolean environment overrides can force either file
|
|
17
18
|
* source on or off when a tool needs different behavior.
|
|
@@ -256,20 +257,6 @@ export function getBundlePath(data: Record<string, unknown>, path: string): stri
|
|
|
256
257
|
return undefined;
|
|
257
258
|
}
|
|
258
259
|
|
|
259
|
-
/**
|
|
260
|
-
* Detect a Databricks App runtime from its required name, host, and port.
|
|
261
|
-
*
|
|
262
|
-
* `DBX_TOOLS_DATABRICKS_APP_ENV` takes precedence when it contains a recognized
|
|
263
|
-
* boolean value. This lets local tools emulate the deployed runtime (`true`) or
|
|
264
|
-
* lets unusual deployed processes retain local config lookup (`false`). An
|
|
265
|
-
* absent or unrecognized override falls back to structural detection.
|
|
266
|
-
*/
|
|
267
|
-
export function isDatabricksAppEnv(
|
|
268
|
-
source: Record<string, string | undefined> = process.env,
|
|
269
|
-
): boolean {
|
|
270
|
-
return environmentUtils.isDatabricksAppEnv(source);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
260
|
/** Exact, uppercase, and tokenized-uppercase names for a human-friendly key. */
|
|
274
261
|
export function environmentKeys(name: string): readonly string[] {
|
|
275
262
|
const trimmed = name.trim();
|
|
@@ -527,7 +514,8 @@ export function bundleFile(cwd?: string | null, profile?: string | null): Config
|
|
|
527
514
|
if (override === false) return undefined;
|
|
528
515
|
if (
|
|
529
516
|
override === undefined &&
|
|
530
|
-
(process.env.NODE_ENV?.trim().toLowerCase() === "production" ||
|
|
517
|
+
(process.env.NODE_ENV?.trim().toLowerCase() === "production" ||
|
|
518
|
+
environmentUtils.isDatabricksAppEnv())
|
|
531
519
|
) {
|
|
532
520
|
return undefined;
|
|
533
521
|
}
|
|
@@ -537,7 +525,8 @@ export function bundleFile(cwd?: string | null, profile?: string | null): Config
|
|
|
537
525
|
|
|
538
526
|
/** The parsed `app.yaml` / `app.yml` for `cwd`, when local App config reads are enabled. */
|
|
539
527
|
export function appFile(cwd?: string | null): ConfigFile | undefined {
|
|
540
|
-
const enabled =
|
|
528
|
+
const enabled =
|
|
529
|
+
object.toBoolean(process.env[CONFIG_APP_KEY]) ?? !environmentUtils.isDatabricksAppEnv();
|
|
541
530
|
if (!enabled) return undefined;
|
|
542
531
|
return loadAppFile(resolveWorkingDirectory(cwd));
|
|
543
532
|
}
|
|
@@ -566,7 +555,8 @@ function sourceData(
|
|
|
566
555
|
|
|
567
556
|
/** Parsed `.env` for `cwd`, or `{}`; parsed file data is cached by path. */
|
|
568
557
|
function dotenv(cwd?: string | null): Record<string, string | undefined> {
|
|
569
|
-
const enabled =
|
|
558
|
+
const enabled =
|
|
559
|
+
object.toBoolean(process.env[CONFIG_DOTENV_KEY]) ?? !environmentUtils.isDatabricksAppEnv();
|
|
570
560
|
if (!enabled) return {};
|
|
571
561
|
const resolved = resolveWorkingDirectory(cwd);
|
|
572
562
|
return loadDotenv(resolved, nodeEnvNames(process.env.NODE_ENV));
|