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

[ENGAGE-2223] Change vite to rspack #937

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
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.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VITE_ROOT_API=
VITE_HOTJAR_PROJECT_KEY=
VITE_SENTRY_DSN_ENDPOINT=
ROOT_API=
HOTJAR_PROJECT_KEY=
SENTRY_DSN_ENDPOINT=
KEYCLOAK_ISSUER=
KEYCLOAK_AUTHORIZATION_ENDPOINT=
KEYCLOAK_USERINFO_ENDPOINT=
Expand All @@ -10,5 +10,5 @@ KEYCLOAK_TOKEN_ENDPOINT=
KEYCLOAK_CHECK_SESSION_IFRAME=
KEYCLOAK_CLIENT_ID=
KEYCLOAK_REALM=
VITE_HELPHERO=
VITE_URL_ACADEMY=
HELPHERO=
URL_ACADEMY=
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ module.exports = {
},
],
parserOptions: {
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
requireConfigFile: false,
ecmaVersion: 2020,
sourceType: 'module',
babelOptions: {
presets: ['@babel/preset-env'],
},
},
};
8 changes: 4 additions & 4 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
with:
node-version: 18
- name: Install Dependencies
run: yarn --frozen-lockfile
run: npm ci
- name: Build application
run: yarn build
run: npm run build
- name: Run lint
run: yarn lint
run: npm run lint
- name: Run Unit Tests
run: yarn test:coverage
run: npm run test:coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
Expand Down
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ WORKDIR /home/app

RUN apk --no-cache add git

COPY package.json yarn.lock ./
COPY package.json package-lock.json ./

RUN --mount=type=cache,target=/root/.yarn \
YARN_CACHE_FOLDER=/root/.yarn yarn install
RUN --mount=type=cache,target=/root/.npm NPM_CONFIG_CACHE=/root/.npm npm install

COPY . ./

RUN NODE_OPTIONS=--openssl-legacy-provider yarn build
RUN NODE_OPTIONS=--openssl-legacy-provider npm run build

FROM nginxinc/nginx-unprivileged:1.25-alpine

Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ yarn

| Variable | Type | Default | Description |
|--|--|--|--|
| VITE_ROOT_API | `string` | Empty | HTTP service API URL ( remember to pass "/" at the end)
| VITE_KEYCLOAK_ISSUER | `string` | Empty | Keycloak base API
| VITE_KEYCLOAK_CLIENT_ID | `string` | Empty | Keycloak client ID
| VITE_KEYCLOAK_REALM | `string` | Empty | Keycloak Realm
| VITE_SENTRY_DSN_ENDPOINT | `string` | Empty | Sentry DSN endpoint
| VITE_HELPHERO | `string` | Empty | HelpHero identifier
| VITE_STRIPE_API | `string` | Empty | Stripe Public Key
| VITE_BOT_URL | `string` | Empty | Internal Bot URL
| VITE_2FA_APP_ANDROID | `string` | Empty | Two-factor authentication App Link for Android
| VITE_2FA_APP_IOS | `string` | Empty | Two-factor authentication App Link for iOS
| VITE_URL_ACADEMY | `string` | Empty | Academy module URL
| VITE_URL_FLOWS | `string` | Empty | Flows module URL
| VITE_MODULE_CHATS | `string` | Empty | Chats module URL
| ROOT_API | `string` | Empty | HTTP service API URL ( remember to pass "/" at the end)
| KEYCLOAK_ISSUER | `string` | Empty | Keycloak base API
| KEYCLOAK_CLIENT_ID | `string` | Empty | Keycloak client ID
| KEYCLOAK_REALM | `string` | Empty | Keycloak Realm
| SENTRY_DSN_ENDPOINT | `string` | Empty | Sentry DSN endpoint
| HELPHERO | `string` | Empty | HelpHero identifier
| STRIPE_API | `string` | Empty | Stripe Public Key
| BOT_URL | `string` | Empty | Internal Bot URL
| TWO_FA_APP_ANDROID | `string` | Empty | Two-factor authentication App Link for Android
| TWO_FA_APP_IOS | `string` | Empty | Two-factor authentication App Link for iOS
| URL_ACADEMY | `string` | Empty | Academy module URL
| URL_FLOWS | `string` | Empty | Flows module URL
| MODULE_CHATS | `string` | Empty | Chats module URL

