@xnoxs/flux-lang 3.4.3 → 3.4.4

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/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [3.4.4] — 2026-06-26
11
+
12
+ ### Added
13
+ - **`flux upgrade`** — cek semua dependensi di `flux.json` dan update ke versi terbaru dari npm
14
+ - `flux upgrade` — update langsung, tulis ke `flux.json`
15
+ - `flux upgrade --check` — dry-run, hanya tampilkan update yang tersedia tanpa mengubah file
16
+ - Tampilkan `↑ nama@lama → baru` untuk deps yang bisa di-upgrade, `✓ nama@ver — up to date` untuk yang sudah terbaru
17
+ - Tandai `(dev)` untuk devDependencies
18
+ - `flux upgrade` dan `flux upgrade --check` ditambahkan ke help text CLI
19
+ - Semua perintah package manager (`add/remove/install/upgrade/search/info/list`) sekarang tampil di `flux help`
20
+
21
+ ---
22
+
10
23
  ## [3.4.3] — 2026-06-26
11
24
 
12
25
  ### Fixed
package/dist/flux-cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /*!
3
- * flux-lang v3.4.3
3
+ * flux-lang v3.4.4
4
4
  * Flux — A modern language that transpiles to JavaScript. Python-clean syntax, TypeScript-level safety, Rust-inspired pattern matching.
5
5
  * (c) 2026 Flux Lang Contributors
6
6
  * Released under the MIT License
@@ -7216,7 +7216,7 @@ var require_package = __commonJS({
7216
7216
  "package.json"(exports2, module2) {
7217
7217
  module2.exports = {
7218
7218
  name: "@xnoxs/flux-lang",
7219
- version: "3.4.3",
7219
+ version: "3.4.4",
7220
7220
  description: "Flux \u2014 A modern language that transpiles to JavaScript. Python-clean syntax, TypeScript-level safety, Rust-inspired pattern matching.",
7221
7221
  main: "dist/flux.cjs.js",
7222
7222
  module: "dist/flux.esm.js",
@@ -8836,6 +8836,80 @@ var require_pkg = __commonJS({
8836
8836
  console.log();
8837
8837
  }
8838
8838
  module2.exports.cmdPublish = cmdPublish2;
8839
+ async function cmdUpgrade(opts) {
8840
+ const check = opts && opts.check || false;
8841
+ const cwd = process.cwd();
8842
+ const pkg = readPackage(cwd);
8843
+ if (!pkg) {
8844
+ err("No flux.json found. Run: flux init");
8845
+ return;
8846
+ }
8847
+ const allDeps = Object.assign({}, pkg.dependencies || {}, pkg.devDependencies || {});
8848
+ const names = Object.keys(allDeps);
8849
+ if (names.length === 0) {
8850
+ info("No dependencies in flux.json");
8851
+ return;
8852
+ }
8853
+ console.log();
8854
+ console.log(clr2(C2.cyan, " Checking " + names.length + " package(s) for updates...\n"));
8855
+ let updated = 0;
8856
+ let upToDate = 0;
8857
+ let failed = 0;
8858
+ for (const name of names) {
8859
+ const current = allDeps[name].replace(/^[\^~>=<\s]+/, "");
8860
+ try {
8861
+ const data = await fetchJson(REGISTRY_URL + "/" + name);
8862
+ const latest = data["dist-tags"] && data["dist-tags"].latest;
8863
+ if (!latest) {
8864
+ err(name + " \u2014 could not resolve latest");
8865
+ failed++;
8866
+ continue;
8867
+ }
8868
+ const isDev = !!(pkg.devDependencies && pkg.devDependencies[name]);
8869
+ const tag = isDev ? clr2(C2.blue, " (dev)") : "";
8870
+ if (current === latest) {
8871
+ console.log(" " + clr2(C2.gray, "\u2713") + " " + clr2(C2.bold, name) + clr2(C2.gray, "@" + current + " \u2014 up to date") + tag);
8872
+ upToDate++;
8873
+ } else {
8874
+ console.log(" " + clr2(C2.yellow, "\u2191") + " " + clr2(C2.bold, name) + clr2(C2.gray, "@" + current) + " \u2192 " + clr2(C2.green, latest) + tag);
8875
+ if (!check) {
8876
+ if (isDev) {
8877
+ if (!pkg.devDependencies) pkg.devDependencies = {};
8878
+ pkg.devDependencies[name] = "^" + latest;
8879
+ } else {
8880
+ if (!pkg.dependencies) pkg.dependencies = {};
8881
+ pkg.dependencies[name] = "^" + latest;
8882
+ }
8883
+ }
8884
+ updated++;
8885
+ }
8886
+ } catch (e) {
8887
+ err(name + " \u2014 " + e.message);
8888
+ failed++;
8889
+ }
8890
+ }
8891
+ console.log();
8892
+ if (check) {
8893
+ console.log(clr2(C2.cyan, " Check mode: no changes written."));
8894
+ if (updated > 0) {
8895
+ console.log(clr2(C2.yellow, " " + updated + " update(s) available. Run: flux upgrade"));
8896
+ } else {
8897
+ console.log(clr2(C2.green, " All packages are up to date."));
8898
+ }
8899
+ } else {
8900
+ if (updated > 0) {
8901
+ const pkgPath = Path.join(cwd, "flux.json");
8902
+ Fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n", "utf8");
8903
+ ok(updated + " package(s) updated in flux.json");
8904
+ info("Run: flux install to apply changes");
8905
+ } else {
8906
+ console.log(clr2(C2.green, " \u2713 All packages are already up to date."));
8907
+ }
8908
+ if (failed > 0) info(failed + " package(s) could not be checked");
8909
+ }
8910
+ console.log();
8911
+ }
8912
+ module2.exports.cmdUpgrade = cmdUpgrade;
8839
8913
  }
8840
8914
  });
8841
8915
 
@@ -8914,6 +8988,13 @@ function showHelp() {
8914
8988
  ["fmt <file.flux>", "Format source code in-place"],
8915
8989
  ["test [dir]", "Discover and run *.test.flux files"],
8916
8990
  ["publish [--patch|minor|major]", "Bump version, update CHANGELOG, tag & release"],
8991
+ ["add <package>[@ver] [--dev]", "Add a dependency to flux.json"],
8992
+ ["remove <package>", "Remove a dependency from flux.json"],
8993
+ ["install", "Install all dependencies from flux.json"],
8994
+ ["upgrade [--check]", "Upgrade all dependencies to latest versions"],
8995
+ ["search <query>", "Search the npm registry for packages"],
8996
+ ["info <package>", "Show package details from npm registry"],
8997
+ ["list", "List installed dependencies from flux.json"],
8917
8998
  ["tokens <file.flux>", "Show lexer token list"],
8918
8999
  ["ast <file.flux>", "Show Abstract Syntax Tree (JSON)"],
8919
9000
  ["repl", "Interactive REPL mode"],
@@ -10326,6 +10407,12 @@ function main() {
10326
10407
  cmdList({});
10327
10408
  break;
10328
10409
  }
10410
+ case "upgrade": {
10411
+ const { cmdUpgrade } = require_pkg();
10412
+ const isCheck = process.argv.includes("--check");
10413
+ cmdUpgrade({ check: isCheck });
10414
+ break;
10415
+ }
10329
10416
  case "repl":
10330
10417
  case void 0:
10331
10418
  if (!cmd) {
package/dist/flux.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * flux-lang v3.4.3
2
+ * flux-lang v3.4.4
3
3
  * Flux — A modern language that transpiles to JavaScript. Python-clean syntax, TypeScript-level safety, Rust-inspired pattern matching.
4
4
  * (c) 2026 Flux Lang Contributors
5
5
  * Released under the MIT License
package/dist/flux.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * flux-lang v3.4.3
2
+ * flux-lang v3.4.4
3
3
  * Flux — A modern language that transpiles to JavaScript. Python-clean syntax, TypeScript-level safety, Rust-inspired pattern matching.
4
4
  * (c) 2026 Flux Lang Contributors
5
5
  * Released under the MIT License
package/dist/flux.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * flux-lang v3.4.3
2
+ * flux-lang v3.4.4
3
3
  * Flux — A modern language that transpiles to JavaScript. Python-clean syntax, TypeScript-level safety, Rust-inspired pattern matching.
4
4
  * (c) 2026 Flux Lang Contributors
5
5
  * Released under the MIT License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xnoxs/flux-lang",
3
- "version": "3.4.3",
3
+ "version": "3.4.4",
4
4
  "description": "Flux — A modern language that transpiles to JavaScript. Python-clean syntax, TypeScript-level safety, Rust-inspired pattern matching.",
5
5
  "main": "dist/flux.cjs.js",
6
6
  "module": "dist/flux.esm.js",
package/src/self/pkg.js CHANGED
@@ -283,4 +283,79 @@ function cmdPublish(opts) {
283
283
  info("Run: flux publish --registry <url> for a custom registry");
284
284
  console.log();
285
285
  }
286
- module.exports.cmdPublish = cmdPublish;
286
+ module.exports.cmdPublish = cmdPublish;
287
+
288
+ // ── flux upgrade [--check] ─────────────────────────────────────────────────
289
+ // Checks all dependencies in flux.json for newer versions and updates them.
290
+ // --check : dry-run, only show what would change without writing
291
+ async function cmdUpgrade(opts) {
292
+ const check = (opts && opts.check) || false;
293
+ const cwd = process.cwd();
294
+ const pkg = readPackage(cwd);
295
+ if (!pkg) { err('No flux.json found. Run: flux init'); return; }
296
+
297
+ const allDeps = Object.assign({}, pkg.dependencies || {}, pkg.devDependencies || {});
298
+ const names = Object.keys(allDeps);
299
+ if (names.length === 0) { info('No dependencies in flux.json'); return; }
300
+
301
+ console.log();
302
+ console.log(clr(C.cyan, ' Checking ' + names.length + ' package(s) for updates...\n'));
303
+
304
+ let updated = 0;
305
+ let upToDate = 0;
306
+ let failed = 0;
307
+
308
+ for (const name of names) {
309
+ const current = allDeps[name].replace(/^[\^~>=<\s]+/, '');
310
+ try {
311
+ const data = await fetchJson(REGISTRY_URL + '/' + name);
312
+ const latest = data['dist-tags'] && data['dist-tags'].latest;
313
+ if (!latest) { err(name + ' — could not resolve latest'); failed++; continue; }
314
+
315
+ const isDev = !!(pkg.devDependencies && pkg.devDependencies[name]);
316
+ const tag = isDev ? clr(C.blue, ' (dev)') : '';
317
+
318
+ if (current === latest) {
319
+ console.log(' ' + clr(C.gray, '✓') + ' ' + clr(C.bold, name) + clr(C.gray, '@' + current + ' — up to date') + tag);
320
+ upToDate++;
321
+ } else {
322
+ console.log(' ' + clr(C.yellow, '↑') + ' ' + clr(C.bold, name) + clr(C.gray, '@' + current) + ' → ' + clr(C.green, latest) + tag);
323
+ if (!check) {
324
+ if (isDev) {
325
+ if (!pkg.devDependencies) pkg.devDependencies = {};
326
+ pkg.devDependencies[name] = '^' + latest;
327
+ } else {
328
+ if (!pkg.dependencies) pkg.dependencies = {};
329
+ pkg.dependencies[name] = '^' + latest;
330
+ }
331
+ }
332
+ updated++;
333
+ }
334
+ } catch (e) {
335
+ err(name + ' — ' + e.message);
336
+ failed++;
337
+ }
338
+ }
339
+
340
+ console.log();
341
+ if (check) {
342
+ console.log(clr(C.cyan, ' Check mode: no changes written.'));
343
+ if (updated > 0) {
344
+ console.log(clr(C.yellow, ' ' + updated + ' update(s) available. Run: flux upgrade'));
345
+ } else {
346
+ console.log(clr(C.green, ' All packages are up to date.'));
347
+ }
348
+ } else {
349
+ if (updated > 0) {
350
+ const pkgPath = Path.join(cwd, 'flux.json');
351
+ Fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n', 'utf8');
352
+ ok(updated + ' package(s) updated in flux.json');
353
+ info('Run: flux install to apply changes');
354
+ } else {
355
+ console.log(clr(C.green, ' ✓ All packages are already up to date.'));
356
+ }
357
+ if (failed > 0) info(failed + ' package(s) could not be checked');
358
+ }
359
+ console.log();
360
+ }
361
+ module.exports.cmdUpgrade = cmdUpgrade;