@donotdev/cli 0.0.29 → 0.0.31

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.
Files changed (37) hide show
  1. package/dependencies-matrix.json +28 -29
  2. package/dist/bin/commands/build.js +17 -12
  3. package/dist/bin/commands/bump.js +422 -185
  4. package/dist/bin/commands/cacheout.js +17 -12
  5. package/dist/bin/commands/coach.js +17 -12
  6. package/dist/bin/commands/create-app.js +17 -12
  7. package/dist/bin/commands/create-project.js +17 -12
  8. package/dist/bin/commands/db.js +17 -12
  9. package/dist/bin/commands/deploy.js +17 -12
  10. package/dist/bin/commands/dev.js +17 -12
  11. package/dist/bin/commands/doctor.js +17 -12
  12. package/dist/bin/commands/emu.js +17 -12
  13. package/dist/bin/commands/format.js +17 -12
  14. package/dist/bin/commands/get-demo.js +17 -12
  15. package/dist/bin/commands/make-admin.js +17 -12
  16. package/dist/bin/commands/preview.js +17 -12
  17. package/dist/bin/commands/seed.js +17 -12
  18. package/dist/bin/commands/setup-cicd.js +17 -12
  19. package/dist/bin/commands/setup.js +17 -12
  20. package/dist/bin/commands/staging.js +17 -12
  21. package/dist/bin/commands/sync-secrets.js +17 -12
  22. package/dist/bin/commands/type-check.js +17 -12
  23. package/dist/bin/commands/wai.js +17 -12
  24. package/dist/bin/dndev.js +1 -1
  25. package/dist/bin/donotdev.js +1 -1
  26. package/dist/index.js +17 -12
  27. package/package.json +1 -1
  28. package/templates/app-next/src/globals.css.example +3 -2
  29. package/templates/overlay-supabase/src/config/providers.expo.ts.example +2 -0
  30. package/templates/overlay-supabase/src/config/providers.ts.example +2 -0
  31. package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +58 -0
  32. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +50 -0
  33. package/templates/root-consumer/.claude/skills/design/SKILL.md.example +46 -0
  34. package/templates/root-consumer/.claude/skills/design/output-template.md +35 -0
  35. package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +70 -0
  36. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +76 -0
  37. package/templates/root-consumer/.claude/skills/techdebt/SKILL.md.example +46 -0
@@ -6368,7 +6368,7 @@ import {
6368
6368
  sep,
6369
6369
  extname
6370
6370
  } from "node:path";
