https://github.com/tuliren/battery
Interactive toys for Charles
https://github.com/tuliren/battery
Last synced: 9 days ago
JSON representation
Interactive toys for Charles
- Host: GitHub
- URL: https://github.com/tuliren/battery
- Owner: tuliren
- License: mit
- Created: 2024-02-06T21:21:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-01T06:31:53.000Z (8 months ago)
- Last Synced: 2025-03-26T05:23:53.119Z (7 months ago)
- Language: TypeScript
- Homepage: https://battery.liren.dev
- Size: 393 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Battery
[](https://github.com/tuliren/battery/actions/workflows/build.yaml)
## Development
### Dev credential
- Add dev credential from `.env.sample`
```
cp .env.sample .env.local
```
- Update `.env.local` with credentials from the dev database
### Dev server
- Run
```
corepack enable
yarn install
yarn dev
```
- Visit `localhost:3000`
### Local script
- Add a `ts` file under [`scripts`](./scripts).
- Run it with `yarn script scripts/ [parameters]`.
### Environment Variables
| Env | `NEXT_PUBLIC_VERCEL_ENV` | `NODE_ENV` |
|---------|--------------------------|---------------|
| Local | `undefined` | `development` |
| Preview | `preview` | `production` |
| Prod | `production` | `production` |
### IDE Support
- Setup `eslint` in IntelliJ
- Go to `Preferences / Language & Frameworks / JavaScript / Code Quality Tools / ESLint`
- Check `Manual ESLint configuration`
- Set `ESLint package` to `Detect package and configuration file from the nearest package.json`
- If you use `Automatic ESLint configuration`, the setting depends on the global format in
your IntelliJ, which may be different from the setting in this project.
- [Optional] Check `Run eslint --fix on save`
- Setup `prettier` in IntelliJ
- Go to `Preferences / Languages & Frameworks / JavaScript / Prettier`
- Select the `Prettier package` from the `node_modules`.
- [Optional] Check `On 'Reformat Code' action`
- [Optional] Check `On save`