@jjlmoya/utils-diy 1.4.0 → 1.7.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-diy",
3
- "version": "1.4.0",
3
+ "version": "1.7.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 { diyCategory } from './category';
2
- export { default as diyCategorySEO } from './category/seo.astro';
2
+ export const diyCategorySEO = () => 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
 
20
20
  export { ClayCalculatorComponent, ClayCalculatorSEO, ClayCalculatorBibliography } from './tool/clayCalculator';
21
21
  export { CLAY_CALCULATOR_TOOL } from './tool/clayCalculator/index';
@@ -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>>;
@@ -0,0 +1,18 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { diyCategory as toolsCategory } from '../category/index';
3
+
4
+ const EXPECTED_LOCALES = [
5
+ 'de', 'en', 'es', 'fr', 'id', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'zh'
6
+ ];
7
+
8
+ describe('Category Validation', () => {
9
+ it('should have all 15 required locales', () => {
10
+ const registeredLocales = Object.keys(toolsCategory.i18n);
11
+ EXPECTED_LOCALES.forEach((locale) => {
12
+ expect(
13
+ registeredLocales,
14
+ `Category is missing locale "${locale}"`,
15
+ ).toContain(locale);
16
+ });
17
+ });
18
+ });
@@ -0,0 +1,23 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { ALL_TOOLS } from '../tools';
3
+ import type { ToolLocaleContent } from '../types';
4
+
5
+ describe('Slug Language Code Format Validation', () => {
6
+ ALL_TOOLS.forEach((tool) => {
7
+ describe(`Tool: ${tool.entry.id}`, () => {
8
+ it('slug should not end with 2-letter language codes like -ja, -ru, -ko', async () => {
9
+ const locales = Object.keys(tool.entry.i18n);
10
+
11
+ for (const locale of locales) {
12
+ const loader = tool.entry.i18n[locale as keyof typeof tool.entry.i18n];
13
+ const content = (await loader?.()) as ToolLocaleContent;
14
+
15
+ expect(
16
+ content.slug,
17
+ `Tool "${tool.entry.id}" locale "${locale}" slug ("${content.slug}") cannot end with a 2-letter language code (e.g., -ja, -ru, -ko).`,
18
+ ).not.toMatch(/-[a-z]{2}$/);
19
+ }
20
+ });
21
+ });
22
+ });
23
+ });
@@ -2,6 +2,54 @@ import { describe, it, expect } from 'vitest';
2
2
  import { ALL_TOOLS } from '../tools';
3
3
  import type { ToolLocaleContent } from '../types';
4
4
 
