@jjlmoya/utils-babies 1.9.0 → 1.11.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-babies",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -6,7 +6,7 @@ export * from './tool/baby-percentile-calculator';
6
6
  export * from './tool/fertile-days-estimator';
7
7
  export * from './tool/pregnancy-calculator';
8
8
  export * from './tool/vaccination-calendar';
9
- export { default as babiesCategorySEO } from './category/seo.astro';
9
+ export const babiesCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
10
10
 
11
11
  export type {
12
12
  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 { BabiesToolEntry, ToolDefinition, ToolLocaleContent } from '../../types';
2
- import BabyFeedingCalculatorComponent from './component.astro';
3
- import BabyFeedingCalculatorSEO from './seo.astro';
4
- import BabyFeedingCalculatorBibliography from './bibliography.astro';
5
2
 
6
3
  export interface BabyFeedingCalculatorUI {
7
4
  [key: string]: string;
@@ -49,11 +46,10 @@ export const babyFeedingCalculator: BabiesToolEntry<BabyFeedingCalculatorUI> = {
49
46
  },
50
47
  };
51
48
 
52
- export { BabyFeedingCalculatorComponent, BabyFeedingCalculatorSEO, BabyFeedingCalculatorBibliography };
53
49
 
54
50
  export const BABY_FEEDING_CALCULATOR_TOOL: ToolDefinition = {
55
51
  entry: babyFeedingCalculator,
56
- Component: BabyFeedingCalculatorComponent,
57
- SEOComponent: BabyFeedingCalculatorSEO,
58
- BibliographyComponent: BabyFeedingCalculatorBibliography,
52
+ Component: () => import('./component.astro'),
53
+ SEOComponent: () => import('./seo.astro'),
54
+ BibliographyComponent: () => import('./bibliography.astro'),
59
55
  };
@@ -1,7 +1,4 @@
1
1
  import type { BabiesToolEntry, ToolDefinition, ToolLocaleContent } from '../../types';
2
- import BabyPercentileCalculatorComponent from './component.astro';
3
- import BabyPercentileCalculatorSEO from './seo.astro';
4
- import BabyPercentileCalculatorBibliography from './bibliography.astro';
5
2
 
6
3
  export interface BabyPercentileCalculatorUI {
7
4
  [key: string]: string;
@@ -57,11 +54,10 @@ export const babyPercentileCalculator: BabiesToolEntry<BabyPercentileCalculatorU
57
54
  },
58
55
  };
59
56
 
60
- export { BabyPercentileCalculatorComponent, BabyPercentileCalculatorSEO, BabyPercentileCalculatorBibliography };
61
57
 
62
58
  export const BABY_PERCENTILE_CALCULATOR_TOOL: ToolDefinition = {
63
59
  entry: babyPercentileCalculator,
64
- Component: BabyPercentileCalculatorComponent,
65
- SEOComponent: BabyPercentileCalculatorSEO,
66
- BibliographyComponent: BabyPercentileCalculatorBibliography,
60
+ Component: () => import('./component.astro'),
61
+ SEOComponent: () => import('./seo.astro'),
62
+ BibliographyComponent: () => import('./bibliography.astro'),
67
63
  };
@@ -1,7 +1,4 @@
1
1
  import type { BabiesToolEntry, ToolDefinition, ToolLocaleContent } from '../../types';
2
- import BabySizeConverterComponent from './component.astro';
3
- import BabySizeConverterSEO from './seo.astro';
4
- import BabySizeConverterBibliography from './bibliography.astro';
5
2
 
6
3
  export interface BabySizeConverterUI {
7
4
  [key: string]: string;
@@ -55,11 +52,10 @@ export const babySizeConverter: BabiesToolEntry<BabySizeConverterUI> = {
55
52
  },
56
53
  };
57
54
 
58
- export { BabySizeConverterComponent, BabySizeConverterSEO, BabySizeConverterBibliography };
59
55
 
60
56
  export const BABY_SIZE_CONVERTER_TOOL: ToolDefinition = {
61
57
  entry: babySizeConverter,
62
- Component: BabySizeConverterComponent,
63
- SEOComponent: BabySizeConverterSEO,
64
- BibliographyComponent: BabySizeConverterBibliography,
58
+ Component: () => import('./component.astro'),
59
+ SEOComponent: () => import('./seo.astro'),
60
+ BibliographyComponent: () => import('./bibliography.astro'),
65
61
  };
