@dbt-tools/web 0.6.1 → 0.6.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/README.md +28 -25
- package/dist/assets/{analysis.worker-BzrXut-o.js → analysis.worker-43rj6paY.js} +1 -1
- package/dist/assets/index-CQwlMVeT.js +36 -0
- package/dist/favicon.svg +11 -0
- package/dist/index.html +2 -2
- package/dist-serve/favicon.svg +11 -0
- package/dist-serve/server/cli.js +268 -78
- package/package.json +3 -3
- package/dist/assets/app-logo-ByfNNtT8.svg +0 -30
- package/dist/assets/index-WFlxSrs-.js +0 -36
package/README.md
CHANGED
|
@@ -34,13 +34,16 @@ Or without a global install:
|
|
|
34
34
|
npx @dbt-tools/web --target /path/to/your/dbt/target
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`npx` invokes the package’s binary (`dbt-tools-web`).
|
|
37
|
+
`npx` invokes the package’s binary (`dbt-tools-web`). Run **`dbt-tools-web --help`** for the full list. Common flags:
|
|
38
38
|
|
|
39
|
-
| Flag
|
|
40
|
-
|
|
|
41
|
-
| `--target <
|
|
42
|
-
| `--
|
|
43
|
-
| `--
|
|
39
|
+
| Flag | Description |
|
|
40
|
+
| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
41
|
+
| `--dbt-target <target>` | Artifact root: local path, `s3://`, or `gs://` (env: `DBT_TOOLS_DBT_TARGET`) |
|
|
42
|
+
| `--target <dir>` / `-t` | Alias for **local** `--dbt-target` (also sets `DBT_TOOLS_TARGET_DIR`) |
|
|
43
|
+
| `--gcs-impersonate-service-account`, `--gcs-project-id`, `--s3-region`, `--s3-endpoint` | Remote client settings (provider must match target URI) |
|
|
44
|
+
| `--port <n>` / `-p` | Listen port (default **3000**) |
|
|
45
|
+
| `--version` / `-V` | Print package version |
|
|
46
|
+
| `--help` / `-h` | Usage |
|
|
44
47
|
|
|
45
48
|
The server listens on **127.0.0.1** and prints the URL (e.g. `http://127.0.0.1:3000`). Open that URL in your browser manually (`open`, `xdg-open`, or your desktop environment).
|
|
46
49
|
|
|
@@ -94,12 +97,18 @@ Heavy analysis runs in a **web worker** (browser-safe shared library). The same
|
|
|
94
97
|
|
|
95
98
|
## Configuration (`dbt-tools-web` and production server)
|
|
96
99
|
|
|
100
|
+
**CLI flags** (see `dbt-tools-web --help`) mirror **`dbt-tools-mcp`** for artifact root and remote client settings: `--dbt-target`, `--gcs-project-id`, `--gcs-impersonate-service-account`, `--s3-region`, `--s3-endpoint`, plus `--port`, `-V` / `--version`. **`--target`** remains an alias for a **local** directory (sets `DBT_TOOLS_TARGET_DIR`). Flags override matching env vars when both are set.
|
|
101
|
+
|
|
97
102
|
Set these in the environment for the **Node process** that runs `dbt-tools-web` (not in the browser):
|
|
98
103
|
|
|
99
|
-
| Variable
|
|
100
|
-
|
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
104
|
+
| Variable | Description |
|
|
105
|
+
| ----------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
106
|
+
| `DBT_TOOLS_DBT_TARGET` | Artifact root at startup (local path, `s3://`, or `gs://`); same as `--dbt-target` |
|
|
107
|
+
| `DBT_TOOLS_TARGET_DIR` | Local directory alias (legacy; use `--target` or local `--dbt-target`) |
|
|
108
|
+
| `DBT_TOOLS_GCS_PROJECT_ID` | GCS client project (`gs://` targets) |
|
|
109
|
+
| `DBT_TOOLS_GCS_IMPERSONATE_SERVICE_ACCOUNT` | GCS impersonation principal (`gs://` targets) |
|
|
110
|
+
| `DBT_TOOLS_S3_REGION` / `DBT_TOOLS_S3_ENDPOINT` | S3 client settings (`s3://` targets) |
|
|
111
|
+
| `DBT_TOOLS_DEBUG` | Set to `1` for server-side debug logs |
|
|
103
112
|
|
|
104
113
|
**Client:** add **`?debug=1`** to the URL for browser console debug logging.
|
|
105
114
|
|
|
@@ -107,7 +116,7 @@ Set these in the environment for the **Node process** that runs `dbt-tools-web`
|
|
|
107
116
|
|
|
108
117
|
### Remote artifact sources
|
|
109
118
|
|
|
110
|
-
Use the in-app **Load artifacts** panel
|
|
119
|
+
Use **`--dbt-target`** / **`DBT_TOOLS_DBT_TARGET`** at startup to preload local or remote (`s3://`, `gs://`) artifacts, or use the in-app **Load artifacts** panel to switch later. The dev server and **`dbt-tools-web`** list keys under remote prefixes, **poll** for changes, and surface newer artifact versions **without switching your selected location automatically**. Credentials stay in the **Node process** (AWS default chain, GCS ADC / `GOOGLE_APPLICATION_CREDENTIALS`), not in the browser.
|
|
111
120
|
|
|
112
121
|
### Vite dev environment reference (monorepo)
|
|
113
122
|
|
|
@@ -126,7 +135,7 @@ When **`DBT_TOOLS_TARGET_DIR`** is set, Vite serves `/api/...` like the publishe
|
|
|
126
135
|
|
|
127
136
|
### Published server vs static Docker image
|
|
128
137
|
|
|
129
|
-
- **`dbt-tools-web`** (npm): Node HTTP server + static `dist/` + artifact middleware. Honors **`DBT_TOOLS_TARGET_DIR`**,
|
|
138
|
+
- **`dbt-tools-web`** (npm): Node HTTP server + static `dist/` + artifact middleware. Honors **`DBT_TOOLS_DBT_TARGET`** / **`DBT_TOOLS_TARGET_DIR`**, remote client env vars, and **`DBT_TOOLS_DEBUG`**. Does **not** use Vite file-watch env vars.
|
|
130
139
|
- **Dockerfile (nginx):** builds static **`dist/`** and serves it with **nginx**. There is **no** Node artifact middleware in that image unless you change the deployment shape, so the same **`DBT_TOOLS_*`** server env vars **do not apply** to that container as shipped.
|
|
131
140
|
|
|
132
141
|
### Build static image (monorepo)
|
|
@@ -245,34 +254,28 @@ DBT_TOOLS_WATCH=0 DBT_TOOLS_TARGET_DIR=./target pnpm dev
|
|
|
245
254
|
|
|
246
255
|
To smoke-test the published **`dbt-tools-web`** entrypoint and tarball layout **without publishing to the public npm registry**:
|
|
247
256
|
|
|
248
|
-
- **Recommended (matches CI):** from the **repository root** after `pnpm install`, run Verdaccio, publish
|
|
257
|
+
- **Recommended (matches CI):** from the **repository root** after `pnpm install`, run Verdaccio, publish **`@dbt-tools/core` first** (same semver as web), then `@dbt-tools/web`, pack, and smoke via `npm install` with `NPM_CONFIG_REGISTRY` pointing at that registry. `dbt-artifacts-parser` is resolved from npm:
|
|
249
258
|
|
|
250
259
|
```bash
|
|
251
260
|
bash scripts/smoke-npx-with-verdaccio.sh
|
|
252
261
|
```
|
|
253
262
|
|
|
254
|
-
This avoids **`No matching version found for @dbt-tools/core@…`** when
|
|
263
|
+
This avoids **`No matching version found for @dbt-tools/core@…`** and stale **npmjs** `core@0.6.1` without entrypoint exports when your branch adds new `@dbt-tools/core` APIs (packed web lists `"@dbt-tools/core": "0.6.2"`).
|
|
255
264
|
|
|
256
|
-
- **Manual pack only** (only reliable if
|
|
265
|
+
- **Manual pack only** (only reliable if `@dbt-tools/core@<version>` exists on the registry you use, or set `NPM_CONFIG_REGISTRY` accordingly):
|
|
257
266
|
|
|
258
267
|
```bash
|
|
259
268
|
pnpm --filter @dbt-tools/web pack
|
|
269
|
+
export NPM_CONFIG_REGISTRY=http://127.0.0.1:4873 # if using local Verdaccio
|
|
270
|
+
pnpm --filter @dbt-tools/web run smoke:npx-tgz
|
|
260
271
|
```
|
|
261
272
|
|
|
262
273
|
`prepack` runs the full web build and writes **`dbt-tools-web-<version>.tgz` at the repo root** (the file is gitignored).
|
|
263
274
|
|
|
264
|
-
- **Empty directory**
|
|
265
|
-
|
|
266
|
-
```bash
|
|
267
|
-
cd "$(mktemp -d)"
|
|
268
|
-
# After copying the .tgz into this directory (adjust version to match package.json):
|
|
269
|
-
npx -y ./dbt-tools-web-0.4.1.tgz -- --help
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
If you pass a **bare absolute path** to the tarball, some `npx` versions try to execute it as a shell script and fail (`Permission denied`). Prefer either a **relative** `./…tgz` path or an explicit package spec:
|
|
275
|
+
- **Empty directory** (smoke script uses `npm install` + `node_modules/.bin/dbt-tools-web`, not bare `npx` on the tarball path):
|
|
273
276
|
|
|
274
277
|
```bash
|
|
275
|
-
|
|
278
|
+
REPO_ROOT=/path/to/dbt-tools-ts bash packages/web/scripts/smoke-npx-packed-tarball.sh
|
|
276
279
|
```
|
|
277
280
|
|
|
278
281
|
### Project layout (abridged)
|