add eslint + doc README + env var

This commit is contained in:
Andreani Jean
2023-01-10 16:24:44 +01:00
parent a8469a9dfa
commit 5a7bfecb4b
10 changed files with 4408 additions and 50 deletions

1
.env
View File

@@ -0,0 +1 @@
VITE_API_URL=http://dev.geovisio.xuan.codeursenliberte.fr/api/search

26
.eslintrc.js Normal file
View File

@@ -0,0 +1,26 @@
module.exports = {
env: {
node: true,
},
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".vue"],
ecmaVersion: 2020,
sourceType: "module",
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:vue/base",
"prettier",
],
rules: {
"vue/require-default-prop": "off",
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
},
};

View File

@@ -50,25 +50,3 @@ npm run workflows:unit
```sh
npm run lint
```
## Deploy with Github Pages
The deploy is on the `gh-pages` branch.
1 - You must build a static project :
```sh
vite build
```
2 - Add and Commit :
```sh
ga .
gc -m 'my commit'
```
3 - Push on the specific branch
```sh
git subtree push --prefix dist origin gh-pages
```

View File

@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "vite",
"start": "vite preview --port $PORT",
"start": "vite --port $PORT",
"build": "run-p type-check build-only",
"preview": "vite preview",
"test:unit": "vitest --environment jsdom --root src/",
@@ -25,7 +25,7 @@
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.4",
"@types/jsdom": "^20.0.1",
"@types/node": "^18.11.9",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.4.0",
"@vitejs/plugin-vue": "^3.2.0",

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { RouterView } from 'vue-router'
import { RouterView } from "vue-router";
</script>
<template>

View File

@@ -1,22 +1,22 @@
import { createApp } from 'vue'
import { createI18n } from 'vue-i18n'
import App from './App.vue'
import router from './router'
import fr from './locales/fr.json'
import { createApp } from "vue";
import { createI18n } from "vue-i18n";
import App from "./App.vue";
import router from "./router";
import fr from "./locales/fr.json";
import './assets/main.css'
import "./assets/main.css";
const i18n = createI18n({
locale: 'fr',
locale: "fr",
globalInjection: true,
legacy: false,
messages: {
fr
}
})
const app = createApp(App)
fr,
},
});
const app = createApp(App);
app.use(i18n)
app.use(router)
app.use(i18n);
app.use(router);
app.mount('#app')
app.mount("#app");

View File

@@ -5,15 +5,11 @@
import { onMounted } from "vue";
import Viewer from "../lib/Viewer.js";
const onloadImg = () => {
new Viewer(
"viewer",
"http://dev.geovisio.xuan.codeursenliberte.fr/api/search",
{
map: {
startWide: true,
},
}
);
new Viewer("viewer", import.meta.env.VITE_API_URL, {
map: {
startWide: true,
},
});
};
onMounted(() => {

View File

@@ -7,6 +7,7 @@
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"types": ["vite/client"]
}
}

4356
yarn-error.log Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -630,7 +630,7 @@
"@types/mapbox__point-geometry" "*"
"@types/pbf" "*"
"@types/node@*", "@types/node@^18.11.9":
"@types/node@*", "@types/node@^18.11.18":
version "18.11.18"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f"
integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==