@jjlmoya/utils-nature 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-nature",
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
@@ -1,5 +1,5 @@
1
1
  export { natureCategory } from './category';
2
- export { default as natureCategorySEO } from './category/seo.astro';
2
+ export const natureCategorySEO = () => 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>,
@@ -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 { NatureToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import CricketThermometerComponent from './component.astro';
3
- import CricketThermometerSEO from './seo.astro';
4
- import CricketThermometerBibliography from './bibliography.astro';
5
2
 
6
3
  import type { CricketThermometerUI } from './ui';
7
4
 
@@ -32,11 +29,10 @@ export const cricketThermometer: NatureToolEntry<CricketThermometerUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { CricketThermometerComponent, CricketThermometerSEO, CricketThermometerBibliography };
36
32
 
37
33
  export const CRICKET_THERMOMETER_TOOL: ToolDefinition = {
38
34
  entry: cricketThermometer,
39
- Component: CricketThermometerComponent,
40
- SEOComponent: CricketThermometerSEO,
41
- BibliographyComponent: CricketThermometerBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };
@@ -1,7 +1,4 @@
1
1
  import type { NatureToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import DigitalCarbonComponent from './component.astro';
3
- import DigitalCarbonSEO from './seo.astro';
4
- import DigitalCarbonBibliography from './bibliography.astro';
5
2
  import type { DigitalCarbonUI } from './ui';
6
3
 
7
4
  export type DigitalCarbonLocaleContent = ToolLocaleContent<DigitalCarbonUI>;
@@ -31,11 +28,10 @@ export const digitalCarbon: NatureToolEntry<DigitalCarbonUI> = {
31
28
  },
32
29
  };
33
30
 
34
- export { DigitalCarbonComponent, DigitalCarbonSEO, DigitalCarbonBibliography };
35
31
 
36
32
  export const DIGITAL_CARBON_TOOL: ToolDefinition = {
37
33
  entry: digitalCarbon,
38
- Component: DigitalCarbonComponent,
39
- SEOComponent: DigitalCarbonSEO,
40
- BibliographyComponent: DigitalCarbonBibliography,
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 { NatureToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import RainHarvesterComponent from './component.astro';
3
- import RainHarvesterSEO from './seo.astro';
4
- import RainHarvesterBibliography from './bibliography.astro';
5
2
  import type { RainHarvesterUI } from './ui';
6
3
 
7
4
  export type RainHarvesterLocaleContent = ToolLocaleContent<RainHarvesterUI>;
@@ -31,11 +28,10 @@ export const rainHarvester: NatureToolEntry<RainHarvesterUI> = {
31
28
  },
32
29
  };
33
30
 
34
- export { RainHarvesterComponent, RainHarvesterSEO, RainHarvesterBibliography };
35
31
 
36
32
  export const RAIN_HARVESTER_TOOL: ToolDefinition = {
37
33
  entry: rainHarvester,
38
- Component: RainHarvesterComponent,
39
- SEOComponent: RainHarvesterSEO,
40
- BibliographyComponent: RainHarvesterBibliography,
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 { NatureToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import SeedCalculatorComponent from './component.astro';
3
- import SeedCalculatorSEO from './seo.astro';
4
- import SeedCalculatorBibliography from './bibliography.astro';
5
2
 
6
3
  import type { SeedCalculatorUI } from './ui';
7
4
 
@@ -32,11 +29,10 @@ export const seedCalculator: NatureToolEntry<SeedCalculatorUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { SeedCalculatorComponent, SeedCalculatorSEO, SeedCalculatorBibliography };
36
32
 
37
33
  export const SEED_CALCULATOR_TOOL: ToolDefinition = {
38
34
  entry: seedCalculator,
39
- Component: SeedCalculatorComponent,
40
- SEOComponent: SeedCalculatorSEO,
41
- BibliographyComponent: SeedCalculatorBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };