@saooti/octopus-sdk 32.0.13 → 32.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -657,3 +657,4 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
657
657
  * 32.0.11 Merge 31
658
658
  * 32.0.12 Merge 31
659
659
  * 32.0.13 Test Vite au lieu de Webpack
660
+ * 32.0.14 Mise en place Vite au lieu de Webpack
@@ -4,8 +4,8 @@
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
6
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
- <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
- <link rel="stylesheet" href="<%= BASE_URL %>css/fonts/style.css">
7
+ <link rel="icon" href="/favicon.ico">
8
+ <link rel="stylesheet" href="/css/fonts/style.css">
9
9
  <title>octopus-library</title>
10
10
  </head>
11
11
  <body>
@@ -15,4 +15,5 @@
15
15
  <div id="app"></div>
16
16
  <!-- built files will be auto injected -->
17
17
  </body>
18
+ <script type="module" src="./src/main.ts"></script>
18
19
  </html>
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "32.0.13",
3
+ "version": "32.0.14",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
7
7
  "scripts": {
8
- "serve": "vue-cli-service serve",
9
- "build": "vue-cli-service build --report",
10
- "lint": "vue-cli-service lint --fix",
8
+ "serve": "vite preview",
9
+ "build": "vite build",
10
+ "dev": "vite",
11
+ "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
11
12
  "build_bundle": "vue-cli-service build --target lib --name octopus ./index.js",
12
13
  "prettifile": "prettier --single-quote --trailing-comma es5 --write",
13
14
  "prettify": "prettier --single-quote --trailing-comma es5 --write src/**/**/**/*.{js,vue}"
14
15
  },
15
16
  "dependencies": {
16
- "@saooti/octopus-api": "^0.31.7",
17
+ "@saooti/octopus-api": "^0.32.0",
17
18
  "@vue/cli": "^5.0.8",
18
19
  "@vue/compat": "^3.2.37",
20
+ "autoprefixer": "^10.4.8",
19
21
  "axios": "^0.24.0",
20
22
  "bootstrap": "5.2.0",
21
- "core-js": "^3.23.5",
22
23
  "hls.js": "^1.1.5",
23
24
  "humanize-duration": "^3.27.2",
24
25
  "jquery": "^3.5.14",
25
26
  "moment": "^2.29.4",
26
- "moment-locales-webpack-plugin": "^1.2.0",
27
27
  "qrcode.vue": "^3.3.3",
28
28
  "sass": "^1.53.0",
29
- "sass-loader": "^12.6.0",
30
29
  "swiper": "^8.3.1",
31
30
  "v-calendar": "^3.0.0-alpha.8",
31
+ "vite": "^3.0.4",
32
32
  "vue": "^3.2.37",
33
33
  "vue-i18n": "^9.2.0-beta.40",
34
34
  "vue-multiselect": "^3.0.0-alpha.2",
@@ -36,22 +36,18 @@
36
36
  "vue-router": "^4.1.2",
37
37
  "vue3-lazyload": "^0.2.5-beta",
38
38
  "vue3-swatches": "^1.0.10",
39
- "vuex": "^4.0.2",
40
- "webpack": "^5.73.0"
39
+ "vuex": "^4.0.2"
41
40
  },
42
41
  "devDependencies": {
43
42
  "@types/bootstrap": "^5.1.13",
44
43
  "@types/jquery": "^3.5.14",
45
44
  "@typescript-eslint/eslint-plugin": "^5.30.7",
46
45
  "@typescript-eslint/parser": "^5.30.7",
47
- "@vue/cli-plugin-babel": "^5.0.8",
48
- "@vue/cli-plugin-eslint": "^5.0.8",
49
- "@vue/cli-plugin-typescript": "^5.0.8",
50
- "@vue/cli-service": "^5.0.8",
46
+ "@vitejs/plugin-vue": "^3.0.1",
51
47
  "@vue/compiler-sfc": "^3.2.31",
52
48
  "@vue/eslint-config-typescript": "^8.0.0",
53
49
  "eslint": "^8.20.0",
54
- "eslint-plugin-vue": "^7.20.0",
50
+ "eslint-plugin-vue": "^7.17.0",
55
51
  "typescript": "^4.7.4"
56
52
  },
