@golstats/gsc-game-data 1.0.325-alpha.1 → 1.0.325-alpha.2

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.
Files changed (2) hide show
  1. package/README.md +74 -19
  2. package/package.json +7 -5
package/README.md CHANGED
@@ -1,35 +1,90 @@
1
- # gsc-games-data
1
+ # @golstats/gsc-game-data
2
2
 
3
- This template should help get you started developing with Vue 3 in Vite.
3
+ Componente Vue para visualización de datos de juegos deportivos.
4
4
 
5
- ## Recommended IDE Setup
5
+ ## Instalación
6
6
 
7
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
7
+ ```bash
8
+ npm install @golstats/gsc-game-data
9
+ ```
8
10
 
9
- ## Customize configuration
11
+ ## Uso Básico
10
12
 
11
- See [Vite Configuration Reference](https://vitejs.dev/config/).
13
+ ```javascript
14
+ import { createApp } from 'vue'
15
+ import { createStore } from 'vuex'
16
+ import { GSCGameData, registerStoreModules } from '@golstats/gsc-game-data'
17
+ import '@golstats/gsc-game-data/style.css'
12
18
 
13
- ## Project Setup
19
+ // Crear store
20
+ const store = createStore({
21
+ // tu configuración de store
22
+ })
14
23
 
15
- ```sh
16
- npm install
17
- ```
24
+ // Registrar módulos necesarios
25
+ registerStoreModules(store)
18
26
 
19
- ### Compile and Hot-Reload for Development
27
+ // Crear aplicación
28
+ const app = createApp({
29
+ components: {
30
+ GSCGameData
31
+ },
32
+ template: `
33
+ <GSCGameData
34
+ :default-game-id="gameID"
35
+ :current-season-id="seasonID"
36
+ :sort-calendar="false"
37
+ :socket="socket"
38
+ />
39
+ `
40
+ })
20
41
 
21
- ```sh
22
- npm run dev
42
+ app.use(store)
43
+ app.mount('#app')
23
44
  ```
24
45
 
25
- ### Compile and Minify for Production
46
+ ## Importación de Componentes Individuales
26
47
 
27
- ```sh
28
- npm run build
48
+ Para mejorar el rendimiento, puedes importar componentes individuales:
49
+
50
+ ```javascript
51
+ // Importación bajo demanda
52
+ import { GSCGameData } from '@golstats/gsc-game-data'
53
+ import { StatisticsMain } from '@golstats/gsc-game-data/statistics'
54
+ import { GSCProminentMain } from '@golstats/gsc-game-data/prominent'
29
55
  ```
30
56
 
31
- ### Lint with [ESLint](https://eslint.org/)
57
+ ## Solución de Problemas
58
+
59
+ ### Error: _export_sfc4 is not a function
60
+
61
+ Si encuentras este error, asegúrate de estar usando la versión más reciente del paquete que incluye las correcciones para los helpers de Vue.
62
+
63
+ ### Error: Failed to resolve module specifier
64
+
65
+ Si encuentras errores de resolución de módulos, asegúrate de que las rutas de importación sean correctas:
32
66
 
33
- ```sh
34
- npm run lint
67
+ ```javascript
68
+ // Correcto
69
+ import { GSCGameData } from '@golstats/gsc-game-data'
70
+
71
+ // Incorrecto - no usar rutas relativas para importar el paquete
72
+ import { GSCGameData } from '../node_modules/@golstats/gsc-game-data'
35
73
  ```
74
+
75
+ ## Optimizaciones Implementadas
76
+
77
+ Esta versión incluye importantes optimizaciones:
78
+
79
+ 1. **Carga Modular**: Los componentes se cargan bajo demanda para reducir el tiempo de carga inicial
80
+ 2. **Exportaciones Nombradas**: Permite importar solo lo que necesitas
81
+ 3. **Preservación de Helpers**: Corrige problemas con los helpers de Vue en el bundle
82
+ 4. **Resolución de Rutas**: Mejora la compatibilidad con diferentes entornos de build
83
+
84
+ ## Scripts Disponibles
85
+
86
+ - `npm run dev`: Inicia el servidor de desarrollo
87
+ - `npm run build`: Construye el paquete para producción
88
+ - `npm run build:analyze`: Construye y analiza el tamaño del bundle
89
+ - `npm run preview`: Vista previa del paquete construido
90
+ - `npm run lint`: Ejecuta el linter
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@golstats/gsc-game-data",
3
- "version": "1.0.325-alpha.1",
3
+ "version": "1.0.325-alpha.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
- "main": "./dist/gsc-game-data.umd.cjs",
8
+ "main": "./dist/gsc-game-data.js",
9
9
  "module": "./dist/gsc-game-data.js",
10
10
  "exports": {
11
11
  ".": {
12
12
  "import": "./dist/gsc-game-data.js",
13
- "require": "./dist/gsc-game-data.umd.cjs"
13
+ "default": "./dist/gsc-game-data.js"
14
14
  },
15
- "./style.css": "./dist/style.css"
15
+ "./style.css": "./dist/style.css",
16
+ "./dist/style.css": "./dist/style.css"
16
17
  },
17
18
  "scripts": {
18
19
  "dev": "vite",
@@ -20,7 +21,8 @@
20
21
  "build:analyze": "vite build --mode analyze",
21
22
  "preview": "vite preview",
22
23
  "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
23
- "format": "prettier --write src/"
24
+ "format": "prettier --write src/",
25
+ "prepublishOnly": "npm run build"
24
26
  },
25
27
  "dependencies": {
26
28
  "@golstats/gsc-calendar-by-game": "1.0.84-alpha.3",