@hkdigital/lib-core 0.5.96 → 0.5.98

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.
Files changed (34) hide show
  1. package/README.md +8 -56
  2. package/dist/config/generators/imagetools.d.ts +4 -10
  3. package/dist/config/generators/imagetools.js +43 -25
  4. package/dist/config/imagetools.d.ts +2 -2
  5. package/dist/meta/components/Favicons.svelte +1 -1
  6. package/dist/meta/components/Favicons.svelte.d.ts +9 -5
  7. package/dist/meta/components/PWA.svelte +2 -2
  8. package/dist/meta/components/PWA.svelte.d.ts +9 -5
  9. package/dist/meta/components/SEO.svelte +113 -77
  10. package/dist/meta/components/SEO.svelte.d.ts +28 -28
  11. package/dist/{config/meta.d.ts → meta/config.d.ts} +14 -14
  12. package/dist/meta/config.js +115 -0
  13. package/dist/meta/templates/README.md +3 -3
  14. package/dist/meta/templates/lib/{config/meta.d.ts → meta/config.d.ts} +22 -29
  15. package/dist/{config/meta.js → meta/templates/lib/meta/config.js} +10 -10
  16. package/dist/meta/templates/lib/meta/favicon.png +0 -0
  17. package/dist/meta/templates/lib/meta/preview-landscape.png +0 -0
  18. package/dist/meta/templates/lib/meta/preview-square.png +0 -0
  19. package/dist/meta/templates/routes/(meta)/manifest.json/+server.js +3 -4
  20. package/dist/meta/templates/routes/(meta)/robots.txt/+server.js +1 -1
  21. package/dist/meta/templates/routes/(meta)/sitemap.xml/+server.js +1 -1
  22. package/dist/meta/typedef.d.ts +100 -1
  23. package/dist/meta/typedef.js +45 -5
  24. package/dist/meta.d.ts +1 -1
  25. package/dist/meta.js +1 -1
  26. package/package.json +1 -1
  27. package/dist/meta/config.typedef.d.ts +0 -98
  28. package/dist/meta/config.typedef.js +0 -44
  29. package/dist/meta/templates/lib/config/meta.js +0 -112
  30. package/dist/meta/templates/lib/meta.d.ts +0 -8
  31. package/dist/meta/templates/lib/meta.js +0 -23
  32. /package/dist/meta/{templates/lib/assets/meta/favicon.png → favicon.png} +0 -0
  33. /package/dist/meta/{templates/lib/assets/meta/preview-landscape.png → preview-landscape.png} +0 -0
  34. /package/dist/meta/{templates/lib/assets/meta/preview-square.png → preview-square.png} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.96",
