@jjlmoya/utils-streaming 1.4.0 → 1.7.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-streaming",
3
- "version": "1.4.0",
3
+ "version": "1.7.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 { streamingCategory } from './category';
2
- export { default as streamingCategorySEO } from './category/seo.astro';
2
+ export const streamingCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
3
3
 
4
4
  export type {
5
5
  KnownLocale,
@@ -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>,
@@ -53,8 +54,6 @@ export async function getStaticPaths() {
53
54
  return paths;
54
55
  }
55
56
 
56
- type ToolComponent = (props: { ui: Record<string, string> }) => unknown;
57
-
58
57
  interface NavItem {
59
58
  id: string;
60
59
  title: string;
@@ -63,7 +62,7 @@ interface NavItem {
63
62
  }
64
63
 
65
64
  interface Props {
66
- Component: ToolComponent;
65
+ Component: unknown;
67
66
  locale: KnownLocale;
68
67
  content: ToolLocaleContent;
69
68
  localeUrls: Partial<Record<KnownLocale, string>>;
@@ -1,7 +1,4 @@
1
1
  import type { StreamingToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import SorteoComponent from './component.astro';
3
- import SorteoSEO from './seo.astro';
4
- import SorteoBibliography from './bibliography.astro';
5
2
  import type { SorteoUI } from './ui';
6
3
 
7
4
  export type SorteoLocaleContent = ToolLocaleContent<SorteoUI>;
@@ -31,11 +28,10 @@ export const sorteo: StreamingToolEntry<SorteoUI> = {
31
28
  },
32
29
  };
33
30
 
34
- export { SorteoComponent, SorteoSEO, SorteoBibliography };
35
31
 
36
32
  export const SORTEO_TOOL: ToolDefinition = {
37
33
  entry: sorteo,
38
- Component: SorteoComponent,
39
- SEOComponent: SorteoSEO,
40
- BibliographyComponent: SorteoBibliography,
34
+ Component: () => import('./component.astro'),
35
+ SEOComponent: () => import('./seo.astro'),
36
+ BibliographyComponent: () => import('./bibliography.astro'),
41
37
  };
@@ -1,7 +1,4 @@
1
1
  import type { StreamingToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import TebasCheckComponent from './component.astro';
3
- import TebasCheckSEO from './seo.astro';
4
- import TebasCheckBibliography from './bibliography.astro';
5
2
  import type { TebasCheckUI } from './types';
6
3
 
7
4
  export type TebasCheckLocaleContent = ToolLocaleContent<TebasCheckUI>;
@@ -31,11 +28,10 @@ export const tebasCheck: StreamingToolEntry<TebasCheckUI> = {
31
28
  },
32
29
  };
33
30
 
34
- export { TebasCheckComponent, TebasCheckSEO, TebasCheckBibliography };
35
31
 
36
32
  export const TEBAS_CHECK_TOOL: ToolDefinition = {
37
33
  entry: tebasCheck,
38
- Component: TebasCheckComponent,
39
- SEOComponent: TebasCheckSEO,
40
- BibliographyComponent: TebasCheckBibliography,
34
+ Component: () => import('./component.astro'),
35
+ SEOComponent: () => import('./seo.astro'),
36
+ BibliographyComponent: () => import('./bibliography.astro'),
41
37
  };