@cldmv/slothlet 2.4.1 → 2.4.2
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.
|
@@ -116,9 +116,30 @@ export async function create(dir, rootLevel = true, maxDepth = Infinity, current
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
} else {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
if (this.config.debug) {
|
|
122
|
+
console.log(`[DEBUG] Processing non-default exports for ${fileName}`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (hasMultipleDefaultExports) {
|
|
126
|
+
|
|
127
|
+
if (this.config.debug) {
|
|
128
|
+
console.log(`[DEBUG] Multi-default context: flattening ${fileName} exports to root`);
|
|
129
|
+
}
|
|
130
|
+
for (const [key, value] of Object.entries(mod)) {
|
|
131
|
+
api[key] = value;
|
|
132
|
+
rootNamedExports[key] = value;
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
|
|
136
|
+
if (this.config.debug) {
|
|
137
|
+
console.log(`[DEBUG] Traditional context: preserving ${fileName} as namespace`);
|
|
138
|
+
}
|
|
139
|
+
api[apiKey] = mod;
|
|
140
|
+
for (const [key, value] of Object.entries(mod)) {
|
|
141
|
+
rootNamedExports[key] = value;
|
|
142
|
+
}
|
|
122
143
|
}
|
|
123
144
|
}
|
|
124
145
|
}
|
|
@@ -80,7 +80,27 @@ export async function create(dir, rootLevel = true, maxDepth = Infinity, current
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
} else {
|
|
83
|
-
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
if (instance.config.debug) {
|
|
86
|
+
console.log(`[DEBUG] Processing non-default exports for ${fileName}`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (hasMultipleDefaultExports) {
|
|
90
|
+
|
|
91
|
+
if (instance.config.debug) {
|
|
92
|
+
console.log(`[DEBUG] Multi-default context: flattening ${fileName} exports to root`);
|
|
93
|
+
}
|
|
94
|
+
for (const [k, v] of Object.entries(mod)) {
|
|
95
|
+
api[k] = v;
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
|
|
99
|
+
if (instance.config.debug) {
|
|
100
|
+
console.log(`[DEBUG] Traditional context: preserving ${fileName} as namespace`);
|
|
101
|
+
}
|
|
102
|
+
api[apiKey] = mod;
|
|
103
|
+
}
|
|
84
104
|
}
|
|
85
105
|
}
|
|
86
106
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cldmv/slothlet",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"moduleVersions": {
|
|
5
|
-
"lazy": "1.
|
|
6
|
-
"eager": "1.
|
|
5
|
+
"lazy": "1.2.0",
|
|
6
|
+
"eager": "1.2.0"
|
|
7
7
|
},
|
|
8
8
|
"description": "Slothlet: Modular API Loader for Node.js. Lazy mode dynamically loads API modules and submodules only when accessed, supporting both lazy and eager loading.",
|
|
9
9
|
"main": "./index.cjs",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slothlet_eager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/slothlet_eager.mjs"],"names":[],"mappings":"AA2IA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAsDH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4BAtBW,MAAM,cACN,OAAO,aACP,MAAM,iBACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"slothlet_eager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/slothlet_eager.mjs"],"names":[],"mappings":"AA2IA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAsDH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4BAtBW,MAAM,cACN,OAAO,aACP,MAAM,iBACN,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAqK3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slothlet_lazy.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/slothlet_lazy.mjs"],"names":[],"mappings":"AA6JA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,4BAvBW,MAAM,cACN,OAAO,aACP,MAAM,iBACN,MAAM,GACJ,OAAO,CAAC,WAAS,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"slothlet_lazy.d.mts","sourceRoot":"","sources":["../../../../dist/lib/modes/slothlet_lazy.mjs"],"names":[],"mappings":"AA6JA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,4BAvBW,MAAM,cACN,OAAO,aACP,MAAM,iBACN,MAAM,GACJ,OAAO,CAAC,WAAS,MAAM,CAAC,CAiIpC"}
|