@jjlmoya/utils-pets 1.7.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-pets",
3
- "version": "1.7.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
@@ -2,7 +2,7 @@ export * from './tool/petAge';
2
2
  export * from './tool/petRation';
3
3
 
4
4
  export { petsCategory } from './category';
5
- export { default as PetsCategorySEO } from './category/seo.astro';
5
+ export const PetsCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
6
6
 
7
7
  export type {
8
8
  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>,
@@ -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,7 +1,4 @@
1
1
  import type { PetToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import PetAgeCalculator from './component.astro';
3
- import PetAgeSEO from './seo.astro';
4
- import PetAgeBibliography from './bibliography.astro';
5
2
 
6
3
  export interface PetAgeUI {
7
4
  [key: string]: string;
@@ -66,11 +63,10 @@ export const petAge: PetToolEntry<PetAgeUI> = {
66
63
  },
67
64
  };
68
65
 
69
- export { PetAgeCalculator, PetAgeSEO, PetAgeBibliography };
70
66
 
71
67
  export const PET_AGE_TOOL: ToolDefinition = {
72
68
  entry: petAge,
73
- Component: PetAgeCalculator,
74
- SEOComponent: PetAgeSEO,
75
- BibliographyComponent: PetAgeBibliography,
69
+ Component: () => import('./component.astro'),
70
+ SEOComponent: () => import('./seo.astro'),
71
+ BibliographyComponent: () => import('./bibliography.astro'),
76
72
  };
@@ -1,7 +1,4 @@
1
1
  import type { PetToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import PetRationCalculator from './component.astro';
3
- import PetRationSEO from './seo.astro';
4
- import PetRationBibliography from './bibliography.astro';
5
2
 
6
3
  export interface PetRationUI {
7
4
  [key: string]: string;
@@ -65,11 +62,10 @@ export const petRation: PetToolEntry<PetRationUI> = {
65
62
  },
66
63
  };
67
64
 
68
- export { PetRationCalculator, PetRationSEO, PetRationBibliography };
69
65
 
70
66
  export const PET_RATION_TOOL: ToolDefinition = {
71
67
  entry: petRation,
72
- Component: PetRationCalculator,
73
- SEOComponent: PetRationSEO,
74
- BibliographyComponent: PetRationBibliography,
68
+ Component: () => import('./component.astro'),
69
+ SEOComponent: () => import('./seo.astro'),
70
+ BibliographyComponent: () => import('./bibliography.astro'),
75
71
  };