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 +1 -1
- package/build/{chunk-4GHTRYYP.js → chunk-FBNE5NZX.js} +24 -0
- package/build/index.js +1 -1
- package/package.json +20 -20
package/build/bin/run.js
CHANGED
|
@@ -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
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.
|
|
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
|
|
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
|
|
40
|
+
"@adonisjs/eslint-config": "^3.0.0",
|
|
41
41
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
42
|
-
"@adonisjs/tsconfig": "^2.0.0
|
|
43
|
-
"@japa/assert": "^4.
|
|
44
|
-
"@japa/file-system": "^
|
|
45
|
-
"@japa/runner": "^
|
|
46
|
-
"@poppinss/ts-exec": "^1.4.
|
|
47
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
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": "^
|
|
49
|
+
"@types/node": "^25.3.0",
|
|
50
50
|
"@types/which-pm-runs": "^1.0.2",
|
|
51
|
-
"c8": "^
|
|
52
|
-
"cross-env": "^10.
|
|
51
|
+
"c8": "^11.0.0",
|
|
52
|
+
"cross-env": "^10.1.0",
|
|
53
53
|
"del-cli": "^7.0.0",
|
|
54
|
-
"eslint": "^
|
|
55
|
-
"prettier": "^3.
|
|
56
|
-
"release-it": "19.
|
|
57
|
-
"tsup": "^8.5.
|
|
58
|
-
"typescript": "^5.9.
|
|
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
|
|
62
|
-
"execa": "^9.6.
|
|
63
|
-
"giget": "^
|
|
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
|
},
|