@xnoxs/flux-lang 3.4.7 → 3.4.8

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ⚡ Flux Lang v3.4.6
1
+ # ⚡ Flux Lang v3.4.7
2
2
 
3
3
  **Flux** is a modern programming language that transpiles to clean JavaScript — combining Python-style indentation, TypeScript-grade type safety, Rust-inspired pattern matching, and a rich standard library — all with **zero runtime overhead**.
4
4
 
package/dist/flux-cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /*!
3
- * flux-lang v3.4.7
3
+ * flux-lang v3.4.8
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
@@ -7219,7 +7219,7 @@ var require_package = __commonJS({
7219
7219
  "package.json"(exports2, module2) {
7220
7220
  module2.exports = {
7221
7221
  name: "@xnoxs/flux-lang",
7222
- version: "3.4.7",
7222
+ version: "3.4.8",
7223
7223
  description: "Flux \u2014 A modern language that transpiles to JavaScript. Python-clean syntax, TypeScript-level safety, Rust-inspired pattern matching.",
7224
7224
  main: "dist/flux.cjs.js",
7225
7225
  module: "dist/flux.esm.js",
@@ -9332,7 +9332,8 @@ ${projectName}/
9332
9332
  \u2502 \u2514\u2500\u2500 utils.flux # Utility functions
9333
9333
  \u251C\u2500\u2500 tests/
9334
9334
  \u2502 \u2514\u2500\u2500 main.test.flux # Test suite
9335
- \u251C\u2500\u2500 flux.json # Project config
9335
+ \u251C\u2500\u2500 flux_modules/ # Packages installed by \`flux install\` (gitignored)
9336
+ \u251C\u2500\u2500 flux.json # Project config & dependencies
9336
9337
  \u2514\u2500\u2500 README.md
9337
9338
  \`\`\`
9338
9339
 
@@ -9386,6 +9387,10 @@ ${projectName}/
9386
9387
  console.log(` ${clr(C.yellow, `cd ${projectName}`)}`);
9387
9388
  console.log(` ${clr(C.yellow, `flux run src/main.flux`)}`);
9388
9389
  console.log();
9390
+ console.log(clr(C.gray, ` Add packages (installed into flux_modules/):`));
9391
+ console.log(` ${clr(C.yellow, `flux add <package>`)}`);
9392
+ console.log(` ${clr(C.yellow, `flux install`)}`);
9393
+ console.log();
9389
9394
  console.log(clr(C.gray, ` Or run the test suite:`));
9390
9395
  console.log(` ${clr(C.yellow, `flux test tests/`)}`);
9391
9396
  console.log();
package/dist/flux.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * flux-lang v3.4.7
2
+ * flux-lang v3.4.8
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.7
2
+ * flux-lang v3.4.8
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.7
2
+ * flux-lang v3.4.8
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.7",
3
+ "version": "3.4.8",
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/cli.flux CHANGED
@@ -775,7 +775,8 @@ flux run src/main.flux
775
775
  │ └── utils.flux # Utility functions
776
776
  ├── tests/
777
777
  │ └── main.test.flux # Test suite
778
- ├── flux.json # Project config
778
+ ├── flux_modules/ # Packages installed by \`flux install\` (gitignored)
779
+ ├── flux.json # Project config & dependencies
779
780
  └── README.md
780
781
  \`\`\`
781
782
 
@@ -820,6 +821,10 @@ flux run src/main.flux
820
821
  console.log(" " + yellow("cd " + projectName))
821
822
  console.log(" " + yellow("flux run src/main.flux"))
822
823
  console.log()
824
+ console.log(gray(" Add packages (installed into flux_modules/):"))
825
+ console.log(" " + yellow("flux add <package>"))
826
+ console.log(" " + yellow("flux install"))
827
+ console.log()
823
828
  console.log(gray(" Or run the test suite:"))
824
829
  console.log(" " + yellow("flux test tests/"))
825
830
  console.log()
package/src/self/cli.js CHANGED
@@ -586,7 +586,7 @@ function cmdInit(name, opts) {
586
586
  const testFlux = "// Tests for {projectName}\n// Run: flux test tests/\n\n// ── Functions under test ──────────────────────────────────────\nfn add(a, b):\n return a + b\n\nfn mul(a, b):\n return a * b\n\nfn clamp(value, lo, hi):\n if value < lo: return lo\n if value > hi: return hi\n return value\n\nfn average(nums):\n if nums.length == 0: return 0\n return nums.reduce((s, x) -> s + x, 0) / nums.length\n\ntype Result = Ok(value) | Err(message)\n\nfn safeDivide(a, b):\n if b == 0: return Err(\"div by zero\")\n return Ok(a / b)\n\n// ── Test functions ────────────────────────────────────────────\nfn test_add():\n assert(add(1, 2) == 3, \"1+2=3\")\n assert(add(0, 0) == 0, \"0+0=0\")\n assert(add(-1, 1) == 0, \"-1+1=0\")\n\nfn test_mul():\n assert(mul(3, 4) == 12, \"3*4=12\")\n assert(mul(0, 5) == 0, \"0*5=0\")\n\nfn test_clamp():\n assert(clamp(5, 0, 10) == 5, \"within range\")\n assert(clamp(-1, 0, 10) == 0, \"below min\")\n assert(clamp(15, 0, 10) == 10, \"above max\")\n\nfn test_average():\n assert(average([2, 4, 6]) == 4, \"average of 2,4,6\")\n assert(average([]) == 0, \"empty list\")\n\nfn test_safe_divide():\n val ok = safeDivide(10, 2)\n match ok:\n when Ok(v): assert(v == 5, \"10/2=5\")\n when Err(e): assert(false, \"unexpected error\")\n val err = safeDivide(10, 0)\n match err:\n when Ok(v): assert(false, \"expected error\")\n when Err(e): assert(e == \"div by zero\", \"error message\")\n\nfn test_pipe_operator():\n val result = [1, 2, 3, 4, 5] |> filter(n -> n > 2) |> map(n -> n * 2)\n assert(result.length == 3, \"filter length\")\n assert(result[0] == 6, \"first element\")\n assert(result[2] == 10, \"last element\")";
587
587
  const fluxJson = { name: projectName, version: "1.0.0", description: (("A Flux Lang v" + VERSION) + " project"), author: "", license: "MIT", entry: "src/main.flux", outDir: "dist", sourcemap: false, typecheck: true, scripts: { start: "flux run src/main.flux", build: "flux bundle src/main.flux -o dist/bundle.js", dev: "flux watch src/main.flux", check: "flux check src/main.flux", test: "flux test tests/", fmt: "flux fmt src/", lint: "flux lint src/" }, dependencies: { }, devDependencies: { "@xnoxs/flux-lang": ("^" + VERSION) } };
588
588
  const gitignore = "node_modules/\ndist/\nflux_modules/\n*.js.map\n.DS_Store\n";
589
- const readme = "# {projectName}\n\nA project built with [Flux Lang](https://flux-lang.dev) v{VERSION} — the self-hosted compiler.\n\n## Quick Start\n\n```bash\nflux run src/main.flux\n```\n\n## Project Structure\n\n```\n{projectName}/\n├── src/\n│ ├── main.flux # Entry point\n│ └── utils.flux # Utility functions\n├── tests/\n│ └── main.test.flux # Test suite\n├── flux.json # Project config\n└── README.md\n```\n\n## Commands\n\n| Command | Description |\n|---|---|\n| `flux run src/main.flux` | Run the project |\n| `flux bundle src/main.flux -o dist/bundle.js` | Bundle to single file |\n| `flux watch src/main.flux` | Watch mode |\n| `flux check src/main.flux` | Type check + static analysis |\n| `flux test tests/` | Run all tests |\n| `flux fmt src/` | Format source code |\n| `flux lint src/` | Lint for issues |\n| `flux add <package>` | Add a dependency |";
589
+ const readme = "# {projectName}\n\nA project built with [Flux Lang](https://flux-lang.dev) v{VERSION} — the self-hosted compiler.\n\n## Quick Start\n\n```bash\nflux run src/main.flux\n```\n\n## Project Structure\n\n```\n{projectName}/\n├── src/\n│ ├── main.flux # Entry point\n│ └── utils.flux # Utility functions\n├── tests/\n│ └── main.test.flux # Test suite\n├── flux_modules/ # Packages installed by `flux install` (gitignored)\n├── flux.json # Project config & dependencies\n└── README.md\n```\n\n## Commands\n\n| Command | Description |\n|---|---|\n| `flux run src/main.flux` | Run the project |\n| `flux bundle src/main.flux -o dist/bundle.js` | Bundle to single file |\n| `flux watch src/main.flux` | Watch mode |\n| `flux check src/main.flux` | Type check + static analysis |\n| `flux test tests/` | Run all tests |\n| `flux fmt src/` | Format source code |\n| `flux lint src/` | Lint for issues |\n| `flux add <package>` | Add a dependency |";
590
590
  const allFiles = [(projectName + "/src/main.flux"), (projectName + "/src/utils.flux"), (projectName + "/tests/main.test.flux"), (projectName + "/flux.json"), (projectName + "/.gitignore"), (projectName + "/README.md")];
591
591
  Fs.writeFileSync(Path.join(dir, "src", "main.flux"), mainFlux, "utf8");
592
592
  Fs.writeFileSync(Path.join(dir, "src", "utils.flux"), utilsFlux, "utf8");
@@ -606,6 +606,10 @@ function cmdInit(name, opts) {
606
606
  console.log((" " + yellow(("cd " + projectName))));
607
607
  console.log((" " + yellow("flux run src/main.flux")));
608
608
  console.log();
609
+ console.log(gray(" Add packages (installed into flux_modules/):"));
610
+ console.log((" " + yellow("flux add <package>")));
611
+ console.log((" " + yellow("flux install")));
612
+ console.log();
609
613
  console.log(gray(" Or run the test suite:"));
610
614
  console.log((" " + yellow("flux test tests/")));
611
615
  console.log();