@jjlmoya/utils-sports 1.6.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-sports",
3
- "version": "1.6.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 { sportsCategory } from './category';
2
- export { default as sportsCategorySEO } from './category/seo.astro';
2
+ export const sportsCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
3
3
 
4
4
  export type {
5
5
  KnownLocale,
@@ -17,39 +17,15 @@ export type {
17
17
 
18
18
  export { ALL_ENTRIES, ALL_TOOLS } from './tools';
19
19
 
20
- export {
21
- ScoreKeeperComponent,
22
- ScoreKeeperSEO,
23
- ScoreKeeperBibliography,
24
- SCORE_KEEPER_TOOL,
25
- scoreKeeper,
26
- } from './tool/scoreKeeper/index';
20
+ export { SCORE_KEEPER_TOOL, scoreKeeper } from './tool/scoreKeeper/index';
27
21
  export type { ScoreKeeperUI, ScoreKeeperLocaleContent } from './tool/scoreKeeper/index';
28
22
 
29
- export {
30
- TournamentBracketComponent,
31
- TournamentBracketSEO,
32
- TournamentBracketBibliography,
33
- TOURNAMENT_BRACKET_TOOL,
34
- tournamentBracket,
35
- } from './tool/tournamentBracket/index';
23
+ export { TOURNAMENT_BRACKET_TOOL, tournamentBracket } from './tool/tournamentBracket/index';
36
24
  export type { TournamentBracketUI, TournamentBracketLocaleContent } from './tool/tournamentBracket/index';
37
25
 
38
- export {
39
- GymTrackerComponent,
40
- GymTrackerSEO,
41
- GymTrackerBibliography,
42
- GYM_TRACKER_TOOL,
43
- gymTracker,
44
- } from './tool/gymTracker/index';
26
+ export { GYM_TRACKER_TOOL, gymTracker } from './tool/gymTracker/index';
45
27
  export type { GymTrackerUI, GymTrackerLocaleContent } from './tool/gymTracker/index';
46
28
 
47
- export {
48
- ReactionTesterComponent,
49
- ReactionTesterSEO,
50
- ReactionTesterBibliography,
51
- REACTION_TESTER_TOOL,
52
- reactionTester,
53
- } from './tool/reactionTester/index';
29
+ export { REACTION_TESTER_TOOL, reactionTester } from './tool/reactionTester/index';
54
30
  export type { ReactionTesterUI, ReactionTesterLocaleContent } from './tool/reactionTester/index';
55
31
 
@@ -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 { SportsToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import GymTrackerComponent from './component.astro';
3
- import GymTrackerSEO from './seo.astro';
4
- import GymTrackerBibliography from './bibliography.astro';
5
2
  import type { GymTrackerUI } from './ui';
6
3
 
7
4
  export type { GymTrackerUI };
@@ -32,11 +29,10 @@ export const gymTracker: SportsToolEntry<GymTrackerUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { GymTrackerComponent, GymTrackerSEO, GymTrackerBibliography };
36
32
 
37
33
  export const GYM_TRACKER_TOOL: ToolDefinition = {
38
34
  entry: gymTracker,
39
- Component: GymTrackerComponent,
40
- SEOComponent: GymTrackerSEO,
41
- BibliographyComponent: GymTrackerBibliography,
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 { SportsToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import ReactionTesterComponent from './component.astro';
3
- import ReactionTesterSEO from './seo.astro';
4
- import ReactionTesterBibliography from './bibliography.astro';
5
2
  import type { ReactionTesterUI } from './ui';
6
3
 
7
4
  export type { ReactionTesterUI };
@@ -32,11 +29,10 @@ export const reactionTester: SportsToolEntry<ReactionTesterUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { ReactionTesterComponent, ReactionTesterSEO, ReactionTesterBibliography };
36
32
 
37
33
  export const REACTION_TESTER_TOOL: ToolDefinition = {
38
34
  entry: reactionTester,
39
- Component: ReactionTesterComponent,
40
- SEOComponent: ReactionTesterSEO,
41
- BibliographyComponent: ReactionTesterBibliography,
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 { SportsToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import ScoreKeeperComponent from './component.astro';
3
- import ScoreKeeperSEO from './seo.astro';
4
- import ScoreKeeperBibliography from './bibliography.astro';
5
2
 
6
3
  import type { ScoreKeeperUI } from './ui';
7
4
 
@@ -33,11 +30,10 @@ export const scoreKeeper: SportsToolEntry<ScoreKeeperUI> = {
33
30
  },
34
31
  };
35
32
 
36
- export { ScoreKeeperComponent, ScoreKeeperSEO, ScoreKeeperBibliography };
37
33
 
38
34
  export const SCORE_KEEPER_TOOL: ToolDefinition = {
39
35
  entry: scoreKeeper,
40
- Component: ScoreKeeperComponent,
41
- SEOComponent: ScoreKeeperSEO,
42
- BibliographyComponent: ScoreKeeperBibliography,
36
+ Component: () => import('./component.astro'),
37
+ SEOComponent: () => import('./seo.astro'),
38
+ BibliographyComponent: () => import('./bibliography.astro'),
43
39
  };
@@ -1,7 +1,4 @@
1
1
  import type { SportsToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import TournamentBracketComponent from './component.astro';
3
- import TournamentBracketSEO from './seo.astro';
4
- import TournamentBracketBibliography from './bibliography.astro';
5
2
  import type { TournamentBracketUI } from './ui';
6
3
 
7
4
  export type { TournamentBracketUI };
@@ -32,11 +29,10 @@ export const tournamentBracket: SportsToolEntry<TournamentBracketUI> = {
32
29
  },
33
30
  };
34
31
 
35
- export { TournamentBracketComponent, TournamentBracketSEO, TournamentBracketBibliography };
36
32
 
37
33
  export const TOURNAMENT_BRACKET_TOOL: ToolDefinition = {
38
34
  entry: tournamentBracket,
39
- Component: TournamentBracketComponent,
40
- SEOComponent: TournamentBracketSEO,
41
- BibliographyComponent: TournamentBracketBibliography,
35
+ Component: () => import('./component.astro'),
36
+ SEOComponent: () => import('./seo.astro'),
37
+ BibliographyComponent: () => import('./bibliography.astro'),
42
38
  };