@hakobu/hakobu 1.0.0
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 +21 -0
- package/README.md +673 -0
- package/dictionary/angular-bridge.js +3 -0
- package/dictionary/any-promise.js +3 -0
- package/dictionary/async.js +3 -0
- package/dictionary/aws-sdk.js +7 -0
- package/dictionary/babel-core.js +3 -0
- package/dictionary/batch.js +3 -0
- package/dictionary/bcrypt.js +3 -0
- package/dictionary/better-sqlite3.js +3 -0
- package/dictionary/bignum.js +3 -0
- package/dictionary/bindings.js +3 -0
- package/dictionary/blessed.js +8 -0
- package/dictionary/body-parser.js +9 -0
- package/dictionary/browserify.js +7 -0
- package/dictionary/bson.js +3 -0
- package/dictionary/buffermaker.js +7 -0
- package/dictionary/bunyan.js +9 -0
- package/dictionary/busboy.js +7 -0
- package/dictionary/bytes.js +3 -0
- package/dictionary/callsites.js +3 -0
- package/dictionary/chokidar.js +3 -0
- package/dictionary/coffee-script.js +7 -0
- package/dictionary/colors.js +3 -0
- package/dictionary/compression.js +3 -0
- package/dictionary/compressjs.js +7 -0
- package/dictionary/connect-mongo.js +3 -0
- package/dictionary/connect-mongodb.js +3 -0
- package/dictionary/connect-redis.js +3 -0
- package/dictionary/connect.js +10 -0
- package/dictionary/consolidate.js +3 -0
- package/dictionary/cookie-parser.js +3 -0
- package/dictionary/cookie.js +3 -0
- package/dictionary/cors.js +3 -0
- package/dictionary/cron.js +3 -0
- package/dictionary/cross-env.js +11 -0
- package/dictionary/cross-spawn-async.js +3 -0
- package/dictionary/curve25519.js +3 -0
- package/dictionary/data-preflight.js +7 -0
- package/dictionary/debug.js +3 -0
- package/dictionary/denymount.js +3 -0
- package/dictionary/diff.js +3 -0
- package/dictionary/drivelist.js +22 -0
- package/dictionary/ed25519.js +3 -0
- package/dictionary/ejs.js +3 -0
- package/dictionary/elasticsearch.js +3 -0
- package/dictionary/electron.js +17 -0
- package/dictionary/emailjs.js +3 -0
- package/dictionary/engine.io.js +3 -0
- package/dictionary/epoll.js +3 -0
- package/dictionary/errorhandler.js +7 -0
- package/dictionary/errors.js +7 -0
- package/dictionary/eslint.js +7 -0
- package/dictionary/etcher-image-write.js +3 -0
- package/dictionary/exceljs.js +21 -0
- package/dictionary/exiftool.exe.js +13 -0
- package/dictionary/exiftool.pl.js +13 -0
- package/dictionary/express-load.js +12 -0
- package/dictionary/express-session.js +3 -0
- package/dictionary/express.js +14 -0
- package/dictionary/extender.js +11 -0
- package/dictionary/extsprintf.js +3 -0
- package/dictionary/faye-websocket.js +3 -0
- package/dictionary/feathers.js +3 -0
- package/dictionary/findup-sync.js +3 -0
- package/dictionary/floordate.js +3 -0
- package/dictionary/fmt.js +3 -0
- package/dictionary/formidable.js +3 -0
- package/dictionary/fs-extra.js +3 -0
- package/dictionary/fsevents.js +3 -0
- package/dictionary/geoip-lite.js +7 -0
- package/dictionary/github.js +7 -0
- package/dictionary/gm.js +3 -0
- package/dictionary/google-closure-compiler-java.js +13 -0
- package/dictionary/google-closure-compiler.js +13 -0
- package/dictionary/googleapis.js +7 -0
- package/dictionary/got.js +3 -0
- package/dictionary/graceful-fs.js +19 -0
- package/dictionary/grpc.js +11 -0
- package/dictionary/gulp.js +3 -0
- package/dictionary/hap-nodejs.js +3 -0
- package/dictionary/heapdump.js +3 -0
- package/dictionary/hoek.js +3 -0
- package/dictionary/homebridge.js +3 -0
- package/dictionary/http-proxy.js +3 -0
- package/dictionary/http-server.js +3 -0
- package/dictionary/image-size.js +3 -0
- package/dictionary/indexof.js +3 -0
- package/dictionary/inquirer.js +3 -0
- package/dictionary/j.js +16 -0
- package/dictionary/jade.js +3 -0
- package/dictionary/jsdom.js +3 -0
- package/dictionary/json-stringify-date.js +3 -0
- package/dictionary/json-stringify-safe.js +3 -0
- package/dictionary/jsonwebtoken.js +3 -0
- package/dictionary/kerberos.js +3 -0
- package/dictionary/knex.js +7 -0
- package/dictionary/later.js +7 -0
- package/dictionary/level.js +3 -0
- package/dictionary/leveldown.js +10 -0
- package/dictionary/levelup.js +3 -0
- package/dictionary/liftoff.js +12 -0
- package/dictionary/lodash.js +3 -0
- package/dictionary/log4js.js +7 -0
- package/dictionary/logform.js +7 -0
- package/dictionary/machinepack-urls.js +7 -0
- package/dictionary/markdown.js +3 -0
- package/dictionary/mdns.js +6 -0
- package/dictionary/method-override.js +3 -0
- package/dictionary/microjob.js +16 -0
- package/dictionary/mime-types.js +3 -0
- package/dictionary/mime.js +3 -0
- package/dictionary/minimatch.js +3 -0
- package/dictionary/minstache.js +3 -0
- package/dictionary/module-deps.js +3 -0
- package/dictionary/moment-timezone.js +3 -0
- package/dictionary/moment.js +7 -0
- package/dictionary/mongodb-core.js +22 -0
- package/dictionary/mongodb.js +7 -0
- package/dictionary/mongoose.js +7 -0
- package/dictionary/mongoskin.js +7 -0
- package/dictionary/ms.js +3 -0
- package/dictionary/msgpack.js +3 -0
- package/dictionary/multer.js +3 -0
- package/dictionary/muri.js +3 -0
- package/dictionary/native-or-bluebird.js +3 -0
- package/dictionary/natives.js +3 -0
- package/dictionary/nconf.js +7 -0
- package/dictionary/nedb.js +3 -0
- package/dictionary/negotiator.js +7 -0
- package/dictionary/newrelic.js +3 -0
- package/dictionary/nib.js +3 -0
- package/dictionary/nightmare.js +18 -0
- package/dictionary/node-forge.js +7 -0
- package/dictionary/node-libcurl.js +3 -0
- package/dictionary/node-notifier.js +30 -0
- package/dictionary/node-pre-gyp.js +7 -0
- package/dictionary/node-redis-pubsub.js +3 -0
- package/dictionary/node-sass.js +3 -0
- package/dictionary/node-uuid.js +3 -0
- package/dictionary/node-xlsx.js +3 -0
- package/dictionary/node-zookeeper-client.js +7 -0
- package/dictionary/nodegit.js +7 -0
- package/dictionary/nodemailer-sendmail-transport.js +3 -0
- package/dictionary/nodemailer.js +3 -0
- package/dictionary/npm-registry-client.js +7 -0
- package/dictionary/npm.js +7 -0
- package/dictionary/nssocket.js +3 -0
- package/dictionary/oauth2orize.js +7 -0
- package/dictionary/octobat.js +3 -0
- package/dictionary/open.js +13 -0
- package/dictionary/opn.js +4 -0
- package/dictionary/optimist.js +3 -0
- package/dictionary/passport-local.js +3 -0
- package/dictionary/passport.js +3 -0
- package/dictionary/pg-cursor.js +3 -0
- package/dictionary/pg-query-stream.js +3 -0
- package/dictionary/pg-types.js +7 -0
- package/dictionary/pg.js +7 -0
- package/dictionary/pg.js.js +7 -0
- package/dictionary/pgpass.js +7 -0
- package/dictionary/phantom.js +19 -0
- package/dictionary/phantomjs-prebuilt.js +16 -0
- package/dictionary/pkginfo.js +3 -0
- package/dictionary/pm2.js +7 -0
- package/dictionary/pmx.js +3 -0
- package/dictionary/pouchdb.js +3 -0
- package/dictionary/primus-emitter.js +3 -0
- package/dictionary/primus-spark-latency.js +3 -0
- package/dictionary/primus.js +3 -0
- package/dictionary/publicsuffixlist.js +15 -0
- package/dictionary/pug.js +3 -0
- package/dictionary/punt.js +3 -0
- package/dictionary/puppeteer.js +13 -0
- package/dictionary/pwd.js +3 -0
- package/dictionary/q.js +3 -0
- package/dictionary/raven.js +3 -0
- package/dictionary/rc.js +12 -0
- package/dictionary/readable-stream.js +3 -0
- package/dictionary/rechoir.js +3 -0
- package/dictionary/redis-parser.js +3 -0
- package/dictionary/redis.js +3 -0
- package/dictionary/regression.js +3 -0
- package/dictionary/reload.js +7 -0
- package/dictionary/request.js +3 -0
- package/dictionary/require-uncached.js +3 -0
- package/dictionary/require_optional.js +3 -0
- package/dictionary/s3.js +3 -0
- package/dictionary/safe_datejs.js +3 -0
- package/dictionary/sails.js +33 -0
- package/dictionary/sax.js +3 -0
- package/dictionary/scrypt.js +3 -0
- package/dictionary/semver.js +3 -0
- package/dictionary/sequelize.js +7 -0
- package/dictionary/serialport.js +3 -0
- package/dictionary/sha3.js +3 -0
- package/dictionary/sharp.js +11 -0
- package/dictionary/shelljs.js +7 -0
- package/dictionary/sinon.js +3 -0
- package/dictionary/socket.io-client.js +13 -0
- package/dictionary/socket.io.js +12 -0
- package/dictionary/sqip.js +7 -0
- package/dictionary/sqlite3.js +7 -0
- package/dictionary/steam-crypto.js +7 -0
- package/dictionary/steam-resources.js +19 -0
- package/dictionary/steam.js +3 -0
- package/dictionary/stripe-webhook-middleware.js +3 -0
- package/dictionary/stripe.js +3 -0
- package/dictionary/strong-globalize.js +3 -0
- package/dictionary/stylus.js +14 -0
- package/dictionary/supervisor.js +3 -0
- package/dictionary/svgo.js +8 -0
- package/dictionary/tabtab.js +3 -0
- package/dictionary/tesseract.js.js +7 -0
- package/dictionary/thread-stream.js +7 -0
- package/dictionary/throng.js +3 -0
- package/dictionary/time.js +3 -0
- package/dictionary/tinify.js +7 -0
- package/dictionary/tiny-worker.js +7 -0
- package/dictionary/tmp.js +3 -0
- package/dictionary/transformers.js +3 -0
- package/dictionary/uglify-js.js +9 -0
- package/dictionary/umd.js +19 -0
- package/dictionary/underscore.js +3 -0
- package/dictionary/union.js +3 -0
- package/dictionary/update-notifier.js +3 -0
- package/dictionary/usage.js +7 -0
- package/dictionary/v8flags.js +13 -0
- package/dictionary/verror.js +3 -0
- package/dictionary/voc.js +3 -0
- package/dictionary/webdriverio.js +7 -0
- package/dictionary/winston-uber.js +7 -0
- package/dictionary/winston.js +7 -0
- package/dictionary/ws.js +3 -0
- package/dictionary/xlsx.js +16 -0
- package/dictionary/xml2js.js +3 -0
- package/dictionary/yargs.js +3 -0
- package/dictionary/zeromq.js +13 -0
- package/lib-es5/addon-extract.js +164 -0
- package/lib-es5/analyzer.js +687 -0
- package/lib-es5/app-bundle.js +133 -0
- package/lib-es5/appdir.js +265 -0
- package/lib-es5/bin.js +304 -0
- package/lib-es5/bootstrap.js +179 -0
- package/lib-es5/bundler.js +496 -0
- package/lib-es5/chmod.js +15 -0
- package/lib-es5/colors.js +12 -0
- package/lib-es5/commands.js +376 -0
- package/lib-es5/common.js +328 -0
- package/lib-es5/compress_type.js +10 -0
- package/lib-es5/config.js +291 -0
- package/lib-es5/detector.js +421 -0
- package/lib-es5/esm-hooks.js +366 -0
- package/lib-es5/esm-resolver.js +292 -0
- package/lib-es5/esm-transformer.js +378 -0
- package/lib-es5/exports-resolver.js +184 -0
- package/lib-es5/external-artifacts.js +170 -0
- package/lib-es5/fabricator.js +137 -0
- package/lib-es5/follow.js +190 -0
- package/lib-es5/help.js +52 -0
- package/lib-es5/index.d.ts +2 -0
- package/lib-es5/index.js +552 -0
- package/lib-es5/log.js +7 -0
- package/lib-es5/mach-o.js +262 -0
- package/lib-es5/manifest.js +21 -0
- package/lib-es5/options.js +19 -0
- package/lib-es5/packager.js +1036 -0
- package/lib-es5/packer.js +137 -0
- package/lib-es5/pe-metadata.js +130 -0
- package/lib-es5/producer.js +378 -0
- package/lib-es5/refiner.js +87 -0
- package/lib-es5/resolver.js +142 -0
- package/lib-es5/runtime-diagnostics.js +172 -0
- package/lib-es5/sea.js +307 -0
- package/lib-es5/snapshot-fs-patch.js +396 -0
- package/lib-es5/snapshot-fs.js +255 -0
- package/lib-es5/snapshot-index.js +135 -0
- package/lib-es5/snapshot-path.js +168 -0
- package/lib-es5/types.js +9 -0
- package/lib-es5/walker.js +1019 -0
- package/lib-es5/windows-sign.js +139 -0
- package/package.json +99 -0
- package/prelude/bootstrap.js +2263 -0
- package/prelude/diagnostic.js +147 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompressType = void 0;
|
|
4
|
+
var CompressType;
|
|
5
|
+
(function (CompressType) {
|
|
6
|
+
CompressType[CompressType["None"] = 0] = "None";
|
|
7
|
+
CompressType[CompressType["GZip"] = 1] = "GZip";
|
|
8
|
+
CompressType[CompressType["Brotli"] = 2] = "Brotli";
|
|
9
|
+
})(CompressType = exports.CompressType || (exports.CompressType = {}));
|
|
10
|
+
//# sourceMappingURL=compress_type.js.map
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Hakobu Configuration Normalization
|
|
4
|
+
*
|
|
5
|
+
* Reads packaging config from:
|
|
6
|
+
* 1. CLI flags (highest priority)
|
|
7
|
+
* 2. package.json "hakobu" field (modern)
|
|
8
|
+
* 3. package.json "pkg" field (legacy — accepted with warnings)
|
|
9
|
+
*
|
|
10
|
+
* All inputs are normalized into PackageOptions for the packaging pipeline.
|
|
11
|
+
* Legacy `pkg` options are mapped where safe, warned where changed, and
|
|
12
|
+
* rejected where unsupported.
|
|
13
|
+
*/
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.normalizeConfig = void 0;
|
|
19
|
+
const fs_1 = __importDefault(require("fs"));
|
|
20
|
+
const path_1 = __importDefault(require("path"));
|
|
21
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
22
|
+
// Main normalization function
|
|
23
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
24
|
+
function normalizeConfig(args) {
|
|
25
|
+
const warnings = [];
|
|
26
|
+
const projectRoot = path_1.default.resolve(args.projectRoot);
|
|
27
|
+
// ── Read package.json ──
|
|
28
|
+
const pkgJsonPath = path_1.default.join(projectRoot, 'package.json');
|
|
29
|
+
let hakobuConfig;
|
|
30
|
+
let legacyConfig;
|
|
31
|
+
if (fs_1.default.existsSync(pkgJsonPath)) {
|
|
32
|
+
try {
|
|
33
|
+
const pkg = JSON.parse(fs_1.default.readFileSync(pkgJsonPath, 'utf8'));
|
|
34
|
+
if (pkg.hakobu) {
|
|
35
|
+
hakobuConfig = pkg.hakobu;
|
|
36
|
+
}
|
|
37
|
+
if (pkg.pkg) {
|
|
38
|
+
if (hakobuConfig) {
|
|
39
|
+
warnings.push({
|
|
40
|
+
type: 'deprecated',
|
|
41
|
+
option: 'pkg',
|
|
42
|
+
message: 'Both "hakobu" and "pkg" fields found in package.json. Using "hakobu"; ignoring "pkg".',
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
legacyConfig = pkg.pkg;
|
|
47
|
+
warnings.push({
|
|
48
|
+
type: 'migrated',
|
|
49
|
+
option: 'pkg',
|
|
50
|
+
message: 'Reading config from "pkg" field. Migrate to "hakobu" field for future compatibility.',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch { /* invalid package.json — analyzer will handle this */ }
|
|
56
|
+
}
|
|
57
|
+
// ── Handle legacy --config / -c flag ──
|
|
58
|
+
if (args.config) {
|
|
59
|
+
warnings.push({
|
|
60
|
+
type: 'deprecated',
|
|
61
|
+
option: '--config',
|
|
62
|
+
message: '--config is deprecated. Put config in the "hakobu" field of package.json instead.',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// ── Reject unsupported legacy CLI flags ──
|
|
66
|
+
checkUnsupportedCliFlag(args, 'no-bytecode', warnings);
|
|
67
|
+
checkUnsupportedCliFlag(args, 'public', warnings);
|
|
68
|
+
checkUnsupportedCliFlag(args, 'public-packages', warnings);
|
|
69
|
+
checkUnsupportedCliFlag(args, 'sea', warnings);
|
|
70
|
+
// options is now supported — V8 flags baking (handled in normalization below)
|
|
71
|
+
checkUnsupportedCliFlag(args, 'no-native-build', warnings);
|
|
72
|
+
checkUnsupportedCliFlag(args, 'no-dict', warnings);
|
|
73
|
+
// build is now supported — force local base binary build
|
|
74
|
+
// ── Handle legacy --out-path / --outdir ──
|
|
75
|
+
let legacyOutputPath;
|
|
76
|
+
const outPathValue = args['out-path'] || args.outdir || args['out-dir'];
|
|
77
|
+
if (outPathValue) {
|
|
78
|
+
warnings.push({
|
|
79
|
+
type: 'migrated',
|
|
80
|
+
option: '--out-path',
|
|
81
|
+
message: '--out-path is accepted. Use --output with a full path in new projects.',
|
|
82
|
+
});
|
|
83
|
+
legacyOutputPath = String(outPathValue);
|
|
84
|
+
}
|
|
85
|
+
// ── Handle legacy --targets (comma-separated, plural) ──
|
|
86
|
+
let legacyTarget;
|
|
87
|
+
if (args.targets) {
|
|
88
|
+
const targetList = String(args.targets).split(',').filter(Boolean);
|
|
89
|
+
if (targetList.length > 1) {
|
|
90
|
+
warnings.push({
|
|
91
|
+
type: 'deprecated',
|
|
92
|
+
option: '--targets',
|
|
93
|
+
message: 'Multi-target builds are not supported. Hakobu builds one target at a time. Using the first target.',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
if (targetList.length > 0) {
|
|
97
|
+
legacyTarget = targetList[0];
|
|
98
|
+
warnings.push({
|
|
99
|
+
type: 'migrated',
|
|
100
|
+
option: '--targets',
|
|
101
|
+
message: '--targets is accepted. Use --target (singular) in new projects.',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// ── Normalize legacy pkg config ──
|
|
106
|
+
const fromLegacy = legacyConfig ? normalizeLegacy(legacyConfig, warnings) : {};
|
|
107
|
+
// ── Normalize modern hakobu config ──
|
|
108
|
+
const fromModern = hakobuConfig || {};
|
|
109
|
+
// ── Merge: CLI > modern config > legacy config ──
|
|
110
|
+
// CLI flags take highest priority, then modern "hakobu" field, then legacy "pkg" field.
|
|
111
|
+
const source = hakobuConfig ? fromModern : fromLegacy;
|
|
112
|
+
const entry = args.entry || source.entry;
|
|
113
|
+
const target = args.target || legacyTarget || source.target;
|
|
114
|
+
const output = resolveOutput(args.output, legacyOutputPath, source.output);
|
|
115
|
+
const assets = source.assets;
|
|
116
|
+
const externals = source.externals;
|
|
117
|
+
// Bundle mode
|
|
118
|
+
let bundle;
|
|
119
|
+
if (args.bundle === true || args.bundle === '') {
|
|
120
|
+
bundle = true;
|
|
121
|
+
}
|
|
122
|
+
else if (typeof args.bundle === 'string') {
|
|
123
|
+
bundle = args.bundle;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
bundle = source.bundle;
|
|
127
|
+
}
|
|
128
|
+
let bundleExternal;
|
|
129
|
+
if (args.external) {
|
|
130
|
+
bundleExternal = Array.isArray(args.external) ? args.external : [String(args.external)];
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
bundleExternal = source.bundleExternal;
|
|
134
|
+
}
|
|
135
|
+
// Bytecode mode — CLI --bytecode overrides config only when explicitly true
|
|
136
|
+
const bytecode = args.bytecode === true ? true : (source.bytecode ?? false);
|
|
137
|
+
// Compression — CLI --compress overrides config
|
|
138
|
+
let compress;
|
|
139
|
+
if (args.compress) {
|
|
140
|
+
const algo = String(args.compress).toLowerCase();
|
|
141
|
+
if (algo === 'brotli' || algo === 'br') {
|
|
142
|
+
compress = 'brotli';
|
|
143
|
+
}
|
|
144
|
+
else if (algo === 'gzip' || algo === 'gz') {
|
|
145
|
+
compress = 'gzip';
|
|
146
|
+
}
|
|
147
|
+
else if (algo !== 'none') {
|
|
148
|
+
warnings.push({
|
|
149
|
+
type: 'unsupported',
|
|
150
|
+
option: '--compress',
|
|
151
|
+
message: `--compress "${args.compress}" is not supported. Use Brotli or GZip (or omit for no compression).`,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
compress = hakobuConfig?.compress;
|
|
157
|
+
}
|
|
158
|
+
// V8 baked options — CLI --options overrides config
|
|
159
|
+
let v8Options;
|
|
160
|
+
if (args.options) {
|
|
161
|
+
v8Options = String(args.options)
|
|
162
|
+
.split(',')
|
|
163
|
+
.filter(Boolean)
|
|
164
|
+
.map(flag => flag.startsWith('--') ? flag : `--${flag}`);
|
|
165
|
+
}
|
|
166
|
+
else if (hakobuConfig?.options) {
|
|
167
|
+
v8Options = hakobuConfig.options.map((flag) => flag.startsWith('--') ? flag : `--${flag}`);
|
|
168
|
+
}
|
|
169
|
+
// Metadata — from "hakobu.metadata" in package.json
|
|
170
|
+
const metadata = hakobuConfig?.metadata;
|
|
171
|
+
return {
|
|
172
|
+
options: {
|
|
173
|
+
projectRoot,
|
|
174
|
+
entry,
|
|
175
|
+
target,
|
|
176
|
+
output,
|
|
177
|
+
assets,
|
|
178
|
+
externals,
|
|
179
|
+
bundle,
|
|
180
|
+
bundleExternal,
|
|
181
|
+
bytecode: bytecode || undefined,
|
|
182
|
+
metadata,
|
|
183
|
+
appBundle: hakobuConfig?.appBundle,
|
|
184
|
+
macos: hakobuConfig?.macos,
|
|
185
|
+
appDir: hakobuConfig?.appDir,
|
|
186
|
+
appImage: hakobuConfig?.appImage,
|
|
187
|
+
linux: hakobuConfig?.linux,
|
|
188
|
+
compress,
|
|
189
|
+
options: v8Options,
|
|
190
|
+
forceBuild: args.build === true ? true : undefined,
|
|
191
|
+
},
|
|
192
|
+
warnings,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
exports.normalizeConfig = normalizeConfig;
|
|
196
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
197
|
+
// Legacy normalization
|
|
198
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
199
|
+
function normalizeLegacy(legacy, warnings) {
|
|
200
|
+
const result = {};
|
|
201
|
+
// pkg.scripts → mapped to assets (they were extra files to include)
|
|
202
|
+
if (legacy.scripts && legacy.scripts.length > 0) {
|
|
203
|
+
warnings.push({
|
|
204
|
+
type: 'migrated',
|
|
205
|
+
option: 'pkg.scripts',
|
|
206
|
+
message: '"pkg.scripts" mapped to "hakobu.assets". In Hakobu, use "assets" for extra files to include.',
|
|
207
|
+
});
|
|
208
|
+
result.assets = [...(legacy.assets || []), ...legacy.scripts];
|
|
209
|
+
}
|
|
210
|
+
else if (legacy.assets && legacy.assets.length > 0) {
|
|
211
|
+
result.assets = legacy.assets;
|
|
212
|
+
}
|
|
213
|
+
// pkg.targets → take the first one
|
|
214
|
+
if (legacy.targets && legacy.targets.length > 0) {
|
|
215
|
+
if (legacy.targets.length > 1) {
|
|
216
|
+
warnings.push({
|
|
217
|
+
type: 'deprecated',
|
|
218
|
+
option: 'pkg.targets',
|
|
219
|
+
message: 'Multi-target "pkg.targets" not supported. Hakobu builds one target at a time. Using the first.',
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
result.target = legacy.targets[0];
|
|
223
|
+
}
|
|
224
|
+
// pkg.outputPath → output
|
|
225
|
+
if (legacy.outputPath) {
|
|
226
|
+
result.output = legacy.outputPath;
|
|
227
|
+
}
|
|
228
|
+
// Reject unsupported legacy config fields
|
|
229
|
+
if (legacy.patches) {
|
|
230
|
+
warnings.push({
|
|
231
|
+
type: 'unsupported',
|
|
232
|
+
option: 'pkg.patches',
|
|
233
|
+
message: '"pkg.patches" is not supported. Hakobu does not support source patching during packaging.',
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (legacy.dictionary) {
|
|
237
|
+
warnings.push({
|
|
238
|
+
type: 'unsupported',
|
|
239
|
+
option: 'pkg.dictionary',
|
|
240
|
+
message: '"pkg.dictionary" is not supported. Hakobu resolves dependencies from the project directly.',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
if (legacy.deployFiles) {
|
|
244
|
+
warnings.push({
|
|
245
|
+
type: 'unsupported',
|
|
246
|
+
option: 'pkg.deployFiles',
|
|
247
|
+
message: '"pkg.deployFiles" is not supported. Use "hakobu.assets" for extra files, or "hakobu.externals" for external binaries.',
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
if (legacy.ignore) {
|
|
251
|
+
warnings.push({
|
|
252
|
+
type: 'unsupported',
|
|
253
|
+
option: 'pkg.ignore',
|
|
254
|
+
message: '"pkg.ignore" is not supported. Hakobu includes only files reachable from the entry point.',
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
260
|
+
// Helpers
|
|
261
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
262
|
+
function resolveOutput(cliOutput, legacyOutputPath, configOutput) {
|
|
263
|
+
if (cliOutput)
|
|
264
|
+
return cliOutput;
|
|
265
|
+
if (configOutput)
|
|
266
|
+
return configOutput;
|
|
267
|
+
if (legacyOutputPath)
|
|
268
|
+
return legacyOutputPath;
|
|
269
|
+
return undefined;
|
|
270
|
+
}
|
|
271
|
+
function checkUnsupportedCliFlag(args, flag, warnings) {
|
|
272
|
+
if (args[flag] !== undefined && args[flag] !== false) {
|
|
273
|
+
const messages = {
|
|
274
|
+
'no-bytecode': '--no-bytecode is not needed. Hakobu defaults to source-only mode. Use --bytecode to opt in to bytecode compilation.',
|
|
275
|
+
// compress is now supported — handled in normalization above
|
|
276
|
+
'public': '--public is not supported. Hakobu always includes source.',
|
|
277
|
+
'public-packages': '--public-packages is not supported. Hakobu always includes source.',
|
|
278
|
+
'sea': '--sea is not supported. Hakobu uses its own snapshot format, not Node SEA.',
|
|
279
|
+
// options is now supported — handled in normalization above
|
|
280
|
+
'no-native-build': '--no-native-build is not needed. Hakobu does not prebuild native addons by default.',
|
|
281
|
+
'no-dict': '--no-dict is not supported. Hakobu does not use dictionaries.',
|
|
282
|
+
// build is now supported — handled in normalization
|
|
283
|
+
};
|
|
284
|
+
warnings.push({
|
|
285
|
+
type: 'unsupported',
|
|
286
|
+
option: `--${flag}`,
|
|
287
|
+
message: messages[flag] || `--${flag} is not supported.`,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=config.js.map
|