Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Commit fa17ec5

Browse files
committed
replace vue cli by vite, streamline bookmarklet
1 parent c0748c3 commit fa17ec5

18 files changed

+15043
-11598
lines changed

Closure_Front_End/.env

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
VUE_APP_API_URL=http://localhost:8000/api/v1
1+
VITE_API_URL=http://localhost:8000/api/v1
22

33
# See https://cli.vuejs.org/config/#publicpath
44
PUBLIC_PATH=/
55

66
# Auth settings. Technically you can re-use them
77
# between environments, but for production you shouldn't.
8-
VUE_APP_AUTH0_DOMAIN=closure.us.auth0.com
9-
VUE_APP_AUTH0_CLIENT_ID=gh4L2Gnt32xeVLAMkBe7NbGQ30BsVTvu
8+
VITE_AUTH0_DOMAIN=closure.us.auth0.com
9+
VITE_AUTH0_CLIENT_ID=gh4L2Gnt32xeVLAMkBe7NbGQ30BsVTvu
1010

1111
# make sure this points to where the front-end is hosted,
1212
# and you've configured Auth0 to consider this a legitimate callback URL.
13-
VUE_APP_AUTH0_REDIRECT_URI=http://localhost:8080
13+
VITE_AUTH0_REDIRECT_URI=http://localhost:8080
1414

1515
# either 'localstorage' or 'memory' if you don't want to persist
1616
# login between page refreshes
17-
VUE_APP_AUTH0_CACHE_LOCATION=localstorage
17+
VITE_AUTH0_CACHE_LOCATION=localstorage

Closure_Front_End/.env.production

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
VUE_APP_API_URL=https://api.uniclosure.me/api/v1
1+
VITE_API_URL=https://api.uniclosure.me/api/v1
22

33

44
PUBLIC_PATH=/
55

6-
VUE_APP_AUTH0_DOMAIN=closure.us.auth0.com
7-
VUE_APP_AUTH0_CLIENT_ID=n0CulxlV1bW4RibDDotmd7tsEVBXaYSl
8-
VUE_APP_AUTH0_REDIRECT_URI=https://uniclosure.me/
6+
VITE_AUTH0_DOMAIN=closure.us.auth0.com
7+
VITE_AUTH0_CLIENT_ID=n0CulxlV1bW4RibDDotmd7tsEVBXaYSl
8+
VITE_AUTH0_REDIRECT_URI=https://uniclosure.me/

Closure_Front_End/.eslintrc.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es2021": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:vue/vue3-essential"
10+
],
11+
"parserOptions": {
12+
"ecmaVersion": 12,
13+
"sourceType": "module"
14+
},
15+
"plugins": [
16+
"vue"
17+
],
18+
"rules": {},
19+
"overrides": [
20+
{
21+
"files": [
22+
"**/__tests__/*.{j,t}s?(x)",
23+
"**/tests/unit/**/*.spec.{j,t}s?(x)"
24+
],
25+
"env": {
26+
"jest": true
27+
}
28+
}
29+
]
30+
};

Closure_Front_End/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ You can run `npm run build` within the `Closure_Front_End` folder to create an o
5252
appear at the `dist` folder.
5353

5454
You can then serve this folder with any web-server. For quickly previewing the production build locally,
55-
after having done the [appropriate configuration](#localProd), you can use Python's standard http-server module, by running:
55+
after having done the [appropriate configuration](#localProd), you can then serve the build using a node based server,
56+
by running:
5657

57-
`python -m http.server --directory dist 8080`
58+
`npm run preview`
5859

5960
And then visting http://localhost:8080
6061

Closure_Front_End/babel.config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
module.exports = {
2-
presets: [
3-
'@vue/cli-plugin-babel/preset'
4-
]
5-
}
2+
presets: ['@babel/preset-env'],
3+
plugins: ['babel-plugin-transform-vite-meta-env'],
4+
env: {
5+
test: {
6+
plugins: ['@babel/plugin-transform-runtime']
7+
}
8+
}
9+
}
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
<!DOCTYPE html>
2-
<html lang="">
2+
<html lang="he">
33

44
<head>
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width,initial-scale=1.0">
8-
9-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<link rel="icon" href="/favicon.ico">
109
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma-rtl.min.css">
1110

1211
<!-- icons -->
1312
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
1413

1514
<title>
16-
<%= htmlWebpackPlugin.options.title %>
15+
Closure()
1716
</title>
1817
</head>
1918

2019
<body>
2120
<noscript>
22-
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
21+
<strong>We're sorry but this website doesn't work properly without JavaScript enabled.
2322
Please enable it to continue.</strong>
2423
</noscript>
2524
<div id="app"></div>
26-
27-
<!-- built files will be auto injected -->
25+
<script type="module" src="/src/main.js"></script>
2826
</body>
2927

3028
</html>

Closure_Front_End/jest.config.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1-
module.exports = {
2-
preset: '@vue/cli-plugin-unit-jest',
1+
// jest.config.js
2+
// Sync object
3+
/** @type {import('@jest/types').Config.InitialOptions} */
4+
const config = {
5+
moduleFileExtensions: [
6+
"js",
7+
"json",
8+
"vue"
9+
],
310
transform: {
4-
'^.+\\.vue$': 'vue-jest'
11+
".*\\.(js)$": "babel-jest",
12+
".*\\.(vue)$": "vue-jest"
13+
},
14+
// support the same @ -> src alias mapping in source code
15+
moduleNameMapper: {
16+
"^@/(.*)$": "<rootDir>/src/$1"
17+
},
18+
globals: {
19+
'vue-jest': {
20+
babelConfig: true
21+
}
522
}
623
}
24+
25+
module.exports = config

0 commit comments

Comments
 (0)