@jjlmoya/utils-astronomy 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-astronomy",
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
@@ -4,7 +4,7 @@ export * from './tool/starExposureCalculator';
4
4
  export * from './tool/telescopeResolution';
5
5
 
6
6
  export { toolsCategory as astronomyCategory } from './category';
7
- export { default as AstronomyCategorySEO } from './category/seo.astro';
7
+ export const AstronomyCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
8
8
 
9
9
  export type {
10
10
  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 { AstronomyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import BortleVisualizerComponent from './component.astro';
3
- import BortleVisualizerSEO from './seo.astro';
4
- import BortleVisualizerBibliography from './bibliography.astro';
5
2
 
6
3
  export interface BortleVisualizerUI {
7
4
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -55,11 +52,10 @@ export const bortleVisualizer: AstronomyToolEntry<BortleVisualizerUI> = {
55
52
  },
56
53
  };
57
54
 
58
- export { BortleVisualizerComponent, BortleVisualizerSEO, BortleVisualizerBibliography };
59
55
 
60
56
  export const BORTLE_VISUALIZER_TOOL: ToolDefinition = {
61
57
  entry: bortleVisualizer,
62
- Component: BortleVisualizerComponent,
63
- SEOComponent: BortleVisualizerSEO,
64
- BibliographyComponent: BortleVisualizerBibliography,
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 { AstronomyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import DeepSpaceScopeComponent from './component.astro';
3
- import DeepSpaceScopeSEO from './seo.astro';
4
- import DeepSpaceScopeBibliography from './bibliography.astro';
5
2
 
6
3
  export interface DeepSpaceObject {
7
4
  name: string;
@@ -62,11 +59,10 @@ export const deepSpaceScope: AstronomyToolEntry<DeepSpaceScopeUI> = {
62
59
  },
63
60
  };
64
61
 
65
- export { DeepSpaceScopeComponent, DeepSpaceScopeSEO, DeepSpaceScopeBibliography };
66
62
 
67
63
  export const DEEP_SPACE_SCOPE_TOOL: ToolDefinition = {
68
64
  entry: deepSpaceScope,
69
- Component: DeepSpaceScopeComponent,
70
- SEOComponent: DeepSpaceScopeSEO,
71
- BibliographyComponent: DeepSpaceScopeBibliography,
65
+ Component: () => import('./component.astro'),
66
+ SEOComponent: () => import('./seo.astro'),
67
+ BibliographyComponent: () => import('./bibliography.astro'),
72
68
  };
@@ -1,7 +1,4 @@
1
1
  import type { AstronomyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import StarExposureCalculatorComponent from './component.astro';
3
- import StarExposureCalculatorSEO from './seo.astro';
4
- import StarExposureCalculatorBibliography from './bibliography.astro';
5
2
 
6
3
  export interface StarExposureCalculatorUI {
7
4
  [key: string]: string;
@@ -51,11 +48,10 @@ export const starExposureCalculator: AstronomyToolEntry<StarExposureCalculatorUI
51
48
  },
52
49
  };
53
50
 
54
- export { StarExposureCalculatorComponent, StarExposureCalculatorSEO, StarExposureCalculatorBibliography };
55
51
 
56
52
  export const STAR_EXPOSURE_CALCULATOR_TOOL: ToolDefinition = {
57
53
  entry: starExposureCalculator,
58
- Component: StarExposureCalculatorComponent,
59
- SEOComponent: StarExposureCalculatorSEO,
60
- BibliographyComponent: StarExposureCalculatorBibliography,
54
+ Component: () => import('./component.astro'),
55
+ SEOComponent: () => import('./seo.astro'),
56
+ BibliographyComponent: () => import('./bibliography.astro'),
61
57
  };
@@ -1,7 +1,4 @@
1
1
  import type { AstronomyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import TelescopeResolutionComponent from './component.astro';
3
- import TelescopeResolutionSEO from './seo.astro';
4
- import TelescopeResolutionBibliography from './bibliography.astro';
5
2
 
6
3
  export interface TelescopeResolutionUI {
7
4
  [key: string]: string | Array<{ value: string; label: string }>;
@@ -51,11 +48,10 @@ export const telescopeResolution: AstronomyToolEntry<TelescopeResolutionUI> = {
51
48
  },
52
49
  };
53
50
 
54
- export { TelescopeResolutionComponent, TelescopeResolutionSEO, TelescopeResolutionBibliography };
55
51
 
56
52
  export const TELESCOPE_RESOLUTION_TOOL: ToolDefinition = {
57
53
  entry: telescopeResolution,
58
- Component: TelescopeResolutionComponent,
59
- SEOComponent: TelescopeResolutionSEO,
60
- BibliographyComponent: TelescopeResolutionBibliography,
54
+ Component: () => import('./component.astro'),
55
+ SEOComponent: () => import('./seo.astro'),
56
+ BibliographyComponent: () => import('./bibliography.astro'),
61
57
  };