Skip to content

Commit

Permalink
README updates and init script tweaks (remix-run#24)
Browse files Browse the repository at this point in the history
Co-authored-by: Kent C. Dodds <[email protected]>
  • Loading branch information
chaance and kentcdodds authored Mar 21, 2022
1 parent f840ca0 commit 192d38e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ Not a fan of bits of the stack? Fork it, change it, and use `npx create-remix --
npm run setup
```

- Validate the app has been set up properly (optional):

```sh
npm run validate
```

- Start dev server:

```sh
Expand Down Expand Up @@ -75,14 +69,26 @@ Prior to your first deployment, you'll need to do a few things:
fly auth signup
```

> **Note:** If you have more than one Fly account, ensure that you are signed into the same account in the Fly CLI as you are in the browser. In your terminal, run `fly auth whoami` and ensure the email matches the Fly account signed into the browser.
- Create two apps on Fly, one for staging and one for production:

```sh
fly create indie-stack-template
fly create indie-stack-template-staging
```

- Create a new [GitHub Repository](https://repo.new)
- Initialize Git.

```sh
git init
```

- Create a new [GitHub Repository](https://repo.new), and then add it as the remote for your project. **Do not push your app yet!**

```sh
git remote add origin <ORIGIN_URL>
```

- Add a `FLY_API_TOKEN` to your GitHub repo. To do this, go to your user settings on Fly and create a new [token](https://web.fly.io/user/personal_access_tokens/new), then add it to [your repo secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) with the name `FLY_API_TOKEN`.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"generate:css": "tailwindcss -o ./app/styles/tailwind.css",
"postinstall": "remix setup node",
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
"setup": "prisma migrate dev",
"setup": "prisma migrate dev && prisma db seed",
"start": "remix-serve build",
"start:mocks": "node --require ./mocks ./node_modules/.bin/remix-serve build",
"test": "vitest",
Expand Down
25 changes: 17 additions & 8 deletions remix.init/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,23 @@ async function main({ rootDirectory }) {

execSync(`npm run setup`, { stdio: "inherit", cwd: rootDirectory });

await askSetupQuestions({ rootDirectory }).catch((error) => {
if (error.isTtyError) {
// Prompt couldn't be rendered in the current environment
} else {
throw error;
}
});
// TODO: There is currently an issue with the test cleanup script that results
// in an error when running Cypress in some cases. Add this question back
// when this is fixed.
// await askSetupQuestions({ rootDirectory }).catch((error) => {
// if (error.isTtyError) {
// // Prompt couldn't be rendered in the current environment
// } else {
// throw error;
// }
// });

console.log(
`Setup is complete. You're now ready to rock and roll 🤘
Start development with \`npm run dev\`
`.trim()
);
}

async function askSetupQuestions({ rootDirectory }) {
Expand All @@ -91,7 +101,6 @@ async function askSetupQuestions({ rootDirectory }) {
);
execSync(`npm run validate`, { stdio: "inherit", cwd: rootDirectory });
}
console.log(`✅ Project is ready! Start development with "npm run dev"`);
}

module.exports = main;

0 comments on commit 192d38e

Please sign in to comment.