@tdk-landscape/tdk-cli-core 1.3.71 → 1.3.72
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/CHANGELOG.md +4 -0
- package/cli/dist/commands/doctor.js +9 -2
- package/cli/dist/utils/doctor-runtime.js +24 -16
- package/cli/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ Notable changes to the `tdk` CLI. Versions match [npm](https://www.npmjs.com/pac
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
- `tdk doctor` no longer fails with "Verdaccio is not reachable" when the project config enables Verdaccio but no Premium license grants it. TDK does not start Verdaccio in that case, so the check could never pass; it is now skipped with a note. A registry your own `.npmrc` points at (`:4873`) is still checked. Found by the ERP CI workflow.
|
|
8
|
+
|
|
9
|
+
## 1.3.71 (2026-09-28)
|
|
10
|
+
|
|
7
11
|
- `tdk project` in a freshly cloned repo (one that already has `.tdk/project.json`) now creates the missing `.env` with working defaults. Before, it regenerated the configs but left no `.env`, and `tdk doctor` then failed with "set VERDACCIO_URL_DOCKER=<value>". Doctor now says to run `tdk project` when there is no `.env` at all. Found by the ERP CI workflow.
|
|
8
12
|
|
|
9
13
|
## 1.3.70 (2026-09-28)
|
|
@@ -3,8 +3,9 @@ import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
|
3
3
|
import { dirname, join, normalize } from "node:path";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import { hasVerdaccioLicense } from "../generator/extension-fetch.js";
|
|
6
7
|
import { MASTER_CONFIG_FILES, QUICKSTART_DOCS_URL, REQUIRED_PACKAGE_SCRIPTS, } from "../utils/constants.js";
|
|
7
|
-
import { checkHealthRoutes, checkHostPorts, checkIngressPorts, checkPrivateNpmRegistry, checkTiltResourceHealth, summarizeServiceProbes, } from "../utils/doctor-runtime.js";
|
|
8
|
+
import { checkHealthRoutes, checkHostPorts, checkIngressPorts, checkPrivateNpmRegistry, checkTiltResourceHealth, projectConfigEnablesVerdaccio, summarizeServiceProbes, } from "../utils/doctor-runtime.js";
|
|
8
9
|
import { validateEnvFile } from "../utils/env-validator.js";
|
|
9
10
|
import { formatCount } from "../utils/formatting.js";
|
|
10
11
|
import { findProjectRoot } from "../utils/paths.js";
|
|
@@ -755,7 +756,13 @@ export const doctorCommand = new Command("doctor")
|
|
|
755
756
|
// Preflight: a local Postgres or web server on 5432/80/443.
|
|
756
757
|
() => checkHostPorts(),
|
|
757
758
|
// Preflight: Verdaccio down causes ImageBuild bun install ConnectionRefused.
|
|
758
|
-
|
|
759
|
+
async () => {
|
|
760
|
+
const root = findProjectRoot() ?? process.cwd();
|
|
761
|
+
const licensed = projectConfigEnablesVerdaccio(root)
|
|
762
|
+
? await hasVerdaccioLicense(root)
|
|
763
|
+
: true;
|
|
764
|
+
return checkPrivateNpmRegistry(execSync, root, undefined, licensed);
|
|
765
|
+
},
|
|
759
766
|
// Runtime checks: skip gracefully if the stack isn't started yet.
|
|
760
767
|
checkContainerResourceHealth,
|
|
761
768
|
// When Tilt is up, surface red resources (Traefik/apps never started).
|
|
@@ -175,23 +175,20 @@ export function summarizeTiltBuildError(error) {
|
|
|
175
175
|
export function isRegistryRelatedBuildError(error) {
|
|
176
176
|
return /ConnectionRefused downloading package manifest|Verdaccio|private registry|dependency install failed during ImageBuild|install-deps\.sh|bun install/i.test(error);
|
|
177
177
|
}
|
|
178
|
-
export function
|
|
178
|
+
export function projectConfigEnablesVerdaccio(projectRoot = findProjectRoot() ?? process.cwd()) {
|
|
179
179
|
const projectJsonPath = join(projectRoot, ".tdk", "project.json");
|
|
180
|
-
if (existsSync(projectJsonPath))
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
if (Object.values(parsed.phases ?? {}).some((phase) => (phase.enabledStacks ?? []).includes("verdaccio"))) {
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
catch {
|
|
191
|
-
// Fall through to npmrc heuristics.
|
|
192
|
-
}
|
|
180
|
+
if (!existsSync(projectJsonPath))
|
|
181
|
+
return false;
|
|
182
|
+
try {
|
|
183
|
+
const parsed = JSON.parse(readFileSync(projectJsonPath, "utf-8"));
|
|
184
|
+
return (parsed.optional_infra?.verdaccio === true ||
|
|
185
|
+
Object.values(parsed.phases ?? {}).some((phase) => (phase.enabledStacks ?? []).includes("verdaccio")));
|
|
193
186
|
}
|
|
194
|
-
|
|
187
|
+
catch {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function npmrcPointsAtVerdaccio(projectRoot) {
|
|
195
192
|
for (const candidate of [join(projectRoot, ".npmrc"), join(projectRoot, "package.json")]) {
|
|
196
193
|
if (!existsSync(candidate))
|
|
197
194
|
continue;
|
|
@@ -207,13 +204,24 @@ export function projectExpectsVerdaccio(projectRoot = findProjectRoot() ?? proce
|
|
|
207
204
|
}
|
|
208
205
|
return false;
|
|
209
206
|
}
|
|
207
|
+
export function projectExpectsVerdaccio(projectRoot = findProjectRoot() ?? process.cwd()) {
|
|
208
|
+
return projectConfigEnablesVerdaccio(projectRoot) || npmrcPointsAtVerdaccio(projectRoot);
|
|
209
|
+
}
|
|
210
210
|
/**
|
|
211
211
|
* When the project uses a local Verdaccio registry, fail early with a clear
|
|
212
212
|
* fix instead of only showing truncated ImageBuild exit codes later.
|
|
213
213
|
*/
|
|
214
214
|
export function checkPrivateNpmRegistry(exec = execSync, projectRoot = findProjectRoot() ?? process.cwd(), registryUrl = process.env.VERDACCIO_URL ??
|
|
215
215
|
process.env.NPM_REGISTRY_URL ??
|
|
216
|
-
DEFAULT_VERDACCIO_URL) {
|
|
216
|
+
DEFAULT_VERDACCIO_URL, verdaccioLicensed = true) {
|
|
217
|
+
if (!verdaccioLicensed && !npmrcPointsAtVerdaccio(projectRoot)) {
|
|
218
|
+
return {
|
|
219
|
+
name: "Private npm registry",
|
|
220
|
+
didPass: true,
|
|
221
|
+
isSkipped: true,
|
|
222
|
+
message: "Verdaccio is enabled in the project config but needs a Premium license, so TDK will not start it - skipped",
|
|
223
|
+
};
|
|
224
|
+
}
|
|
217
225
|
if (!projectExpectsVerdaccio(projectRoot)) {
|
|
218
226
|
return {
|
|
219
227
|
name: "Private npm registry",
|
package/cli/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tdk-landscape/tdk-cli-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.72",
|
|
4
4
|
"description": "Run 100 microservices on a 16 GB laptop without Kubernetes. Scaffold services and run them locally with hot reload, built on Tilt.",
|
|
5
5
|
"homepage": "https://tdk-landscape.github.io/tdk-website",
|
|
6
6
|
"repository": {
|