@saooti/octopus-sdk 32.0.12 → 32.0.15

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
@@ -656,3 +656,6 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
656
656
  * 32.0.10 Ajout alt
657
657
  * 32.0.11 Merge 31
658
658
  * 32.0.12 Merge 31
659
+ * 32.0.13 Test Vite au lieu de Webpack
660
+ * 32.0.14 Mise en place Vite au lieu de Webpack
661
+ * 32.0.15 Pb lié refactor
@@ -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,35 +1,34 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "32.0.12",
3
+ "version": "32.0.15",
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
- "main": "./dist/octopus.common.js",
16
16
  "dependencies": {
17
- "@saooti/octopus-api": "^0.31.7",
17
+ "@saooti/octopus-api": "^0.32.0",
18
18
  "@vue/cli": "^5.0.8",
19
19
  "@vue/compat": "^3.2.37",
20
+ "autoprefixer": "^10.4.8",
20
21
  "axios": "^0.24.0",
21
22
  "bootstrap": "5.2.0",
22
- "core-js": "^3.23.5",
23
23
  "hls.js": "^1.1.5",
24
24
  "humanize-duration": "^3.27.2",
25
25
  "jquery": "^3.5.14",
26
26
  "moment": "^2.29.4",
27
- "moment-locales-webpack-plugin": "^1.2.0",
28
27
  "qrcode.vue": "^3.3.3",
29
28
  "sass": "^1.53.0",
30
- "sass-loader": "^12.6.0",
31
29
  "swiper": "^8.3.1",
32
30
  "v-calendar": "^3.0.0-alpha.8",
31
+ "vite": "^3.0.4",
33
32
  "vue": "^3.2.37",
34
33
  "vue-i18n": "^9.2.0-beta.40",
35
34
  "vue-multiselect": "^3.0.0-alpha.2",
@@ -37,22 +36,18 @@
37
36
  "vue-router": "^4.1.2",
38
37
  "vue3-lazyload": "^0.2.5-beta",
39
38
  "vue3-swatches": "^1.0.10",
40
- "vuex": "^4.0.2",
41
- "webpack": "^5.73.0"
39
+ "vuex": "^4.0.2"
42
40
  },
43
41
  "devDependencies": {
44
42
  "@types/bootstrap": "^5.1.13",
45
43
  "@types/jquery": "^3.5.14",
46
44
  "@typescript-eslint/eslint-plugin": "^5.30.7",
47
45
  "@typescript-eslint/parser": "^5.30.7",
48
- "@vue/cli-plugin-babel": "^5.0.8",
49
- "@vue/cli-plugin-eslint": "^5.0.8",
50
- "@vue/cli-plugin-typescript": "^5.0.8",
51
- "@vue/cli-service": "^5.0.8",
46
+ "@vitejs/plugin-vue": "^3.0.1",
52
47
  "@vue/compiler-sfc": "^3.2.31",
53
48
  "@vue/eslint-config-typescript": "^8.0.0",
54
49
  "eslint": "^8.20.0",
55
- "eslint-plugin-vue": "^7.20.0",
50
+ "eslint-plugin-vue": "^7.17.0",
56
51
  "typescript": "^4.7.4"
57
52
  },
58
53
  "eslintConfig": {
@@ -136,7 +136,7 @@ export default defineComponent({
136
136
  }
137
137
  },
138
138
  organisation(): string|undefined {
139
- return this.organisationId ?? this.$store.state.filter.organisationId;
139
+ return this.organisationId ?this.organisationId:this.$store.state.filter.organisationId;
140
140
  },
141
141
  },
