Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat(project): Replace Create React App with Vite" #510

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BROWSER=none
VITE_API_ROOT=https://farmhand.vercel.app/
VITE_NAME=$npm_package_name
VITE_FARMHAND_PACKAGE_VERSION=$npm_package_version
VITE_TURN_USERNAME=
VITE_TURN_CREDENTIAL=
REACT_APP_API_ROOT=https://farmhand.vercel.app/
REACT_APP_NAME=$npm_package_name
REACT_APP_VERSION=$npm_package_version
REACT_APP_TURN_USERNAME=
REACT_APP_TURN_CREDENTIAL=
3 changes: 0 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"globals": {
"vitest": true
},
"extends": ["react-app"],
"rules": {
"import/order": [
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ jobs:
run: npm ci

- name: 'Run tests'
run: npm test -- --coverage --run
run: npm test -- --reporters=default --reporters=jest-junit

- name: Test Report
uses: dorny/test-reporter@v1
with:
name: Jest Tests # Name of the check run which will be created
path: reports/jest-*.xml # Path to test results
reporter: jest-junit # Format of test results

- name: 'Check types'
# TODO: Change this to check:types when all type errors are fixed
Expand All @@ -37,4 +44,4 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: build-output
path: dist
path: build
14 changes: 7 additions & 7 deletions .github/workflows/run-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ jobs:
tags: true
branch: main

- run: npm run build -- --base="./"
- run: PUBLIC_URL='./' npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Prepare Web Artifacts
run: zip farmhand-web-${{ env.PACKAGE_VERSION }}.zip -r dist/*
run: zip farmhand-web-${{ env.PACKAGE_VERSION }}.zip -r build/*

- name: Create Release
id: create_release
Expand All @@ -82,26 +82,26 @@ jobs:
files: |
./farmhand-web-${{ env.PACKAGE_VERSION }}.zip

- run: node -e "console.log(require('./package.json').version)" > dist/version.txt
- run: node -e "console.log(require('./package.json').version)" > build/version.txt
- name: Publish itch.io build
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.ITCH_TOKEN }}
CHANNEL: html5
ITCH_GAME: Farmhand
ITCH_USER: jeremyckahn
PACKAGE: dist
VERSION_FILE: dist/version.txt
PACKAGE: build
VERSION_FILE: build/version.txt

- run: |
npm run build -- --base='/farmhand'
PUBLIC_URL='/farmhand' npm run build

# https://github.com/marketplace/actions/deploy-to-github-pages
- name: Deploy to jeremyckahn.github.io/farmhand
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
folder: build
clean: true
single-commit: true

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ build
Session.vim
.DS_Store
.idea
coverage

.vercel
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Farmhand uses a [SemVer](https://semver.org/)-like versioning system. It differs

## Project overview

- This project uses [Vite](https://vitejs.dev/), so please refer to the documentation of that project to learn about the development toolchain.
- This project is built with [Create React App](https://create-react-app.dev/), so please refer to the documentation of that project to learn about the development toolchain.
- Farmhand uses [Piskel](https://www.piskelapp.com/) for the art assets.

## Running locally
Expand Down Expand Up @@ -138,13 +138,13 @@ The process will take several minutes to complete and it will notify the Discord
Farmhand supports feature flags for code that should only be enabled in specific environments. To create a feature flag, add a line that looks like this in the relevant `.env` file:

```
VITE_ENABLE_[FEATURE_NAME]=true
REACT_APP_ENABLE_[FEATURE_NAME]=true
```

Where `[FEATURE_NAME]` is replaced with the name of your feature. So, adding this to `.env.development.local`:

```
VITE_ENABLE_MINING=true
REACT_APP_ENABLE_MINING=true
```

Would enable the `MINING` feature only for the local development environment. You can access the enabled feature flags at runtime by `import`ing the `features` Object from [`config.js`](https://github.com/jeremyckahn/farmhand/blob/develop/src/config.js). See [Adding Custom Environment Variables](https://create-react-app.dev/docs/adding-custom-environment-variables/) for more information on how to use environment variables.
Expand Down
34 changes: 0 additions & 34 deletions manifest.js

This file was deleted.

Loading
Loading