@cldmv/slothlet 3.8.0 → 3.9.1
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/README.md +6 -7
- package/dist/lib/builders/api_builder.mjs +1 -1
- package/dist/lib/builders/modes-processor.mjs +1 -1
- package/dist/lib/handlers/api-manager.mjs +1 -1
- package/dist/lib/handlers/context-async.mjs +1 -1
- package/dist/lib/handlers/metadata.mjs +1 -1
- package/dist/lib/handlers/module-manager.mjs +1 -1
- package/dist/lib/handlers/unified-wrapper.mjs +1 -1
- package/dist/lib/handlers/version-manager.mjs +1 -1
- package/dist/lib/helpers/class-instance-wrapper.mjs +1 -1
- package/dist/lib/helpers/config.mjs +1 -1
- package/dist/lib/helpers/eventemitter-context.mjs +1 -1
- package/dist/lib/helpers/generate-manifest.mjs +17 -0
- package/dist/lib/helpers/manifest-resolver.mjs +17 -0
- package/dist/lib/helpers/module-discovery.mjs +1 -1
- package/dist/lib/helpers/module-manifest-validator.mjs +1 -1
- package/dist/lib/helpers/platform.mjs +17 -0
- package/dist/lib/helpers/resolve-from-caller.mjs +1 -1
- package/dist/lib/i18n/languages/de-de.json +53 -46
- package/dist/lib/i18n/languages/en-gb.json +53 -46
- package/dist/lib/i18n/languages/en-us.json +53 -46
- package/dist/lib/i18n/languages/es-es.json +53 -46
- package/dist/lib/i18n/languages/es-mx.json +53 -46
- package/dist/lib/i18n/languages/fr-fr.json +7 -0
- package/dist/lib/i18n/languages/hi-in.json +49 -42
- package/dist/lib/i18n/languages/ja-jp.json +9 -2
- package/dist/lib/i18n/languages/ko-kr.json +9 -2
- package/dist/lib/i18n/languages/pt-br.json +53 -46
- package/dist/lib/i18n/languages/ru-ru.json +45 -38
- package/dist/lib/i18n/languages/zh-cn.json +14 -7
- package/dist/lib/i18n/translations.mjs +1 -1
- package/dist/lib/processors/loader.mjs +1 -1
- package/dist/lib/processors/type-generator.mjs +1 -1
- package/dist/lib/processors/typescript.mjs +1 -1
- package/dist/lib/typegen/typegen.mjs +1 -1
- package/dist/slothlet.mjs +1 -1
- package/index.cjs +4 -14
- package/index.mjs +19 -22
- package/package.json +8 -2
- package/types/dist/lib/builders/api_builder.d.mts.map +1 -1
- package/types/dist/lib/builders/modes-processor.d.mts.map +1 -1
- package/types/dist/lib/handlers/api-manager.d.mts.map +1 -1
- package/types/dist/lib/handlers/context-async.d.mts.map +1 -1
- package/types/dist/lib/handlers/metadata.d.mts.map +1 -1
- package/types/dist/lib/handlers/module-manager.d.mts.map +1 -1
- package/types/dist/lib/handlers/unified-wrapper.d.mts.map +1 -1
- package/types/dist/lib/handlers/version-manager.d.mts.map +1 -1
- package/types/dist/lib/helpers/class-instance-wrapper.d.mts.map +1 -1
- package/types/dist/lib/helpers/config.d.mts +7 -0
- package/types/dist/lib/helpers/config.d.mts.map +1 -1
- package/types/dist/lib/helpers/eventemitter-context.d.mts.map +1 -1
- package/types/dist/lib/helpers/generate-manifest.d.mts +2 -0
- package/types/dist/lib/helpers/generate-manifest.d.mts.map +1 -0
- package/types/dist/lib/helpers/manifest-resolver.d.mts +2 -0
- package/types/dist/lib/helpers/manifest-resolver.d.mts.map +1 -0
- package/types/dist/lib/helpers/module-discovery.d.mts.map +1 -1
- package/types/dist/lib/helpers/module-manifest-validator.d.mts.map +1 -1
- package/types/dist/lib/helpers/platform.d.mts +12 -0
- package/types/dist/lib/helpers/platform.d.mts.map +1 -0
- package/types/dist/lib/helpers/resolve-from-caller.d.mts.map +1 -1
- package/types/dist/lib/i18n/translations.d.mts +1 -0
- package/types/dist/lib/i18n/translations.d.mts.map +1 -1
- package/types/dist/lib/processors/loader.d.mts.map +1 -1
- package/types/dist/lib/processors/type-generator.d.mts.map +1 -1
- package/types/dist/lib/processors/typescript.d.mts.map +1 -1
- package/types/dist/lib/typegen/typegen.d.mts.map +1 -1
- package/types/dist/slothlet.d.mts.map +1 -1
- package/types/index.d.mts +3 -24
- package/types/index.d.mts.map +1 -1
package/index.mjs
CHANGED
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
// Custom uncaught exception handler for SlothletError
|
|
20
|
-
process
|
|
20
|
+
// `process` is undefined in a browser, so define the handler unconditionally but
|
|
21
|
+
// only register it under Node — keeps this entry module loadable in a browser (#123).
|
|
22
|
+
const __isNode = typeof process !== "undefined" && Boolean(process?.versions?.node);
|
|
23
|
+
const __slothletUncaughtHandler = (error) => {
|
|
21
24
|
if (error.name === "SlothletError") {
|
|
22
25
|
console.error("\n================================================================================");
|
|
23
26
|
console.error(`ERROR [${error.code}]: ${error.message}`);
|
|
@@ -81,17 +84,21 @@ process.on("uncaughtException", (error) => {
|
|
|
81
84
|
|
|
82
85
|
// Re-throw other errors to let Node.js handle them
|
|
83
86
|
throw error;
|
|
84
|
-
}
|
|
87
|
+
};
|
|
88
|
+
if (__isNode) process.on("uncaughtException", __slothletUncaughtHandler);
|
|
85
89
|
|
|
86
90
|
// Development environment check (must happen before slothlet imports)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
// devcheck is a Node-only dev-environment check; skip it entirely in a browser.
|
|
92
|
+
const devcheckPromise = __isNode
|
|
93
|
+
? (async () => {
|
|
94
|
+
try {
|
|
95
|
+
await import("@cldmv/slothlet/devcheck");
|
|
96
|
+
} catch {
|
|
97
|
+
// Ignore errors (e.g., devcheck.mjs not found in production)
|
|
98
|
+
// devcheck.mjs uses process.exit() for environment errors
|
|
99
|
+
}
|
|
100
|
+
})()
|
|
101
|
+
: Promise.resolve();
|
|
95
102
|
|
|
96
103
|
/**
|
|
97
104
|
* Creates a slothlet API instance with live-binding context and AsyncLocalStorage support.
|
|
@@ -99,22 +106,12 @@ const devcheckPromise = (async () => {
|
|
|
99
106
|
* @public
|
|
100
107
|
* @async
|
|
101
108
|
*
|
|
102
|
-
* @param {
|
|
103
|
-
* @param {string} [options.dir="api"] - Directory to load API modules from
|
|
104
|
-
* @param {boolean} [options.lazy=false] - Use lazy loading (true) or eager loading (false) - legacy option
|
|
105
|
-
* @param {string} [options.mode] - Loading mode ("lazy", "eager") or execution mode ("singleton", "vm", "worker", "fork") - takes precedence over lazy option
|
|
106
|
-
* @param {string} [options.engine="singleton"] - Execution mode (singleton, vm, worker, fork)
|
|
107
|
-
* @param {number} [options.apiDepth=Infinity] - Maximum directory depth to scan
|
|
108
|
-
* @param {boolean} [options.debug=false] - Enable debug logging
|
|
109
|
-
* @param {string} [options.api_mode="auto"] - API structure mode (auto, function, object)
|
|
110
|
-
* @param {boolean} [options.allowApiOverwrite=true] - Allow addApi to overwrite existing API endpoints
|
|
111
|
-
* @param {object} [options.context={}] - Context data for live bindings
|
|
112
|
-
* @param {object} [options.reference={}] - Reference objects to merge into API root
|
|
109
|
+
* @param {import("./src/slothlet.mjs").SlothletOptions} [options={}] - Configuration options for the slothlet instance. See {@link SlothletOptions} for the full set.
|
|
113
110
|
* @returns {Promise<import("./src/slothlet.mjs").SlothletAPI>} The bound API object with management methods
|
|
114
111
|
*
|
|
115
112
|
* @example // ESM
|
|
116
113
|
* import slothlet from "@cldmv/slothlet";
|
|
117
|
-
* const api = await slothlet({
|
|
114
|
+
* const api = await slothlet({ base: './api', mode: 'lazy' });
|
|
118
115
|
* const result = await api.math.add(2, 3); // 5
|
|
119
116
|
*
|
|
120
117
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cldmv/slothlet",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.1",
|
|
4
4
|
"moduleVersions": {
|
|
5
5
|
"lazy": "3.0.0",
|
|
6
6
|
"eager": "3.0.0",
|
|
@@ -127,6 +127,10 @@
|
|
|
127
127
|
"types": "./types/dist/lib/i18n/translations.d.mts",
|
|
128
128
|
"import": "./dist/lib/i18n/translations.mjs"
|
|
129
129
|
},
|
|
130
|
+
"./i18n/language/*": {
|
|
131
|
+
"slothlet-dev": "./src/lib/i18n/languages/*",
|
|
132
|
+
"default": "./dist/lib/i18n/languages/*"
|
|
133
|
+
},
|
|
130
134
|
"./schemas/slothlet.module.schema.json": "./schemas/slothlet.module.schema.json"
|
|
131
135
|
},
|
|
132
136
|
"types": "./types/index.d.mts",
|
|
@@ -149,6 +153,7 @@
|
|
|
149
153
|
"ci:test:types": "npm run build:dist && npm run build:types && npm run test:types",
|
|
150
154
|
"test:performance": "node tests/performance/performance-benchmark-aggregated.mjs",
|
|
151
155
|
"test:performance-simple": "node tests/performance/performance-benchmark.mjs",
|
|
156
|
+
"test:browser": "node --conditions=slothlet-dev tests/browser/playwright-smoke.mjs",
|
|
152
157
|
"lint": "eslint --config .configs/eslint.config.mjs .",
|
|
153
158
|
"inspect": "node tools/dev/inspect-api-structure.mjs",
|
|
154
159
|
"check:node-versions": "node tools/dev/check-node-versions.mjs",
|
|
@@ -243,7 +248,7 @@
|
|
|
243
248
|
"zero-dependencies"
|
|
244
249
|
],
|
|
245
250
|
"engines": {
|
|
246
|
-
"node": ">=
|
|
251
|
+
"node": ">=22.0.0"
|
|
247
252
|
},
|
|
248
253
|
"author": {
|
|
249
254
|
"name": "Shinrai",
|
|
@@ -296,6 +301,7 @@
|
|
|
296
301
|
"jsdoc-to-markdown": "^9.1.3",
|
|
297
302
|
"jsdoc2md": "^1.0.0",
|
|
298
303
|
"jsonc-parser": "^3.3.1",
|
|
304
|
+
"playwright": "^1.60.0",
|
|
299
305
|
"prettier": "^3.8.3",
|
|
300
306
|
"shx": "^0.4.0",
|
|
301
307
|
"typescript": "^6.0.3",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_builder.d.mts","sourceRoot":"","sources":["../../../../dist/lib/builders/api_builder.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api_builder.d.mts","sourceRoot":"","sources":["../../../../dist/lib/builders/api_builder.mjs"],"names":[],"mappings":"AAAoiD;IAAuC,gCAAqC;IAAsC,0CAA66C;IAAA,oDAAon6B;IAAA,6CAAqR;IAAA,uFAA0vB;IAAA,sDAA8sJ;IAAA,qDAAmkB;IAAA,kDAA2Z;CAAC;8BAA9wtC,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modes-processor.d.mts","sourceRoot":"","sources":["../../../../dist/lib/builders/modes-processor.mjs"],"names":[],"mappings":"AAAmQ;IAA2C,gCAAyC;IAAsC,
|
|
1
|
+
{"version":3,"file":"modes-processor.d.mts","sourceRoot":"","sources":["../../../../dist/lib/builders/modes-processor.mjs"],"names":[],"mappings":"AAAmQ;IAA2C,gCAAyC;IAAsC,iSAA+p8B;IAAA,2KAAq3M;IAAA,2EAAwS;CAAC;8BAAjqqC,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/api-manager.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/api-manager.mjs"],"names":[],"mappings":"AAA2P;IAAuC,gCAAqC;IAAsC;;;;MAAmF;IAAC;;;MAAwwD;IAAA;;;;OAAwsB;IAAA,iDAAymB;IAAA,wEAAiL;IAAA,2CAA6L;IAAA,2DAAqxB;IAAA,qEAA+6D;IAAA,oCAA0H;IAAA,wHAAsyI;IAAA,4FAA4vE;IAAA,kFAAivE;IAAA,oDAAsjE;IAAA,2DAA+zC;IAAgrB,kCAA85S;IAAA;;;;sBAAshB;IAAkb,wEAAu8Q;IAAA,+CAA2e;IAAA;;sBAAkwC;IAAA,4DAA0mD;IAAA,yCAAi3C;IAAA,gEAAynB;IAAA,6DAA6L;IAAA,wHAAiuM;;CAAC;8BAAt6jD,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-async.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/context-async.mjs"],"names":[],"mappings":"AAA+
|
|
1
|
+
{"version":3,"file":"context-async.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/context-async.mjs"],"names":[],"mappings":"AAA+S;IAAwC,SAAqD;IAAC,yBAAsB;IAAC,2CAA2I;IAAA;;;;;;MAAqS;IAAA,+GAAm3C;IAAA,kBAAuJ;IAAA,qBAAsE;IAAA,+BAAyS;IAAA;;;;;;;;;MAAmQ;CAAC;AAAA,sDAAkD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/metadata.mjs"],"names":[],"mappings":"AAA2M;IAAqC,gCAAmC;IAAA,kBAAiB;IAAiqF,kEAA2zB;IAAA,oCAA4N;IAAA,
|
|
1
|
+
{"version":3,"file":"metadata.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/metadata.mjs"],"names":[],"mappings":"AAA2M;IAAqC,gCAAmC;IAAA,kBAAiB;IAAiqF,kEAA2zB;IAAA,oCAA4N;IAAA,8BAA2iC;IAAA,8CAAwI;IAAA,yDAAyiC;IAAA,gDAA0mD;IAAA,2DAA+e;IAAA,gDAAgG;IAAA,+DAA4kB;IAAA,mCAAyX;IAAA,iDAAijB;IAAA;;;MAA8P;IAAA,kCAA2jB;IAAA,6BAA8kB;IAAA,YAAkO;IAAA,cAAoJ;;CAAC;8BAA5kX,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/module-manager.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/module-manager.mjs"],"names":[],"mappings":"AAA+N;IAA0C,gCAAwC;IAAsE;;;;;;UAA4c;IAAA,2CAAgE;IAAA,2BAAoD;IAAA,4BAA0C;IAAA,wBAA4I;IAAA;;;;;;OAAma;IAAA;;;OAAosC;IAAA,qDAAuc;;CAA43J;8BAA9/P,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-wrapper.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/unified-wrapper.mjs"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"unified-wrapper.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/unified-wrapper.mjs"],"names":[],"mappings":";;;;AAA0+E;IAAymH,mCAAsc;IAAA,2CAAy/B;IAAv5J;;;;;;;;;;OAAq4F;IAA59F,6CAAuF;IAAq4F,2EAAgiB;IAAA,kBAAmD;IAA+7C,gEAAqyB;IAAA,8EAAgsC;IAAA,4CAA4oC;IAAA,+BAAs4D;IAAA,6BAA4C;IAAA,sBAA8T;IAAA,yDAAq6P;IAAA,iDAAghG;IAAA,8CAA+oa;IAAA,mBAAkhxB;IAA3oO,uBAAwB;;CAAonO;AAAwK,gDAA8N;8BAAvr7D,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/version-manager.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version-manager.d.mts","sourceRoot":"","sources":["../../../../dist/lib/handlers/version-manager.mjs"],"names":[],"mappings":"AAA0mB;IAA2C,gCAAyC;IAAoG,0GAAu4B;IAAA,8DAA8kB;IAAA,2CAA+E;IAAA,yCAAqE;IAAA,uCAAgF;IAAA,iEAAwO;IAAA,8EAA8d;IAAA;;;kBAA+N;IAAA,oDAA8Z;IAAA,yCAAihB;IAAA,qEAAyxB;IAAA,0CAA+gB;IAAA;;;;;;;;;;MAAurB;IAAsc,wCAA4+K;IAAA,yCAA8kB;IAAA,2CAAwU;IAAA,6CAA2Q;IAAA,iBAAmI;;CAAC;8BAAz5a,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-instance-wrapper.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/class-instance-wrapper.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"class-instance-wrapper.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/class-instance-wrapper.mjs"],"names":[],"mappings":"AAAue,2DAAmT;AAAre,yEAAkL;AAAmT,wHAAwkC"}
|
|
@@ -25,8 +25,13 @@ export class Config extends ComponentBase {
|
|
|
25
25
|
versioning: any;
|
|
26
26
|
permissions: any;
|
|
27
27
|
};
|
|
28
|
+
normalizeEnvTarget(platform: any, hasManifest?: boolean): "browser" | "node";
|
|
28
29
|
transformConfig(config?: {}): {
|
|
30
|
+
base: any;
|
|
29
31
|
dir: any;
|
|
32
|
+
manifest: any;
|
|
33
|
+
resolveModuleSpecifier: any;
|
|
34
|
+
envTarget: string;
|
|
30
35
|
mode: string;
|
|
31
36
|
runtime: string;
|
|
32
37
|
apiDepth: any;
|
|
@@ -104,7 +109,9 @@ export class Config extends ComponentBase {
|
|
|
104
109
|
readGating: boolean;
|
|
105
110
|
rules: any;
|
|
106
111
|
} | null;
|
|
112
|
+
suppressFixes: Set<any>;
|
|
107
113
|
};
|
|
114
|
+
normalizeSuppressFixes(suppressFixes: any, silent: any): Set<any>;
|
|
108
115
|
normalizeTypeScript(typescript: any): {
|
|
109
116
|
enabled: boolean;
|
|
110
117
|
mode: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/config.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/config.mjs"],"names":[],"mappings":"AAAsL;IAAmC,gCAAiC;IAAA;;;MAA2mB;IAAA,iDAA+U;IAAA,2CAA0S;IAAA;;;;;MAAqV;IAAA;;;;;;;;;;;;MAA46B;IAAA,6EAAwL;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAq3J;IAAA,kEAA0gB;IAAA;;;;;;;;;;;;aAAyf;IAAA;;aAAiN;IAAA;;;;;;aAAymD;CAAC;8BAAjjV,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventemitter-context.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/eventemitter-context.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eventemitter-context.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/eventemitter-context.mjs"],"names":[],"mappings":"AAAk7P,qDAA2M;AAAtmB,oDAA2Z;AAArrB,mDAA0R;AAAt7O,yDAA8D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-manifest.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/generate-manifest.mjs"],"names":[],"mappings":"AAAmtC,yDAAoc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-resolver.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/manifest-resolver.mjs"],"names":[],"mappings":"AAAA,oDAAoW,UAAK,YAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-discovery.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/module-discovery.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module-discovery.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/module-discovery.mjs"],"names":[],"mappings":"AAA2Q;;;;;;MAA2nE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-manifest-validator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/module-manifest-validator.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module-manifest-validator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/module-manifest-validator.mjs"],"names":[],"mappings":"AAA6b;;;;;;;;;;;;EAA0mJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export let AsyncLocalStorage: null;
|
|
2
|
+
export let AsyncResource: null;
|
|
3
|
+
export let EventEmitter: null;
|
|
4
|
+
export let createRequire: null;
|
|
5
|
+
export let fs: null;
|
|
6
|
+
export let fsp: null;
|
|
7
|
+
export const isNode: boolean;
|
|
8
|
+
export function loadJson(ref: any): any;
|
|
9
|
+
export let path: null;
|
|
10
|
+
export let url: null;
|
|
11
|
+
export let util: null;
|
|
12
|
+
//# sourceMappingURL=platform.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/platform.mjs"],"names":[],"mappings":"AAAoK,mCAA2B;AAAA,+BAAuB;AAAxE,8BAAsB;AAAkD,+BAAuB;AAAjK,oBAAY;AAAA,qBAAa;AAArG,6BAA4E;AAA2tB,wCAA+L;AAAj4B,sBAAc;AAAA,qBAAa;AAAA,sBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-from-caller.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/resolve-from-caller.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-from-caller.d.mts","sourceRoot":"","sources":["../../../../dist/lib/helpers/resolve-from-caller.mjs"],"names":[],"mappings":"AAAmZ;IAAqC,gCAAmC;IAAA,0CAA2N;IAA0L,sBAA8G;IAAs7B,qCAAsgB;;CAAC;8BAAl4E,0CAA0C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export function getLanguage(): string;
|
|
2
2
|
export function initI18n(options?: {}): void;
|
|
3
3
|
export function setLanguage(lang: any): void;
|
|
4
|
+
export function setLanguageAsync(lang: any): Promise<void>;
|
|
4
5
|
export function t(errorCode: any, params?: {}): any;
|
|
5
6
|
export function translate(errorCode: any, params?: {}): any;
|
|
6
7
|
//# sourceMappingURL=translations.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.mts","sourceRoot":"","sources":["../../../../dist/lib/i18n/translations.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.mts","sourceRoot":"","sources":["../../../../dist/lib/i18n/translations.mjs"],"names":[],"mappings":"AAAgpF,sCAA8C;AAAmc,6CAAgX;AAA7tD,6CAA8b;AAAA,2DAA8b;AAA8C,oDAAmc;AAAnc,4DAAmc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/loader.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/loader.mjs"],"names":[],"mappings":"AAA6I;IAAmC,gCAAiC;IAAsC,0FAAooH;IAA0zB;;;OAAkjD;IAA6pF,gCAAipB;;CAAC;8BAA7/S,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-generator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/type-generator.mjs"],"names":[],"mappings":"AAA+V;;;
|
|
1
|
+
{"version":3,"file":"type-generator.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/type-generator.mjs"],"names":[],"mappings":"AAA+V;;;GAA0gC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/typescript.mjs"],"names":[],"mappings":"AAA2hC,iDAAoK;
|
|
1
|
+
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../../../dist/lib/processors/typescript.mjs"],"names":[],"mappings":"AAA2hC,iDAAoK;AAA64Q,kEAAkZ;AAAluN,mEAA+kC;AAA55D;;;EAA8iB;AAAqwD,yFAA68B;AAAh9J,+EAA4T;AAA8oN;;;GAAm6D;AAA75H;;;GAA0/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typegen.d.mts","sourceRoot":"","sources":["../../../../dist/lib/typegen/typegen.mjs"],"names":[],"mappings":"AAAiN;;;
|
|
1
|
+
{"version":3,"file":"typegen.d.mts","sourceRoot":"","sources":["../../../../dist/lib/typegen/typegen.mjs"],"names":[],"mappings":"AAAiN;;;GAA61B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slothlet.d.mts","sourceRoot":"","sources":["../../dist/slothlet.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slothlet.d.mts","sourceRoot":"","sources":["../../dist/slothlet.mjs"],"names":[],"mappings":"AAA+2d,yDAA6G;AAA7G,mDAA6G"}
|
package/types/index.d.mts
CHANGED
|
@@ -5,35 +5,14 @@ export default slothlet;
|
|
|
5
5
|
* @public
|
|
6
6
|
* @async
|
|
7
7
|
*
|
|
8
|
-
* @param {
|
|
9
|
-
* @param {string} [options.dir="api"] - Directory to load API modules from
|
|
10
|
-
* @param {boolean} [options.lazy=false] - Use lazy loading (true) or eager loading (false) - legacy option
|
|
11
|
-
* @param {string} [options.mode] - Loading mode ("lazy", "eager") or execution mode ("singleton", "vm", "worker", "fork") - takes precedence over lazy option
|
|
12
|
-
* @param {string} [options.engine="singleton"] - Execution mode (singleton, vm, worker, fork)
|
|
13
|
-
* @param {number} [options.apiDepth=Infinity] - Maximum directory depth to scan
|
|
14
|
-
* @param {boolean} [options.debug=false] - Enable debug logging
|
|
15
|
-
* @param {string} [options.api_mode="auto"] - API structure mode (auto, function, object)
|
|
16
|
-
* @param {boolean} [options.allowApiOverwrite=true] - Allow addApi to overwrite existing API endpoints
|
|
17
|
-
* @param {object} [options.context={}] - Context data for live bindings
|
|
18
|
-
* @param {object} [options.reference={}] - Reference objects to merge into API root
|
|
8
|
+
* @param {import("./src/slothlet.mjs").SlothletOptions} [options={}] - Configuration options for the slothlet instance. See {@link SlothletOptions} for the full set.
|
|
19
9
|
* @returns {Promise<import("./src/slothlet.mjs").SlothletAPI>} The bound API object with management methods
|
|
20
10
|
*
|
|
21
11
|
* @example // ESM
|
|
22
12
|
* import slothlet from "@cldmv/slothlet";
|
|
23
|
-
* const api = await slothlet({
|
|
13
|
+
* const api = await slothlet({ base: './api', mode: 'lazy' });
|
|
24
14
|
* const result = await api.math.add(2, 3); // 5
|
|
25
15
|
*
|
|
26
16
|
*/
|
|
27
|
-
export function slothlet(options?:
|
|
28
|
-
dir?: string | undefined;
|
|
29
|
-
lazy?: boolean | undefined;
|
|
30
|
-
mode?: string | undefined;
|
|
31
|
-
engine?: string | undefined;
|
|
32
|
-
apiDepth?: number | undefined;
|
|
33
|
-
debug?: boolean | undefined;
|
|
34
|
-
api_mode?: string | undefined;
|
|
35
|
-
allowApiOverwrite?: boolean | undefined;
|
|
36
|
-
context?: object | undefined;
|
|
37
|
-
reference?: object | undefined;
|
|
38
|
-
}): Promise<import("./src/slothlet.mjs").SlothletAPI>;
|
|
17
|
+
export function slothlet(options?: import("./src/slothlet.mjs").SlothletOptions): Promise<import("./src/slothlet.mjs").SlothletAPI>;
|
|
39
18
|
//# sourceMappingURL=index.d.mts.map
|
package/types/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../index.mjs"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../index.mjs"],"names":[],"mappings":";AAsGA;;;;;;;;;;;;;;GAcG;AACH,mCATW,OAAO,oBAAoB,EAAE,eAAe,GAC1C,OAAO,CAAC,OAAO,oBAAoB,EAAE,WAAW,CAAC,CAkB7D"}
|