create-adonisjs 3.0.0-next.2 → 3.1.0

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/build/bin/run.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  kernel
4
- } from "../chunk-4GHTRYYP.js";
4
+ } from "../chunk-FBNE5NZX.js";
5
5
 
6
6
  // bin/run.ts
7
7
  kernel.handle(["create-adonisjs", ...process.argv.slice(2)]).catch(console.error);
@@ -82,6 +82,29 @@ var CreateNewApp = class extends BaseCommand {
82
82
  this.backendSourceDir = this.destination;
83
83
  }
84
84
  }
85
+ /**
86
+ * Adapts the downloaded starter kit for the detected package manager.
87
+ * Handles two cases:
88
+ * - For pnpm monorepos: generates a pnpm-workspace.yaml from the workspaces field
89
+ * - For any PM mismatch: removes the packageManager field to avoid corepack conflicts
90
+ */
91
+ async #adaptForPackageManager() {
92
+ const pkgJsonPath = join(this.destination, "package.json");
93
+ const pkgJson = await readFile(pkgJsonPath, "utf-8").then(JSON.parse);
94
+ let dirty = false;
95
+ if (this.isMonorepo && this.packageManager === "pnpm" && Array.isArray(pkgJson.workspaces)) {
96
+ const lines = ["packages:"];
97
+ for (const pattern of pkgJson.workspaces) lines.push(` - '${pattern}'`);
98
+ await writeFile(join(this.destination, "pnpm-workspace.yaml"), lines.join("\n") + "\n");
99
+ delete pkgJson.workspaces;
100
+ dirty = true;
101
+ }
102
+ if (pkgJson.packageManager && !pkgJson.packageManager.startsWith(this.packageManager)) {
103
+ delete pkgJson.packageManager;
104
+ dirty = true;
105
+ }
106
+ if (dirty) await writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
107
+ }
85
108
  /**
86
109
  * Executes a bash command using execa with shared default options.
87
110
  * Commands are run from the specified source directory with consistent
@@ -301,6 +324,7 @@ var CreateNewApp = class extends BaseCommand {
301
324
  registry: false
302
325
  });
303
326
  await this.#inspectStarterKit();
327
+ await this.#adaptForPackageManager();
304
328
  await this.#removeLockFile();
305
329
  return `Downloaded "${this.kit}"`;
306
330
  }).addIf(this.gitInit === true, "Initialize git repository", async () => {
package/build/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  kernel
3
- } from "./chunk-4GHTRYYP.js";
3
+ } from "./chunk-FBNE5NZX.js";
4
4
  export {
5
5
  kernel
6
6
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-adonisjs",
3
3
  "description": "Scaffold new AdonisJS applications using starter kits",
4
- "version": "3.0.0-next.2",
4
+ "version": "3.1.0",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "scripts": {
23
23
  "pretest": "npm run lint",
24
- "test": "cross-env NODE_DEBUG=create-adonisjs c8 npm run quick:test",
24
+ "test": "cross-env NODE_DEBUG=create-adonisjs npm run quick:test",
25
25
  "lint": "eslint",
26
26
  "format": "prettier --write .",
27
27
  "typecheck": "tsc --noEmit",
@@ -37,30 +37,30 @@
37
37
  "quick:test": "node --import=@poppinss/ts-exec --enable-source-maps bin/test.ts"
38
38
  },
39
39
  "devDependencies": {
40
- "@adonisjs/eslint-config": "^3.0.0-next.2",
40
+ "@adonisjs/eslint-config": "^3.0.0",
41
41
  "@adonisjs/prettier-config": "^1.4.5",
42
- "@adonisjs/tsconfig": "^2.0.0-next.0",
43
- "@japa/assert": "^4.1.1",
44
- "@japa/file-system": "^2.3.2",
45
- "@japa/runner": "^4.4.0",
46
- "@poppinss/ts-exec": "^1.4.1",
47
- "@release-it/conventional-changelog": "^10.0.1",
42
+ "@adonisjs/tsconfig": "^2.0.0",
43
+ "@japa/assert": "^4.2.0",
44
+ "@japa/file-system": "^3.0.0",
45
+ "@japa/runner": "^5.3.0",
46
+ "@poppinss/ts-exec": "^1.4.4",
47
+ "@release-it/conventional-changelog": "^10.0.5",
48
48
  "@types/gradient-string": "^1.1.6",
49
- "@types/node": "^24.5.2",
49
+ "@types/node": "^25.3.0",
50
50
  "@types/which-pm-runs": "^1.0.2",
51
- "c8": "^10.1.3",
52
- "cross-env": "^10.0.0",
51
+ "c8": "^11.0.0",
52
+ "cross-env": "^10.1.0",
53
53
  "del-cli": "^7.0.0",
54
- "eslint": "^9.36.0",
55
- "prettier": "^3.6.2",
56
- "release-it": "19.0.4",
57
- "tsup": "^8.5.0",
58
- "typescript": "^5.9.2"
54
+ "eslint": "^10.0.2",
55
+ "prettier": "^3.8.1",
56
+ "release-it": "19.2.4",
57
+ "tsup": "^8.5.1",
58
+ "typescript": "^5.9.3"
59
59
  },
60
60
  "dependencies": {
61
- "@adonisjs/ace": "^14.0.1-next.2",
62
- "execa": "^9.6.0",
63
- "giget": "^2.0.0",
61
+ "@adonisjs/ace": "^14.0.1",
62
+ "execa": "^9.6.1",
63
+ "giget": "^3.1.2",
64
64
  "gradient-string": "^3.0.0",
65
65
  "which-pm-runs": "^1.1.0"
66
66
  },