my-animated-components 1.0.3 → 1.0.4

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/dist/index.js CHANGED
@@ -63,14 +63,14 @@ const loadComponents = (componentsPath) => {
63
63
 
64
64
  // Set the path to your components directory
65
65
  const componentsPath = './components';
66
- // Create an object to hold your dynamic exports
67
- const dynamicExports = {};
68
- // Export components dynamically
66
+ let componentsExports = {};
67
+ // Dynamically load the components
69
68
  loadComponents(componentsPath)
70
69
  .then((components) => {
71
70
  components.forEach(({ name, component }) => {
72
71
  if (component) {
73
- dynamicExports[name] = component;
72
+ // Dynamically assign each component to the componentsExports object
73
+ componentsExports[name] = component;
74
74
  }
75
75
  });
76
76
  })
@@ -78,4 +78,4 @@ loadComponents(componentsPath)
78
78
  console.error('Error loading components:', err);
79
79
  });
80
80
 
81
- export { dynamicExports };
81
+ export { componentsExports };
@@ -1,5 +1,3 @@
1
1
  import './styles/tailwind.css';
2
- declare const dynamicExports: {
3
- [key: string]: any;
4
- };
5
- export { dynamicExports };
2
+ declare let componentsExports: Record<string, any>;
3
+ export { componentsExports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-animated-components",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -4,15 +4,15 @@ import { loadComponents } from './utils/Listfiles';
4
4
  // Set the path to your components directory
5
5
  const componentsPath = './components';
6
6
 
7
- // Create an object to hold your dynamic exports
8
- const dynamicExports: { [key: string]: any } = {};
7
+ let componentsExports: Record<string, any> = {};
9
8
 
10
- // Export components dynamically
9
+ // Dynamically load the components
11
10
  loadComponents(componentsPath)
12
11
  .then((components) => {
13
12
  components.forEach(({ name, component }: any) => {
14
13
  if (component) {
15
- dynamicExports[name] = component;
14
+ // Dynamically assign each component to the componentsExports object
15
+ componentsExports[name] = component;
16
16
  }
17
17
  });
18
18
  })
@@ -20,5 +20,5 @@ loadComponents(componentsPath)
20
20
  console.error('Error loading components:', err);
21
21
  });
22
22
 
23
-
24
- export { dynamicExports };
23
+ // After loading, export all components from the componentsExports object
24
+ export { componentsExports };