6371
- import { fileURLToPath } from "node:url";
6371
+ import "node:url";
6372
6372
  function safeExecuteAsync(fn, message) {
6373
6373
  return fn().catch((error2) => {
6374
6374
  throw new Error(
@@ -7295,19 +7295,24 @@ var init_PathResolver = __esm({
7295
7295
  return resolved;
7296
7296
  }
7297
7297
  /**
7298
- * Get path to empty.js module for optional dependency aliasing
7299
- * Used by Vite and Turbopack to alias missing optional deps
7300
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7301
- * @returns Package specifier or absolute path to empty.js
7298
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7299
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7300
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7301
+ * condition (.cjs), so we derive the ESM path from it.
7302
7302
  */
7303
- getEmptyModulePath(returnPackageSpecifier = false) {
7304
- if (returnPackageSpecifier) {
7305
- return "@donotdev/core/empty";
7306
- }
7303
+ getEmptyModulePath() {
7304
+ const cjsPath = this.getEmptyCjsModulePath();
7305
+ return cjsPath.replace(/\.cjs$/, ".js");
7306
+ }
7307
+ /**
7308
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7309
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7310
+ * exports, so any named import resolves.
7311
+ */
7312
+ getEmptyCjsModulePath() {
7307
7313
  const resolved = this.resolvePackage("@donotdev/core/empty");
7308
- if (resolved) return resolved;
7309
- const thisDir = dirname(fileURLToPath(import.meta.url));
7310
- return this.normalizePath(join(thisDir, "../empty.js"));
7314
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7315
+ return resolved;
7311
7316
  }
7312
7317
  // === PRIVATE METHODS ===
7313
7318
  /**
@@ -6382,7 +6382,7 @@ import {
6382
6382
  sep,
6383
6383
  extname
6384
6384
  } from "node:path";
6385
- import { fileURLToPath } from "node:url";
6385
+ import "node:url";
6386
6386
  function safeExecuteAsync(fn, message) {
6387
6387
  return fn().catch((error2) => {
6388
6388
  throw new Error(
@@ -7309,19 +7309,24 @@ var init_PathResolver = __esm({
7309
7309
  return resolved;
7310
7310
  }
7311
7311
  /**
7312
- * Get path to empty.js module for optional dependency aliasing
7313
- * Used by Vite and Turbopack to alias missing optional deps
7314
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7315
- * @returns Package specifier or absolute path to empty.js
7312
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7313
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7314
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7315
+ * condition (.cjs), so we derive the ESM path from it.
7316
7316
  */
7317
- getEmptyModulePath(returnPackageSpecifier = false) {
7318
- if (returnPackageSpecifier) {
7319
- return "@donotdev/core/empty";
7320
- }
7317
+ getEmptyModulePath() {
7318
+ const cjsPath = this.getEmptyCjsModulePath();
7319
+ return cjsPath.replace(/\.cjs$/, ".js");
7320
+ }
7321
+ /**
7322
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7323
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7324
+ * exports, so any named import resolves.
7325
+ */
7326
+ getEmptyCjsModulePath() {
7321
7327
  const resolved = this.resolvePackage("@donotdev/core/empty");
7322
- if (resolved) return resolved;
7323
- const thisDir = dirname(fileURLToPath(import.meta.url));
7324
- return this.normalizePath(join(thisDir, "../empty.js"));
7328
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7329
+ return resolved;
7325
7330
  }
7326
7331
  // === PRIVATE METHODS ===
7327
7332
  /**
@@ -6769,7 +6769,7 @@ import {
6769
6769
  sep,
6770
6770
  extname
6771
6771
  } from "node:path";
6772
- import { fileURLToPath } from "node:url";
6772
+ import "node:url";
6773
6773
  function safeExecuteAsync(fn, message) {
6774
6774
  return fn().catch((error2) => {
6775
6775
  throw new Error(
@@ -7696,19 +7696,24 @@ var init_PathResolver = __esm({
7696
7696
  return resolved;
7697
7697
  }
7698
7698
  /**
7699
- * Get path to empty.js module for optional dependency aliasing
7700
- * Used by Vite and Turbopack to alias missing optional deps
7701
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7702
- * @returns Package specifier or absolute path to empty.js
7699
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7700
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7701
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7702
+ * condition (.cjs), so we derive the ESM path from it.
7703
7703
  */
7704
- getEmptyModulePath(returnPackageSpecifier = false) {
7705
- if (returnPackageSpecifier) {
7706
- return "@donotdev/core/empty";
7707
- }
7704
+ getEmptyModulePath() {
7705
+ const cjsPath = this.getEmptyCjsModulePath();
7706
+ return cjsPath.replace(/\.cjs$/, ".js");
7707
+ }
7708
+ /**
7709
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7710
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7711
+ * exports, so any named import resolves.
7712
+ */
7713
+ getEmptyCjsModulePath() {
7708
7714
  const resolved = this.resolvePackage("@donotdev/core/empty");
7709
- if (resolved) return resolved;
7710
- const thisDir = dirname(fileURLToPath(import.meta.url));
7711
- return this.normalizePath(join(thisDir, "../empty.js"));
7715
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7716
+ return resolved;
7712
7717
  }
7713
7718
  // === PRIVATE METHODS ===
7714
7719
  /**
@@ -6911,7 +6911,7 @@ import {
6911
6911
  sep,
6912
6912
  extname
6913
6913
  } from "node:path";
6914
- import { fileURLToPath } from "node:url";
6914
+ import "node:url";
6915
6915
  function safeExecuteAsync(fn, message) {
6916
6916
  return fn().catch((error2) => {
6917
6917
  throw new Error(
@@ -7838,19 +7838,24 @@ var init_PathResolver = __esm({
7838
7838
  return resolved;
7839
7839
  }
7840
7840
  /**
7841
- * Get path to empty.js module for optional dependency aliasing
7842
- * Used by Vite and Turbopack to alias missing optional deps
7843
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7844
- * @returns Package specifier or absolute path to empty.js
7841
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7842
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7843
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7844
+ * condition (.cjs), so we derive the ESM path from it.
7845
7845
  */
7846
- getEmptyModulePath(returnPackageSpecifier = false) {
7847
- if (returnPackageSpecifier) {
7848
- return "@donotdev/core/empty";
7849
- }
7846
+ getEmptyModulePath() {
7847
+ const cjsPath = this.getEmptyCjsModulePath();
7848
+ return cjsPath.replace(/\.cjs$/, ".js");
7849
+ }
7850
+ /**
7851
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7852
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7853
+ * exports, so any named import resolves.
7854
+ */
7855
+ getEmptyCjsModulePath() {
7850
7856
  const resolved = this.resolvePackage("@donotdev/core/empty");
7851
- if (resolved) return resolved;
7852
- const thisDir = dirname(fileURLToPath(import.meta.url));
7853
- return this.normalizePath(join(thisDir, "../empty.js"));
7857
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7858
+ return resolved;
7854
7859
  }
7855
7860
  // === PRIVATE METHODS ===
7856
7861
  /**
@@ -6838,7 +6838,7 @@ import {
6838
6838
  sep,
6839
6839
  extname
6840
6840
  } from "node:path";
6841
- import { fileURLToPath } from "node:url";
6841
+ import "node:url";
6842
6842
  function safeExecuteAsync(fn, message) {
6843
6843
  return fn().catch((error2) => {
6844
6844
  throw new Error(
@@ -7765,19 +7765,24 @@ var init_PathResolver = __esm({
7765
7765
  return resolved;
7766
7766
  }
7767
7767
  /**
7768
- * Get path to empty.js module for optional dependency aliasing
7769
- * Used by Vite and Turbopack to alias missing optional deps
7770
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7771
- * @returns Package specifier or absolute path to empty.js
7768
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7769
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7770
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7771
+ * condition (.cjs), so we derive the ESM path from it.
7772
7772
  */
7773
- getEmptyModulePath(returnPackageSpecifier = false) {
7774
- if (returnPackageSpecifier) {
7775
- return "@donotdev/core/empty";
7776
- }
7773
+ getEmptyModulePath() {
7774
+ const cjsPath = this.getEmptyCjsModulePath();
7775
+ return cjsPath.replace(/\.cjs$/, ".js");
7776
+ }
7777
+ /**
7778
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7779
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7780
+ * exports, so any named import resolves.
7781
+ */
7782
+ getEmptyCjsModulePath() {
7777
7783
  const resolved = this.resolvePackage("@donotdev/core/empty");
7778
- if (resolved) return resolved;
7779
- const thisDir = dirname(fileURLToPath(import.meta.url));
7780
- return this.normalizePath(join(thisDir, "../empty.js"));
7784
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7785
+ return resolved;
7781
7786
  }
7782
7787
  // === PRIVATE METHODS ===
7783
7788
  /**
@@ -6844,7 +6844,7 @@ import {
6844
6844
  sep,
6845
6845
  extname
6846
6846
  } from "node:path";
6847
- import { fileURLToPath } from "node:url";
6847
+ import "node:url";
6848
6848
  function safeExecuteAsync(fn, message) {
6849
6849
  return fn().catch((error2) => {
6850
6850
  throw new Error(
@@ -7771,19 +7771,24 @@ var init_PathResolver = __esm({
7771
7771
  return resolved;
7772
7772
  }
7773
7773
  /**
7774
- * Get path to empty.js module for optional dependency aliasing
7775
- * Used by Vite and Turbopack to alias missing optional deps
7776
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7777
- * @returns Package specifier or absolute path to empty.js
7774
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7775
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7776
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7777
+ * condition (.cjs), so we derive the ESM path from it.
7778
7778
  */
7779
- getEmptyModulePath(returnPackageSpecifier = false) {
7780
- if (returnPackageSpecifier) {
7781
- return "@donotdev/core/empty";
7782
- }
7779
+ getEmptyModulePath() {
7780
+ const cjsPath = this.getEmptyCjsModulePath();
7781
+ return cjsPath.replace(/\.cjs$/, ".js");
7782
+ }
7783
+ /**
7784
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7785
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7786
+ * exports, so any named import resolves.
7787
+ */
7788
+ getEmptyCjsModulePath() {
7783
7789
  const resolved = this.resolvePackage("@donotdev/core/empty");
7784
- if (resolved) return resolved;
7785
- const thisDir = dirname(fileURLToPath(import.meta.url));
7786
- return this.normalizePath(join(thisDir, "../empty.js"));
7790
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7791
+ return resolved;
7787
7792
  }
7788
7793
  // === PRIVATE METHODS ===
7789
7794
  /**
@@ -6664,7 +6664,7 @@ import {
6664
6664
  sep,
6665
6665
  extname
6666
6666
  } from "node:path";
6667
- import { fileURLToPath } from "node:url";
6667
+ import "node:url";
6668
6668
  function safeExecuteAsync(fn, message) {
6669
6669
  return fn().catch((error2) => {
6670
6670
  throw new Error(
@@ -7591,19 +7591,24 @@ var init_PathResolver = __esm({
7591
7591
  return resolved;
7592
7592
  }
7593
7593
  /**
7594
- * Get path to empty.js module for optional dependency aliasing
7595
- * Used by Vite and Turbopack to alias missing optional deps
7596
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7597
- * @returns Package specifier or absolute path to empty.js
7594
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7595
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7596
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7597
+ * condition (.cjs), so we derive the ESM path from it.
7598
7598
  */
7599
- getEmptyModulePath(returnPackageSpecifier = false) {
7600
- if (returnPackageSpecifier) {
7601
- return "@donotdev/core/empty";
7602
- }
7599
+ getEmptyModulePath() {
7600
+ const cjsPath = this.getEmptyCjsModulePath();
7601
+ return cjsPath.replace(/\.cjs$/, ".js");
7602
+ }
7603
+ /**
7604
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7605
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7606
+ * exports, so any named import resolves.
7607
+ */
7608
+ getEmptyCjsModulePath() {
7603
7609
  const resolved = this.resolvePackage("@donotdev/core/empty");
7604
- if (resolved) return resolved;
7605
- const thisDir = dirname(fileURLToPath(import.meta.url));
7606
- return this.normalizePath(join(thisDir, "../empty.js"));
7610
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7611
+ return resolved;
7607
7612
  }
7608
7613
  // === PRIVATE METHODS ===
7609
7614
  /**
@@ -6397,7 +6397,7 @@ import {
6397
6397
  sep,
6398
6398
  extname
6399
6399
  } from "node:path";
6400
- import { fileURLToPath } from "node:url";
6400
+ import "node:url";
6401
6401
  function safeExecuteAsync(fn, message) {
6402
6402
  return fn().catch((error2) => {
6403
6403
  throw new Error(
@@ -7324,19 +7324,24 @@ var init_PathResolver = __esm({
7324
7324
  return resolved;
7325
7325
  }
7326
7326
  /**
7327
- * Get path to empty.js module for optional dependency aliasing
7328
- * Used by Vite and Turbopack to alias missing optional deps
7329
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7330
- * @returns Package specifier or absolute path to empty.js
7327
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7328
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7329
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7330
+ * condition (.cjs), so we derive the ESM path from it.
7331
7331
  */
7332
- getEmptyModulePath(returnPackageSpecifier = false) {
7333
- if (returnPackageSpecifier) {
7334
- return "@donotdev/core/empty";
7335
- }
7332
+ getEmptyModulePath() {
7333
+ const cjsPath = this.getEmptyCjsModulePath();
7334
+ return cjsPath.replace(/\.cjs$/, ".js");
7335
+ }
7336
+ /**
7337
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7338
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7339
+ * exports, so any named import resolves.
7340
+ */
7341
+ getEmptyCjsModulePath() {
7336
7342
  const resolved = this.resolvePackage("@donotdev/core/empty");
7337
- if (resolved) return resolved;
7338
- const thisDir = dirname(fileURLToPath(import.meta.url));
7339
- return this.normalizePath(join(thisDir, "../empty.js"));
7343
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7344
+ return resolved;
7340
7345
  }
7341
7346
  // === PRIVATE METHODS ===
7342
7347
  /**
@@ -6747,7 +6747,7 @@ import {
6747
6747
  sep,
6748
6748
  extname
6749
6749
  } from "node:path";
6750
- import { fileURLToPath } from "node:url";
6750
+ import "node:url";
6751
6751
  function safeExecuteAsync(fn, message) {
6752
6752
  return fn().catch((error2) => {
6753
6753
  throw new Error(
@@ -7674,19 +7674,24 @@ var init_PathResolver = __esm({
7674
7674
  return resolved;
7675
7675
  }
7676
7676
  /**
7677
- * Get path to empty.js module for optional dependency aliasing
7678
- * Used by Vite and Turbopack to alias missing optional deps
7679
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7680
- * @returns Package specifier or absolute path to empty.js
7677
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7678
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7679
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7680
+ * condition (.cjs), so we derive the ESM path from it.
7681
7681
  */
7682
- getEmptyModulePath(returnPackageSpecifier = false) {
7683
- if (returnPackageSpecifier) {
7684
- return "@donotdev/core/empty";
7685
- }
7682
+ getEmptyModulePath() {
7683
+ const cjsPath = this.getEmptyCjsModulePath();
7684
+ return cjsPath.replace(/\.cjs$/, ".js");
7685
+ }
7686
+ /**
7687
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7688
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7689
+ * exports, so any named import resolves.
7690
+ */
7691
+ getEmptyCjsModulePath() {
7686
7692
  const resolved = this.resolvePackage("@donotdev/core/empty");
7687
- if (resolved) return resolved;
7688
- const thisDir = dirname(fileURLToPath(import.meta.url));
7689
- return this.normalizePath(join(thisDir, "../empty.js"));
7693
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7694
+ return resolved;
7690
7695
  }
7691
7696
  // === PRIVATE METHODS ===
7692
7697
  /**
@@ -6368,7 +6368,7 @@ import {
6368
6368
  sep,
6369
6369
  extname
6370
6370
  } from "node:path";
6371
- import { fileURLToPath } from "node:url";
6371
+ import "node:url";
6372
6372
  function safeExecuteAsync(fn, message) {
6373
6373
  return fn().catch((error2) => {
6374
6374
  throw new Error(
@@ -7295,19 +7295,24 @@ var init_PathResolver = __esm({
7295
7295
  return resolved;
7296
7296
  }
7297
7297
  /**
7298
- * Get path to empty.js module for optional dependency aliasing
7299
- * Used by Vite and Turbopack to alias missing optional deps
7300
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7301
- * @returns Package specifier or absolute path to empty.js
7298
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7299
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7300
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7301
+ * condition (.cjs), so we derive the ESM path from it.
7302
7302
  */
7303
- getEmptyModulePath(returnPackageSpecifier = false) {
7304
- if (returnPackageSpecifier) {
7305
- return "@donotdev/core/empty";
7306
- }
7303
+ getEmptyModulePath() {
7304
+ const cjsPath = this.getEmptyCjsModulePath();
7305
+ return cjsPath.replace(/\.cjs$/, ".js");
7306
+ }
7307
+ /**
7308
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7309
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7310
+ * exports, so any named import resolves.
7311
+ */
7312
+ getEmptyCjsModulePath() {
7307
7313
  const resolved = this.resolvePackage("@donotdev/core/empty");
7308
- if (resolved) return resolved;
7309
- const thisDir = dirname(fileURLToPath(import.meta.url));
7310
- return this.normalizePath(join(thisDir, "../empty.js"));
7314
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7315
+ return resolved;
7311
7316
  }
7312
7317
  // === PRIVATE METHODS ===
7313
7318
  /**
@@ -6609,7 +6609,7 @@ import {
6609
6609
  sep,
6610
6610
  extname
6611
6611
  } from "node:path";
6612
- import { fileURLToPath } from "node:url";
6612
+ import "node:url";
6613
6613
  function safeExecuteAsync(fn, message) {
6614
6614
  return fn().catch((error2) => {
6615
6615
  throw new Error(
@@ -7536,19 +7536,24 @@ var init_PathResolver = __esm({
7536
7536
  return resolved;
7537
7537
  }
7538
7538
  /**
7539
- * Get path to empty.js module for optional dependency aliasing
7540
- * Used by Vite and Turbopack to alias missing optional deps
7541
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7542
- * @returns Package specifier or absolute path to empty.js
7539
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7540
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7541
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7542
+ * condition (.cjs), so we derive the ESM path from it.
7543
7543
  */
7544
- getEmptyModulePath(returnPackageSpecifier = false) {
7545
- if (returnPackageSpecifier) {
7546
- return "@donotdev/core/empty";
7547
- }
7544
+ getEmptyModulePath() {
7545
+ const cjsPath = this.getEmptyCjsModulePath();
7546
+ return cjsPath.replace(/\.cjs$/, ".js");
7547
+ }
7548
+ /**
7549
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7550
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7551
+ * exports, so any named import resolves.
7552
+ */
7553
+ getEmptyCjsModulePath() {
7548
7554
  const resolved = this.resolvePackage("@donotdev/core/empty");
7549
- if (resolved) return resolved;
7550
- const thisDir = dirname(fileURLToPath(import.meta.url));
7551
- return this.normalizePath(join(thisDir, "../empty.js"));
7555
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7556
+ return resolved;
7552
7557
  }
7553
7558
  // === PRIVATE METHODS ===
7554
7559
  /**
@@ -6832,7 +6832,7 @@ import {
6832
6832
  sep,
6833
6833
  extname
6834
6834
  } from "node:path";
6835
- import { fileURLToPath } from "node:url";
6835
+ import "node:url";
6836
6836
  function safeExecuteAsync(fn, message) {
6837
6837
  return fn().catch((error2) => {
6838
6838
  throw new Error(
@@ -7759,19 +7759,24 @@ var init_PathResolver = __esm({
7759
7759
  return resolved;
7760
7760
  }
7761
7761
  /**
7762
- * Get path to empty.js module for optional dependency aliasing
7763
- * Used by Vite and Turbopack to alias missing optional deps
7764
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7765
- * @returns Package specifier or absolute path to empty.js
7762
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7763
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7764
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7765
+ * condition (.cjs), so we derive the ESM path from it.
7766
7766
  */
7767
- getEmptyModulePath(returnPackageSpecifier = false) {
7768
- if (returnPackageSpecifier) {
7769
- return "@donotdev/core/empty";
7770
- }
7767
+ getEmptyModulePath() {
7768
+ const cjsPath = this.getEmptyCjsModulePath();
7769
+ return cjsPath.replace(/\.cjs$/, ".js");
7770
+ }
7771
+ /**
7772
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7773
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7774
+ * exports, so any named import resolves.
7775
+ */
7776
+ getEmptyCjsModulePath() {
7771
7777
  const resolved = this.resolvePackage("@donotdev/core/empty");
7772
- if (resolved) return resolved;
7773
- const thisDir = dirname(fileURLToPath(import.meta.url));
7774
- return this.normalizePath(join(thisDir, "../empty.js"));
7778
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7779
+ return resolved;
7775
7780
  }
7776
7781
  // === PRIVATE METHODS ===
7777
7782
  /**
@@ -6664,7 +6664,7 @@ import {
6664
6664
  sep,
6665
6665
  extname
6666
6666
  } from "node:path";
6667
- import { fileURLToPath } from "node:url";
6667
+ import "node:url";
6668
6668
  function safeExecuteAsync(fn, message) {
6669
6669
  return fn().catch((error2) => {
6670
6670
  throw new Error(
@@ -7591,19 +7591,24 @@ var init_PathResolver = __esm({
7591
7591
  return resolved;
7592
7592
  }
7593
7593
  /**
7594
- * Get path to empty.js module for optional dependency aliasing
7595
- * Used by Vite and Turbopack to alias missing optional deps
7596
- * @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
7597
- * @returns Package specifier or absolute path to empty.js
7594
+ * Get absolute path to empty ESM module for optional dependency aliasing.
7595
+ * Used by Vite resolveId — served directly to the browser in dev mode.
7596
+ * Note: resolvePackage uses require.resolve (CJS) which picks the "default"
7597
+ * condition (.cjs), so we derive the ESM path from it.
7598
7598
  */
7599
- getEmptyModulePath(returnPackageSpecifier = false) {
7600
- if (returnPackageSpecifier) {
7601
- return "@donotdev/core/empty";
7602
- }
7599
+ getEmptyModulePath() {
7600
+ const cjsPath = this.getEmptyCjsModulePath();
7601
+ return cjsPath.replace(/\.cjs$/, ".js");
7602
+ }
7603
+ /**
7604
+ * Get absolute path to empty CJS module for esbuild pre-bundling.
7605
+ * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
7606
+ * exports, so any named import resolves.
7607
+ */
7608
+ getEmptyCjsModulePath() {
7603
7609
  const resolved = this.resolvePackage("@donotdev/core/empty");
7604
- if (resolved) return resolved;
7605
- const thisDir = dirname(fileURLToPath(import.meta.url));
7606
- return this.normalizePath(join(thisDir, "../empty.js"));
7610
+ if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7611
+ return resolved;
7607
7612
  }
7608
7613
  // === PRIVATE METHODS ===
7609
7614
  /**