142
142
  watch: {
@@ -72,7 +72,7 @@ export default defineComponent({
72
72
  return this.$store.state.filter.organisationId;
73
73
  },
74
74
  organisation(): string|undefined {
75
- return this.organisationId ?? this.filterOrga;
75
+ return this.organisationId ?this.organisationId: this.filterOrga;
76
76
  },
77
77
  rubriqueFilter(): Array<RubriquageFilter>{
78
78
  return this.$store.state.filter.rubriqueFilter;
@@ -80,7 +80,7 @@ export default defineComponent({
80
80
  return this.loaded && !this.livesArray[0].lives.length && !this.livesArray[2].lives.length && !this.livesArray[3].lives.length;
81
81
  },
82
82
  filterOrgaUsed(): string|undefined {
83
- return this.filterOrga??this.organisationId;
83
+ return this.filterOrga?this.filterOrga:this.organisationId;
84
84
  },
85
85
  filterOrga(): string {
86
86
  return this.$store.state.filter.organisationId;
@@ -75,7 +75,7 @@ export default defineComponent({
75
75
  return this.participants.slice(this.dfirst, Math.min(this.dfirst + this.dsize,this.totalCount));
76
76
  },
77
77
  organisation(): string|undefined {
78
- return this.organisationId??this.$store.state.filter.organisationId;
78
+ return this.organisationId?this.organisationId:this.$store.state.filter.organisationId;
79
79
  },
80
80
  },
81
81
  watch: {
@@ -80,7 +80,7 @@ export default defineComponent({
80
80
  return !this.query ?'NAME': 'SCORE';
81
81
  },
82
82
  organisation(): string|undefined {
83
- return this.organisationId ?? this.$store.state.filter.organisationId;
83
+ return this.organisationId ?this.organisationId: this.$store.state.filter.organisationId;
84
84
  },
85
85
  },
86
86
  watch: {
@@ -111,7 +111,7 @@ export default defineComponent({
111
111
  return this.$store.state.filter.organisationId;
112
112
  },
113
113
  organisation(): string|undefined {
114
- return this.organisationId ?? this.filterOrga;
114
+ return this.organisationId ?this.organisationId: this.filterOrga;
115
115
  },
116
116
  previousAvailable(): boolean {
117
117
  return this.index > 0;
@@ -96,7 +96,7 @@ export default defineComponent({
96
96
  ${this.rubriqueId}|${this.rubriquageId}|${this.before}|${this.after}|${this.includeHidden}|${this.noRubriquageId}|${this.notValid}`;
97
97
  },
98
98
  organisation(): string|undefined {
99
- return this.organisationId ?? this.$store.state.filter.organisationId;
99
+ return this.organisationId ?this.organisationId: this.$store.state.filter.organisationId;
100
100
  },
101
101
  sort(): string {
102
102
  return this.popularSort? "POPULARITY" : this.sortCriteria??'DATE';
@@ -95,7 +95,7 @@ export default defineComponent({
95
95
  return this.$store.state.filter.organisationId;
96
96
  },
97
97
  organisation(): string|undefined {
98
- return this.organisationId ?? this.filterOrga;
98
+ return this.organisationId ?this.organisationId: this.filterOrga;
99
99
  },
100
100
  watchVariable():string{
101
101
  return `${this.emissionId}|${this.organisationId}|${this.filterOrga}|${this.iabId}|${this.rubriqueId}|${this.rubriquageId}|${this.query}`;
@@ -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){
@@ -96,7 +96,7 @@ export default defineComponent({
96
96
  true===state.generalParameters.isAdmin
97
97
  },
98
98
  organisation(): string|undefined {
99
- return this.organisationId??this.filterOrga;
99
+ return this.organisationId?this.organisationId:this.filterOrga;
100
100
  },
101
101
  },
102
102
 
@@ -106,7 +106,7 @@ export default defineComponent({
106
106
  methods: {
107
107
  initComponent(): void{
108
108
  this.iabId =this.$store.state.filter.iab?.id;
109
- this.organisationId = this.productor?? this.filterOrga;
109
+ this.organisationId = this.productor ?this.productor: this.filterOrga;
110
110
  if (this.organisation && this.organisationRight) {
111
111
  this.includeHidden = true;
112
112
  }
@@ -47,7 +47,7 @@ export default defineComponent({
47
47
  },
48
48
  },
49
49
  created() {
50
- this.organisationId = this.productor??this.filterOrga;
50
+ this.organisationId = this.productor ?this.productor: this.filterOrga;
51
51
  },
52
52
  })
53
53
  </script>
@@ -66,7 +66,7 @@ export default defineComponent({
66
66
  },
67
67
 
68
68
  created() {
69
- this.organisationId = this.productor ??this.filterOrga;
69
+ this.organisationId = this.productor ?this.productor: this.filterOrga;;
70
70
  },
71
71
  })
72
72
  </script>
@@ -117,7 +117,7 @@ export default defineComponent({
117
117
  true===state.generalParameters.isAdmin;
118
118
  },
119
119
  organisation(): string|undefined {
120
- return this.organisationId ?? this.filterOrga;
120
+ return this.organisationId ?this.organisationId: this.filterOrga;
121
121
  },
122
122
  pageParameters(){
123
123
  return {
@@ -134,7 +134,7 @@ export default defineComponent({
134
134
  methods: {
135
135
  initPodcastsPage(){
136
136
  this.searchPattern = this.searchInit ?? '';
137
- this.organisationId = this.productor ?? this.filterOrga;
137
+ this.organisationId = this.productor ?this.productor: this.filterOrga;
138
138
  this.includeHidden = this.organisation && this.organisationRight ? true : false;
139
139
  this.iabId =this.$store.state.filter.iab?.id;
140
140
  if(this.$store.state.filter.rubriqueFilter.length){
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 */