3
+ "version": "0.5.98",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -1,98 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
3
- /**
4
- * App identity
5
- */
6
- export type MetaConfig = {
7
- /**
8
- * - Full app name
9
- */
10
- name: string;
11
- /**
12
- * - Short app name (max 12 characters)
13
- */
14
- shortName: string;
15
- /**
16
- * - App description for search engines
17
- *
18
- * Language and locale
19
- */
20
- description: string;
21
- /**
22
- * Language configurations
23
- */
24
- languages: Record<string, {
25
- lang: string;
26
- locale: string;
27
- }>;
28
- /**
29
- * - Default language code
30
- */
31
- defaultLanguage: string;
32
- /**
33
- * - Default locale
34
- *
35
- * PWA theme and colors
36
- */
37
- defaultLocale: string;
38
- /**
39
- * - Theme color
40
- */
41
- backgroundAndThemeColor: string;
42
- /**
43
- * - Theme color for browser UI
44
- */
45
- themeColor: string;
46
- /**
47
- * - Background color
48
- */
49
- backgroundColor: string;
50
- /**
51
- * - iOS status bar style
52
- */
53
- statusBarStyle: string;
54
- /**
55
- * - Screen orientation
56
- */
57
- orientation: string;
58
- /**
59
- * - Disable pinch-to-zoom
60
- *
61
- * SEO images
62
- */
63
- disablePageZoom: boolean;
64
- /**
65
- * - Landscape SEO image URL (1200×630)
66
- */
67
- SeoImageLandscape?: string | undefined;
68
- /**
69
- * - Square SEO image URL (1200×1200)
70
- *
71
- * Favicon images (processed by imagetools)
72
- */
73
- SeoImageSquare?: string | undefined;
74
- /**
75
- * Processed favicon images
76
- */
77
- faviconImages: Array<{
78
- src: string;
79
- width: number;
80
- }>;
81
- /**
82
- * Processed apple-touch-icon images
83
- *
84
- * Site configuration
85
- */
86
- appleTouchIcons: Array<{
87
- src: string;
88
- width: number;
89
- }>;
90
- /**
91
- * Routes for sitemap.xml
92
- */
93
- siteRoutes: import("./utils/sitemap/typedef.js").SitemapRoute[];
94
- /**
95
- * Robots.txt configuration
96
- */
97
- robotsConfig: import("./utils/robots/typedef.js").RobotsConfig;
98
- };
@@ -1,44 +0,0 @@
1
- /**
2
- * Meta configuration type definitions
3
- */
4
-
5
- /**
6
- * @typedef {Object} MetaConfig
7
- *
8
- * App identity
9
- * @property {string} name - Full app name
10
- * @property {string} shortName - Short app name (max 12 characters)
11
- * @property {string} description - App description for search engines
12
- *
13
- * Language and locale
14
- * @property {Record<string, {lang: string, locale: string}>} languages
15
- * Language configurations
16
- * @property {string} defaultLanguage - Default language code
17
- * @property {string} defaultLocale - Default locale
18
- *
19
- * PWA theme and colors
20
- * @property {string} backgroundAndThemeColor - Theme color
21
- * @property {string} themeColor - Theme color for browser UI
22
- * @property {string} backgroundColor - Background color
23
- * @property {string} statusBarStyle - iOS status bar style
24
- * @property {string} orientation - Screen orientation
25
- * @property {boolean} disablePageZoom - Disable pinch-to-zoom
26
- *
27
- * SEO images
28
- * @property {string} [SeoImageLandscape] - Landscape SEO image URL (1200×630)
29
- * @property {string} [SeoImageSquare] - Square SEO image URL (1200×1200)
30
- *
31
- * Favicon images (processed by imagetools)
32
- * @property {Array<{src: string, width: number}>} faviconImages
33
- * Processed favicon images
34
- * @property {Array<{src: string, width: number}>} appleTouchIcons
35
- * Processed apple-touch-icon images
36
- *
37
- * Site configuration
38
- * @property {import('./utils/sitemap/typedef.js').SitemapRoute[]} siteRoutes
39
- * Routes for sitemap.xml
40
- * @property {import('./utils/robots/typedef.js').RobotsConfig} robotsConfig
41
- * Robots.txt configuration
42
- */
43
-
44
- export default {};
@@ -1,112 +0,0 @@
1
- /**
2
- * Meta configuration
3
- *
4
- * Customize this file with your app's information.
5
- * After copying to your project, update all values below.
6
- */
7
-
8
- /**
9
- * App identity
10
- */
11
- export const name = 'Your App Name';
12
- export const shortName = 'YourApp'; // max 12 characters
13
- export const description = 'Your app description for search engines';
14
-
15
- /**
16
- * Language and locale configuration
17
- *
18
- * @type {Record<string, {lang: string, locale: string}>}
19
- */
20
- export const languages = {
21
- 'en': { lang: 'en-GB', locale: 'en_GB' },
22
- 'nl': { lang: 'nl-NL', locale: 'nl_NL' }
23
-
24
- // Add more languages as needed:
25
- // 'es': { lang: 'es-ES', locale: 'es_ES' },
26
- // 'en-us': { lang: 'en-US', locale: 'en_US' }
27
- };
28
-
29
- export const defaultLanguage = 'en';
30
- export const defaultLocale = languages[defaultLanguage].locale;
31
-
32
- /**
33
- * PWA theme and colors
34
- */
35
- export const backgroundAndThemeColor = '#082962';
36
- export const themeColor = backgroundAndThemeColor;
37
- export const backgroundColor = backgroundAndThemeColor;
38
-
39
- /**
40
- * iOS PWA configuration
41
- */
42
- export const statusBarStyle = 'black-translucent'; // 'default' | 'black' | 'black-translucent'
43
-
44
- /**
45
- * Screen orientation
46
- */
47
- export const orientation = 'any'; // 'any' | 'landscape' | 'portrait'
48
-
49
- /**
50
- * Disable pinch-to-zoom
51
- *
52
- * Only enable for games or canvas apps where zoom breaks functionality
53
- */
54
- export const disablePageZoom = false;
55
-
56
- /**
57
- * SEO social media preview images
58
- *
59
- * Replace the image files with your own designs.
60
- * The images are processed by Vite imagetools to correct dimensions.
61
- *
62
- * To disable: comment out imports and set to null
63
- */
64
- import SeoLandscapeImg from '../../../../assets/meta/preview-landscape.png?seo-landscape';
65
- import SeoSquareImg from '../../../../assets/meta/preview-square.png?seo-square';
66
-
67
- export const SeoImageLandscape = SeoLandscapeImg; // 1200×630
68
- export const SeoImageSquare = SeoSquareImg; // 1200×1200
69
-
70
- // To disable SEO images:
71
- // export const SeoImageLandscape = null;
72
- // export const SeoImageSquare = null;
73
-
74
- /**
75
- * Favicon images (processed by Vite imagetools)
76
- */
77
- import FaviconImgs from '../../../../assets/meta/favicon.png?favicons';
78
- import AppleTouchImgs from '../../../../assets/meta/favicon.png?apple-touch-icons';
79
-
80
- export const faviconImages = FaviconImgs;
81
- export const appleTouchIcons = AppleTouchImgs;
82
-
83
- /**
84
- * Site routes for sitemap.xml
85
- *
86
- * @type {import('../../../typedef.js').SitemapRoute[]}
87
- *
88
- * @see @hkdigital/lib-core/meta/README.md for configuration options
89
- */
90
- export const siteRoutes = [
91
- '/'
92
- // Add your routes:
93
- // '/about',
94
- // '/contact',
95
- // { path: '/blog', priority: 0.9, changefreq: 'daily' }
96
- ];
97
-
98
- /**
99
- * Robots.txt configuration
100
- *
101
- * @type {import('../../../typedef.js').RobotsConfig}
102
- *
103
- * @see @hkdigital/lib-core/meta/README.md for configuration options
104
- */
105
- export const robotsConfig = {
106
- allowedHosts: '*', // '*' allows all hosts
107
- disallowedPaths: [], // e.g., ['/admin', '/api']
108
-
109
- // AI bot control (site-wide via robots.txt)
110
- allowAiTraining: true, // GPTBot, Google-Extended, CCBot, anthropic-ai
111
- allowAiReading: true // ChatGPT-User, Claude-Web, cohere-ai
112
- };
@@ -1,8 +0,0 @@
1
- import { Favicons } from '../../components.js';
2
- import { PWA } from '../../components.js';
3
- import { SEO } from '../../components.js';
4
- export const getLangFromPath: Function;
5
- export const injectLang: Function;
6
- export const handleLang: Function;
7
- import * as config from '../../../config/meta.js';
8
- export { Favicons, PWA, SEO, config };
@@ -1,23 +0,0 @@
1
- /**
2
- * Meta components configured for your app
3
- *
4
- * This file imports the library components and configures them with your
5
- * app's config. Components are automatically updated when you update the
6
- * @hkdigital/lib-core library.
7
- */
8
-
9
- import { Favicons, PWA, SEO } from '../../components.js';
10
- import { createLangUtils } from '../../utils.js';
11
- import * as config from '../../../config/meta.js';
12
-
13
- // Create configured language utilities
14
- const { getLangFromPath, injectLang, handleLang } = createLangUtils(config);
15
-
16
- // Re-export components (they'll receive config as a prop in your layout)
17
- export { Favicons, PWA, SEO };
18
-
19
- // Export language utilities
20
- export { getLangFromPath, injectLang, handleLang };
21
-
22
- // Export config for convenience
23
- export { config };