5
+ const sharingLocales = ['ja', 'ko', 'zh'];
6
+
7
+ interface ValidateParams {
8
+ toolId: string;
9
+ locale: string;
10
+ content: ToolLocaleContent;
11
+ enSlug: string;
12
+ slugs: Map<string, string>;
13
+ }
14
+
15
+ const validateLocaleSlug = ({
16
+ toolId,
17
+ locale,
18
+ content,
19
+ enSlug,
20
+ slugs,
21
+ }: ValidateParams) => {
22
+ expect(
23
+ content.slug,
24
+ `Tool "${toolId}" locale "${locale}" has an invalid slug ("${content.slug}"). Slugs must be transliterated (only a-z, 0-9, and -).`,
25
+ ).toMatch(/^[a-z0-9-]+$/);
26
+
27
+ if (locale === 'en') {
28
+ return;
29
+ }
30
+
31
+ if (sharingLocales.includes(locale)) {
32
+ expect(
33
+ content.slug,
34
+ `Tool "${toolId}" locale "${locale}" must use the same slug as "en" ("${enSlug}").`,
35
+ ).toBe(enSlug);
36
+ } else {
37
+ expect(
38
+ content.slug,
39
+ `Tool "${toolId}" locale "${locale}" has the same slug as "en" ("${enSlug}"). Cada slug tiene que estar en su propia idioma`,
40
+ ).not.toBe(enSlug);
41
+
42
+ if (slugs.has(content.slug)) {
43
+ const previousLocale = slugs.get(content.slug);
44
+ expect(
45
+ false,
46
+ `Tool "${toolId}" locales "${locale}" and "${previousLocale}" share the same slug ("${content.slug}"). Cada slug tiene que estar en su propia idioma`,
47
+ ).toBe(true);
48
+ }
49
+ slugs.set(content.slug, locale);
50
+ }
51
+ };
52
+
5
53
  describe('Slug Localization and Uniqueness Validation', () => {
6
54
  ALL_TOOLS.forEach((tool) => {
7
55
  describe(`Tool: ${tool.entry.id}`, () => {
@@ -16,43 +64,18 @@ describe('Slug Localization and Uniqueness Validation', () => {
16
64
  enSlug = enContent.slug;
17
65
  }
18
66
 
19
- const sharingLocales = ['ja', 'ko', 'zh'];
20
-
21
67
  for (const locale of locales) {
22
68
  const loader = tool.entry.i18n[locale as keyof typeof tool.entry.i18n];
23
69
  const content = (await loader?.()) as ToolLocaleContent;
24
-
25
- expect(
26
- content.slug,
27
- `Tool "${tool.entry.id}" locale "${locale}" has an invalid slug ("${content.slug}"). Slugs must be transliterated (only a-z, 0-9, and -).`,
28
- ).toMatch(/^[a-z0-9-]+$/);
29
-
30
- if (locale === 'en') {
31
- continue;
32
- }
33
-
34
- if (sharingLocales.includes(locale)) {
35
- expect(
36
- content.slug,
37
- `Tool "${tool.entry.id}" locale "${locale}" must use the same slug as "en" ("${enSlug}").`,
38
- ).toBe(enSlug);
39
- } else {
40
- expect(
41
- content.slug,
42
- `Tool "${tool.entry.id}" locale "${locale}" has the same slug as "en" ("${enSlug}"). Cada slug tiene que estar en su propia idioma`,
43
- ).not.toBe(enSlug);
44
-
45
- const previousLocale = slugs.get(content.slug);
46
- if (previousLocale) {
47
- expect(
48
- false,
49
- `Tool "${tool.entry.id}" locales "${locale}" and "${previousLocale}" share the same slug ("${content.slug}"). Cada slug tiene que estar en su propia idioma`,
50
- ).toBe(true);
51
- }
52
- slugs.set(content.slug, locale);
53
- }
70
+ validateLocaleSlug({
71
+ toolId: tool.entry.id,
72
+ locale,
73
+ content,
74
+ enSlug,
75
+ slugs,
76
+ });
54
77
  }
55
78
  });
56
79
  });
57
80
  });
58
- });
81
+ });
@@ -1,7 +1,4 @@
1
1
  import type { DiyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import BalusterCalculatorComponent from './component.astro';
3
- import BalusterCalculatorSEO from './seo.astro';
4
- import BalusterCalculatorBibliography from './bibliography.astro';
5
2
  import type { BalusterCalculatorUI } from './ui';
6
3
 
7
4
  export type BalusterCalculatorLocaleContent = ToolLocaleContent<BalusterCalculatorUI>;
@@ -31,11 +28,10 @@ export const balusterCalculator: DiyToolEntry<BalusterCalculatorUI> = {
31
28
  },
32
29
  };
33
30
 
34
- export { BalusterCalculatorComponent, BalusterCalculatorSEO, BalusterCalculatorBibliography };
35
31
 
