@emeryld/manager 0.4.3 → 0.4.5
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.
|
@@ -201,7 +201,7 @@ function formatVariantLines(variants, selected) {
|
|
|
201
201
|
lines.push(`${pointer}${numberLabel}. ${label} ${meta}`);
|
|
202
202
|
});
|
|
203
203
|
lines.push('');
|
|
204
|
-
lines.push(colors.dim('Use ↑/↓ (or j/k) to move, digits (1-9,0 for 10) to
|
|
204
|
+
lines.push(colors.dim('Use ↑/↓ (or j/k) to move, digits (1-9,0 for 10) to run instantly, Enter to confirm, Esc/Ctrl+C to exit.'));
|
|
205
205
|
return lines;
|
|
206
206
|
}
|
|
207
207
|
function renderInteractiveList(lines, previousLineCount) {
|
|
@@ -281,7 +281,7 @@ async function promptForVariant() {
|
|
|
281
281
|
render();
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
-
if (
|
|
284
|
+
if (buffer.length === 1 && (buffer[0] === 0x0d || buffer[0] === 0x0a)) {
|
|
285
285
|
commitSelection(VARIANTS[selectedIndex]);
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
@@ -306,6 +306,10 @@ async function promptForTargetDir(fallback) {
|
|
|
306
306
|
const normalized = answer || fallback;
|
|
307
307
|
return path.resolve(workspaceRoot, normalized);
|
|
308
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Solution #1: always build the workspace dependency graph after install.
|
|
311
|
+
* This prevents workspace-unbuilt dist/types issues for workspace:* deps.
|
|
312
|
+
*/
|
|
309
313
|
async function postCreateTasks(targetDir, options) {
|
|
310
314
|
if (options?.skipInstall) {
|
|
311
315
|
logGlobal('Skipping pnpm install (flag).', colors.dim);
|
|
@@ -323,6 +327,27 @@ async function postCreateTasks(targetDir, options) {
|
|
|
323
327
|
logGlobal('Skipping build (flag).', colors.dim);
|
|
324
328
|
return;
|
|
325
329
|
}
|
|
330
|
+
// Prefer: build deps of the new package (pkg + its workspace deps)
|
|
331
|
+
try {
|
|
332
|
+
if (options?.pkgName) {
|
|
333
|
+
logGlobal(`Building workspace deps for ${options.pkgName}…`, colors.cyan);
|
|
334
|
+
await runCommand('pnpm', ['-r', '--filter', `${options.pkgName}...`, 'build'], workspaceRoot);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
logGlobal(`Filtered workspace build failed; will try full workspace build: ${error instanceof Error ? error.message : String(error)}`, colors.yellow);
|
|
340
|
+
}
|
|
341
|
+
// Fallback: build everything
|
|
342
|
+
try {
|
|
343
|
+
logGlobal('Building full workspace…', colors.cyan);
|
|
344
|
+
await runCommand('pnpm', ['-r', 'build'], workspaceRoot);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
logGlobal(`Full workspace build failed; falling back to building only the new package: ${error instanceof Error ? error.message : String(error)}`, colors.yellow);
|
|
349
|
+
}
|
|
350
|
+
// Final fallback (old behavior): build only the new package if it has a build script
|
|
326
351
|
try {
|
|
327
352
|
const pkgJsonPath = path.join(targetDir, 'package.json');
|
|
328
353
|
const pkgRaw = await readFile(pkgJsonPath, 'utf8');
|
|
@@ -366,6 +391,7 @@ export async function createRrrPackage(options = {}) {
|
|
|
366
391
|
await postCreateTasks(target.targetDir, {
|
|
367
392
|
skipInstall: options.skipInstall,
|
|
368
393
|
skipBuild: options.skipBuild ?? options.skipInstall,
|
|
394
|
+
pkgName: target.pkgName,
|
|
369
395
|
});
|
|
370
396
|
logGlobal('Scaffold complete. Install/build steps were attempted; ready to run!', colors.green);
|
|
371
397
|
}
|
|
@@ -10,9 +10,22 @@ const CONTRACT_SCRIPTS = [
|
|
|
10
10
|
'clean',
|
|
11
11
|
'test',
|
|
12
12
|
];
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* IMPORTANT:
|
|
15
|
+
* @emeryld/rrroutes-contract appears to ship types that may not expose these as named exports
|
|
16
|
+
* in some module shapes (CJS export= or default export). To make scaffolds compile reliably,
|
|
17
|
+
* we import as a namespace and then grab from either `default` or the namespace object.
|
|
18
|
+
*/
|
|
19
|
+
export const CONTRACT_TS = `import * as rrroutesContract from '@emeryld/rrroutes-contract'
|
|
14
20
|
import { z } from 'zod'
|
|
15
21
|
|
|
22
|
+
const api = (rrroutesContract as any).default ?? rrroutesContract
|
|
23
|
+
const { defineSocketEvents, finalize, resource } = api as {
|
|
24
|
+
defineSocketEvents: (...args: any[]) => any
|
|
25
|
+
finalize: (...args: any[]) => any
|
|
26
|
+
resource: (...args: any[]) => any
|
|
27
|
+
}
|
|
28
|
+
|
|
16
29
|
const routes = resource('/api')
|
|
17
30
|
.sub(
|
|
18
31
|
resource('health')
|
|
@@ -90,7 +103,10 @@ function contractPackageJson(name) {
|
|
|
90
103
|
import: './dist/index.js',
|
|
91
104
|
},
|
|
92
105
|
},
|
|
93
|
-
|
|
106
|
+
// ✅ Solution #2: dev continuously emits dist/*.js + dist/*.d.ts
|
|
107
|
+
scripts: baseScripts('tsc -p tsconfig.json --watch --preserveWatchOutput'),
|
|
108
|
+
// You can keep this pinned if you want, but the import strategy above prevents breakage
|
|
109
|
+
// across different module export shapes.
|
|
94
110
|
dependencies: {
|
|
95
111
|
'@emeryld/rrroutes-contract': '^2.5.2',
|
|
96
112
|
zod: '^4.2.1',
|