@frontman-ai/nextjs 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/dist/cli.js +39 -14
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -648,18 +648,43 @@ async function detectNextVersion(projectDir) {
648
648
  }
649
649
  }
650
650
  async function detectPackageManager(projectDir) {
651
- let bunLock = Nodepath2.join(projectDir, "bun.lockb");
652
- let pnpmLock = Nodepath2.join(projectDir, "pnpm-lock.yaml");
653
- let yarnLock = Nodepath2.join(projectDir, "yarn.lock");
654
- let npmLock = Nodepath2.join(projectDir, "package-lock.json");
655
- if (await fileExists(bunLock)) {
656
- return "Bun";
657
- } else if (await fileExists(pnpmLock)) {
658
- return "Pnpm";
659
- } else if (await fileExists(yarnLock)) {
660
- return "Yarn";
651
+ let checkDir = async (dir) => {
652
+ let bunLock = Nodepath2.join(dir, "bun.lockb");
653
+ let pnpmLock = Nodepath2.join(dir, "pnpm-lock.yaml");
654
+ let yarnLock = Nodepath2.join(dir, "yarn.lock");
655
+ let npmLock = Nodepath2.join(dir, "package-lock.json");
656
+ if (await fileExists(bunLock)) {
657
+ return "Bun";
658
+ } else if (await fileExists(pnpmLock)) {
659
+ return "Pnpm";
660
+ } else if (await fileExists(yarnLock)) {
661
+ return "Yarn";
662
+ } else if (await fileExists(npmLock)) {
663
+ return "Npm";
664
+ } else {
665
+ return;
666
+ }
667
+ };
668
+ let pm = await checkDir(projectDir);
669
+ if (pm !== void 0) {
670
+ return pm;
671
+ }
672
+ let parentDir = Nodepath2.dirname(projectDir);
673
+ if (parentDir === projectDir) {
674
+ return "Npm";
675
+ }
676
+ let pm$1 = await checkDir(parentDir);
677
+ if (pm$1 !== void 0) {
678
+ return pm$1;
679
+ }
680
+ let grandparentDir = Nodepath2.dirname(parentDir);
681
+ if (grandparentDir === parentDir) {
682
+ return "Npm";
683
+ }
684
+ let pm$2 = await checkDir(grandparentDir);
685
+ if (pm$2 !== void 0) {
686
+ return pm$2;
661
687
  } else {
662
- await fileExists(npmLock);
663
688
  return "Npm";
664
689
  }
665
690
  }
@@ -747,11 +772,11 @@ function getPackageManagerCommand(pm) {
747
772
  case "Npm":
748
773
  return "npm";
749
774
  case "Yarn":
750
- return "yarn";
775
+ return "npx yarn";
751
776
  case "Pnpm":
752
- return "pnpm";
777
+ return "npx pnpm";
753
778
  case "Bun":
754
- return "bun";
779
+ return "npx bun";
755
780
  }
756
781
  }
757
782
  function getInstallArgs(pm, isDevOpt) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontman-ai/nextjs",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Next.js integration for Frontman - AI-powered development tools and observability",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",