Skip to content

Commit

Permalink
Merge pull request #115 from Tietokilta/feat/vite
Browse files Browse the repository at this point in the history
Migrate from ESBuild to Vite
  • Loading branch information
PurkkaKoodari committed Jan 18, 2024
2 parents 5073046 + bbb34e9 commit 64429af
Show file tree
Hide file tree
Showing 28 changed files with 1,078 additions and 1,113 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ module.exports = {
// https://github.com/typescript-eslint/typescript-eslint/issues/2094
"EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true
},
"ignorePatterns": [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
".eslintrc.js"
],
"settings": {
"react": {
"pragma": "React",
Expand Down
1 change: 0 additions & 1 deletion packages/ilmomasiina-backend/.eslintignore

This file was deleted.

11 changes: 10 additions & 1 deletion packages/ilmomasiina-backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const config = {
/** The host to run the backend server on. */
host: envString('HOST', 'localhost'),
/** The port to run the backend server on. */
port: envInteger('PORT', 3000),
// Check DEV_BACKEND_PORT first, then PORT, then default to 3000.
port: envInteger('DEV_BACKEND_PORT', envInteger('PORT', 3000)),

/** Whether an Azure App Service environment is detected. */
isAzure: process.env.WEBSITE_SITE_NAME !== undefined,
Expand Down Expand Up @@ -154,6 +155,14 @@ if (config.oldEditTokenSalt === config.newEditTokenSecret) {
);
}

try {
// Node only supports URL.canParse since 18.17.0
// eslint-disable-next-line no-new
new URL(config.baseUrl);
} catch (err) {
throw new Error('BASE_URL is invalid - make sure it is a full URL like http://example.com.');
}

if (!config.eventDetailsUrl.includes('{slug}')) {
throw new Error('EVENT_DETAILS_URL must contain {slug} if set.');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ilmomasiina-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"moment-timezone": "^0.5.34",
"react": "^17 || ^18",
"react-bootstrap": "^1.6.5",
"react-countdown-now": "^2.1.2",
"react-countdown": "^2.3.5",
"react-dom": "^17 || ^18",
"react-final-form": "^6.5.9",
"react-i18next": "^12.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import moment from 'moment';
import Countdown from 'react-countdown-now';
import Countdown from 'react-countdown';

import { useSingleEventContext } from '../../../modules/singleEvent';
import SignupButton from './SignupButton';
Expand Down
6 changes: 3 additions & 3 deletions packages/ilmomasiina-components/src/styles/_definitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ $secondary-background: #f1f1f1 !default;
$secondary-text-color: #7a7a7a !default;

// Bootstrap core mixins
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/mixins";

$signup-state-not-opened: $body-color !default;
$signup-state-opened: $green !default;
Expand Down
6 changes: 5 additions & 1 deletion packages/ilmomasiina-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
"composite": true
"composite": true,
"baseUrl": ".",
"paths": {
"@tietokilta/ilmomasiina-models": ["../ilmomasiina-models/src/index.ts"]
}
},
"exclude": [
"node_modules",
Expand Down
3 changes: 0 additions & 3 deletions packages/ilmomasiina-frontend/.eslintignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
</head>
<body>
<div id="root" style="min-height: 100%"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
21 changes: 9 additions & 12 deletions packages/ilmomasiina-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
"name": "@tietokilta/ilmomasiina-frontend",
"version": "2.0.0-alpha13",
"scripts": {
"build": "ts-node -O '{\"module\":\"commonjs\"}' scripts/build.ts",
"build": "vite build",
"clean": "rimraf build dist",
"start": "ts-node -O '{\"module\":\"commonjs\"}' scripts/dev.ts",
"start": "vite",
"typecheck": "tsc --build"
},
"proxy": "http://localhost:3001",
"repository": {
"type": "git",
"url": "git+https://github.com/Tietokilta/ilmomasiina.git"
},
"license": "MIT",
"dependencies": {
"@craftamap/esbuild-plugin-html": "^0.4.0",
"@sentry/browser": "^6.19.7",
"@tietokilta/ilmomasiina-components": "workspace:2.0.0-alpha13",
"@tietokilta/ilmomasiina-models": "workspace:2.0.0-alpha13",
Expand All @@ -27,12 +25,12 @@
"@types/react-dom": "^17.0.17",
"@types/react-redux": "^7.1.24",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react": "^4.0.4",
"bootstrap": "^4.6.1",
"connected-react-router": "^6.9.2",
"csv-stringify": "^6.4.2",
"date-fns": "^2.28.0",
"esbuild": "^0.14.46",
"esbuild-sass-plugin": "^2.2.6",
"dotenv": "^16.0.3",
"final-form": "^4.20.10",
"final-form-arrays": "^3.1.0",
"history": "^4.10.1",
Expand Down Expand Up @@ -61,13 +59,12 @@
"reselect": "^4.1.6",
"sass": "^1.52.3",
"ts-node": "^10.8.1",
"typescript": "~4.9"
"typescript": "~4.9",
"vite": "^4.4.9",
"vite-plugin-checker": "^0.6.2",
"vite-tsconfig-paths": "^4.2.1"
},
"devDependencies": {
"@types/lodash": "^4.14.199",
"@types/ws": "^8.5.3",
"rimraf": "^3.0.2",
"lodash": "^4.17.21",
"ws": "^8.8.0"
"rimraf": "^3.0.2"
}
}
31 changes: 0 additions & 31 deletions packages/ilmomasiina-frontend/scripts/.eslintrc.json

This file was deleted.

35 changes: 0 additions & 35 deletions packages/ilmomasiina-frontend/scripts/autoreload.js

This file was deleted.

38 changes: 0 additions & 38 deletions packages/ilmomasiina-frontend/scripts/build.ts

This file was deleted.

Loading

0 comments on commit 64429af

Please sign in to comment.