@lenne.tech/cli 1.50.2 → 1.50.3
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/build/commands/dev/up.js +7 -10
- package/build/lib/dev-patches.js +17 -9
- package/package.json +1 -1
package/build/commands/dev/up.js
CHANGED
|
@@ -252,22 +252,19 @@ const UpCommand = {
|
|
|
252
252
|
process.exit(1);
|
|
253
253
|
return 'dev up: port in use';
|
|
254
254
|
}
|
|
255
|
-
// The CLAUDE.md URL block
|
|
256
|
-
//
|
|
257
|
-
//
|
|
258
|
-
//
|
|
259
|
-
//
|
|
260
|
-
//
|
|
261
|
-
// would carry per-ticket URLs into a commit.
|
|
255
|
+
// The CLAUDE.md URL block names both addresses: the `*.localhost` name a
|
|
256
|
+
// browser opens and, for a script, the env var that carries the loopback
|
|
257
|
+
// address. Not the port itself: the base CLAUDE.md is git-tracked too, and the
|
|
258
|
+
// port differs per machine, so writing it here dirtied every checkout on each
|
|
259
|
+
// `lt dev up` (see `patchClaudeMd`). NEVER for a ticket worktree: that
|
|
260
|
+
// CLAUDE.md would carry per-ticket URLs into a commit.
|
|
262
261
|
if (!ticket) {
|
|
263
262
|
const claudeCandidates = [
|
|
264
263
|
(0, path_1.join)(layout.root, 'CLAUDE.md'),
|
|
265
264
|
...(layout.apiDir ? [(0, path_1.join)(layout.apiDir, 'CLAUDE.md')] : []),
|
|
266
265
|
...(layout.appDir ? [(0, path_1.join)(layout.appDir, 'CLAUDE.md')] : []),
|
|
267
266
|
];
|
|
268
|
-
const patched = claudeCandidates
|
|
269
|
-
.map((f) => (0, dev_patches_1.patchClaudeMd)(f, { apiPort, appPort, dbName, identity }))
|
|
270
|
-
.filter((r) => r.patched);
|
|
267
|
+
const patched = claudeCandidates.map((f) => (0, dev_patches_1.patchClaudeMd)(f, { dbName, identity })).filter((r) => r.patched);
|
|
271
268
|
if (patched.length > 0) {
|
|
272
269
|
info(colors.dim(`updated CLAUDE.md URL block in ${patched.length} file(s)`));
|
|
273
270
|
}
|
package/build/lib/dev-patches.js
CHANGED
|
@@ -125,7 +125,7 @@ function patchApiConfig(file) {
|
|
|
125
125
|
* in place.
|
|
126
126
|
*/
|
|
127
127
|
function patchClaudeMd(file, options) {
|
|
128
|
-
const {
|
|
128
|
+
const { dbName, identity } = options;
|
|
129
129
|
const startMarker = '<!-- lt-dev:url-block:start -->';
|
|
130
130
|
const endMarker = '<!-- lt-dev:url-block:end -->';
|
|
131
131
|
const apiSub = identity.subdomains.api;
|
|
@@ -155,14 +155,22 @@ function patchClaudeMd(file, options) {
|
|
|
155
155
|
// agent following it would `curl` a name that does not resolve for Node on
|
|
156
156
|
// Windows, and fail silently. The browser address stays first: it is the one a
|
|
157
157
|
// human opens.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (
|
|
165
|
-
lines.push(
|
|
158
|
+
//
|
|
159
|
+
// The loopback address is named by its env var, never by its port. This file is
|
|
160
|
+
// committed, and the internal port is allocated per machine (4000 + whatever the
|
|
161
|
+
// other registered projects took), so writing `127.0.0.1:4031` here left every
|
|
162
|
+
// checkout modified after `lt dev up`, and committing it only moved the diff to
|
|
163
|
+
// the next developer. The env var names are the same everywhere.
|
|
164
|
+
if (appSub)
|
|
165
|
+
lines.push(`- App: \`https://${appSub.hostname}\``);
|
|
166
|
+
if (apiSub)
|
|
167
|
+
lines.push(`- API: \`https://${apiSub.hostname}\``);
|
|
168
|
+
const loopbackVars = [
|
|
169
|
+
...(appSub ? ['`LT_DEV_APP_INTERNAL_URL`'] : []),
|
|
170
|
+
...(apiSub ? ['`LT_DEV_API_INTERNAL_URL`'] : []),
|
|
171
|
+
];
|
|
172
|
+
if (loopbackVars.length > 0) {
|
|
173
|
+
lines.push(`- The \`*.localhost\` names are resolved by BROWSERS. Node, \`curl\` and other tools may not resolve them (they do not on Windows), so a script uses the loopback address: ${loopbackVars.join(' / ')} (set in the processes and in \`.lt-dev/.env\`), or the \`→ 127.0.0.1:<port>\` that \`lt dev status\` prints. The port differs per machine, which is why it is not written here.`);
|
|
166
174
|
}
|
|
167
175
|
if (dbName)
|
|
168
176
|
lines.push(`- DB: \`mongodb://127.0.0.1/${dbName}\``);
|