Skip to content

Commit

Permalink
refactor: migrate create-react-app to vite
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Oct 10, 2024
1 parent 279c21d commit 7b675f5
Show file tree
Hide file tree
Showing 16 changed files with 11,895 additions and 29,947 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-env",
["@babel/preset-react", { "runtime": "automatic" }]
]
}
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ env:
PACT_BROKER_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }}
PACT_PROVIDER: pactflow-example-provider
PACT_BROKER_TOKEN: ${{ secrets.PACTFLOW_TOKEN_FOR_CI_CD_WORKSHOP }}
REACT_APP_API_BASE_URL: http://localhost:3001
VITE_APP_API_BASE_URL: http://localhost:3001
GIT_COMMIT: ${{ github.sha }}
GIT_REF: ${{ github.ref }}

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
- name: Install
run: npm i
- name: Test
Expand All @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: docker pull pactfoundation/pact-cli:latest
- name: Can I deploy?
run: GIT_BRANCH=${GIT_REF:11} make can_i_deploy
Expand All @@ -46,7 +46,7 @@ jobs:
runs-on: ubuntu-latest
needs: can-i-deploy
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: docker pull pactfoundation/pact-cli:latest
- name: Deploy
run: GIT_BRANCH=${GIT_REF:11} make deploy
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ci: test publish_pacts can_i_deploy $(DEPLOY_TARGET)
# Use this for quick feedback when playing around with your workflows.
fake_ci: .env
@CI=true \
REACT_APP_API_BASE_URL=http://localhost:8080 \
VITE_APP_API_BASE_URL=http://localhost:8080 \
make ci

publish_pacts: .env
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Open a separate terminal for the consumer.
Before starting the consumer, create a `.env` file in the root of the project and set the URL to point to your running provider:

```bash
REACT_APP_API_BASE_URL=http://localhost:8080
VITE_APP_API_BASE_URL=http://localhost:8080
```

Then run:
Expand Down
1 change: 1 addition & 0 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
Loading

0 comments on commit 7b675f5

Please sign in to comment.