@jjlmoya/utils-hardware 1.6.0 → 1.9.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": "@jjlmoya/utils-hardware",
3
- "version": "1.6.0",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { hardwareCategory } from './category';
2
- export { default as hardwareCategorySEO } from './category/seo.astro';
2
+ export const hardwareCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
3
3
 
4
4
  export type {
5
5
  KnownLocale,
@@ -15,7 +15,7 @@ export type {
15
15
  ToolDefinition,
16
16
  } from './types';
17
17
 
18
- export { ALL_TOOLS } from './tools';
18
+ export { ALL_ENTRIES, ALL_TOOLS } from './tools';
19
19
 
20
20
  export { PixelesPantallaComponent, PixelesPantallaSEO, PixelesPantallaBibliography, PIXELES_PANTALLA_TOOL } from './tool/deadPixelTest/index';
21
21
  export { TestTecladoComponent, TestTecladoSEO, TestTecladoBibliography, TEST_TECLADO_TOOL } from './tool/keyboardTest/index';
@@ -14,7 +14,8 @@ import type { UtilitySEOContent } from "@jjlmoya/utils-shared";
14
14
  export async function getStaticPaths() {
15
15
  const paths = [];
16
16
 
17
- for (const { entry, Component } of ALL_TOOLS) {
17
+ for (const { entry, Component: lazyComp } of ALL_TOOLS) {
18
+ const { default: Component } = await lazyComp();
18
19
  const localeEntries = Object.entries(entry.i18n) as [
19
20
  KnownLocale,
20
21
  () => Promise<ToolLocaleContent>,
@@ -52,8 +53,6 @@ export async function getStaticPaths() {
52
53
  return paths;
53
54
  }
54
55
 
55
- type ToolComponent = (props: { ui: Record<string, string> }) => unknown;
56
-
57
56
  interface NavItem {
58
57
  id: string;
59
58
  title: string;
@@ -62,7 +61,7 @@ interface NavItem {
62
61
  }
63
62
 
64
63
  interface Props {
65
- Component: ToolComponent;
64
+ Component: unknown;
66
65
  locale: KnownLocale;
67
66
  content: ToolLocaleContent;
68
67
  localeUrls: Partial<Record<KnownLocale, string>>;
@@ -1,8 +1,5 @@
1
1
  import type { HardwareToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
2
 
3
- import EstimadorSaludBateriaComponent from './component.astro';
4
- import EstimadorSaludBateriaSEO from './seo.astro';
5
- import EstimadorSaludBateriaBibliography from './bibliography.astro';
6
3
 
7
4
  import type { EstimadorSaludBateriaUI } from './ui';
8
5
  export type EstimadorSaludBateriaLocaleContent = ToolLocaleContent<EstimadorSaludBateriaUI>;
@@ -32,11 +29,10 @@ export const estimadorSaludBateria: HardwareToolEntry<EstimadorSaludBateriaUI> =
32
29
  },
33
30
  };
34
31
 
35
- export { EstimadorSaludBateriaComponent, EstimadorSaludBateriaSEO, EstimadorSaludBateriaBibliography };
36
32
 
37
33
  export const ESTIMADOR_SALUD_BATERIA_TOOL: ToolDefinition = {
38
34
  entry: estimadorSaludBateria,
39
- Component: EstimadorSaludBateriaComponent,
40
- SEOComponent: EstimadorSaludBateriaSEO,
41
- BibliographyComponent: EstimadorSaludBateriaBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };
@@ -1,8 +1,5 @@
1
1
  import type { HardwareToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
2
 
3
- import PixelesPantallaComponent from './component.astro';
4
- import PixelesPantallaSEO from './seo.astro';
5
- import PixelesPantallaBibliography from './bibliography.astro';
6
3
 
7
4
  import type { PixelesPantallaUI } from './ui';
8
5
  export type PixelesPantallaLocaleContent = ToolLocaleContent<PixelesPantallaUI>;
@@ -32,11 +29,10 @@ export const pixelesPantalla: HardwareToolEntry<PixelesPantallaUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { PixelesPantallaComponent, PixelesPantallaSEO, PixelesPantallaBibliography };
36
32
 
37
33
  export const PIXELES_PANTALLA_TOOL: ToolDefinition = {
38
34
  entry: pixelesPantalla,
39
- Component: PixelesPantallaComponent,
40
- SEOComponent: PixelesPantallaSEO,
41
- BibliographyComponent: PixelesPantallaBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };
@@ -1,8 +1,5 @@
1
1
  import type { HardwareToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
2
 
3
- import TestMandoComponent from './component.astro';
4
- import TestMandoSEO from './seo.astro';
5
- import TestMandoBibliography from './bibliography.astro';
6
3
 
7
4
  import type { TestMandoUI } from './ui';
8
5
  export type TestMandoLocaleContent = ToolLocaleContent<TestMandoUI>;
@@ -32,11 +29,10 @@ export const testMando: HardwareToolEntry<TestMandoUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { TestMandoComponent, TestMandoSEO, TestMandoBibliography };
36
32
 
37
33
  export const TEST_MANDO_TOOL: ToolDefinition = {
38
34
  entry: testMando,
39
- Component: TestMandoComponent,
40
- SEOComponent: TestMandoSEO,
41
- BibliographyComponent: TestMandoBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };
@@ -1,8 +1,5 @@
1
1
  import type { HardwareToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
2
 
3
- import ProbadorVibracionMandoComponent from './component.astro';
4
- import ProbadorVibracionMandoSEO from './seo.astro';
5
- import ProbadorVibracionMandoBibliography from './bibliography.astro';
6
3
 
7
4
  import type { ProbadorVibracionMandoUI } from './ui';
8
5
  export type ProbadorVibracionMandoLocaleContent = ToolLocaleContent<ProbadorVibracionMandoUI>;
@@ -32,11 +29,10 @@ export const probadorVibracionMando: HardwareToolEntry<ProbadorVibracionMandoUI>
32
29
  },
33
30
  };
34
31
 
35
- export { ProbadorVibracionMandoComponent, ProbadorVibracionMandoSEO, ProbadorVibracionMandoBibliography };
36
32
 
37
33
  export const PROBADOR_VIBRACION_MANDO_TOOL: ToolDefinition = {
38
34
  entry: probadorVibracionMando,
39
- Component: ProbadorVibracionMandoComponent,
40
- SEOComponent: ProbadorVibracionMandoSEO,
41
- BibliographyComponent: ProbadorVibracionMandoBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };
@@ -1,8 +1,5 @@
1
1
  import type { HardwareToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
2
 
3
- import TestTecladoComponent from './component.astro';
4
- import TestTecladoSEO from './seo.astro';
5
- import TestTecladoBibliography from './bibliography.astro';
6
3
 
7
4
  import type { TestTecladoUI } from './ui';
8
5
  export type TestTecladoLocaleContent = ToolLocaleContent<TestTecladoUI>;
@@ -32,11 +29,10 @@ export const testTeclado: HardwareToolEntry<TestTecladoUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { TestTecladoComponent, TestTecladoSEO, TestTecladoBibliography };
36
32
 
37
33
  export const TEST_TECLADO_TOOL: ToolDefinition = {
38
34
  entry: testTeclado,
39
- Component: TestTecladoComponent,
40
- SEOComponent: TestTecladoSEO,
41
- BibliographyComponent: TestTecladoBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };
@@ -1,8 +1,5 @@
1
1
  import type { HardwareToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
2
 
3
- import TestRatonComponent from './component.astro';
4
- import TestRatonSEO from './seo.astro';
5
- import TestRatonBibliography from './bibliography.astro';
6
3
 
7
4
  import type { TestRatonUI } from './ui';
8
5
  export type TestRatonLocaleContent = ToolLocaleContent<TestRatonUI>;
@@ -32,11 +29,10 @@ export const testRaton: HardwareToolEntry<TestRatonUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { TestRatonComponent, TestRatonSEO, TestRatonBibliography };
36
32
 
37
33
  export const TEST_RATON_TOOL: ToolDefinition = {
38
34
  entry: testRaton,
39
- Component: TestRatonComponent,
40
- SEOComponent: TestRatonSEO,
41
- BibliographyComponent: TestRatonBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };
@@ -1,8 +1,5 @@
1
1
  import type { HardwareToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
2
 
3
- import ToneGeneratorComponent from './component.astro';
4
- import ToneGeneratorSEO from './seo.astro';
5
- import ToneGeneratorBibliography from './bibliography.astro';
6
3
 
7
4
  import type { ToneGeneratorUI } from './ui';
8
5
  export type ToneGeneratorLocaleContent = ToolLocaleContent<ToneGeneratorUI>;
@@ -32,11 +29,10 @@ export const toneGenerator: HardwareToolEntry<ToneGeneratorUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { ToneGeneratorComponent, ToneGeneratorSEO, ToneGeneratorBibliography };
36
32
 
37
33
  export const TONE_GENERATOR_TOOL: ToolDefinition = {
38
34
  entry: toneGenerator,
39
- Component: ToneGeneratorComponent,
40
- SEOComponent: ToneGeneratorSEO,
41
- BibliographyComponent: ToneGeneratorBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };
package/src/tools.ts CHANGED
@@ -8,3 +8,5 @@ import { ESTIMADOR_SALUD_BATERIA_TOOL } from './tool/batteryHealthEstimator/inde
8
8
  import { TONE_GENERATOR_TOOL } from './tool/toneGenerator/index';
9
9
 
10
10
  export const ALL_TOOLS: ToolDefinition[] = [PIXELES_PANTALLA_TOOL, TEST_TECLADO_TOOL, TEST_MANDO_TOOL, PROBADOR_VIBRACION_MANDO_TOOL, TEST_RATON_TOOL, ESTIMADOR_SALUD_BATERIA_TOOL, TONE_GENERATOR_TOOL];
11
+
12
+ export const ALL_ENTRIES = ALL_TOOLS.map(t => t.entry);