From 003c7844f16b1aea0bfe928d0feb7d9f27bb5aa2 Mon Sep 17 00:00:00 2001 From: Tom Gobich Date: Sun, 27 Oct 2024 07:06:24 -0400 Subject: [PATCH] fixed(preloads): edgejs globals file only needs registered in 'web' environment. --- README.md | 1 + src/scaffolds/jumpstart_scaffold.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 099bcfd..94a0231 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ All you need to do is install & configure Adocasts Jumpstart. It'll then: - Views -> Pages 8. Adds Jumpstart's routes to your `routes.ts` file 9. Adds auth methods to your user model +10. Lastly, you can optionally uninstall `@adocasts.com/jumpstart`. Once everything is scaffolded, you no longer need it. After that, be sure to update any new environment variables or configurations that may have been added from missing AdonisJS core packages, boot it up, and visit `/jumpstart`. diff --git a/src/scaffolds/jumpstart_scaffold.ts b/src/scaffolds/jumpstart_scaffold.ts index 5dc1844..312ba60 100644 --- a/src/scaffolds/jumpstart_scaffold.ts +++ b/src/scaffolds/jumpstart_scaffold.ts @@ -181,7 +181,7 @@ export default class JumpstartScaffold extends BaseScaffold { await this.codemods.makeUsingStub(stubsRoot, 'start/globals.stub', {}) await this.codemods.updateRcFile((rcFile) => { - rcFile.addPreloadFile('#start/globals') + rcFile.addPreloadFile('#start/globals', ['web']) }) } @@ -197,9 +197,9 @@ export default class JumpstartScaffold extends BaseScaffold { await this.copyView('emails') // stubs -> migrations - this.stubMigration('migrations/create_email_histories_table.stub') - this.stubMigration('migrations/create_password_reset_tokens_table.stub') - this.stubMigration('migrations/create_remember_me_tokens_table.stub') + await this.stubMigration('migrations/create_email_histories_table.stub') + await this.stubMigration('migrations/create_password_reset_tokens_table.stub') + await this.stubMigration('migrations/create_remember_me_tokens_table.stub') // stubs -> models await this.copyModel('email_history.stub')