ywana-core8 0.1.96 β 0.1.98
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-PUBLISH.md +166 -0
- package/dist/index.css +4501 -226
- package/dist/index.js +42641 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +37447 -31364
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +40345 -34418
- package/dist/index.umd.js.map +1 -1
- package/doc/src/index.js +1 -2
- package/doc/src/ywana-core8.css +16646 -0
- package/package.json +25 -19
- package/publish.sh +288 -5
- package/src/html/accordion.example.js +0 -74
- package/src/setupTests.js +38 -0
- package/test-publish.sh +159 -0
- package/vite.config.js +86 -0
- package/vitest.config.js +42 -0
- package/dist/index.cjs +0 -36722
- package/dist/index.cjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/src/incubator/pdfViewer.js +0 -33
package/test-publish.sh
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# π§ͺ Script de Prueba para el Publisher
|
4
|
+
# ====================================
|
5
|
+
# Este script muestra cΓ³mo se ve el publisher sin hacer cambios reales
|
6
|
+
|
7
|
+
# Colores para output
|
8
|
+
RED='\033[0;31m'
|
9
|
+
GREEN='\033[0;32m'
|
10
|
+
YELLOW='\033[1;33m'
|
11
|
+
BLUE='\033[0;34m'
|
12
|
+
PURPLE='\033[0;35m'
|
13
|
+
CYAN='\033[0;36m'
|
14
|
+
NC='\033[0m' # No Color
|
15
|
+
|
16
|
+
# FunciΓ³n para mostrar barras de progreso
|
17
|
+
show_progress() {
|
18
|
+
local duration=$1
|
19
|
+
local message=$2
|
20
|
+
local progress=0
|
21
|
+
local bar_length=50
|
22
|
+
|
23
|
+
echo -e "${CYAN}${message}${NC}"
|
24
|
+
|
25
|
+
while [ $progress -le $duration ]; do
|
26
|
+
local filled=$((progress * bar_length / duration))
|
27
|
+
local empty=$((bar_length - filled))
|
28
|
+
|
29
|
+
printf "\r${GREEN}["
|
30
|
+
printf "%*s" $filled | tr ' ' '='
|
31
|
+
printf "%*s" $empty | tr ' ' '-'
|
32
|
+
printf "]${NC} %d%%" $((progress * 100 / duration))
|
33
|
+
|
34
|
+
sleep 0.05
|
35
|
+
progress=$((progress + 1))
|
36
|
+
done
|
37
|
+
echo ""
|
38
|
+
}
|
39
|
+
|
40
|
+
# FunciΓ³n para mostrar spinner
|
41
|
+
show_spinner() {
|
42
|
+
local duration=$1
|
43
|
+
local message=$2
|
44
|
+
local spin='β β β Ήβ Έβ Όβ ΄β ¦β §β β '
|
45
|
+
local i=0
|
46
|
+
local count=0
|
47
|
+
|
48
|
+
echo -e "${CYAN}${message}${NC}"
|
49
|
+
while [ $count -lt $duration ]; do
|
50
|
+
i=$(( (i+1) %10 ))
|
51
|
+
printf "\r${YELLOW}${spin:$i:1}${NC} Procesando..."
|
52
|
+
sleep 0.1
|
53
|
+
count=$((count + 1))
|
54
|
+
done
|
55
|
+
printf "\r${GREEN}β${NC} Completado\n"
|
56
|
+
}
|
57
|
+
|
58
|
+
# FunciΓ³n para log con timestamp
|
59
|
+
log() {
|
60
|
+
local level=$1
|
61
|
+
local message=$2
|
62
|
+
local timestamp=$(date '+%H:%M:%S')
|
63
|
+
|
64
|
+
case $level in
|
65
|
+
"INFO") echo -e "${BLUE}[${timestamp}]${NC} ${message}" ;;
|
66
|
+
"SUCCESS") echo -e "${GREEN}[${timestamp}] β${NC} ${message}" ;;
|
67
|
+
"WARNING") echo -e "${YELLOW}[${timestamp}] β ${NC} ${message}" ;;
|
68
|
+
"ERROR") echo -e "${RED}[${timestamp}] β${NC} ${message}" ;;
|
69
|
+
esac
|
70
|
+
}
|
71
|
+
|
72
|
+
# Banner inicial
|
73
|
+
echo -e "${PURPLE}"
|
74
|
+
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
|
75
|
+
echo "β π§ͺ DEMO PUBLISHER β"
|
76
|
+
echo "β (Modo de Prueba - Sin Cambios) β"
|
77
|
+
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
|
78
|
+
echo -e "${NC}"
|
79
|
+
|
80
|
+
COMMIT_MESSAGE="Demo: MigraciΓ³n completa a Vite con mejoras de rendimiento"
|
81
|
+
log "INFO" "Mensaje de commit: ${COMMIT_MESSAGE}"
|
82
|
+
|
83
|
+
echo ""
|
84
|
+
log "INFO" "Iniciando pipeline de publicaciΓ³n (DEMO)..."
|
85
|
+
|
86
|
+
# PASO 1: Verificaciones Previas
|
87
|
+
echo -e "\n${PURPLE}π PASO 1: Verificaciones Previas${NC}"
|
88
|
+
log "INFO" "Rama actual: main"
|
89
|
+
log "SUCCESS" "Working directory limpio"
|
90
|
+
log "SUCCESS" "ConexiΓ³n a internet OK"
|
91
|
+
log "SUCCESS" "Verificaciones previas completadas"
|
92
|
+
|
93
|
+
# PASO 2: Tests
|
94
|
+
echo -e "\n${PURPLE}π§ͺ PASO 2: Ejecutando Tests${NC}"
|
95
|
+
log "INFO" "Ejecutando suite de tests..."
|
96
|
+
show_spinner 25 "Ejecutando tests"
|
97
|
+
log "SUCCESS" "Todos los tests pasaron (19 suites, 348 tests)"
|
98
|
+
|
99
|
+
# PASO 3: Build
|
100
|
+
echo -e "\n${PURPLE}π¨ PASO 3: Building Proyecto${NC}"
|
101
|
+
log "SUCCESS" "Build anterior eliminado"
|
102
|
+
log "INFO" "Iniciando build con Vite..."
|
103
|
+
show_spinner 15 "Compilando con Vite"
|
104
|
+
log "SUCCESS" "Build completado en 1.37s"
|
105
|
+
|
106
|
+
echo -e "${CYAN}π¦ Archivos generados:${NC}"
|
107
|
+
echo -e " index.css (1.4M)"
|
108
|
+
echo -e " index.js (1.6M)"
|
109
|
+
echo -e " index.modern.js (1.6M)"
|
110
|
+
echo -e " index.umd.js (1.7M)"
|
111
|
+
|
112
|
+
# PASO 4: VersiΓ³n
|
113
|
+
echo -e "\n${PURPLE}π PASO 4: Incrementando VersiΓ³n${NC}"
|
114
|
+
CURRENT_VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "0.1.95")
|
115
|
+
NEW_VERSION="0.1.96"
|
116
|
+
log "INFO" "VersiΓ³n actual: v${CURRENT_VERSION}"
|
117
|
+
log "SUCCESS" "Nueva versiΓ³n: v${NEW_VERSION}"
|
118
|
+
|
119
|
+
# PASO 5: Git
|
120
|
+
echo -e "\n${PURPLE}π€ PASO 5: Git Commit y Push${NC}"
|
121
|
+
log "INFO" "AΓ±adiendo archivos al staging..."
|
122
|
+
show_progress 20 "Preparando commit..."
|
123
|
+
FULL_COMMIT_MESSAGE="v${NEW_VERSION}: ${COMMIT_MESSAGE}"
|
124
|
+
log "INFO" "Creando commit: ${FULL_COMMIT_MESSAGE}"
|
125
|
+
log "SUCCESS" "Commit creado (DEMO - no real)"
|
126
|
+
log "SUCCESS" "Tag v${NEW_VERSION} creado (DEMO - no real)"
|
127
|
+
show_spinner 20 "Subiendo cambios a GitHub"
|
128
|
+
log "SUCCESS" "Push completado exitosamente (DEMO - no real)"
|
129
|
+
|
130
|
+
# PASO 6: NPM
|
131
|
+
echo -e "\n${PURPLE}π¦ PASO 6: Publicando a NPM${NC}"
|
132
|
+
log "INFO" "Usuario NPM: demo-user"
|
133
|
+
show_spinner 30 "Publicando a NPM Registry"
|
134
|
+
log "SUCCESS" "Paquete publicado exitosamente (DEMO - no real)"
|
135
|
+
|
136
|
+
# RESUMEN FINAL
|
137
|
+
echo -e "\n${GREEN}"
|
138
|
+
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
|
139
|
+
echo "β π DEMO COMPLETADO β"
|
140
|
+
echo "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
|
141
|
+
echo -e "${NC}"
|
142
|
+
|
143
|
+
echo -e "${CYAN}π Resumen de la publicaciΓ³n (DEMO):${NC}"
|
144
|
+
echo -e " ${GREEN}β${NC} VersiΓ³n: v${CURRENT_VERSION} β v${NEW_VERSION}"
|
145
|
+
echo -e " ${GREEN}β${NC} Commit: ${FULL_COMMIT_MESSAGE}"
|
146
|
+
echo -e " ${GREEN}β${NC} Rama: main"
|
147
|
+
echo -e " ${GREEN}β${NC} Usuario NPM: demo-user"
|
148
|
+
echo -e " ${GREEN}β${NC} Build time: 1.37s"
|
149
|
+
|
150
|
+
echo -e "\n${CYAN}π Enlaces ΓΊtiles:${NC}"
|
151
|
+
echo -e " π¦ NPM: https://www.npmjs.com/package/ywana-core8"
|
152
|
+
echo -e " π GitHub: https://github.com/ywana/ywana-core8"
|
153
|
+
echo -e " π Tag: https://github.com/ywana/ywana-core8/releases/tag/v${NEW_VERSION}"
|
154
|
+
|
155
|
+
echo -e "\n${CYAN}π₯ Para instalar la nueva versiΓ³n:${NC}"
|
156
|
+
echo -e " ${YELLOW}npm install ywana-core8@${NEW_VERSION}${NC}"
|
157
|
+
|
158
|
+
echo -e "\n${GREEN}π Β‘Demo completado exitosamente!${NC}"
|
159
|
+
echo -e "${PURPLE}Para usar el publisher real, ejecuta: ./publish.sh${NC}\n"
|
package/vite.config.js
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
import { defineConfig } from 'vite'
|
2
|
+
import react from '@vitejs/plugin-react'
|
3
|
+
import { resolve } from 'path'
|
4
|
+
|
5
|
+
export default defineConfig({
|
6
|
+
plugins: [
|
7
|
+
react({
|
8
|
+
// Usar React.createElement como microbundle
|
9
|
+
jsxRuntime: 'classic',
|
10
|
+
// Incluir archivos .js que contengan JSX
|
11
|
+
include: /\.(jsx|js|ts|tsx)$/
|
12
|
+
})
|
13
|
+
],
|
14
|
+
|
15
|
+
build: {
|
16
|
+
lib: {
|
17
|
+
entry: resolve(__dirname, 'src/index.js'),
|
18
|
+
name: 'YwanaCore8',
|
19
|
+
formats: ['es', 'cjs', 'umd'],
|
20
|
+
fileName: (format) => {
|
21
|
+
switch (format) {
|
22
|
+
case 'es':
|
23
|
+
return 'index.modern.js'
|
24
|
+
case 'cjs':
|
25
|
+
return 'index.js'
|
26
|
+
case 'umd':
|
27
|
+
return 'index.umd.js'
|
28
|
+
default:
|
29
|
+
return `index.${format}.js`
|
30
|
+
}
|
31
|
+
}
|
32
|
+
},
|
33
|
+
|
34
|
+
rollupOptions: {
|
35
|
+
// Externalizar peer dependencies
|
36
|
+
external: ['react', 'react-dom'],
|
37
|
+
output: {
|
38
|
+
globals: {
|
39
|
+
react: 'React',
|
40
|
+
'react-dom': 'ReactDOM'
|
41
|
+
},
|
42
|
+
// Configurar nombres de archivos CSS
|
43
|
+
assetFileNames: (assetInfo) => {
|
44
|
+
if (assetInfo.name && assetInfo.name.endsWith('.css')) {
|
45
|
+
return 'index.css'
|
46
|
+
}
|
47
|
+
return assetInfo.name
|
48
|
+
}
|
49
|
+
}
|
50
|
+
},
|
51
|
+
|
52
|
+
// No comprimir como microbundle --no-compress
|
53
|
+
minify: false,
|
54
|
+
|
55
|
+
// Generar sourcemaps
|
56
|
+
sourcemap: true
|
57
|
+
},
|
58
|
+
|
59
|
+
// ConfiguraciΓ³n para desarrollo
|
60
|
+
server: {
|
61
|
+
port: 3000,
|
62
|
+
open: false
|
63
|
+
},
|
64
|
+
|
65
|
+
// Configurar esbuild para JSX en archivos .js
|
66
|
+
esbuild: {
|
67
|
+
loader: 'jsx',
|
68
|
+
include: /src\/.*\.js$/,
|
69
|
+
exclude: []
|
70
|
+
},
|
71
|
+
|
72
|
+
// Resolver alias si es necesario
|
73
|
+
resolve: {
|
74
|
+
alias: {
|
75
|
+
'@': resolve(__dirname, 'src')
|
76
|
+
}
|
77
|
+
},
|
78
|
+
|
79
|
+
// ConfiguraciΓ³n para testing con Vitest
|
80
|
+
test: {
|
81
|
+
environment: 'jsdom',
|
82
|
+
setupFiles: ['./src/setupTests.js'],
|
83
|
+
globals: true,
|
84
|
+
css: true
|
85
|
+
}
|
86
|
+
})
|
package/vitest.config.js
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
2
|
+
import react from '@vitejs/plugin-react'
|
3
|
+
import { resolve } from 'path'
|
4
|
+
|
5
|
+
export default defineConfig({
|
6
|
+
plugins: [
|
7
|
+
react({
|
8
|
+
jsxRuntime: 'classic'
|
9
|
+
})
|
10
|
+
],
|
11
|
+
|
12
|
+
test: {
|
13
|
+
environment: 'jsdom',
|
14
|
+
setupFiles: ['./src/setupTests.js'],
|
15
|
+
globals: true,
|
16
|
+
css: true,
|
17
|
+
|
18
|
+
// ConfiguraciΓ³n similar a Jest
|
19
|
+
include: [
|
20
|
+
'src/**/__tests__/**/*.(js|jsx)',
|
21
|
+
'src/**/?(*.)(spec|test).(js|jsx)'
|
22
|
+
],
|
23
|
+
|
24
|
+
coverage: {
|
25
|
+
include: [
|
26
|
+
'src/**/*.(js|jsx)'
|
27
|
+
],
|
28
|
+
exclude: [
|
29
|
+
'src/index.js',
|
30
|
+
'src/setupTests.js',
|
31
|
+
'src/**/*.test.(js|jsx)',
|
32
|
+
'src/**/*.spec.(js|jsx)'
|
33
|
+
]
|
34
|
+
}
|
35
|
+
},
|
36
|
+
|
37
|
+
resolve: {
|
38
|
+
alias: {
|
39
|
+
'@': resolve(__dirname, 'src')
|
40
|
+
}
|
41
|
+
}
|
42
|
+
})
|