spoko-design-system 0.2.56 → 0.2.58

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
@@ -53,7 +53,7 @@ export { default as getProductChecklist } from './src/utils/product/getProductCh
53
53
  export { default as getShorterDescription } from './src/utils/seo/getShorterDescription';
54
54
 
55
55
  // Utils: Text
56
- export { getData as default } from './src/utils/getData';
56
+ export { default as getData} from './src/utils/getData';
57
57
  // export { default as getData } from './src/utils/getData';
58
58
  // export { getData } from './src/utils/getData';
59
59
  export { getTranslation, text2paragraphs, countWords, firstSentence, removeSemicolon } from './src/utils/text';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoko-design-system",
3
- "version": "0.2.56",
3
+ "version": "0.2.58",
4
4
  "private": false,
5
5
  "main": "./index.ts",
6
6
  "module": "./index.ts",
@@ -1,9 +1,4 @@
1
- import fs from 'node:fs';
2
- import fetch from 'node-fetch';
3
- import dotenv from 'dotenv';
4
- import path from 'node:path'; // dodajemy do bezpiecznej obsługi ścieżek
5
1
 
6
- dotenv.config();
7
2
 
8
3
  const API_URL = process.env.API_URL || '';
9
4
  const CACHE_DIR = process.env.CACHE_DIR || './.cache';
@@ -15,8 +10,8 @@ interface ApiResponse<T> {
15
10
  data: T;
16
11
  }
17
12
 
18
- export const getData = async <T>(type: string): Promise<T | null> => {
19
- if (!API_URL) {
13
+ export const getData = async <T>(type: string, api: string): Promise<T | null> => {
14
+ if (!api) {
20
15
  console.error("API_URL is not defined in .env");
21
16
  return null;
22
17
  }