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

refactor: migrate create-react-app to vite #143

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
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