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 +6 -5
- package/dist/src/index.d.ts +4 -0
- package/package.json +1 -1
- package/src/index.ts +8 -4
- package/src/utils/Listfiles.ts +0 -1
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
|
-
//
|
|
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
|
-
|
|
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 };
|
package/dist/src/index.d.ts
CHANGED
package/package.json
CHANGED
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
|
-
//
|
|
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
|
-
|
|
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 };
|
package/src/utils/Listfiles.ts
CHANGED