@venizia/dev-configs 0.2.0-0 → 0.2.0-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.
- package/dist/compile.d.ts +15 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +40 -0
- package/dist/compile.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Bundles and compiles a single Bun executable: minified, linked sourcemaps, target read from `BUN_TARGET`. */
|
|
2
|
+
export declare class BunCompiler {
|
|
3
|
+
/**
|
|
4
|
+
* `plugins` is a parameter, never resolved here - `dev-configs` sits below every other IGNIS
|
|
5
|
+
* package (see the Makefile chain) and must not import a plugin factory such as
|
|
6
|
+
* `platformaticKafkaPlugins()` from `helpers`, which would invert that chain.
|
|
7
|
+
*/
|
|
8
|
+
static compile(opts?: {
|
|
9
|
+
entrypoint?: string;
|
|
10
|
+
outfile?: string;
|
|
11
|
+
target?: string;
|
|
12
|
+
plugins?: Bun.BunPlugin[];
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAIA,gHAAgH;AAChH,qBAAa,WAAW;IACtB;;;;OAIG;WACU,OAAO,CAClB,IAAI,GAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;KACtB,GACL,OAAO,CAAC,IAAI,CAAC;CAiCjB"}
|
package/dist/compile.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BunCompiler = void 0;
|
|
4
|
+
const DEFAULT_ENTRYPOINT = "./dist/index.js";
|
|
5
|
+
const DEFAULT_OUTFILE = "./dist/bin";
|
|
6
|
+
const DEFAULT_COMPILE_TARGET = "bun-linux-x64";
|
|
7
|
+
/** Bundles and compiles a single Bun executable: minified, linked sourcemaps, target read from `BUN_TARGET`. */
|
|
8
|
+
class BunCompiler {
|
|
9
|
+
/**
|
|
10
|
+
* `plugins` is a parameter, never resolved here - `dev-configs` sits below every other IGNIS
|
|
11
|
+
* package (see the Makefile chain) and must not import a plugin factory such as
|
|
12
|
+
* `platformaticKafkaPlugins()` from `helpers`, which would invert that chain.
|
|
13
|
+
*/
|
|
14
|
+
static async compile(opts = {}) {
|
|
15
|
+
const { entrypoint = DEFAULT_ENTRYPOINT, outfile = DEFAULT_OUTFILE, target = Bun.env.BUN_TARGET ?? DEFAULT_COMPILE_TARGET, plugins = [], } = opts;
|
|
16
|
+
const built = await Bun.build({
|
|
17
|
+
entrypoints: [entrypoint],
|
|
18
|
+
target: "bun",
|
|
19
|
+
minify: { whitespace: true, syntax: true },
|
|
20
|
+
sourcemap: "linked",
|
|
21
|
+
throw: false,
|
|
22
|
+
compile: {
|
|
23
|
+
// `target` is read from an environment variable at runtime, so it cannot be checked against Bun's literal union at compile time.
|
|
24
|
+
target: target,
|
|
25
|
+
outfile,
|
|
26
|
+
},
|
|
27
|
+
plugins,
|
|
28
|
+
});
|
|
29
|
+
if (!built.success) {
|
|
30
|
+
// `getError` lives in `inversion`, which depends on `dev-configs` - importing it here would
|
|
31
|
+
// create a circular workspace dependency, so a failed compile throws a plain `Error` instead.
|
|
32
|
+
throw new Error([
|
|
33
|
+
`[BunCompiler] compile failed for entrypoint "${entrypoint}":`,
|
|
34
|
+
...built.logs.map((log) => `[${log.level}] ${log.message}`),
|
|
35
|
+
].join("\n"));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.BunCompiler = BunCompiler;
|
|
40
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAC7C,MAAM,eAAe,GAAG,YAAY,CAAC;AACrC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAE/C,gHAAgH;AAChH,MAAa,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAClB,OAKI,EAAE;QAEN,MAAM,EACJ,UAAU,GAAG,kBAAkB,EAC/B,OAAO,GAAG,eAAe,EACzB,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,sBAAsB,EACrD,OAAO,GAAG,EAAE,GACb,GAAG,IAAI,CAAC;QAET,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC;YAC5B,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;YAC1C,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE;gBACP,iIAAiI;gBACjI,MAAM,EAAE,MAAiC;gBACzC,OAAO;aACR;YACD,OAAO;SACR,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,4FAA4F;YAC5F,8FAA8F;YAC9F,MAAM,IAAI,KAAK,CACb;gBACE,gDAAgD,UAAU,IAAI;gBAC9D,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;aAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA9CD,kCA8CC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./compile"), exports);
|
|
17
18
|
__exportStar(require("./eslint"), exports);
|
|
18
19
|
__exportStar(require("./prettier"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,2CAAyB;AACzB,6CAA2B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/dev-configs",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-2",
|
|
4
4
|
"description": "Shareable development configurations for TypeScript projects: ESLint v9 flat config (with unicorn plugin), Prettier formatting, and TypeScript compiler options with critical decorator support (experimentalDecorators, emitDecoratorMetadata, useDefineForClassFields). Single source of truth for consistent code style, type checking, and build settings across monorepo packages. 3-line consumption pattern per config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build-tools",
|