@frontman-ai/nextjs 0.1.0 → 0.1.2

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 +43 -18
  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
  }
@@ -777,13 +802,6 @@ function getInstallArgs(pm, isDevOpt) {
777
802
 
778
803
  // src/cli/FrontmanNextjs__Cli__Install.res.mjs
779
804
  async function installDependencies(projectDir, packageManager, dryRun) {
780
- if (dryRun) {
781
- console.log("Would install: @frontman-ai/nextjs @opentelemetry/sdk-node");
782
- return {
783
- TAG: "Ok",
784
- _0: void 0
785
- };
786
- }
787
805
  let pm = getPackageManagerCommand(packageManager);
788
806
  let args = getInstallArgs(packageManager);
789
807
  let packages = [
@@ -791,6 +809,13 @@ async function installDependencies(projectDir, packageManager, dryRun) {
791
809
  "@opentelemetry/sdk-node"
792
810
  ];
793
811
  let cmd = pm + ` ` + args.join(" ") + ` ` + packages.join(" ");
812
+ if (dryRun) {
813
+ console.log(`Would run: ` + cmd);
814
+ return {
815
+ TAG: "Ok",
816
+ _0: void 0
817
+ };
818
+ }
794
819
  console.log(`Installing dependencies with ` + pm + `...`);
795
820
  let err = await execWithOptions(cmd, {
796
821
  cwd: projectDir
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontman-ai/nextjs",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Next.js integration for Frontman - AI-powered development tools and observability",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",