57
53
  "eslintConfig": {
@@ -168,7 +168,6 @@ export default defineComponent({
168
168
  changeLanguage(): void{
169
169
  this.setCookie('octopus-language', this.language);
170
170
  loadLocaleMessages(this.$i18n, this.language, this.$store.state.general.isEducation);
171
- moment.locale(this.$i18n.locale);
172
171
  octopusApi.fetchDataWithParams<Array<Category>>(0, `iab/list${state.octopusApi.organisationId? '/'+state.octopusApi.organisationId : ''}`, { lang: this.$i18n.locale }).then((data: Array<Category>) => {
173
172
  this.$store.commit('categoriesSet', data);
174
173
  if(this.$store.state.filter.iab){
package/src/i18n.ts CHANGED
@@ -1,7 +1,12 @@
1
1
 
2
2
  import { nextTick } from 'vue'
3
3
  import { createI18n } from 'vue-i18n';
4
-
4
+ import moment from 'moment';
5
+ import 'moment/dist/locale/de.js';
6
+ import 'moment/dist/locale/es.js';
7
+ import 'moment/dist/locale/fr.js';
8
+ import 'moment/dist/locale/it.js';
9
+ import 'moment/dist/locale/sl.js';
5
10
 
6
11
  export function setupI18n(options = { locale: 'en' }, isEducation: boolean) {
7
12
  const i18n = createI18n(options)
@@ -11,6 +16,7 @@ export function setupI18n(options = { locale: 'en' }, isEducation: boolean) {
11
16
 
12
17
  export function setI18nLanguage(i18n: any, locale: string) {
13
18
  i18n.locale = locale;
19
+ moment.locale(locale);
14
20
  const html= document.querySelector('html');
15
21
  if(html){
16
22
  html.setAttribute('lang', locale);
@@ -19,6 +25,7 @@ export function setI18nLanguage(i18n: any, locale: string) {
19
25
 
20
26
  export async function loadLocaleMessages(i18n: any, locale:string, isEducation: boolean) {
21
27
  if(!i18n.messages[locale] || 0===Object.keys(i18n.messages[locale]).length){
28
+
22
29
  let messages = await import(
23
30
  `./locale/${locale}.ts`
24
31
  )
package/src/main.ts CHANGED
@@ -4,7 +4,6 @@ import VueLazyLoad from 'vue3-lazyload';
4
4
  import App from './App.vue';
5
5
  import {setupI18n} from './i18n';
6
6
  import router from '@/router/router';
7
- import moment from 'moment';
8
7
  import store from '@/store/AppStore';
9
8
  import paramStore from '@/store/paramStore';
10
9
  /* import 'popper.js/dist/popper.min.js'; */
@@ -43,7 +42,6 @@ if(0===language.length){
43
42
  }
44
43
 
45
44
  const i18n = setupI18n({locale: language}, store.state.general.education);
46
- moment.locale(language);
47
45
 
48
46
  paramStore.initialize({
49
47
  generalParameters: {},
@@ -196,7 +196,7 @@ const routes: Array<RouteRecordRaw> = [
196
196
 
197
197
  ];
198
198
  export default createRouter({
199
- history: createWebHistory(process.env.BASE_URL),
199
+ history: createWebHistory(),
200
200
  routes: routes,
201
201
  scrollBehavior(): {left: number; top: number} {
202
202
  return { left: 0, top: 0 };
package/vite.config.js ADDED
@@ -0,0 +1,16 @@
1
+ /* eslint-disable */
2
+
3
+ import { defineConfig } from 'vite';
4
+ import vue from '@vitejs/plugin-vue';
5
+ const path = require('path');
6
+ export default defineConfig({
7
+ resolve: {
8
+ alias: {
9
+ '@': path.resolve(__dirname, './src'),
10
+ },
11
+ },
12
+ plugins: [
13
+ vue(),
14
+ ]
15
+ });
16
+ /* eslint-enable */
package/babel.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- presets: [
3
- '@vue/cli-plugin-babel/preset'
4
- ]
5
- }
package/vue.config.js DELETED
@@ -1,16 +0,0 @@
1
- /* eslint-disable */
2
- const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
3
-
4
- module.exports = {
5
- configureWebpack: {
6
- output: {
7
- globalObject: 'this',
8
- },
9
- plugins:[
10
- new MomentLocalesPlugin({
11
- localesToKeep: ['fr'],
12
- }),
13
- ],
14
- },
15
- };
16
- /* eslint-enable */