my-animated-components 1.0.2 → 1.0.3

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
@@ -31,7 +31,6 @@ function styleInject(css, ref) {
31
31
  var css_248z = "@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n";
32
32
  styleInject(css_248z);
33
33
 
34
- // /src/utils/listFiles.ts
35
34
  // Dynamically import and load components, returning them for export
36
35
  const loadComponents = (componentsPath) => {
37
36
  return new Promise((resolve, reject) => {
@@ -62,19 +61,21 @@ const loadComponents = (componentsPath) => {
62
61
  });
63
62
  };
64
63
 
65
- // /src/index.ts
66
64
  // Set the path to your components directory
67
65
  const componentsPath = './components';
68
- // Dynamically load and export components
66
+ // Create an object to hold your dynamic exports
67
+ const dynamicExports = {};
68
+ // Export components dynamically
69
69
  loadComponents(componentsPath)
70
70
  .then((components) => {
71
71
  components.forEach(({ name, component }) => {
72
72
  if (component) {
73
- // Dynamically export the components
74
- module.exports[name] = component;
73
+ dynamicExports[name] = component;
75
74
  }
76
75
  });
77
76
  })
78
77
  .catch((err) => {
79
78
  console.error('Error loading components:', err);
80
79
  });
80
+
81
+ export { dynamicExports };
@@ -1 +1,5 @@
1
1
  import './styles/tailwind.css';
2
+ declare const dynamicExports: {
3
+ [key: string]: any;
4
+ };
5
+ export { dynamicExports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-animated-components",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -1,20 +1,24 @@
1
- // /src/index.ts
2
1
  import './styles/tailwind.css';
3
2
  import { loadComponents } from './utils/Listfiles';
4
3
 
5
4
  // Set the path to your components directory
6
5
  const componentsPath = './components';
7
6
 
8
- // Dynamically load and export components
7
+ // Create an object to hold your dynamic exports
8
+ const dynamicExports: { [key: string]: any } = {};
9
+
10
+ // Export components dynamically
9
11
  loadComponents(componentsPath)
10
12
  .then((components) => {
11
13
  components.forEach(({ name, component }: any) => {
12
14
  if (component) {
13
- // Dynamically export the components
14
- module.exports[name] = component;
15
+ dynamicExports[name] = component;
15
16
  }
16
17
  });
17
18
  })
18
19
  .catch((err) => {
19
20
  console.error('Error loading components:', err);
20
21
  });
22
+
23
+
24
+ export { dynamicExports };
@@ -1,4 +1,3 @@
1
- // /src/utils/listFiles.ts
2
1
  import fs from 'fs';
3
2
  import path from 'path';
4
3