## Tokens
...
Expand Down
2 changes: 1 addition & 1 deletion config.js.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = (() => {
return {
VITE_API_BASE_URL: '${VITE_API_BASE_URL}',
API_BASE_URL: '${API_BASE_URL}',
test: 'Hello World!',
get(name) {
return this[name] || import.meta.env[name];
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
context: .
dockerfile: Dockerfile
args:
- VITE_ROOT_API=${VITE_ROOT_API:-http://api-connect.push.al}
- ROOT_API=${ROOT_API:-http://api-connect.push.al}
- KEYCLOAK_ISSUER=${KEYCLOAK_ISSUER}
- KEYCLOAK_AUTHORIZATION_ENDPOINT=${KEYCLOAK_AUTHORIZATION_ENDPOINT}
- KEYCLOAK_USERINFO_ENDPOINT=${KEYCLOAK_USERINFO_ENDPOINT}
Expand All @@ -16,12 +16,12 @@ services:
- KEYCLOAK_CHECK_SESSION_IFRAME=${KEYCLOAK_CHECK_SESSION_IFRAME}
- KEYCLOAK_CLIENT_ID=${KEYCLOAK_CLIENT_ID}
- KEYCLOAK_REALM=${KEYCLOAK_REALM}
- VITE_HOTJAR_PROJECT_KEY=${VITE_HOTJAR_PROJECT_KEY}
- VITE_BOT_URL=${VITE_BOT_URL}
- VITE_SENTRY_DSN_ENDPOINT=${VITE_SENTRY_DSN_ENDPOINT}
- VITE_HELPHERO=${VITE_HELPHERO}
- VITE_URL_ACADEMY=${VITE_URL_ACADEMY}
- VITE_BILLING_API_URL=${VITE_BILLING_API_URL}
- HOTJAR_PROJECT_KEY=${HOTJAR_PROJECT_KEY}
- BOT_URL=${BOT_URL}
- SENTRY_DSN_ENDPOINT=${SENTRY_DSN_ENDPOINT}
- HELPHERO=${HELPHERO}
- URL_ACADEMY=${URL_ACADEMY}
- BILLING_API_URL=${BILLING_API_URL}
- MP9_AB_MAPPING_TOKEN=${MP9_AB_MAPPING_TOKEN}
ports:
- 8080:8080
26 changes: 13 additions & 13 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/bin/sh
export JSON_STRING='window.configs = { \
"VITE_ROOT_API":"'${VITE_ROOT_API}'", \
"VITE_KEYCLOAK_ISSUER":"'${VITE_KEYCLOAK_ISSUER}'", \
"VITE_KEYCLOAK_CLIENT_ID":"'${VITE_KEYCLOAK_CLIENT_ID}'", \
"VITE_KEYCLOAK_REALM":"'${VITE_KEYCLOAK_REALM}'", \
"VITE_SENTRY_DSN_ENDPOINT":"'${VITE_SENTRY_DSN_ENDPOINT}'", \
"VITE_HELPHERO":"'${VITE_HELPHERO}'", \
"VITE_STRIPE_API":"'${VITE_STRIPE_API}'", \
"VITE_BOT_URL":"'${VITE_BOT_URL}'", \
"VITE_2FA_APP_ANDROID":"'${VITE_2FA_APP_ANDROID}'", \
"VITE_2FA_APP_IOS":"'${VITE_2FA_APP_IOS}'", \
"ROOT_API":"'${ROOT_API}'", \
"KEYCLOAK_ISSUER":"'${KEYCLOAK_ISSUER}'", \
"KEYCLOAK_CLIENT_ID":"'${KEYCLOAK_CLIENT_ID}'", \
"KEYCLOAK_REALM":"'${KEYCLOAK_REALM}'", \
"SENTRY_DSN_ENDPOINT":"'${SENTRY_DSN_ENDPOINT}'", \
"HELPHERO":"'${HELPHERO}'", \
"STRIPE_API":"'${STRIPE_API}'", \
"BOT_URL":"'${BOT_URL}'", \
"TWO_FA_APP_ANDROID":"'${TWO_FA_APP_ANDROID}'", \
"TWO_FA_APP_IOS":"'${TWO_FA_APP_IOS}'", \
"FLOWS_GENERIC_TOKEN":"'${FLOWS_GENERIC_TOKEN}'", \
"MODULES_YAML":"'${MODULES_YAML}'", \
"BRAIN_IS_SHOWN_FOR_PROJECTS":"'${BRAIN_IS_SHOWN_FOR_PROJECTS}'", \
"BRAIN_IS_SHOWN_FOR_USERS":"'${BRAIN_IS_SHOWN_FOR_USERS}'", \
"BRAIN_IS_SHOWN_FOR_USER_MANAGED_PROJECTS_FROM":"'${BRAIN_IS_SHOWN_FOR_USER_MANAGED_PROJECTS_FROM}'", \
"NEXUS_API":"'${NEXUS_API}'", \
"VITE_HOTJAR_ID":"'${VITE_HOTJAR_ID}'", \
"VITE_BILLING_API_URL":"'${VITE_BILLING_API_URL}'", \
"VITE_CHATS_API_URL":"'${VITE_CHATS_API_URL}'", \
"HOTJAR_ID":"'${HOTJAR_ID}'", \
"BILLING_API_URL":"'${BILLING_API_URL}'", \
"CHATS_API_URL":"'${CHATS_API_URL}'", \
"GITHUB_API":"'${GITHUB_API}'", \
"GITHUB_CONTENT_API":"'${GITHUB_CONTENT_API}'", \
"GITHUB_PLATFORM_UPDATES_REPOSITORY":"'${GITHUB_PLATFORM_UPDATES_REPOSITORY}'", \
Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script nonce="app" type="module" src="/src/main.js"></script>
</body>

</html>
Loading
Loading