@@ -1,7 +1,4 @@
1
1
  import type { BabiesToolEntry, ToolDefinition, ToolLocaleContent } from '../../types';
2
- import FertileDaysEstimatorComponent from './component.astro';
3
- import FertileDaysEstimatorSEO from './seo.astro';
4
- import FertileDaysEstimatorBibliography from './bibliography.astro';
5
2
 
6
3
  export interface FertileDaysEstimatorUI {
7
4
  [key: string]: string;
@@ -49,11 +46,10 @@ export const fertileDaysEstimator: BabiesToolEntry<FertileDaysEstimatorUI> = {
49
46
  },
50
47
  };
51
48
 
52
- export { FertileDaysEstimatorComponent, FertileDaysEstimatorSEO, FertileDaysEstimatorBibliography };
53
49
 
54
50
  export const FERTILE_DAYS_ESTIMATOR_TOOL: ToolDefinition = {
55
51
  entry: fertileDaysEstimator,
56
- Component: FertileDaysEstimatorComponent,
57
- SEOComponent: FertileDaysEstimatorSEO,
58
- BibliographyComponent: FertileDaysEstimatorBibliography,
52
+ Component: () => import('./component.astro'),
53
+ SEOComponent: () => import('./seo.astro'),
54
+ BibliographyComponent: () => import('./bibliography.astro'),
59
55
  };
@@ -1,7 +1,4 @@
1
1
  import type { BabiesToolEntry, ToolDefinition, ToolLocaleContent } from '../../types';
2
- import PregnancyCalculatorComponent from './component.astro';
3
- import PregnancyCalculatorSEO from './seo.astro';
4
- import PregnancyCalculatorBibliography from './bibliography.astro';
5
2
 
6
3
  export interface MilestoneI18n {
7
4
  analogies: { fruits: string; geek: string; sweets: string };
@@ -89,11 +86,10 @@ export const pregnancyCalculator: BabiesToolEntry<PregnancyCalculatorUI> = {
89
86
  },
90
87
  };
91
88
 
92
- export { PregnancyCalculatorComponent, PregnancyCalculatorSEO, PregnancyCalculatorBibliography };
93
89
 
94
90
  export const PREGNANCY_CALCULATOR_TOOL: ToolDefinition = {
95
91
  entry: pregnancyCalculator,
96
- Component: PregnancyCalculatorComponent,
97
- SEOComponent: PregnancyCalculatorSEO,
98
- BibliographyComponent: PregnancyCalculatorBibliography,
92
+ Component: () => import('./component.astro'),
93
+ SEOComponent: () => import('./seo.astro'),
94
+ BibliographyComponent: () => import('./bibliography.astro'),
99
95
  };
@@ -1,7 +1,4 @@
1
1
  import type { BabiesToolEntry, ToolDefinition, ToolLocaleContent } from '../../types';
2
- import VaccinationCalendarComponent from './component.astro';
3
- import VaccinationCalendarSEO from './seo.astro';
4
- import VaccinationCalendarBibliography from './bibliography.astro';
5
2
 
6
3
  export interface VaccinationCalendarUI {
7
4
  [key: string]: string;
@@ -69,11 +66,10 @@ export const vaccinationCalendar: BabiesToolEntry<VaccinationCalendarUI> = {
69
66
  },
70
67
  };
71
68
 
72
- export { VaccinationCalendarComponent, VaccinationCalendarSEO, VaccinationCalendarBibliography };
73
69
 
74
70
  export const VACCINATION_CALENDAR_TOOL: ToolDefinition = {
75
71
  entry: vaccinationCalendar,
76
- Component: VaccinationCalendarComponent,
77
- SEOComponent: VaccinationCalendarSEO,
78
- BibliographyComponent: VaccinationCalendarBibliography,
72
+ Component: () => import('./component.astro'),
73
+ SEOComponent: () => import('./seo.astro'),
74
+ BibliographyComponent: () => import('./bibliography.astro'),
79
75
  };