@jjlmoya/utils-travel 1.3.0 → 1.6.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 +1 -1
- package/src/index.ts +2 -2
- package/src/pages/[locale]/[slug].astro +3 -4
- package/src/tool/luggage-calculator/index.ts +3 -7
- package/src/tool/mini-adventures/index.ts +3 -7
- package/src/tool/suitcase-checklist/index.ts +3 -7
- package/src/tool/tip-calculator/index.ts +3 -7
- package/src/tools.ts +2 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { travelCategory } from './category';
|
|
2
|
-
export
|
|
2
|
+
export const TravelCategorySEO = () => import('./category/seo.astro').then((m) => m.default);
|
|
3
3
|
|
|
4
4
|
export type {
|
|
5
5
|
KnownLocale,
|
|
@@ -15,7 +15,7 @@ export type {
|
|
|
15
15
|
ToolDefinition,
|
|
16
16
|
} from './types';
|
|
17
17
|
|
|
18
|
-
export { ALL_TOOLS } from './tools';
|
|
18
|
+
export { ALL_ENTRIES, ALL_TOOLS } from './tools';
|
|
19
19
|
export { luggageCalculator, LUGGAGE_CALCULATOR_TOOL, LuggageCalculator, LuggageCalculatorSEO, LuggageCalculatorBibliography } from './tool/luggage-calculator';
|
|
20
20
|
export { tipCalculator, TIP_CALCULATOR_TOOL, TipCalculator, TipCalculatorSEO, TipCalculatorBibliography } from './tool/tip-calculator';
|
|
21
21
|
export { suitcaseChecklist, SUITCASE_CHECKLIST_TOOL, SuitcaseChecklist, SuitcaseChecklistSEO, SuitcaseChecklistBibliography } from './tool/suitcase-checklist';
|
|
@@ -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:
|
|
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 { TravelToolEntry, ToolDefinition, ToolLocaleContent } from '../../types';
|
|
2
|
-
import LuggageCalculator from './component.astro';
|
|
3
|
-
import LuggageCalculatorSEO from './seo.astro';
|
|
4
|
-
import LuggageCalculatorBibliography from './bibliography.astro';
|
|
5
2
|
|
|
6
3
|
export interface Airline {
|
|
7
4
|
name: string;
|
|
@@ -55,11 +52,10 @@ export const luggageCalculator: TravelToolEntry<LuggageCalculatorUI> = {
|
|
|
55
52
|
},
|
|
56
53
|
};
|
|
57
54
|
|
|
58
|
-
export { LuggageCalculator, LuggageCalculatorSEO, LuggageCalculatorBibliography };
|
|
59
55
|
|
|
60
56
|
export const LUGGAGE_CALCULATOR_TOOL: ToolDefinition = {
|
|
61
57
|
entry: luggageCalculator,
|
|
62
|
-
Component:
|
|
63
|
-
SEOComponent:
|
|
64
|
-
BibliographyComponent:
|
|
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 { TravelToolEntry, ToolDefinition } from '../../types';
|
|
2
|
-
import MiniAdventures from './component.astro';
|
|
3
|
-
import MiniAdventuresSEO from './seo.astro';
|
|
4
|
-
import MiniAdventuresBibliography from './bibliography.astro';
|
|
5
2
|
|
|
6
3
|
export interface AdventureCategory {
|
|
7
4
|
id: string;
|
|
@@ -72,11 +69,10 @@ export const miniAdventures: TravelToolEntry<MiniAdventuresUI> = {
|
|
|
72
69
|
},
|
|
73
70
|
};
|
|
74
71
|
|
|
75
|
-
export { MiniAdventures, MiniAdventuresSEO, MiniAdventuresBibliography };
|
|
76
72
|
|
|
77
73
|
export const MINI_ADVENTURES_TOOL: ToolDefinition = {
|
|
78
74
|
entry: miniAdventures,
|
|
79
|
-
Component:
|
|
80
|
-
SEOComponent:
|
|
81
|
-
BibliographyComponent:
|
|
75
|
+
Component: () => import('./component.astro'),
|
|
76
|
+
SEOComponent: () => import('./seo.astro'),
|
|
77
|
+
BibliographyComponent: () => import('./bibliography.astro'),
|
|
82
78
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { TravelToolEntry, ToolDefinition } from '../../types';
|
|
2
|
-
import SuitcaseChecklist from './component.astro';
|
|
3
|
-
import SuitcaseChecklistSEO from './seo.astro';
|
|
4
|
-
import SuitcaseChecklistBibliography from './bibliography.astro';
|
|
5
2
|
|
|
6
3
|
export interface ChecklistItem {
|
|
7
4
|
label: string;
|
|
@@ -77,11 +74,10 @@ export const suitcaseChecklist: TravelToolEntry<SuitcaseChecklistUI> = {
|
|
|
77
74
|
},
|
|
78
75
|
};
|
|
79
76
|
|
|
80
|
-
export { SuitcaseChecklist, SuitcaseChecklistSEO, SuitcaseChecklistBibliography };
|
|
81
77
|
|
|
82
78
|
export const SUITCASE_CHECKLIST_TOOL: ToolDefinition = {
|
|
83
79
|
entry: suitcaseChecklist,
|
|
84
|
-
Component:
|
|
85
|
-
SEOComponent:
|
|
86
|
-
BibliographyComponent:
|
|
80
|
+
Component: () => import('./component.astro'),
|
|
81
|
+
SEOComponent: () => import('./seo.astro'),
|
|
82
|
+
BibliographyComponent: () => import('./bibliography.astro'),
|
|
87
83
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { TravelToolEntry, ToolDefinition } from '../../types';
|
|
2
|
-
import TipCalculator from './component.astro';
|
|
3
|
-
import TipCalculatorSEO from './seo.astro';
|
|
4
|
-
import TipCalculatorBibliography from './bibliography.astro';
|
|
5
2
|
|
|
6
3
|
export interface TipCountry {
|
|
7
4
|
id: string;
|
|
@@ -55,11 +52,10 @@ export const tipCalculator: TravelToolEntry<TipCalculatorUI> = {
|
|
|
55
52
|
},
|
|
56
53
|
};
|
|
57
54
|
|
|
58
|
-
export { TipCalculator, TipCalculatorSEO, TipCalculatorBibliography };
|
|
59
55
|
|
|
60
56
|
export const TIP_CALCULATOR_TOOL: ToolDefinition = {
|
|
61
57
|
entry: tipCalculator,
|
|
62
|
-
Component:
|
|
63
|
-
SEOComponent:
|
|
64
|
-
BibliographyComponent:
|
|
58
|
+
Component: () => import('./component.astro'),
|
|
59
|
+
SEOComponent: () => import('./seo.astro'),
|
|
60
|
+
BibliographyComponent: () => import('./bibliography.astro'),
|
|
65
61
|
};
|