spoko-design-system 0.2.77 → 0.2.79

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/index.ts CHANGED
@@ -58,11 +58,8 @@ export { default as getShorterDescription } from './src/utils/seo/getShorterDesc
58
58
  // Utils: Text
59
59
 
60
60
  export { getTranslation, text2paragraphs, countWords, firstSentence, removeSemicolon } from './src/utils/text';
61
- // export { apiInfo, getData } from './src/utils/getData';
62
61
  export { default as formatDate } from './src/utils/text/formatDate';
63
62
  export { default as formatLocaleNumber } from './src/utils/text/formatLocaleNumber';
64
63
  export { default as formatPad } from './src/utils/text/formatPad';
65
64
  export { default as getNumberFormatted } from './src/utils/text/getNumberFormatted';
66
65
  export { default as getTranslatedLink } from './src/utils/text/getTranslatedLink';
67
- // export { default as getApiCategories } from './src/utils/api/getCategories';
68
- export { default as getEnvVariable } from './src/utils/getEnvVariable';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "0.2.77",
3
+ "version": "0.2.79",
4
4
  "private": false,
5
5
  "main": "./index.ts",
6
6
  "module": "./index.ts",
@@ -37,7 +37,7 @@
37
37
  "spoko design system"
38
38
  ],
39
39
  "dependencies": {
40
- "@algolia/client-search": "^5.14.0",
40
+ "@algolia/client-search": "^5.14.2",
41
41
  "@astrojs/mdx": "^3.1.9",
42
42
  "@astrojs/node": "^8.3.4",
43
43
  "@astrojs/sitemap": "^3.2.1",
@@ -62,7 +62,7 @@
62
62
  "@iconify-json/ph": "^1.2.1",
63
63
  "@iconify-json/simple-icons": "^1.2.11",
64
64
  "@iconify-json/uil": "^1.2.1",
65
- "@iconify/json": "^2.2.272",
65
+ "@iconify/json": "^2.2.273",
66
66
  "@iconify/vue": "^4.1.2",
67
67
  "@playform/compress": "^0.1.6",
68
68
  "@playform/inline": "github:playform/inline",
@@ -91,12 +91,12 @@
91
91
  "swiper": "^11.1.14",
92
92
  "unocss": "^0.64.1",
93
93
  "vite": "^5.4.11",
94
- "vue": "^3.5.12"
94
+ "vue": "^3.5.13"
95
95
  },
96
96
  "devDependencies": {
97
97
  "@unocss/transformer-variant-group": "^0.64.1",
98
98
  "@vitejs/plugin-vue": "^5.2.0",
99
- "astro": "^4.16.12",
99
+ "astro": "^4.16.13",
100
100
  "unocss": "^0.60.0"
101
101
  },
102
102
  "packageManager": "pnpm@9.8.0",
package/.env.example DELETED
@@ -1,3 +0,0 @@
1
- API_URL=https://host/api/
2
- IMG_URL=https://domain.com
3
- CACHE_DIR=./.cache
@@ -1,56 +0,0 @@
1
- const version = (Math.random() + 1).toString(36).substring(7); // random version to refresh cache from Cloudflare
2
-
3
- interface ApiResponse<T> {
4
- success: boolean;
5
- data: T;
6
- }
7
-
8
- export function getEnvVariable(key, defaultValue = null) {
9
- // First we check import.meta.env (for ES6 environments)
10
- if (typeof import.meta !== 'undefined' && typeof import.meta.env !== 'undefined') {
11
- return import.meta.env[key] || defaultValue;
12
- }
13
-
14
- // Then check process.env (for Node.js environment)
15
- if (typeof process !== 'undefined' && typeof process.env !== 'undefined') {
16
- return process.env[key] || defaultValue;
17
- }
18
-
19
- // If no variable is found, the default value is returned
20
- return defaultValue;
21
- }
22
- const API_URL = getEnvVariable('API_URL', 'https://default-api.com');
23
-
24
-
25
- export const apiInfo = (name: string) => {
26
- return API_URL
27
- }
28
-
29
- export const getData = async <T>(type: string): Promise<T | null> => {
30
- const API = `${API_URL}${type}?version=${version}`;
31
-
32
- try {
33
- const response = await fetch(API);
34
-
35
- if (!response.ok) {
36
- console.error(`Request failed with status ${response.status}: ${response.statusText}`);
37
- return null;
38
- }
39
-
40
- const jsonObject: ApiResponse<T> = await response.json();
41
-
42
- // Return data if API call is successful
43
- if (jsonObject.success) {
44
- return jsonObject.data;
45
- } else {
46
- console.error('API returned success: false');
47
- return null;
48
- }
49
- } catch (error) {
50
- console.error('Fetch error:', error);
51
- return null;
52
- }
53
- };
54
-
55
-
56
- export default { apiInfo, getData };
@@ -1,15 +0,0 @@
1
- export default function getEnvVariable(key, defaultValue = null) {
2
- // First we check import.meta.env (for ES6 environments)
3
- if (typeof import.meta !== 'undefined' && typeof import.meta.env !== 'undefined') {
4
- return import.meta.env[key] || defaultValue;
5
- }
6
-
7
- // Then check process.env (for Node.js environment)
8
- if (typeof process !== 'undefined' && typeof process.env !== 'undefined') {
9
- return process.env[key] || defaultValue;
10
- }
11
-
12
- // If no variable is found, the default value is returned
13
- return defaultValue;
14
- }
15
-