@empathyco/x-archetype-utils 2.1.5 → 2.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-archetype-utils",
3
- "version": "2.1.5",
3
+ "version": "2.2.0",
4
4
  "description": "Utilities for x-archetype",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -41,11 +41,11 @@
41
41
  "prepublishOnly": "pnpm run build"
42
42
  },
43
43
  "peerDependencies": {
44
- "vue": "^3.5.44",
44
+ "vue": "^3.5.45",
45
45
  "vue-i18n": "^9.14.5"
46
46
  },
47
47
  "dependencies": {
48
- "@empathyco/x-utils": "1.1.5",
48
+ "@empathyco/x-utils": "1.2.0",
49
49
  "vue-i18n": "~9.14.5"
50
50
  },
51
51
  "devDependencies": {
@@ -53,14 +53,14 @@
53
53
  "@vue/test-utils": "2.5.1",
54
54
  "jsdom": "30.1.3",
55
55
  "typescript": "5.9.3",
56
- "vite": "6.4.5",
56
+ "vite": "6.4.6",
57
57
  "vite-plugin-dts": "4.5.4",
58
58
  "vite-plugin-static-copy": "4.1.1",
59
59
  "vitest": "4.1.12",
60
- "vue": "3.5.44"
60
+ "vue": "3.5.45"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "317191ef5637e5f390f558ced832dee6b57df8cc"
65
+ "gitHead": "193fbc1c4fef9c7dcaa6060cd2331b66e1a551d2"
66
66
  }
@@ -1,21 +1,29 @@
1
1
  ---
2
2
  name: x-archetype-utils
3
- description: 'Use when importing, using, or debugging components from x-archetype-utils.'
3
+ description: 'Build and runtime helpers for x-archetype based projects (@empathyco/x-archetype-utils): I18n (vue-i18n wrapper with per-device messages), CssInjector for injecting X component styles at runtime, rollupCssInjectorConfig and webpackConfig. Use when setting up translations or switching locale/device, configuring how X component CSS is injected, or adapting the build of an x-archetype project.'
4
4
  ---
5
5
 
6
- # x-archetype-utils
6
+ <!-- skills-check ignore: setLocale, setDevice, transpileDependencies, configureWebpack -->
7
7
 
8
- Utilidades para el desarrollo de `x-archetype`: configuración de builds (Rollup/webpack), inyección de CSS e i18n.
8
+ # @empathyco/x-archetype-utils
9
9
 
10
- ## Componentes disponibles
10
+ Helpers for projects based on x-archetype. Peer dependencies: `vue` and `vue-i18n` 9.
11
11
 
12
- - `webpackConfig` — configuración base de webpack para x-archetype.
13
- - `rollupCssInjectorConfig` — configuración de Rollup con el CSS injector.
14
- - `CssInjector` / `cssInjector` — inyección de CSS en runtime.
15
- - `I18n` — clase de configuración de internacionalización (vue-i18n).
12
+ ## I18n
16
13
 
17
- ## Instalación
14
+ - Create it with `await I18n.create(options)`. `new I18n(options)` does **not** load the
15
+ messages, so installing it renders empty texts.
16
+ - `setLocale(locale)` and `setDevice(device)` load and switch messages at runtime.
17
+ - Messages are grouped by device: `MessagesByDevice` has a `base` set plus one per device.
18
18
 
19
- ```
20
- npm install @empathyco/x-archetype-utils
21
- ```
19
+ ## CSS injection
20
+
21
+ - `cssInjector` is the shared `CssInjector` instance (a singleton, also exposed on
22
+ `window.xCSSInjector`); X component styles are added through it.
23
+ - `rollupCssInjectorConfig` holds the options for the rollup `replace` and `styles` plugins
24
+ that redirect the CSS injection of x-components to `window.xCSSInjector`.
25
+
26
+ ## webpackConfig
27
+
28
+ A Vue CLI configuration fragment (`transpileDependencies`, `configureWebpack`) to spread into
29
+ `vue.config.js` — not a standalone webpack config.