@venizia/ignis-helpers 0.1.1-13 → 0.1.1-14
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/modules/queue/kafka/bundler/common/constants.d.ts +11 -0
- package/dist/modules/queue/kafka/bundler/common/constants.d.ts.map +1 -1
- package/dist/modules/queue/kafka/bundler/common/constants.js +13 -1
- package/dist/modules/queue/kafka/bundler/common/constants.js.map +1 -1
- package/dist/modules/queue/kafka/bundler/index.d.ts +2 -0
- package/dist/modules/queue/kafka/bundler/index.d.ts.map +1 -1
- package/dist/modules/queue/kafka/bundler/index.js +2 -0
- package/dist/modules/queue/kafka/bundler/index.js.map +1 -1
- package/dist/modules/queue/kafka/bundler/platformatic-require.plugin.d.ts +4 -0
- package/dist/modules/queue/kafka/bundler/platformatic-require.plugin.d.ts.map +1 -0
- package/dist/modules/queue/kafka/bundler/platformatic-require.plugin.js +32 -0
- package/dist/modules/queue/kafka/bundler/platformatic-require.plugin.js.map +1 -0
- package/dist/modules/queue/kafka/bundler/plugins.d.ts +4 -0
- package/dist/modules/queue/kafka/bundler/plugins.d.ts.map +1 -0
- package/dist/modules/queue/kafka/bundler/plugins.js +12 -0
- package/dist/modules/queue/kafka/bundler/plugins.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
export declare class KafkaBundlerPluginNames {
|
|
2
2
|
static readonly PLATFORMATIC_WASM = "ignis:platformatic-wasm";
|
|
3
|
+
static readonly PLATFORMATIC_REQUIRE = "ignis:platformatic-require";
|
|
3
4
|
}
|
|
4
5
|
export declare class PlatformaticWasmSpecifiers {
|
|
5
6
|
static readonly ENTRYPOINT = "@platformatic/wasm-utils";
|
|
6
7
|
static readonly BUNDLED_ENTRYPOINT = "@platformatic/wasm-utils/bundled";
|
|
7
8
|
static readonly ENTRYPOINT_FILTER: RegExp;
|
|
8
9
|
}
|
|
10
|
+
export declare class PlatformaticRequireSpecifiers {
|
|
11
|
+
/** Modules whose module-scope `require()` calls must be hoisted to static imports. */
|
|
12
|
+
static readonly MODULE_FILTER: RegExp;
|
|
13
|
+
/** `const <binding> = require('<specifier>');` at module scope; anchored so a lazy `require()` nested inside a function body never matches. */
|
|
14
|
+
static readonly REQUIRE_PATTERN: RegExp;
|
|
15
|
+
/** Optional peers of `@platformatic/kafka`; a static import would break builds that do not install them. */
|
|
16
|
+
static readonly SKIPPED_SPECIFIERS: readonly string[];
|
|
17
|
+
/** Prefix for the injected import bindings, namespaced to avoid colliding with upstream identifiers. */
|
|
18
|
+
static readonly IMPORT_ALIAS_PREFIX = "__ignisRequire";
|
|
19
|
+
}
|
|
9
20
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/queue/kafka/bundler/common/constants.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAuB;IAClC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,6BAA6B;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/queue/kafka/bundler/common/constants.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAuB;IAClC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,6BAA6B;IAC9D,MAAM,CAAC,QAAQ,CAAC,oBAAoB,gCAAgC;CACrE;AAED,qBAAa,0BAA0B;IACrC,MAAM,CAAC,QAAQ,CAAC,UAAU,8BAA8B;IACxD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,sCAAsC;IACxE,MAAM,CAAC,QAAQ,CAAC,iBAAiB,SAAiC;CACnE;AAED,qBAAa,6BAA6B;IACxC,sFAAsF;IACtF,MAAM,CAAC,QAAQ,CAAC,aAAa,SAAkD;IAE/E,+IAA+I;IAC/I,MAAM,CAAC,QAAQ,CAAC,eAAe,SAAwD;IAEvF,4GAA4G;IAC5G,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAoC;IAEzF,wGAAwG;IACxG,MAAM,CAAC,QAAQ,CAAC,mBAAmB,oBAAoB;CACxD"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlatformaticWasmSpecifiers = exports.KafkaBundlerPluginNames = void 0;
|
|
3
|
+
exports.PlatformaticRequireSpecifiers = exports.PlatformaticWasmSpecifiers = exports.KafkaBundlerPluginNames = void 0;
|
|
4
4
|
class KafkaBundlerPluginNames {
|
|
5
5
|
static { this.PLATFORMATIC_WASM = 'ignis:platformatic-wasm'; }
|
|
6
|
+
static { this.PLATFORMATIC_REQUIRE = 'ignis:platformatic-require'; }
|
|
6
7
|
}
|
|
7
8
|
exports.KafkaBundlerPluginNames = KafkaBundlerPluginNames;
|
|
8
9
|
class PlatformaticWasmSpecifiers {
|
|
@@ -11,4 +12,15 @@ class PlatformaticWasmSpecifiers {
|
|
|
11
12
|
static { this.ENTRYPOINT_FILTER = /^@platformatic\/wasm-utils$/; }
|
|
12
13
|
}
|
|
13
14
|
exports.PlatformaticWasmSpecifiers = PlatformaticWasmSpecifiers;
|
|
15
|
+
class PlatformaticRequireSpecifiers {
|
|
16
|
+
/** Modules whose module-scope `require()` calls must be hoisted to static imports. */
|
|
17
|
+
static { this.MODULE_FILTER = /@platformatic[\\/]kafka[\\/]dist[\\/].*\.js$/; }
|
|
18
|
+
/** `const <binding> = require('<specifier>');` at module scope; anchored so a lazy `require()` nested inside a function body never matches. */
|
|
19
|
+
static { this.REQUIRE_PATTERN = /^const\s+(\w+)\s*=\s*require\((['"])(.+?)\2\);?$/gm; }
|
|
20
|
+
/** Optional peers of `@platformatic/kafka`; a static import would break builds that do not install them. */
|
|
21
|
+
static { this.SKIPPED_SPECIFIERS = ['protobufjs', '@node-rs/crc32']; }
|
|
22
|
+
/** Prefix for the injected import bindings, namespaced to avoid colliding with upstream identifiers. */
|
|
23
|
+
static { this.IMPORT_ALIAS_PREFIX = '__ignisRequire'; }
|
|
24
|
+
}
|
|
25
|
+
exports.PlatformaticRequireSpecifiers = PlatformaticRequireSpecifiers;
|
|
14
26
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/modules/queue/kafka/bundler/common/constants.ts"],"names":[],"mappings":";;;AAAA,MAAa,uBAAuB;aAClB,sBAAiB,GAAG,yBAAyB,CAAC;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/modules/queue/kafka/bundler/common/constants.ts"],"names":[],"mappings":";;;AAAA,MAAa,uBAAuB;aAClB,sBAAiB,GAAG,yBAAyB,CAAC;aAC9C,yBAAoB,GAAG,4BAA4B,CAAC;;AAFtE,0DAGC;AAED,MAAa,0BAA0B;aACrB,eAAU,GAAG,0BAA0B,CAAC;aACxC,uBAAkB,GAAG,kCAAkC,CAAC;aACxD,sBAAiB,GAAG,6BAA6B,CAAC;;AAHpE,gEAIC;AAED,MAAa,6BAA6B;IACxC,sFAAsF;aACtE,kBAAa,GAAG,8CAA8C,CAAC;IAE/E,+IAA+I;aAC/H,oBAAe,GAAG,oDAAoD,CAAC;IAEvF,4GAA4G;aAC5F,uBAAkB,GAAsB,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAEzF,wGAAwG;aACxF,wBAAmB,GAAG,gBAAgB,CAAC;;AAXzD,sEAYC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC"}
|
|
@@ -15,5 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./common"), exports);
|
|
18
|
+
__exportStar(require("./platformatic-require.plugin"), exports);
|
|
18
19
|
__exportStar(require("./platformatic-wasm.plugin"), exports);
|
|
20
|
+
__exportStar(require("./plugins"), exports);
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6DAA2C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,gEAA8C;AAC9C,6DAA2C;AAC3C,4CAA0B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BunPlugin } from 'bun';
|
|
2
|
+
/** `@platformatic/kafka` resolves some dependencies through `createRequire(import.meta.url)` at module scope; `bun build --compile` cannot see through that, so the specifier stays unresolved and the binary dies with "Cannot find package" before boot - this plugin hoists those calls to static imports at bundle time. */
|
|
3
|
+
export declare const platformaticRequirePlugin: () => BunPlugin;
|
|
4
|
+
//# sourceMappingURL=platformatic-require.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformatic-require.plugin.d.ts","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/platformatic-require.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAGrC,gUAAgU;AAChU,eAAO,MAAM,yBAAyB,QAAO,SAgC3C,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.platformaticRequirePlugin = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
/** `@platformatic/kafka` resolves some dependencies through `createRequire(import.meta.url)` at module scope; `bun build --compile` cannot see through that, so the specifier stays unresolved and the binary dies with "Cannot find package" before boot - this plugin hoists those calls to static imports at bundle time. */
|
|
6
|
+
const platformaticRequirePlugin = () => ({
|
|
7
|
+
name: common_1.KafkaBundlerPluginNames.PLATFORMATIC_REQUIRE,
|
|
8
|
+
setup(build) {
|
|
9
|
+
build.onLoad({ filter: common_1.PlatformaticRequireSpecifiers.MODULE_FILTER }, async (args) => {
|
|
10
|
+
const source = await Bun.file(args.path).text();
|
|
11
|
+
const imports = [];
|
|
12
|
+
const contents = source.replace(common_1.PlatformaticRequireSpecifiers.REQUIRE_PATTERN, (matched, binding, _quote, specifier) => {
|
|
13
|
+
if (common_1.PlatformaticRequireSpecifiers.SKIPPED_SPECIFIERS.includes(specifier)) {
|
|
14
|
+
return matched;
|
|
15
|
+
}
|
|
16
|
+
const alias = `${common_1.PlatformaticRequireSpecifiers.IMPORT_ALIAS_PREFIX}${imports.length}`;
|
|
17
|
+
imports.push(`import ${alias} from ${JSON.stringify(specifier)};`);
|
|
18
|
+
// No `?.default` unwrap: a default import already yields `module.exports` for CJS, and
|
|
19
|
+
// unwrapping would break JSON payloads carrying their own top-level `default` key - the
|
|
20
|
+
// draft-06 meta schema has one, so unwrapping silently replaces it with `{}`.
|
|
21
|
+
return `const ${binding} = ${alias};`;
|
|
22
|
+
});
|
|
23
|
+
// No match is not an error: upstream fixing this makes the plugin an inert no-op.
|
|
24
|
+
if (!imports.length) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return { contents: `${imports.join('\n')}\n${contents}`, loader: 'js' };
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
exports.platformaticRequirePlugin = platformaticRequirePlugin;
|
|
32
|
+
//# sourceMappingURL=platformatic-require.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformatic-require.plugin.js","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/platformatic-require.plugin.ts"],"names":[],"mappings":";;;AACA,qCAAkF;AAElF,gUAAgU;AACzT,MAAM,yBAAyB,GAAG,GAAc,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE,gCAAuB,CAAC,oBAAoB;IAClD,KAAK,CAAC,KAAK;QACT,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,sCAA6B,CAAC,aAAa,EAAE,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE;YACjF,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;YAChD,MAAM,OAAO,GAAa,EAAE,CAAC;YAE7B,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAC7B,sCAA6B,CAAC,eAAe,EAC7C,CAAC,OAAO,EAAE,OAAe,EAAE,MAAc,EAAE,SAAiB,EAAE,EAAE;gBAC9D,IAAI,sCAA6B,CAAC,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBACzE,OAAO,OAAO,CAAC;gBACjB,CAAC;gBAED,MAAM,KAAK,GAAG,GAAG,sCAA6B,CAAC,mBAAmB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;gBACtF,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBAEnE,uFAAuF;gBACvF,wFAAwF;gBACxF,8EAA8E;gBAC9E,OAAO,SAAS,OAAO,MAAM,KAAK,GAAG,CAAC;YACxC,CAAC,CACF,CAAC;YAEF,kFAAkF;YAClF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBACpB,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC1E,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAhCU,QAAA,yBAAyB,6BAgCnC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BunPlugin } from 'bun';
|
|
2
|
+
/** Every `@platformatic/kafka` fix needed by `bun build --compile`, as one list - a service compile script registers this instead of tracking the individual plugins. */
|
|
3
|
+
export declare const platformaticKafkaPlugins: () => BunPlugin[];
|
|
4
|
+
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAIrC,yKAAyK;AACzK,eAAO,MAAM,wBAAwB,QAAO,SAAS,EAGpD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.platformaticKafkaPlugins = void 0;
|
|
4
|
+
const platformatic_require_plugin_1 = require("./platformatic-require.plugin");
|
|
5
|
+
const platformatic_wasm_plugin_1 = require("./platformatic-wasm.plugin");
|
|
6
|
+
/** Every `@platformatic/kafka` fix needed by `bun build --compile`, as one list - a service compile script registers this instead of tracking the individual plugins. */
|
|
7
|
+
const platformaticKafkaPlugins = () => [
|
|
8
|
+
(0, platformatic_wasm_plugin_1.platformaticWasmPlugin)(),
|
|
9
|
+
(0, platformatic_require_plugin_1.platformaticRequirePlugin)(),
|
|
10
|
+
];
|
|
11
|
+
exports.platformaticKafkaPlugins = platformaticKafkaPlugins;
|
|
12
|
+
//# sourceMappingURL=plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/plugins.ts"],"names":[],"mappings":";;;AACA,+EAA0E;AAC1E,yEAAoE;AAEpE,yKAAyK;AAClK,MAAM,wBAAwB,GAAG,GAAgB,EAAE,CAAC;IACzD,IAAA,iDAAsB,GAAE;IACxB,IAAA,uDAAyB,GAAE;CAC5B,CAAC;AAHW,QAAA,wBAAwB,4BAGnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-helpers",
|
|
3
|
-
"version": "0.1.1-
|
|
3
|
+
"version": "0.1.1-14",
|
|
4
4
|
"description": "Production-ready TypeScript utility library: pluggable logging (winston or pino behind one ILogger contract), Redis single/cluster/sentinel with pub/sub, BullMQ/MQTT/Kafka message queues, MinIO/Disk/Bun-S3 object storage, AES-256/RSA/ECDH cryptography, Snowflake UID generation, cron scheduling, Socket.IO/WebSocket, TCP/TLS/UDP networking, HTTP clients, secrets/Vault, worker thread pools, and environment management. Sub-path imports isolate optional peer dependencies so the root barrel never forces a peer into your bundle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aes",
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
"devDependencies": {
|
|
269
269
|
"@dotenvx/dotenvx": "^2.14.0",
|
|
270
270
|
"@hono/zod-openapi": "^1.5.1",
|
|
271
|
-
"@platformatic/kafka": "^2.
|
|
271
|
+
"@platformatic/kafka": "^2.8.0",
|
|
272
272
|
"@socket.io/redis-adapter": "^8.3.0",
|
|
273
273
|
"@socket.io/redis-emitter": "^5.1.0",
|
|
274
274
|
"@types/bun": "^1.3.14",
|