create-adonisjs 2.0.0 → 2.1.1
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/README.md +4 -0
- package/build/commands/main.js +16 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,8 +46,12 @@ This argument is optional and the command will prompt you to enter the directory
|
|
|
46
46
|
If you want to use your own starter kit hosted on Github, Gitlab, or Bitbucket, you can use the `--kit` flag to define the repo URL.
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
|
+
# Download from GitHub
|
|
49
50
|
npm init adonisjs -- --kit="github:github_user/repo"
|
|
50
51
|
|
|
52
|
+
# Github is the default provider, so if not specified, it will be assumed as github
|
|
53
|
+
npm init adonisjs -- --kit="github_user/repo"
|
|
54
|
+
|
|
51
55
|
# Download from GitLab
|
|
52
56
|
npm init adonisjs -- --kit="gitlab:user/repo"
|
|
53
57
|
|
package/build/commands/main.js
CHANGED
|
@@ -127,6 +127,16 @@ export class CreateNewApp extends BaseCommand {
|
|
|
127
127
|
async #removeReadmeFile() {
|
|
128
128
|
await unlink(join(this.destination, 'README.md'));
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Optionally remove existing lock file. Errors are ignored
|
|
132
|
+
*/
|
|
133
|
+
async #removeLockFile() {
|
|
134
|
+
await Promise.allSettled([
|
|
135
|
+
unlink(join(this.destination, 'package-lock.json')),
|
|
136
|
+
unlink(join(this.destination, 'yarn.lock')),
|
|
137
|
+
unlink(join(this.destination, 'pnpm-lock.yaml')),
|
|
138
|
+
]);
|
|
139
|
+
}
|
|
130
140
|
/**
|
|
131
141
|
* If starter template has an `.env.example` file, then copy it to `.env`
|
|
132
142
|
*/
|
|
@@ -231,7 +241,12 @@ export class CreateNewApp extends BaseCommand {
|
|
|
231
241
|
tasks
|
|
232
242
|
.add('Download starter kit', async (task) => {
|
|
233
243
|
task.update(`Downloading "${this.kit}"`);
|
|
234
|
-
await downloadTemplate(this.kit, {
|
|
244
|
+
await downloadTemplate(this.kit, {
|
|
245
|
+
dir: this.destination,
|
|
246
|
+
auth: this.token,
|
|
247
|
+
registry: false,
|
|
248
|
+
});
|
|
249
|
+
await this.#removeLockFile();
|
|
235
250
|
return `Downloaded "${this.kit}"`;
|
|
236
251
|
})
|
|
237
252
|
.addIf(this.gitInit === true, 'Initialize git repository', async () => {
|