capibara 1.3.72 → 1.3.73
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/dist/index.js +10 -10
- package/package.json +1 -1
- package/src/lib/capibara.js +5 -0
- package/src/version.js +5 -0
- package/vite.config.js +4 -0
package/package.json
CHANGED
package/src/lib/capibara.js
CHANGED
|
@@ -4,6 +4,7 @@ import utils from '../util/utils';
|
|
|
4
4
|
import tableElements from '../util/tableElements';
|
|
5
5
|
import styleUtils from '../util/styleUtils';
|
|
6
6
|
import icons from '../util/icons';
|
|
7
|
+
import { CAPIBARA_VERSION, IS_PRODUCTION_BUILD } from '../version';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Capibara, planilla para despliegue de datos por fecha como GANTT
|
|
@@ -25,6 +26,10 @@ export class Capibara{
|
|
|
25
26
|
constructor({config}){
|
|
26
27
|
if(config == null) console.error("config no econtrado");
|
|
27
28
|
|
|
29
|
+
if (IS_PRODUCTION_BUILD && typeof console !== "undefined") {
|
|
30
|
+
console.info(`[Capibara] versión ${CAPIBARA_VERSION} (producción)`);
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
this.containerElement = document.querySelector(config.selector);
|
|
29
34
|
|
|
30
35
|
if(this.containerElement == null) console.error("Elemento dom segun config.selector, no encontrado");
|
package/src/version.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Vite reemplaza este valor al compilar el paquete. Mantenerlo en un módulo
|
|
2
|
+
// separado permite que todas las instancias reporten la misma versión real del
|
|
3
|
+
// bundle, no una versión inferida por la aplicación consumidora.
|
|
4
|
+
export const CAPIBARA_VERSION = __CAPIBARA_VERSION__;
|
|
5
|
+
export const IS_PRODUCTION_BUILD = import.meta.env.PROD;
|
package/vite.config.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { defineConfig } from "vite";
|
|
2
2
|
import { resolve } from "path";
|
|
3
3
|
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
|
|
4
|
+
import packageJson from "./package.json";
|
|
4
5
|
|
|
5
6
|
export default defineConfig({
|
|
7
|
+
define: {
|
|
8
|
+
__CAPIBARA_VERSION__: JSON.stringify(packageJson.version),
|
|
9
|
+
},
|
|
6
10
|
plugins: [cssInjectedByJsPlugin()],
|
|
7
11
|
css: {
|
|
8
12
|
preprocessorOptions: {
|