36
32
  export const BALUSTER_CALCULATOR_TOOL: ToolDefinition = {
37
33
  entry: balusterCalculator,
38
- Component: BalusterCalculatorComponent,
39
- SEOComponent: BalusterCalculatorSEO,
40
- BibliographyComponent: BalusterCalculatorBibliography,
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 { DiyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import ClayCalculatorComponent from './component.astro';
3
- import ClayCalculatorSEO from './seo.astro';
4
- import ClayCalculatorBibliography from './bibliography.astro';
5
2
  import type { ClayCalculatorUI } from './ui';
6
3
 
7
4
  export type ClayCalculatorLocaleContent = ToolLocaleContent<ClayCalculatorUI>;
@@ -31,11 +28,10 @@ export const clayCalculator: DiyToolEntry<ClayCalculatorUI> = {
31
28
  },
32
29
  };
33
30
 
34
- export { ClayCalculatorComponent, ClayCalculatorSEO, ClayCalculatorBibliography };
35
31
 
36
32
  export const CLAY_CALCULATOR_TOOL: ToolDefinition = {
37
33
  entry: clayCalculator,
38
- Component: ClayCalculatorComponent,
39
- SEOComponent: ClayCalculatorSEO,
40
- BibliographyComponent: ClayCalculatorBibliography,
34
+ Component: () => import('./component.astro'),
35
+ SEOComponent: () => import('./seo.astro'),
36
+ BibliographyComponent: () => import('./bibliography.astro'),
41
37
  };
@@ -1,14 +1,6 @@
1
- import ConcreteCalculatorComponent from './component.astro';
2
- import ConcreteCalculatorSEO from './seo.astro';
3
- import ConcreteCalculatorBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { ConcreteCalculatorUI } from './ui';
6
3
 
7
- export {
8
- ConcreteCalculatorComponent,
9
- ConcreteCalculatorSEO,
10
- ConcreteCalculatorBibliography,
11
- };
12
4
 
13
5
  export const concreteCalculator: DiyToolEntry<ConcreteCalculatorUI> = {
14
6
  id: 'concrete-calculator',
@@ -34,7 +26,7 @@ export const concreteCalculator: DiyToolEntry<ConcreteCalculatorUI> = {
34
26
 
35
27
  export const CONCRETE_CALCULATOR_TOOL: ToolDefinition = {
36
28
  entry: concreteCalculator,
37
- Component: ConcreteCalculatorComponent,
38
- SEOComponent: ConcreteCalculatorSEO,
39
- BibliographyComponent: ConcreteCalculatorBibliography,
29
+ Component: () => import('./component.astro'),
30
+ SEOComponent: () => import('./seo.astro'),
31
+ BibliographyComponent: () => import('./bibliography.astro'),
40
32
  };
@@ -1,14 +1,6 @@
1
- import CutOptimizerComponent from './component.astro';
2
- import CutOptimizerSEO from './seo.astro';
3
- import CutOptimizerBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { CutOptimizerUI } from './ui';
6
3
 
7
- export {
8
- CutOptimizerComponent,
9
- CutOptimizerSEO,
10
- CutOptimizerBibliography,
11
- };
12
4
 
13
5
  export const cutOptimizer: DiyToolEntry<CutOptimizerUI> = {
14
6
  id: 'cut-optimizer',
@@ -34,7 +26,7 @@ export const cutOptimizer: DiyToolEntry<CutOptimizerUI> = {
34
26
 
35
27
  export const CUT_OPTIMIZER_TOOL: ToolDefinition = {
36
28
  entry: cutOptimizer,
37
- Component: CutOptimizerComponent,
38
- SEOComponent: CutOptimizerSEO,
39
- BibliographyComponent: CutOptimizerBibliography,
29
+ Component: () => import('./component.astro'),
30
+ SEOComponent: () => import('./seo.astro'),
31
+ BibliographyComponent: () => import('./bibliography.astro'),
40
32
  };
@@ -1,14 +1,6 @@
1
- import DrillCalculatorComponent from './component.astro';
2
- import DrillCalculatorSEO from './seo.astro';
3
- import DrillCalculatorBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { DrillCalculatorUI } from './ui';
6
3
 
7
- export {
8
- DrillCalculatorComponent,
9
- DrillCalculatorSEO,
10
- DrillCalculatorBibliography,
11
- };
12
4
 
13
5
  export const drillCalculator: DiyToolEntry<DrillCalculatorUI> = {
14
6
  id: 'drill-rpm-calculator',
@@ -34,7 +26,7 @@ export const drillCalculator: DiyToolEntry<DrillCalculatorUI> = {
34
26
 
35
27
  export const DRILL_CALCULATOR_TOOL: ToolDefinition = {
36
28
  entry: drillCalculator,
37
- Component: DrillCalculatorComponent,
38
- SEOComponent: DrillCalculatorSEO,
39
- BibliographyComponent: DrillCalculatorBibliography,
29
+ Component: () => import('./component.astro'),
30
+ SEOComponent: () => import('./seo.astro'),
31
+ BibliographyComponent: () => import('./bibliography.astro'),
40
32
  };
@@ -1,15 +1,7 @@
1
- import DrillSharpenerComponent from './component.astro';
2
- import DrillSharpenerSEO from './seo.astro';
3
- import DrillSharpenerBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { DrillSharpenerUI } from './ui';
6
3
  import { drillSharpenerUI } from './ui';
7
4
 
8
- export {
9
- DrillSharpenerComponent,
10
- DrillSharpenerSEO,
11
- DrillSharpenerBibliography,
12
- };
13
5
 
14
6
  export const drillSharpener: DiyToolEntry<DrillSharpenerUI> = {
15
7
  id: 'drill-sharpener',
@@ -35,9 +27,9 @@ export const drillSharpener: DiyToolEntry<DrillSharpenerUI> = {
35
27
 
36
28
  export const DRILL_SHARPENER_TOOL: ToolDefinition = {
37
29
  entry: drillSharpener,
38
- Component: DrillSharpenerComponent,
39
- SEOComponent: DrillSharpenerSEO,
40
- BibliographyComponent: DrillSharpenerBibliography,
30
+ Component: () => import('./component.astro'),
31
+ SEOComponent: () => import('./seo.astro'),
32
+ BibliographyComponent: () => import('./bibliography.astro'),
41
33
  };
42
34
 
43
35
  export { drillSharpenerUI };
@@ -1,7 +1,4 @@
1
1
  import type { DiyToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
- import EpoxyCalculatorComponent from './component.astro';
3
- import EpoxyCalculatorSEO from './seo.astro';
4
- import EpoxyCalculatorBibliography from './bibliography.astro';
5
2
  import type { EpoxyCalculatorUI } from './ui';
6
3
 
7
4
  export type EpoxyCalculatorLocaleContent = ToolLocaleContent<EpoxyCalculatorUI>;
@@ -31,11 +28,10 @@ export const epoxyCalculator: DiyToolEntry<EpoxyCalculatorUI> = {
31
28
  },
32
29
  };
33
30
 
34
- export { EpoxyCalculatorComponent, EpoxyCalculatorSEO, EpoxyCalculatorBibliography };
35
31
 
36
32
  export const EPOXY_CALCULATOR_TOOL: ToolDefinition = {
37
33
  entry: epoxyCalculator,
38
- Component: EpoxyCalculatorComponent,
39
- SEOComponent: EpoxyCalculatorSEO,
40
- BibliographyComponent: EpoxyCalculatorBibliography,
34
+ Component: () => import('./component.astro'),
35
+ SEOComponent: () => import('./seo.astro'),
36
+ BibliographyComponent: () => import('./bibliography.astro'),
41
37
  };
@@ -1,14 +1,6 @@
1
- import FurnitureFitComponent from './component.astro';
2
- import FurnitureFitSEO from './seo.astro';
3
- import FurnitureFitBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { FurnitureFitUI } from './ui';
6
3
 
7
- export {
8
- FurnitureFitComponent,
9
- FurnitureFitSEO,
10
- FurnitureFitBibliography,
11
- };
12
4
 
13
5
  export const furnitureFit: DiyToolEntry<FurnitureFitUI> = {
14
6
  id: 'furniture-fit-calculator',
@@ -34,7 +26,7 @@ export const furnitureFit: DiyToolEntry<FurnitureFitUI> = {
34
26
 
35
27
  export const FURNITURE_FIT_TOOL: ToolDefinition = {
36
28
  entry: furnitureFit,
37
- Component: FurnitureFitComponent,
38
- SEOComponent: FurnitureFitSEO,
39
- BibliographyComponent: FurnitureFitBibliography,
29
+ Component: () => import('./component.astro'),
30
+ SEOComponent: () => import('./seo.astro'),
31
+ BibliographyComponent: () => import('./bibliography.astro'),
40
32
  };
@@ -1,10 +1,6 @@
1
- import MortarCalculatorComponent from './component.astro';
2
- import MortarCalculatorSEO from './seo.astro';
3
- import MortarCalculatorBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { MortarCalculatorUI } from './ui';
6
3
 
7
- export { MortarCalculatorComponent, MortarCalculatorSEO, MortarCalculatorBibliography };
8
4
 
9
5
  export const mortarCalculator: DiyToolEntry<MortarCalculatorUI> = {
10
6
  id: 'mortar-calculator',
@@ -30,7 +26,7 @@ export const mortarCalculator: DiyToolEntry<MortarCalculatorUI> = {
30
26
 
31
27
  export const MORTAR_CALCULATOR_TOOL: ToolDefinition = {
32
28
  entry: mortarCalculator,
33
- Component: MortarCalculatorComponent,
34
- SEOComponent: MortarCalculatorSEO,
35
- BibliographyComponent: MortarCalculatorBibliography,
29
+ Component: () => import('./component.astro'),
30
+ SEOComponent: () => import('./seo.astro'),
31
+ BibliographyComponent: () => import('./bibliography.astro'),
36
32
  };
@@ -1,14 +1,6 @@
1
- import PassepartoutCalculatorComponent from './component.astro';
2
- import PassepartoutCalculatorSEO from './seo.astro';
3
- import PassepartoutCalculatorBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { PassepartoutCalculatorUI } from './ui';
6
3
 
7
- export {
8
- PassepartoutCalculatorComponent,
9
- PassepartoutCalculatorSEO,
10
- PassepartoutCalculatorBibliography,
11
- };
12
4
 
13
5
  export const passepartoutCalculator: DiyToolEntry<PassepartoutCalculatorUI> = {
14
6
  id: 'passepartout-calculator',
@@ -34,7 +26,7 @@ export const passepartoutCalculator: DiyToolEntry<PassepartoutCalculatorUI> = {
34
26
 
35
27
  export const PASSEPARTOUT_CALCULATOR_TOOL: ToolDefinition = {
36
28
  entry: passepartoutCalculator,
37
- Component: PassepartoutCalculatorComponent,
38
- SEOComponent: PassepartoutCalculatorSEO,
39
- BibliographyComponent: PassepartoutCalculatorBibliography,
29
+ Component: () => import('./component.astro'),
30
+ SEOComponent: () => import('./seo.astro'),
31
+ BibliographyComponent: () => import('./bibliography.astro'),
40
32
  };
@@ -1,15 +1,7 @@
1
- import StairCalculatorComponent from './component.astro';
2
- import StairCalculatorSEO from './seo.astro';
3
- import StairCalculatorBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { StairCalculatorUI } from './ui';
6
3
  import { stairCalculatorUI } from './ui';
7
4
 
8
- export {
9
- StairCalculatorComponent,
10
- StairCalculatorSEO,
11
- StairCalculatorBibliography,
12
- };
13
5
 
14
6
  export const stairCalculator: DiyToolEntry<StairCalculatorUI> = {
15
7
  id: 'stair-calculator',
@@ -35,9 +27,9 @@ export const stairCalculator: DiyToolEntry<StairCalculatorUI> = {
35
27
 
36
28
  export const STAIR_CALCULATOR_TOOL: ToolDefinition = {
37
29
  entry: stairCalculator,
38
- Component: StairCalculatorComponent,
39
- SEOComponent: StairCalculatorSEO,
40
- BibliographyComponent: StairCalculatorBibliography,
30
+ Component: () => import('./component.astro'),
31
+ SEOComponent: () => import('./seo.astro'),
32
+ BibliographyComponent: () => import('./bibliography.astro'),
41
33
  };
42
34
 
43
35
  export { stairCalculatorUI };
@@ -1,14 +1,6 @@
1
- import ThermalExpansionCalculatorComponent from './component.astro';
2
- import ThermalExpansionCalculatorSEO from './seo.astro';
3
- import ThermalExpansionCalculatorBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { ThermalExpansionCalculatorUI } from './ui';
6
3
 
7
- export {
8
- ThermalExpansionCalculatorComponent,
9
- ThermalExpansionCalculatorSEO,
10
- ThermalExpansionCalculatorBibliography,
11
- };
12
4
 
13
5
  export const thermalExpansionCalculator: DiyToolEntry<ThermalExpansionCalculatorUI> = {
14
6
  id: 'thermal-expansion-calculator',
@@ -34,7 +26,7 @@ export const thermalExpansionCalculator: DiyToolEntry<ThermalExpansionCalculator
34
26
 
35
27
  export const THERMAL_EXPANSION_CALCULATOR_TOOL: ToolDefinition = {
36
28
  entry: thermalExpansionCalculator,
37
- Component: ThermalExpansionCalculatorComponent,
38
- SEOComponent: ThermalExpansionCalculatorSEO,
39
- BibliographyComponent: ThermalExpansionCalculatorBibliography,
29
+ Component: () => import('./component.astro'),
30
+ SEOComponent: () => import('./seo.astro'),
31
+ BibliographyComponent: () => import('./bibliography.astro'),
40
32
  };
@@ -1,14 +1,6 @@
1
- import VoltageDropCalculatorComponent from './component.astro';
2
- import VoltageDropCalculatorSEO from './seo.astro';
3
- import VoltageDropCalculatorBibliography from './bibliography.astro';
4
1
  import type { DiyToolEntry, ToolDefinition } from '../../types';
5
2
  import type { VoltageDropCalculatorUI } from './ui';
6
3
 
7
- export {
8
- VoltageDropCalculatorComponent,
9
- VoltageDropCalculatorSEO,
10
- VoltageDropCalculatorBibliography,
11
- };
12
4
 
13
5
  export const voltageDropCalculator: DiyToolEntry<VoltageDropCalculatorUI> = {
14
6
  id: 'voltage-drop-calculator',
@@ -34,7 +26,7 @@ export const voltageDropCalculator: DiyToolEntry<VoltageDropCalculatorUI> = {
34
26
 
35
27
  export const VOLTAGE_DROP_CALCULATOR_TOOL: ToolDefinition = {
36
28
  entry: voltageDropCalculator,
37
- Component: VoltageDropCalculatorComponent,
38
- SEOComponent: VoltageDropCalculatorSEO,
39
- BibliographyComponent: VoltageDropCalculatorBibliography,
29
+ Component: () => import('./component.astro'),
30
+ SEOComponent: () => import('./seo.astro'),
31
+ BibliographyComponent: () => import('./bibliography.astro'),
40
32
  };
package/src/tools.ts CHANGED
@@ -14,3 +14,5 @@ import { STAIR_CALCULATOR_TOOL } from './tool/stairCalculator/index';
14
14
  import { DRILL_SHARPENER_TOOL } from './tool/drillSharpener/index';
15
15
 
16
16
  export const ALL_TOOLS: ToolDefinition[] = [CLAY_CALCULATOR_TOOL, EPOXY_CALCULATOR_TOOL, BALUSTER_CALCULATOR_TOOL, MORTAR_CALCULATOR_TOOL, PASSEPARTOUT_CALCULATOR_TOOL, CONCRETE_CALCULATOR_TOOL, CUT_OPTIMIZER_TOOL, VOLTAGE_DROP_CALCULATOR_TOOL, FURNITURE_FIT_TOOL, THERMAL_EXPANSION_CALCULATOR_TOOL, DRILL_CALCULATOR_TOOL, STAIR_CALCULATOR_TOOL, DRILL_SHARPENER_TOOL];
17
+
18
+ export const ALL_ENTRIES = ALL_TOOLS.map(t => t.entry);