@emeryld/manager 0.4.3 → 0.4.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.
|
@@ -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
|
+
* ✅ Build solution #1: after install, build the workspace graph (or at least deps)
|
|
311
|
+
* ✅ Keeps a safe fallback to the old "build just the new package" behavior.
|
|
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 building the dependency graph rooted at the new package (fast),
|
|
331
|
+
// fall back to building the whole workspace, then fall back to old behavior.
|
|
332
|
+
try {
|
|
333
|
+
if (options?.pkgName) {
|
|
334
|
+
logGlobal(`Building workspace deps for ${options.pkgName}…`, colors.cyan);
|
|
335
|
+
await runCommand('pnpm', ['-r', '--filter', `${options.pkgName}...`, 'build'], workspaceRoot);
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
logGlobal(`Filtered workspace build failed; will try full workspace build: ${error instanceof Error ? error.message : String(error)}`, colors.yellow);
|
|
341
|
+
}
|
|
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
|
+
// Old behavior fallback: 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
|
}
|
|
@@ -90,7 +90,8 @@ function contractPackageJson(name) {
|
|
|
90
90
|
import: './dist/index.js',
|
|
91
91
|
},
|
|
92
92
|
},
|
|
93
|
-
|
|
93
|
+
// ✅ Dev now *builds/updates dist + .d.ts continuously*
|
|
94
|
+
scripts: baseScripts('tsc -p tsconfig.json --watch --preserveWatchOutput'),
|
|
94
95
|
dependencies: {
|
|
95
96
|
'@emeryld/rrroutes-contract': '^2.5.2',
|
|
96
97
|
zod: '^4.2.1',
|