-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from architecture-building-systems/vite
Change from electron-forge to electron-builder and vite
- Loading branch information
Showing
128 changed files
with
11,159 additions
and
8,526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_CEA_URL="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_CEA_URL="http://localhost:5050" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_CEA_URL="http://localhost:5050" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,6 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
.eslintcache | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules | ||
|
||
# OSX | ||
.DS_Store | ||
|
||
# App packaged | ||
release | ||
dist | ||
|
||
.idea | ||
npm-debug.log.* | ||
__snapshots__ | ||
|
||
# Package.json | ||
package.json | ||
.travis.yml | ||
dist-ssr | ||
*.local | ||
node_modules/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,59 @@ | ||
module.exports = { | ||
/* your base configuration of choice */ | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react/jsx-runtime', | ||
'plugin:prettier/recommended', | ||
], | ||
parser: '@babel/eslint-parser', | ||
parserOptions: { | ||
sourceType: 'module', | ||
requireConfigFile: false, | ||
babelOptions: { | ||
presets: ['@babel/preset-react'], | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
'import/resolver': { | ||
node: { | ||
paths: ['src'], | ||
extensions: ['.js', '.jsx', '.ts', '.tsx'], | ||
}, | ||
}, | ||
}, | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
}, | ||
globals: { | ||
MAIN_WINDOW_WEBPACK_ENTRY: true, | ||
MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: true, | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:import/recommended', | ||
'plugin:jsx-a11y/recommended', | ||
'plugin:prettier/recommended', // Make sure this is always the last element in the array. | ||
], | ||
overrides: [ | ||
{ | ||
env: { | ||
node: true, | ||
}, | ||
files: ['.eslintrc.{js,cjs}'], | ||
parserOptions: { | ||
sourceType: 'script', | ||
}, | ||
}, | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['react-refresh', 'simple-import-sort'], | ||
rules: { | ||
// allow anonymous component functions | ||
'react/display-name': 0, | ||
// disallow console and debugger in production mode | ||
'no-console': process.env.NODE_ENV === 'production' ? 2 : 0, | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, | ||
// allow spreading out properties from an object without warnings | ||
// 'no-unused-vars': [1, { ignoreRestSiblings: true }], | ||
'no-unused-vars': 'off', | ||
'prettier/prettier': ['error', {}, { usePrettierrc: true }], | ||
'react/react-in-jsx-scope': 'off', | ||
'jsx-a11y/accessible-emoji': 'off', | ||
'react/prop-types': 'off', | ||
// 'simple-import-sort/imports': 'error', | ||
// 'simple-import-sort/exports': 'error', | ||
'jsx-a11y/anchor-is-valid': [ | ||
'error', | ||
{ | ||
components: ['Link'], | ||
specialLink: ['hrefLeft', 'hrefRight'], | ||
aspects: ['invalidHref', 'preferButton'], | ||
}, | ||
], | ||
'react-refresh/only-export-components': 'warn', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"eslint.packageManager": "yarn", | ||
"search.exclude": { | ||
"**/node_modules": true, | ||
"**/dist": true, | ||
"**/yarn.lock": true | ||
} | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM node:current-alpine | ||
|
||
WORKDIR /app | ||
COPY package.json . | ||
|
||
RUN yarn | ||
COPY . . | ||
|
||
RUN yarn build | ||
EXPOSE 4173 | ||
|
||
CMD [ "yarn", "preview", "--host" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,54 @@ | ||
# City Energy Analyst GUI | ||
|
||
This is the new interface of CEA in Electron. | ||
Made with the help of [`electron-builder`](https://www.electron.build). | ||
|
||
Made with the help of [`electron-forge`](https://www.electronforge.io/). | ||
There are currently two possible build targets for the GUI. One for desktop (using Electron) and one for the web. | ||
|
||
## Getting Started (development) | ||
|
||
Simply clone down this repository, install dependencies, and get started on your application. | ||
|
||
The use of the [yarn](https://yarnpkg.com/) package manager and [VS Code](https://code.visualstudio.com/) editor is recommended for development. | ||
|
||
e.g. | ||
|
||
```bash | ||
git clone https://github.com/architecture-building-systems/CityEnergyAnalyst-GUI.git | ||
|
||
cd CityEnergyAnalyst-GUI | ||
|
||
# install dependencies | ||
yarn | ||
``` | ||
|
||
### Development Scripts | ||
|
||
For desktop version | ||
|
||
```bash | ||
# app will be launched using electron | ||
yarn electron:dev | ||
``` | ||
|
||
For web version | ||
|
||
```bash | ||
# run application in development mode | ||
yarn start | ||
# web app will be accessible from the browser on http://localhost:5173/ | ||
yarn dev | ||
``` | ||
|
||
# compile source code and create the OS specific application in the `out` folder | ||
yarn package | ||
### Build Scripts | ||
|
||
For desktop version | ||
|
||
```bash | ||
# compiles source code and creates the OS specific application in the `out` folder | ||
yarn electron:build | ||
``` | ||
|
||
For web version | ||
|
||
```bash | ||
# bundles source code and creates the web files in the `dist` folder | ||
yarn build | ||
``` |
Oops, something went wrong.