@designtools/shadows 0.1.14 → 0.1.15

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/dist/cli.js CHANGED
@@ -301,10 +301,26 @@ async function bootstrap(config) {
301
301
  }
302
302
  console.log("");
303
303
  const targetUrl = `http://localhost:${targetPort}`;
304
- try {
305
- await fetch(targetUrl, { signal: AbortSignal.timeout(2e3) });
304
+ let targetReachable = false;
305
+ let waited = false;
306
+ for (let attempt = 0; attempt < 15; attempt++) {
307
+ try {
308
+ await fetch(targetUrl, { signal: AbortSignal.timeout(2e3) });
309
+ targetReachable = true;
310
+ break;
311
+ } catch {
312
+ if (attempt === 0) {
313
+ process2.stdout.write(` ${dim("Waiting for dev server at " + targetUrl + "...")}`);
314
+ waited = true;
315
+ }
316
+ await new Promise((r) => setTimeout(r, 1e3));
317
+ }
318
+ }
319
+ if (waited) process2.stdout.write("\r\x1B[K");
320
+ if (targetReachable) {
306
321
  console.log(` ${green("\u2713")} Target ${targetUrl}`);
307
- } catch {
322
+ } else {
323
+ console.log("");
308
324
  console.log(` ${red("\u2717")} No dev server at ${targetUrl}`);
309
325
  console.log(` ${dim("Start your dev server first, then run this command.")}`);
310
326
  console.log(` ${dim(`Use --port to specify a different port.`)}`);
@@ -432,9 +448,9 @@ async function createToolServer(config) {
432
448
  const builtIndex = distRoot ? path4.join(distRoot, "index.html") : null;
433
449
  const hasBuiltClient = builtIndex && fs4.existsSync(builtIndex);
434
450
  if (hasBuiltClient) {
435
- app.use(express.static(distRoot));
451
+ app.use(express.static(distRoot, { dotfiles: "allow" }));
436
452
  app.use((_req, res) => {
437
- res.sendFile(builtIndex);
453
+ res.sendFile(builtIndex, { dotfiles: "allow" });
438
454
  });
439
455
  } else {
440
456
  const vite = await createViteServer({
@@ -1104,7 +1120,7 @@ function resolveBootstrapSassColors(value) {
1104
1120
  async function scanShadows(projectRoot, framework, styling) {
1105
1121
  const shadows = [];
1106
1122
  const allCssFiles = framework.cssFiles.length > 0 ? framework.cssFiles : styling.cssFiles;
1107
- const cssFilePath = allCssFiles[0] || "";
1123
+ const cssFilePath = allCssFiles[0] || styling.scssFiles?.[0] || "";
1108
1124
  const customShadows = await scanCustomShadows(projectRoot, allCssFiles);
1109
1125
  const overriddenNames = new Set(customShadows.map((s) => s.name));
1110
1126
  if (styling.type === "tailwind-v4" || styling.type === "tailwind-v3") {