@jjlmoya/utils-nautical 1.9.0 → 1.12.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-nautical",
3
- "version": "1.9.0",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -5,7 +5,7 @@ export * from './tool/sailArea';
5
5
  export * from './tool/speedConverter';
6
6
  export * from './tool/endurance';
7
7
  export * from './category';
8
- export { default as NauticalCategorySEO } from './category/seo.astro';
8
+ export const NauticalCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
9
9
 
10
10
  export type {
11
11
  KnownLocale,
@@ -20,4 +20,4 @@ export type {
20
20
  NauticalCategoryEntry,
21
21
  } from './types';
22
22
 
23
- export { ALL_TOOLS } from './tools';
23
+ export { ALL_ENTRIES, ALL_TOOLS } from './tools';
@@ -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 { NauticalToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import EnduranceComponent from './component.astro';
3
- import EnduranceSEO from './seo.astro';
4
- import EnduranceBibliography from './bibliography.astro';
5
2
 
6
3
  export interface EnduranceUI {
7
4
  [key: string]: string;
@@ -58,11 +55,10 @@ export const endurance: NauticalToolEntry<EnduranceUI> = {
58
55
  },
59
56
  };
60
57
 
61
- export { EnduranceComponent, EnduranceSEO, EnduranceBibliography };
62
58
 
63
59
  export const ENDURANCE_TOOL: ToolDefinition = {
64
60
  entry: endurance,
65
- Component: EnduranceComponent,
66
- SEOComponent: EnduranceSEO,
67
- BibliographyComponent: EnduranceBibliography,
61
+ Component: () => import('./component.astro'),
62
+ SEOComponent: () => import('./seo.astro'),
63
+ BibliographyComponent: () => import('./bibliography.astro'),
68
64
  };
@@ -1,7 +1,4 @@
1
1
  import type { NauticalToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import NauticalConverterComponent from './component.astro';
3
- import NauticalConverterSEO from './seo.astro';
4
- import NauticalConverterBibliography from './bibliography.astro';
5
2
 
6
3
  export interface NauticalConverterUI {
7
4
  [key: string]: string;
@@ -59,11 +56,10 @@ export const nauticalConverter: NauticalToolEntry<NauticalConverterUI> = {
59
56
  },
60
57
  };
61
58
 
62
- export { NauticalConverterComponent, NauticalConverterSEO, NauticalConverterBibliography };
63
59
 
64
60
  export const NAUTICAL_CONVERTER_TOOL: ToolDefinition = {
65
61
  entry: nauticalConverter,
66
- Component: NauticalConverterComponent,
67
- SEOComponent: NauticalConverterSEO,
68
- BibliographyComponent: NauticalConverterBibliography,
62
+ Component: () => import('./component.astro'),
63
+ SEOComponent: () => import('./seo.astro'),
64
+ BibliographyComponent: () => import('./bibliography.astro'),
69
65
  };
@@ -1,7 +1,4 @@
1
1
  import type { NauticalToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import SailAreaComponent from './component.astro';
3
- import SailAreaSEO from './seo.astro';
4
- import SailAreaBibliography from './bibliography.astro';
5
2
 
6
3
  export interface SailAreaUI {
7
4
  [key: string]: string;
@@ -55,11 +52,10 @@ export const sailArea: NauticalToolEntry<SailAreaUI> = {
55
52
  },
56
53
  };
57
54
 
58
- export { SailAreaComponent, SailAreaSEO, SailAreaBibliography };
59
55
 
60
56
  export const SAIL_AREA_TOOL: ToolDefinition = {
61
57
  entry: sailArea,
62
- Component: SailAreaComponent,
63
- SEOComponent: SailAreaSEO,
64
- BibliographyComponent: SailAreaBibliography,
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 { NauticalToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import SpeedConverterComponent from './component.astro';
3
- import SpeedConverterSEO from './seo.astro';
4
- import SpeedConverterBibliography from './bibliography.astro';
5
2
 
6
3
  export interface SpeedConverterUI {
7
4
  [key: string]: string;
@@ -48,11 +45,10 @@ export const speedConverter: NauticalToolEntry<SpeedConverterUI> = {
48
45
  },
49
46
  };
50
47
 
51
- export { SpeedConverterComponent, SpeedConverterSEO, SpeedConverterBibliography };
52
48
 
53
49
  export const SPEED_CONVERTER_TOOL: ToolDefinition = {
54
50
  entry: speedConverter,
55
- Component: SpeedConverterComponent,
56
- SEOComponent: SpeedConverterSEO,
57
- BibliographyComponent: SpeedConverterBibliography,
51
+ Component: () => import('./component.astro'),
52
+ SEOComponent: () => import('./seo.astro'),
53
+ BibliographyComponent: () => import('./bibliography.astro'),
58
54
  };
@@ -1,7 +1,4 @@
1
1
  import type { NauticalToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import TideCalculatorCalculator from './component.astro';
3
- import TideCalculatorSEO from './seo.astro';
4
- import TideCalculatorBibliography from './bibliography.astro';
5
2
 
6
3
  export interface TideCalculatorUI {
7
4
  [key: string]: string;
@@ -52,11 +49,10 @@ export const tideCalculator: NauticalToolEntry<TideCalculatorUI> = {
52
49
  },
53
50
  };
54
51
 
55
- export { TideCalculatorCalculator, TideCalculatorSEO, TideCalculatorBibliography };
56
52
 
57
53
  export const TIDE_CALCULATOR_TOOL: ToolDefinition = {
58
54
  entry: tideCalculator,
59
- Component: TideCalculatorCalculator,
60
- SEOComponent: TideCalculatorSEO,
61
- BibliographyComponent: TideCalculatorBibliography,
55
+ Component: () => import('./component.astro'),
56
+ SEOComponent: () => import('./seo.astro'),
57
+ BibliographyComponent: () => import('./bibliography.astro'),
62
58
  };
@@ -1,7 +1,4 @@
1
1
  import type { NauticalToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import UnderKeelComponent from './component.astro';
3
- import UnderKeelSEO from './seo.astro';
4
- import UnderKeelBibliography from './bibliography.astro';
5
2
 
6
3
  export interface UnderKeelUI {
7
4
  [key: string]: string;
@@ -51,11 +48,10 @@ export const underKeel: NauticalToolEntry<UnderKeelUI> = {
51
48
  },
52
49
  };
53
50
 
54
- export { UnderKeelComponent, UnderKeelSEO, UnderKeelBibliography };
55
51
 
56
52
  export const UNDER_KEEL_TOOL: ToolDefinition = {
57
53
  entry: underKeel,
58
- Component: UnderKeelComponent,
59
- SEOComponent: UnderKeelSEO,
60
- BibliographyComponent: UnderKeelBibliography,
54
+ Component: () => import('./component.astro'),
55
+ SEOComponent: () => import('./seo.astro'),
56
+ BibliographyComponent: () => import('./bibliography.astro'),
61
57
  };
package/src/tools.ts CHANGED
@@ -23,3 +23,5 @@ export {
23
23
  SPEED_CONVERTER_TOOL,
24
24
  ENDURANCE_TOOL,
25
25
  };
26
+
27
+ export const ALL_ENTRIES = ALL_TOOLS.map(t => t.entry);