@mahameru/diatrema 0.0.1 → 0.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/diatrema-Bk12jngx.d.ts +93 -0
- package/diatrema-CyKJKZv_.d.cts +93 -0
- package/diatrema.cjs +70 -52
- package/diatrema.cjs.map +1 -1
- package/diatrema.d.cts +6 -72
- package/diatrema.d.ts +4 -71
- package/diatrema.js +70 -52
- package/diatrema.js.map +1 -1
- package/helpers.cjs +2 -18
- package/helpers.cjs.map +1 -1
- package/helpers.d.cts +1 -6
- package/helpers.d.ts +1 -6
- package/helpers.js +1 -16
- package/helpers.js.map +1 -1
- package/index.cjs +4 -18
- package/index.cjs.map +1 -1
- package/index.d.cts +4 -13
- package/index.d.ts +4 -13
- package/index.js +2 -9
- package/index.js.map +1 -1
- package/logger.cjs +10 -5
- package/logger.cjs.map +1 -1
- package/logger.d.cts +1 -1
- package/logger.d.ts +1 -1
- package/logger.js +10 -5
- package/logger.js.map +1 -1
- package/mahameru-plugin.cjs +109 -0
- package/mahameru-plugin.cjs.map +1 -0
- package/mahameru-plugin.d.cts +4 -0
- package/mahameru-plugin.d.ts +4 -0
- package/mahameru-plugin.js +85 -0
- package/mahameru-plugin.js.map +1 -0
- package/package.json +4 -3
- package/scripts/preinstall.cjs +10 -0
- package/scripts/preinstall.cjs.map +1 -0
- package/scripts/preinstall.d.cts +2 -0
- package/scripts/preinstall.d.ts +2 -0
- package/scripts/preinstall.js +9 -9
- package/scripts/preinstall.js.map +1 -0
- package/types.cjs +0 -23
- package/types.cjs.map +1 -1
- package/types.d.cts +5 -3
- package/types.d.ts +5 -3
- package/types.js +0 -15
- package/types.js.map +1 -1
- package/container-error.cjs +0 -45
- package/container-error.cjs.map +0 -1
- package/container-error.d.cts +0 -7
- package/container-error.d.ts +0 -7
- package/container-error.js +0 -22
- package/container-error.js.map +0 -1
- package/container.cjs +0 -318
- package/container.cjs.map +0 -1
- package/container.d.cts +0 -60
- package/container.d.ts +0 -60
- package/container.js +0 -285
- package/container.js.map +0 -1
- package/http-server-error.cjs +0 -44
- package/http-server-error.cjs.map +0 -1
- package/http-server-error.d.cts +0 -7
- package/http-server-error.d.ts +0 -7
- package/http-server-error.js +0 -21
- package/http-server-error.js.map +0 -1
- package/http-server.cjs +0 -382
- package/http-server.cjs.map +0 -1
- package/http-server.d.cts +0 -81
- package/http-server.d.ts +0 -81
- package/http-server.js +0 -359
- package/http-server.js.map +0 -1
- package/mahameru-request.cjs +0 -79
- package/mahameru-request.cjs.map +0 -1
- package/mahameru-request.d.cts +0 -3
- package/mahameru-request.d.ts +0 -3
- package/mahameru-request.js +0 -56
- package/mahameru-request.js.map +0 -1
- package/mahameru-response.cjs +0 -71
- package/mahameru-response.cjs.map +0 -1
- package/mahameru-response.d.cts +0 -17
- package/mahameru-response.d.ts +0 -17
- package/mahameru-response.js +0 -48
- package/mahameru-response.js.map +0 -1
- package/mahameru-server-error.cjs +0 -54
- package/mahameru-server-error.cjs.map +0 -1
- package/mahameru-server-error.d.cts +0 -19
- package/mahameru-server-error.d.ts +0 -19
- package/mahameru-server-error.js +0 -31
- package/mahameru-server-error.js.map +0 -1
- package/module-error.cjs +0 -46
- package/module-error.cjs.map +0 -1
- package/module-error.d.cts +0 -12
- package/module-error.d.ts +0 -12
- package/module-error.js +0 -23
- package/module-error.js.map +0 -1
- package/route.cjs +0 -128
- package/route.cjs.map +0 -1
- package/route.d.cts +0 -46
- package/route.d.ts +0 -46
- package/route.js +0 -105
- package/route.js.map +0 -1
- package/types-BmFqDpSs.d.ts +0 -113
- package/types-Cd6Gkoxx.d.cts +0 -113
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var mahameru_plugin_exports = {};
|
|
21
|
+
__export(mahameru_plugin_exports, {
|
|
22
|
+
MahameruPlugin: () => MahameruPlugin,
|
|
23
|
+
TypesGenerator: () => TypesGenerator
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(mahameru_plugin_exports);
|
|
26
|
+
var import_logger = require('./logger.cjs');
|
|
27
|
+
class MahameruPlugin {
|
|
28
|
+
static {
|
|
29
|
+
__name(this, "MahameruPlugin");
|
|
30
|
+
}
|
|
31
|
+
logger;
|
|
32
|
+
diatrema;
|
|
33
|
+
_options;
|
|
34
|
+
_initialized = false;
|
|
35
|
+
_isShuttingDown = false;
|
|
36
|
+
_typesGenerator;
|
|
37
|
+
constructor(options) {
|
|
38
|
+
this._options = options;
|
|
39
|
+
}
|
|
40
|
+
get initialized() {
|
|
41
|
+
return this._initialized;
|
|
42
|
+
}
|
|
43
|
+
get options() {
|
|
44
|
+
return this._options;
|
|
45
|
+
}
|
|
46
|
+
get typesGenerator() {
|
|
47
|
+
return this._typesGenerator;
|
|
48
|
+
}
|
|
49
|
+
set outputTypesDirPath(outputTypesDirPath) {
|
|
50
|
+
if (this.typesGenerator)
|
|
51
|
+
this.typesGenerator.outputTypesDirPath = outputTypesDirPath;
|
|
52
|
+
}
|
|
53
|
+
setDiatrema(diatrema) {
|
|
54
|
+
this.diatrema = diatrema;
|
|
55
|
+
}
|
|
56
|
+
async initialize() {
|
|
57
|
+
if (!this.diatrema) {
|
|
58
|
+
this.logger.debug("Failed to initialize. No Diatrema instance found");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.logger.debug("Initializing...");
|
|
62
|
+
if (this._initialized) {
|
|
63
|
+
this.logger.debug("Already initialized");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
await this.boot();
|
|
67
|
+
this.logger.debug("Initializing... Done");
|
|
68
|
+
this._initialized = true;
|
|
69
|
+
}
|
|
70
|
+
async destroy() {
|
|
71
|
+
if (!this._initialized || this._isShuttingDown)
|
|
72
|
+
return;
|
|
73
|
+
this.logger.debug("Destroying...");
|
|
74
|
+
this._isShuttingDown = true;
|
|
75
|
+
await this.terminate();
|
|
76
|
+
this._initialized = false;
|
|
77
|
+
this._isShuttingDown = false;
|
|
78
|
+
this.logger.debug("Destroying... Done");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
class TypesGenerator {
|
|
82
|
+
static {
|
|
83
|
+
__name(this, "TypesGenerator");
|
|
84
|
+
}
|
|
85
|
+
logger;
|
|
86
|
+
_diatrema;
|
|
87
|
+
_options;
|
|
88
|
+
_outputTypesDirPath;
|
|
89
|
+
constructor(options) {
|
|
90
|
+
this._options = options;
|
|
91
|
+
}
|
|
92
|
+
set diatrema(diatrema) {
|
|
93
|
+
this._diatrema = diatrema;
|
|
94
|
+
}
|
|
95
|
+
set outputTypesDirPath(outputTypesDirPath) {
|
|
96
|
+
this._outputTypesDirPath = outputTypesDirPath;
|
|
97
|
+
}
|
|
98
|
+
async generate() {
|
|
99
|
+
this.logger.debug("Generating types...");
|
|
100
|
+
const types = await this._generate();
|
|
101
|
+
this.logger.debug("Types generated", types);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
+
0 && (module.exports = {
|
|
106
|
+
MahameruPlugin,
|
|
107
|
+
TypesGenerator
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=mahameru-plugin.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mahameru-plugin.ts"],"sourcesContent":["import type Diatrema from \"./diatrema\";\r\nimport { type Logger } from \"./logger\";\r\n\r\nexport interface BasePluginOptions {\r\n debug?: boolean;\r\n}\r\n\r\nexport abstract class MahameruPlugin<O extends BasePluginOptions = BasePluginOptions> {\r\n public abstract readonly name: string;\r\n public abstract readonly slugName: string;\r\n protected logger!: Logger;\r\n protected diatrema!: Diatrema;\r\n protected _options: O;\r\n protected _initialized = false;\r\n protected _isShuttingDown = false;\r\n protected _typesGenerator?: TypesGenerator;\r\n\r\n constructor(options: Partial<O>) {\r\n this._options = options as O;\r\n }\r\n\r\n get initialized() {\r\n return this._initialized;\r\n }\r\n\r\n get options(): O {\r\n return this._options;\r\n }\r\n\r\n get typesGenerator() {\r\n return this._typesGenerator;\r\n }\r\n\r\n set outputTypesDirPath(outputTypesDirPath: string) {\r\n if (this.typesGenerator)\r\n this.typesGenerator.outputTypesDirPath = outputTypesDirPath;\r\n }\r\n\r\n public setDiatrema(diatrema: Diatrema) {\r\n this.diatrema = diatrema;\r\n }\r\n\r\n public async initialize(): Promise<void> {\r\n if (!this.diatrema) {\r\n this.logger.debug('Failed to initialize. No Diatrema instance found');\r\n\r\n return;\r\n }\r\n\r\n this.logger.debug('Initializing...');\r\n\r\n if (this._initialized) {\r\n this.logger.debug('Already initialized');\r\n\r\n return;\r\n }\r\n\r\n await this.boot();\r\n\r\n this.logger.debug('Initializing... Done');\r\n\r\n this._initialized = true;\r\n }\r\n\r\n public async destroy(): Promise<void> {\r\n if (!this._initialized || this._isShuttingDown)\r\n return;\r\n\r\n this.logger.debug('Destroying...');\r\n\r\n this._isShuttingDown = true;\r\n\r\n await this.terminate();\r\n\r\n this._initialized = false;\r\n this._isShuttingDown = false;\r\n\r\n this.logger.debug('Destroying... Done');\r\n }\r\n\r\n protected abstract boot(options?: Partial<O>): Promise<void> | void;\r\n protected abstract terminate(): Promise<void> | void;\r\n}\r\n\r\nexport interface BaseTypesGeneratorOptions {\r\n debug?: boolean;\r\n}\r\n\r\nexport abstract class TypesGenerator<O extends BaseTypesGeneratorOptions = BaseTypesGeneratorOptions> {\r\n protected logger!: Logger;\r\n protected _diatrema!: Diatrema;\r\n protected _options: O;\r\n protected _outputTypesDirPath!: string;\r\n\r\n constructor(options: Partial<O>) {\r\n this._options = options as O;\r\n }\r\n\r\n set diatrema(diatrema: Diatrema) {\r\n this._diatrema = diatrema;\r\n }\r\n\r\n set outputTypesDirPath(outputTypesDirPath: string) {\r\n this._outputTypesDirPath = outputTypesDirPath;\r\n }\r\n\r\n public async generate() {\r\n this.logger.debug('Generating types...');\r\n const types = await this._generate();\r\n this.logger.debug('Types generated', types);\r\n }\r\n\r\n protected abstract _generate(): Promise<Record<string, any>>;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA4B;AAMrB,MAAe,eAAgE;AAAA,EAPtF,OAOsF;AAAA;AAAA;AAAA,EAGxE;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB;AAAA,EAEV,YAAY,SAAqB;AAC7B,SAAK,WAAW;AAAA,EACpB;AAAA,EAEA,IAAI,cAAc;AACd,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,UAAa;AACb,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,iBAAiB;AACjB,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,mBAAmB,oBAA4B;AAC/C,QAAI,KAAK;AACL,WAAK,eAAe,qBAAqB;AAAA,EACjD;AAAA,EAEO,YAAY,UAAoB;AACnC,SAAK,WAAW;AAAA,EACpB;AAAA,EAEA,MAAa,aAA4B;AACrC,QAAI,CAAC,KAAK,UAAU;AAChB,WAAK,OAAO,MAAM,kDAAkD;AAEpE;AAAA,IACJ;AAEA,SAAK,OAAO,MAAM,iBAAiB;AAEnC,QAAI,KAAK,cAAc;AACnB,WAAK,OAAO,MAAM,qBAAqB;AAEvC;AAAA,IACJ;AAEA,UAAM,KAAK,KAAK;AAEhB,SAAK,OAAO,MAAM,sBAAsB;AAExC,SAAK,eAAe;AAAA,EACxB;AAAA,EAEA,MAAa,UAAyB;AAClC,QAAI,CAAC,KAAK,gBAAgB,KAAK;AAC3B;AAEJ,SAAK,OAAO,MAAM,eAAe;AAEjC,SAAK,kBAAkB;AAEvB,UAAM,KAAK,UAAU;AAErB,SAAK,eAAe;AACpB,SAAK,kBAAkB;AAEvB,SAAK,OAAO,MAAM,oBAAoB;AAAA,EAC1C;AAIJ;AAMO,MAAe,eAAgF;AAAA,EAxFtG,OAwFsG;AAAA;AAAA;AAAA,EACxF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEV,YAAY,SAAqB;AAC7B,SAAK,WAAW;AAAA,EACpB;AAAA,EAEA,IAAI,SAAS,UAAoB;AAC7B,SAAK,YAAY;AAAA,EACrB;AAAA,EAEA,IAAI,mBAAmB,oBAA4B;AAC/C,SAAK,sBAAsB;AAAA,EAC/B;AAAA,EAEA,MAAa,WAAW;AACpB,SAAK,OAAO,MAAM,qBAAqB;AACvC,UAAM,QAAQ,MAAM,KAAK,UAAU;AACnC,SAAK,OAAO,MAAM,mBAAmB,KAAK;AAAA,EAC9C;AAGJ;","names":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import {} from "./logger.js";
|
|
4
|
+
class MahameruPlugin {
|
|
5
|
+
static {
|
|
6
|
+
__name(this, "MahameruPlugin");
|
|
7
|
+
}
|
|
8
|
+
logger;
|
|
9
|
+
diatrema;
|
|
10
|
+
_options;
|
|
11
|
+
_initialized = false;
|
|
12
|
+
_isShuttingDown = false;
|
|
13
|
+
_typesGenerator;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
this._options = options;
|
|
16
|
+
}
|
|
17
|
+
get initialized() {
|
|
18
|
+
return this._initialized;
|
|
19
|
+
}
|
|
20
|
+
get options() {
|
|
21
|
+
return this._options;
|
|
22
|
+
}
|
|
23
|
+
get typesGenerator() {
|
|
24
|
+
return this._typesGenerator;
|
|
25
|
+
}
|
|
26
|
+
set outputTypesDirPath(outputTypesDirPath) {
|
|
27
|
+
if (this.typesGenerator)
|
|
28
|
+
this.typesGenerator.outputTypesDirPath = outputTypesDirPath;
|
|
29
|
+
}
|
|
30
|
+
setDiatrema(diatrema) {
|
|
31
|
+
this.diatrema = diatrema;
|
|
32
|
+
}
|
|
33
|
+
async initialize() {
|
|
34
|
+
if (!this.diatrema) {
|
|
35
|
+
this.logger.debug("Failed to initialize. No Diatrema instance found");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.logger.debug("Initializing...");
|
|
39
|
+
if (this._initialized) {
|
|
40
|
+
this.logger.debug("Already initialized");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
await this.boot();
|
|
44
|
+
this.logger.debug("Initializing... Done");
|
|
45
|
+
this._initialized = true;
|
|
46
|
+
}
|
|
47
|
+
async destroy() {
|
|
48
|
+
if (!this._initialized || this._isShuttingDown)
|
|
49
|
+
return;
|
|
50
|
+
this.logger.debug("Destroying...");
|
|
51
|
+
this._isShuttingDown = true;
|
|
52
|
+
await this.terminate();
|
|
53
|
+
this._initialized = false;
|
|
54
|
+
this._isShuttingDown = false;
|
|
55
|
+
this.logger.debug("Destroying... Done");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
class TypesGenerator {
|
|
59
|
+
static {
|
|
60
|
+
__name(this, "TypesGenerator");
|
|
61
|
+
}
|
|
62
|
+
logger;
|
|
63
|
+
_diatrema;
|
|
64
|
+
_options;
|
|
65
|
+
_outputTypesDirPath;
|
|
66
|
+
constructor(options) {
|
|
67
|
+
this._options = options;
|
|
68
|
+
}
|
|
69
|
+
set diatrema(diatrema) {
|
|
70
|
+
this._diatrema = diatrema;
|
|
71
|
+
}
|
|
72
|
+
set outputTypesDirPath(outputTypesDirPath) {
|
|
73
|
+
this._outputTypesDirPath = outputTypesDirPath;
|
|
74
|
+
}
|
|
75
|
+
async generate() {
|
|
76
|
+
this.logger.debug("Generating types...");
|
|
77
|
+
const types = await this._generate();
|
|
78
|
+
this.logger.debug("Types generated", types);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
MahameruPlugin,
|
|
83
|
+
TypesGenerator
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=mahameru-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mahameru-plugin.ts"],"sourcesContent":["import type Diatrema from \"./diatrema\";\r\nimport { type Logger } from \"./logger\";\r\n\r\nexport interface BasePluginOptions {\r\n debug?: boolean;\r\n}\r\n\r\nexport abstract class MahameruPlugin<O extends BasePluginOptions = BasePluginOptions> {\r\n public abstract readonly name: string;\r\n public abstract readonly slugName: string;\r\n protected logger!: Logger;\r\n protected diatrema!: Diatrema;\r\n protected _options: O;\r\n protected _initialized = false;\r\n protected _isShuttingDown = false;\r\n protected _typesGenerator?: TypesGenerator;\r\n\r\n constructor(options: Partial<O>) {\r\n this._options = options as O;\r\n }\r\n\r\n get initialized() {\r\n return this._initialized;\r\n }\r\n\r\n get options(): O {\r\n return this._options;\r\n }\r\n\r\n get typesGenerator() {\r\n return this._typesGenerator;\r\n }\r\n\r\n set outputTypesDirPath(outputTypesDirPath: string) {\r\n if (this.typesGenerator)\r\n this.typesGenerator.outputTypesDirPath = outputTypesDirPath;\r\n }\r\n\r\n public setDiatrema(diatrema: Diatrema) {\r\n this.diatrema = diatrema;\r\n }\r\n\r\n public async initialize(): Promise<void> {\r\n if (!this.diatrema) {\r\n this.logger.debug('Failed to initialize. No Diatrema instance found');\r\n\r\n return;\r\n }\r\n\r\n this.logger.debug('Initializing...');\r\n\r\n if (this._initialized) {\r\n this.logger.debug('Already initialized');\r\n\r\n return;\r\n }\r\n\r\n await this.boot();\r\n\r\n this.logger.debug('Initializing... Done');\r\n\r\n this._initialized = true;\r\n }\r\n\r\n public async destroy(): Promise<void> {\r\n if (!this._initialized || this._isShuttingDown)\r\n return;\r\n\r\n this.logger.debug('Destroying...');\r\n\r\n this._isShuttingDown = true;\r\n\r\n await this.terminate();\r\n\r\n this._initialized = false;\r\n this._isShuttingDown = false;\r\n\r\n this.logger.debug('Destroying... Done');\r\n }\r\n\r\n protected abstract boot(options?: Partial<O>): Promise<void> | void;\r\n protected abstract terminate(): Promise<void> | void;\r\n}\r\n\r\nexport interface BaseTypesGeneratorOptions {\r\n debug?: boolean;\r\n}\r\n\r\nexport abstract class TypesGenerator<O extends BaseTypesGeneratorOptions = BaseTypesGeneratorOptions> {\r\n protected logger!: Logger;\r\n protected _diatrema!: Diatrema;\r\n protected _options: O;\r\n protected _outputTypesDirPath!: string;\r\n\r\n constructor(options: Partial<O>) {\r\n this._options = options as O;\r\n }\r\n\r\n set diatrema(diatrema: Diatrema) {\r\n this._diatrema = diatrema;\r\n }\r\n\r\n set outputTypesDirPath(outputTypesDirPath: string) {\r\n this._outputTypesDirPath = outputTypesDirPath;\r\n }\r\n\r\n public async generate() {\r\n this.logger.debug('Generating types...');\r\n const types = await this._generate();\r\n this.logger.debug('Types generated', types);\r\n }\r\n\r\n protected abstract _generate(): Promise<Record<string, any>>;\r\n}\r\n"],"mappings":";;AACA,eAA4B;AAMrB,MAAe,eAAgE;AAAA,EAPtF,OAOsF;AAAA;AAAA;AAAA,EAGxE;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB;AAAA,EAEV,YAAY,SAAqB;AAC7B,SAAK,WAAW;AAAA,EACpB;AAAA,EAEA,IAAI,cAAc;AACd,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,UAAa;AACb,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,iBAAiB;AACjB,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,mBAAmB,oBAA4B;AAC/C,QAAI,KAAK;AACL,WAAK,eAAe,qBAAqB;AAAA,EACjD;AAAA,EAEO,YAAY,UAAoB;AACnC,SAAK,WAAW;AAAA,EACpB;AAAA,EAEA,MAAa,aAA4B;AACrC,QAAI,CAAC,KAAK,UAAU;AAChB,WAAK,OAAO,MAAM,kDAAkD;AAEpE;AAAA,IACJ;AAEA,SAAK,OAAO,MAAM,iBAAiB;AAEnC,QAAI,KAAK,cAAc;AACnB,WAAK,OAAO,MAAM,qBAAqB;AAEvC;AAAA,IACJ;AAEA,UAAM,KAAK,KAAK;AAEhB,SAAK,OAAO,MAAM,sBAAsB;AAExC,SAAK,eAAe;AAAA,EACxB;AAAA,EAEA,MAAa,UAAyB;AAClC,QAAI,CAAC,KAAK,gBAAgB,KAAK;AAC3B;AAEJ,SAAK,OAAO,MAAM,eAAe;AAEjC,SAAK,kBAAkB;AAEvB,UAAM,KAAK,UAAU;AAErB,SAAK,eAAe;AACpB,SAAK,kBAAkB;AAEvB,SAAK,OAAO,MAAM,oBAAoB;AAAA,EAC1C;AAIJ;AAMO,MAAe,eAAgF;AAAA,EAxFtG,OAwFsG;AAAA;AAAA;AAAA,EACxF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEV,YAAY,SAAqB;AAC7B,SAAK,WAAW;AAAA,EACpB;AAAA,EAEA,IAAI,SAAS,UAAoB;AAC7B,SAAK,YAAY;AAAA,EACrB;AAAA,EAEA,IAAI,mBAAmB,oBAA4B;AAC/C,SAAK,sBAAsB;AAAA,EAC/B;AAAA,EAEA,MAAa,WAAW;AACpB,SAAK,OAAO,MAAM,qBAAqB;AACvC,UAAM,QAAQ,MAAM,KAAK,UAAU;AACnC,SAAK,OAAO,MAAM,mBAAmB,KAAK;AAAA,EAC9C;AAGJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mahameru/diatrema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "The core engine of MahameruJS. Just like a volcanic diatreme, it serves as the essential conduit that powers and drives the entire framework ecosystem.",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"typecheck": "tsc --noEmit --project tsconfig.json",
|
|
18
|
-
"build": "tsup --config tsup.config.ts && node ./scripts/
|
|
19
|
-
"dev": "cross-env NODE_ENV=development tsup --config tsup.config.ts && node ./scripts/
|
|
18
|
+
"build": "tsup --config tsup.config.ts && node ./scripts/postbuild.js",
|
|
19
|
+
"dev": "cross-env NODE_ENV=development tsup --config tsup.config.ts && node ./scripts/postbuild.js",
|
|
20
|
+
"preinstall": "node ./scripts/preinstall.js"
|
|
20
21
|
},
|
|
21
22
|
"keywords": [
|
|
22
23
|
"node",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
if (process.env.npm_config_global === "true" || process.env.npm_config_global === "1") {
|
|
3
|
+
console.error("\x1B[31m%s\x1B[0m", "==================================================================");
|
|
4
|
+
console.error("\x1B[31m%s\x1B[0m", ` Error: The "${process.env.npm_package_name}" package cannot be installed globally!`);
|
|
5
|
+
console.error("\x1B[31m%s\x1B[0m", " Please install it locally within your project using:");
|
|
6
|
+
console.error("\x1B[33m%s\x1B[0m", ` npm install ${process.env.npm_package_name}`);
|
|
7
|
+
console.error("\x1B[31m%s\x1B[0m", "==================================================================");
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=preinstall.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/scripts/preinstall.ts"],"sourcesContent":["if (process.env.npm_config_global === 'true' || process.env.npm_config_global === '1') {\r\n console.error('\\x1b[31m%s\\x1b[0m', '==================================================================');\r\n console.error('\\x1b[31m%s\\x1b[0m', ` Error: The \"${process.env.npm_package_name}\" package cannot be installed globally!`);\r\n console.error('\\x1b[31m%s\\x1b[0m', ' Please install it locally within your project using:');\r\n console.error('\\x1b[33m%s\\x1b[0m', ` npm install ${process.env.npm_package_name}`);\r\n console.error('\\x1b[31m%s\\x1b[0m', '==================================================================');\r\n\r\n process.exit(1);\r\n}\r\n"],"mappings":";AAAA,IAAI,QAAQ,IAAI,sBAAsB,UAAU,QAAQ,IAAI,sBAAsB,KAAK;AACnF,UAAQ,MAAM,qBAAqB,oEAAoE;AACvG,UAAQ,MAAM,qBAAqB,gBAAgB,QAAQ,IAAI,gBAAgB,yCAAyC;AACxH,UAAQ,MAAM,qBAAqB,uDAAuD;AAC1F,UAAQ,MAAM,qBAAqB,gBAAgB,QAAQ,IAAI,gBAAgB,EAAE;AACjF,UAAQ,MAAM,qBAAqB,oEAAoE;AAEvG,UAAQ,KAAK,CAAC;AAClB;","names":[]}
|
package/scripts/preinstall.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
if (process.env.npm_config_global ===
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
if (process.env.npm_config_global === "true" || process.env.npm_config_global === "1") {
|
|
2
|
+
console.error("\x1B[31m%s\x1B[0m", "==================================================================");
|
|
3
|
+
console.error("\x1B[31m%s\x1B[0m", ` Error: The "${process.env.npm_package_name}" package cannot be installed globally!`);
|
|
4
|
+
console.error("\x1B[31m%s\x1B[0m", " Please install it locally within your project using:");
|
|
5
|
+
console.error("\x1B[33m%s\x1B[0m", ` npm install ${process.env.npm_package_name}`);
|
|
6
|
+
console.error("\x1B[31m%s\x1B[0m", "==================================================================");
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=preinstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/scripts/preinstall.ts"],"sourcesContent":["if (process.env.npm_config_global === 'true' || process.env.npm_config_global === '1') {\r\n console.error('\\x1b[31m%s\\x1b[0m', '==================================================================');\r\n console.error('\\x1b[31m%s\\x1b[0m', ` Error: The \"${process.env.npm_package_name}\" package cannot be installed globally!`);\r\n console.error('\\x1b[31m%s\\x1b[0m', ' Please install it locally within your project using:');\r\n console.error('\\x1b[33m%s\\x1b[0m', ` npm install ${process.env.npm_package_name}`);\r\n console.error('\\x1b[31m%s\\x1b[0m', '==================================================================');\r\n\r\n process.exit(1);\r\n}\r\n"],"mappings":"AAAA,IAAI,QAAQ,IAAI,sBAAsB,UAAU,QAAQ,IAAI,sBAAsB,KAAK;AACnF,UAAQ,MAAM,qBAAqB,oEAAoE;AACvG,UAAQ,MAAM,qBAAqB,gBAAgB,QAAQ,IAAI,gBAAgB,yCAAyC;AACxH,UAAQ,MAAM,qBAAqB,uDAAuD;AAC1F,UAAQ,MAAM,qBAAqB,gBAAgB,QAAQ,IAAI,gBAAgB,EAAE;AACjF,UAAQ,MAAM,qBAAqB,oEAAoE;AAEvG,UAAQ,KAAK,CAAC;AAClB;","names":[]}
|
package/types.cjs
CHANGED
|
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
6
|
var __copyProps = (to, from, except, desc) => {
|
|
11
7
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
8
|
for (let key of __getOwnPropNames(from))
|
|
@@ -17,24 +13,5 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
13
|
};
|
|
18
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
15
|
var types_exports = {};
|
|
20
|
-
__export(types_exports, {
|
|
21
|
-
HTTPMethodEnum: () => HTTPMethodEnum
|
|
22
|
-
});
|
|
23
16
|
module.exports = __toCommonJS(types_exports);
|
|
24
|
-
var HTTPMethodEnum = /* @__PURE__ */ ((HTTPMethodEnum2) => {
|
|
25
|
-
HTTPMethodEnum2["GET"] = "GET";
|
|
26
|
-
HTTPMethodEnum2["HEAD"] = "HEAD";
|
|
27
|
-
HTTPMethodEnum2["POST"] = "POST";
|
|
28
|
-
HTTPMethodEnum2["PUT"] = "PUT";
|
|
29
|
-
HTTPMethodEnum2["DELETE"] = "DELETE";
|
|
30
|
-
HTTPMethodEnum2["CONNECT"] = "CONNECT";
|
|
31
|
-
HTTPMethodEnum2["OPTIONS"] = "OPTIONS";
|
|
32
|
-
HTTPMethodEnum2["TRACE"] = "TRACE";
|
|
33
|
-
HTTPMethodEnum2["PATCH"] = "PATCH";
|
|
34
|
-
return HTTPMethodEnum2;
|
|
35
|
-
})(HTTPMethodEnum || {});
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
HTTPMethodEnum
|
|
39
|
-
});
|
|
40
17
|
//# sourceMappingURL=types.cjs.map
|
package/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["export interface Instances { }\r\nexport type InitiatorHandler = () => Promise<Instances>;\r\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/types.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
interface Instances {
|
|
2
|
+
}
|
|
3
|
+
type InitiatorHandler = () => Promise<Instances>;
|
|
4
|
+
|
|
5
|
+
export type { InitiatorHandler, Instances };
|
package/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
interface Instances {
|
|
2
|
+
}
|
|
3
|
+
type InitiatorHandler = () => Promise<Instances>;
|
|
4
|
+
|
|
5
|
+
export type { InitiatorHandler, Instances };
|
package/types.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
var HTTPMethodEnum = /* @__PURE__ */ ((HTTPMethodEnum2) => {
|
|
2
|
-
HTTPMethodEnum2["GET"] = "GET";
|
|
3
|
-
HTTPMethodEnum2["HEAD"] = "HEAD";
|
|
4
|
-
HTTPMethodEnum2["POST"] = "POST";
|
|
5
|
-
HTTPMethodEnum2["PUT"] = "PUT";
|
|
6
|
-
HTTPMethodEnum2["DELETE"] = "DELETE";
|
|
7
|
-
HTTPMethodEnum2["CONNECT"] = "CONNECT";
|
|
8
|
-
HTTPMethodEnum2["OPTIONS"] = "OPTIONS";
|
|
9
|
-
HTTPMethodEnum2["TRACE"] = "TRACE";
|
|
10
|
-
HTTPMethodEnum2["PATCH"] = "PATCH";
|
|
11
|
-
return HTTPMethodEnum2;
|
|
12
|
-
})(HTTPMethodEnum || {});
|
|
13
|
-
export {
|
|
14
|
-
HTTPMethodEnum
|
|
15
|
-
};
|
|
16
1
|
//# sourceMappingURL=types.js.map
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/container-error.cjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var container_error_exports = {};
|
|
21
|
-
__export(container_error_exports, {
|
|
22
|
-
ContainerError: () => ContainerError
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(container_error_exports);
|
|
25
|
-
class ContainerError extends Error {
|
|
26
|
-
static {
|
|
27
|
-
__name(this, "ContainerError");
|
|
28
|
-
}
|
|
29
|
-
path;
|
|
30
|
-
moduleName;
|
|
31
|
-
constructor(moduleName, path, message) {
|
|
32
|
-
super(message || "Cannot load module: " + moduleName);
|
|
33
|
-
this.name = "ContainerError";
|
|
34
|
-
this.path = path;
|
|
35
|
-
this.moduleName = moduleName;
|
|
36
|
-
Object.setPrototypeOf(this, ContainerError.prototype);
|
|
37
|
-
if (Error.captureStackTrace)
|
|
38
|
-
Error.captureStackTrace(this, ContainerError);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
ContainerError
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=container-error.cjs.map
|
package/container-error.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/container-error.ts"],"sourcesContent":["export class ContainerError extends Error {\r\n public readonly path: string;\r\n public readonly moduleName: string;\r\n\r\n constructor(moduleName: string, path: string, message?: string) {\r\n super(message || 'Cannot load module: ' + moduleName);\r\n this.name = 'ContainerError';\r\n this.path = path;\r\n this.moduleName = moduleName;\r\n\r\n Object.setPrototypeOf(this, ContainerError.prototype);\r\n\r\n if (Error.captureStackTrace)\r\n Error.captureStackTrace(this, ContainerError);\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,uBAAuB,MAAM;AAAA,EAA1C,OAA0C;AAAA;AAAA;AAAA,EACtB;AAAA,EACA;AAAA,EAEhB,YAAY,YAAoB,MAAc,SAAkB;AAC5D,UAAM,WAAW,yBAAyB,UAAU;AACpD,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,aAAa;AAElB,WAAO,eAAe,MAAM,eAAe,SAAS;AAEpD,QAAI,MAAM;AACN,YAAM,kBAAkB,MAAM,cAAc;AAAA,EACpD;AACJ;","names":[]}
|
package/container-error.d.cts
DELETED
package/container-error.d.ts
DELETED
package/container-error.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
class ContainerError extends Error {
|
|
4
|
-
static {
|
|
5
|
-
__name(this, "ContainerError");
|
|
6
|
-
}
|
|
7
|
-
path;
|
|
8
|
-
moduleName;
|
|
9
|
-
constructor(moduleName, path, message) {
|
|
10
|
-
super(message || "Cannot load module: " + moduleName);
|
|
11
|
-
this.name = "ContainerError";
|
|
12
|
-
this.path = path;
|
|
13
|
-
this.moduleName = moduleName;
|
|
14
|
-
Object.setPrototypeOf(this, ContainerError.prototype);
|
|
15
|
-
if (Error.captureStackTrace)
|
|
16
|
-
Error.captureStackTrace(this, ContainerError);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
ContainerError
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=container-error.js.map
|
package/container-error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/container-error.ts"],"sourcesContent":["export class ContainerError extends Error {\r\n public readonly path: string;\r\n public readonly moduleName: string;\r\n\r\n constructor(moduleName: string, path: string, message?: string) {\r\n super(message || 'Cannot load module: ' + moduleName);\r\n this.name = 'ContainerError';\r\n this.path = path;\r\n this.moduleName = moduleName;\r\n\r\n Object.setPrototypeOf(this, ContainerError.prototype);\r\n\r\n if (Error.captureStackTrace)\r\n Error.captureStackTrace(this, ContainerError);\r\n }\r\n}\r\n"],"mappings":";;AAAO,MAAM,uBAAuB,MAAM;AAAA,EAA1C,OAA0C;AAAA;AAAA;AAAA,EACtB;AAAA,EACA;AAAA,EAEhB,YAAY,YAAoB,MAAc,SAAkB;AAC5D,UAAM,WAAW,yBAAyB,UAAU;AACpD,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,aAAa;AAElB,WAAO,eAAe,MAAM,eAAe,SAAS;AAEpD,QAAI,MAAM;AACN,YAAM,kBAAkB,MAAM,cAAc;AAAA,EACpD;AACJ;","names":[]}
|