@hypernym/bundler 0.31.1 → 0.31.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/LICENSE.txt +2 -2
- package/dist/bin/index.js +18 -18
- package/dist/build/index.js +3 -3
- package/package.json +9 -9
package/LICENSE.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026, Ivo Dolenc <https://github.com/ivodolenc>
|
|
4
|
+
Copyright (c) 2026, Hypernym Studio <https://github.com/hypernym-studio>
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/bin/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { build as build$1 } from "../build/index.js";
|
|
|
9
9
|
|
|
10
10
|
//#region src/bin/meta.ts
|
|
11
11
|
const name = `Hyperbundler`;
|
|
12
|
-
const version = `0.31.
|
|
12
|
+
const version = `0.31.3`;
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/utils/logger.ts
|
|
@@ -103,20 +103,20 @@ const externals = [
|
|
|
103
103
|
|
|
104
104
|
//#endregion
|
|
105
105
|
//#region src/bin/loader.ts
|
|
106
|
-
async function getTSConfigPath(cwd
|
|
107
|
-
const tsconfigPath = resolve(cwd
|
|
106
|
+
async function getTSConfigPath(cwd, filePath = "tsconfig.json") {
|
|
107
|
+
const tsconfigPath = resolve(cwd, filePath);
|
|
108
108
|
if (await exists(tsconfigPath)) return tsconfigPath;
|
|
109
109
|
}
|
|
110
110
|
async function loadConfig(filePath, defaults) {
|
|
111
|
-
const cwd
|
|
111
|
+
const cwd = defaults.cwd;
|
|
112
112
|
const result = await build({
|
|
113
|
-
input: resolve(cwd
|
|
113
|
+
input: resolve(cwd, filePath),
|
|
114
114
|
write: false,
|
|
115
115
|
external: (id) => !(isAbsolute(id) || /^(\.|@\/|~\/)/.test(id)),
|
|
116
116
|
tsconfig: defaults.tsconfig,
|
|
117
117
|
output: { format: "esm" }
|
|
118
118
|
});
|
|
119
|
-
const tempConfig = resolve(cwd
|
|
119
|
+
const tempConfig = resolve(cwd, "node_modules/.hypernym/bundler/config.js");
|
|
120
120
|
await write(tempConfig, result.output[0].code);
|
|
121
121
|
const config = (await import(tempConfig)).default;
|
|
122
122
|
return {
|
|
@@ -162,14 +162,14 @@ async function createConfigLoader(args) {
|
|
|
162
162
|
async function createBuilder(config) {
|
|
163
163
|
const { options, path: configPath } = config;
|
|
164
164
|
const { hooks } = options;
|
|
165
|
-
const cl
|
|
165
|
+
const cl = console.log;
|
|
166
166
|
await hooks?.["bundle:start"]?.(options);
|
|
167
|
-
cl
|
|
167
|
+
cl();
|
|
168
168
|
logger.info(dim(`v${version}`));
|
|
169
|
-
cl
|
|
170
|
-
cl
|
|
171
|
-
cl
|
|
172
|
-
cl
|
|
169
|
+
cl("Config", dim(configPath));
|
|
170
|
+
cl();
|
|
171
|
+
cl("Processing specified entries...");
|
|
172
|
+
cl();
|
|
173
173
|
await build$1(options).then((stats) => {
|
|
174
174
|
const entriesLength = options.entries.length;
|
|
175
175
|
const totalEntries = `${entriesLength} ${entriesLength > 1 ? "entries" : "entry"}`;
|
|
@@ -177,12 +177,12 @@ async function createBuilder(config) {
|
|
|
177
177
|
const totalFiles = `${stats.files.length} file${filesLength > 1 ? "s" : ""}`;
|
|
178
178
|
const buildTime = formatMs(stats.buildTime);
|
|
179
179
|
const buildSize = formatBytes(stats.size);
|
|
180
|
-
cl
|
|
181
|
-
cl
|
|
182
|
-
cl
|
|
183
|
-
cl
|
|
184
|
-
cl
|
|
185
|
-
cl
|
|
180
|
+
cl();
|
|
181
|
+
cl("Stats:", dim(`${totalEntries}, ${totalFiles}, ${buildSize}, ${buildTime}`));
|
|
182
|
+
cl();
|
|
183
|
+
cl("All entries successfully processed.");
|
|
184
|
+
cl("Bundle is optimized and ready for production.");
|
|
185
|
+
cl();
|
|
186
186
|
}).catch(error);
|
|
187
187
|
await hooks?.["bundle:end"]?.(options);
|
|
188
188
|
}
|
package/dist/build/index.js
CHANGED
|
@@ -101,7 +101,7 @@ function parseOutputPath(path) {
|
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region src/bin/build.ts
|
|
103
103
|
function logEntryStats(stats) {
|
|
104
|
-
const cl
|
|
104
|
+
const cl = console.log;
|
|
105
105
|
const base = parse(stats.path).base;
|
|
106
106
|
const path = stats.path.replace(base, "");
|
|
107
107
|
let format = stats.format;
|
|
@@ -109,8 +109,8 @@ function logEntryStats(stats) {
|
|
|
109
109
|
if (format === "es" || format === "module") format = "esm";
|
|
110
110
|
const output = dim(path) + base;
|
|
111
111
|
const outputLength = output.length + 2;
|
|
112
|
-
cl
|
|
113
|
-
if (stats.logs) for (const log of stats.logs) cl
|
|
112
|
+
cl(dim("+"), format.padEnd(5), output.padEnd(outputLength), dim(`[${formatBytes(stats.size)}, ${formatMs(stats.buildTime)}]`));
|
|
113
|
+
if (stats.logs) for (const log of stats.logs) cl("!", log.level.padEnd(5), output.padEnd(outputLength), dim(log.log.message));
|
|
114
114
|
}
|
|
115
115
|
async function build(options) {
|
|
116
116
|
const { cwd: cwdir = cwd(), outDir = "dist", entries, externals, tsconfig, hooks, minify } = options;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hypernym/bundler",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.3",
|
|
4
4
|
"author": "Hypernym Studio",
|
|
5
5
|
"description": "ESM & TS module bundler.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@hypernym/args": "^0.3.4",
|
|
59
59
|
"@hypernym/colors": "^1.0.6",
|
|
60
|
-
"@hypernym/utils": "^3.4.
|
|
61
|
-
"rolldown": "^1.0.0-
|
|
62
|
-
"rolldown-plugin-dts": "^0.
|
|
60
|
+
"@hypernym/utils": "^3.4.7",
|
|
61
|
+
"rolldown": "^1.0.0-rc.2",
|
|
62
|
+
"rolldown-plugin-dts": "^0.21.9"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@hypernym/eslint-config": "^3.6.
|
|
66
|
-
"@hypernym/prettier-config": "^3.2.
|
|
67
|
-
"@hypernym/tsconfig": "^2.6.
|
|
68
|
-
"@types/node": "^24.10.
|
|
65
|
+
"@hypernym/eslint-config": "^3.6.7",
|
|
66
|
+
"@hypernym/prettier-config": "^3.2.11",
|
|
67
|
+
"@hypernym/tsconfig": "^2.6.5",
|
|
68
|
+
"@types/node": "^24.10.10",
|
|
69
69
|
"eslint": "^9.39.2",
|
|
70
|
-
"prettier": "^3.
|
|
70
|
+
"prettier": "^3.8.1",
|
|
71
71
|
"typescript": "^5.9.3"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|