create-fluixi 0.1.0-alpha.14 → 0.1.0-alpha.15

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Fluixi
3
+ Copyright (c) 2026 Ibrahima Touré
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.js CHANGED
@@ -35,6 +35,11 @@ var INTRINSICS = {
35
35
  // An environment variable, public or server-only; the browser build refuses a secret.
36
36
  $env: { export: "env", module: "@fluixi/start/env", returns: "plain" }
37
37
  };
38
+ var TAG_INTRINSICS = {
39
+ $html: { export: "html", module: "@fluixi/core" },
40
+ $svg: { export: "svg", module: "@fluixi/core" },
41
+ $css: { export: "css", module: "@fluixi/core" }
42
+ };
38
43
  var INTRINSIC_CALL = new RegExp(`\\$(?:${Object.keys(INTRINSICS).map((n) => n.slice(1)).join("|")})\\s*\\(`);
39
44
 
40
45
  // src/index.ts
@@ -616,13 +621,13 @@ var UI_DEPS = {
616
621
  var UI_DEV_DEPS = { "@fluixi-ui/resolver": "alpha" };
617
622
  var INTRINSICS_DTS = intrinsicsDts();
618
623
  function intrinsicsDts() {
619
- const reactive = Object.entries(INTRINSICS).filter(([, i]) => /^@fluixi\/(reactive|core)\//.test(i.module));
624
+ const reactive = Object.entries({ ...INTRINSICS, ...TAG_INTRINSICS }).filter(([, i]) => /^@fluixi\/(reactive|core)(\/|$)/.test(i.module));
620
625
  const alias = (module) => `__${module.slice(1).replace(/[/.-]/g, "_")}`;
621
626
  const modules = [...new Set(reactive.map(([, i]) => i.module))].sort();
622
627
  return [
623
628
  "// GENERATED by @fluixi/compiler, do not edit.",
624
629
  "//",
625
- "// The reactive and storage intrinsics. They need no import. This file is rewritten on the first",
630
+ "// The reactive, storage and template intrinsics. They need no import. This file is rewritten on the first",
626
631
  "// `fluixi dev`, which adds the components the resolver supplies without an import.",
627
632
  ...modules.map((m) => `import * as ${alias(m)} from '${m}';`),
628
633
  "",
@@ -637,6 +642,21 @@ var LAYERS_CSS = `/* Cascade-layer order. Imported before any component CSS, bec
637
642
  Add this app's own layers only if you want them to rank BELOW the component styles. */
638
643
  @layer app-reset, flx.reset, flx.base, flx.tokens, flx.components, flx.skin;
639
644
  `;
645
+ var USAGE = `Usage: create-fluixi [dir] [options]
646
+
647
+ Scaffold a Fluixi app in dir. What is not given is asked for.
648
+
649
+ --ssr | --spa server-rendered with @fluixi/start, or client-only with vite
650
+ --jsx | --html template syntax
651
+ --ui | --no-ui @fluixi-ui components
652
+ --fluixi-css | --tailwind | --no-css
653
+ --auth=oauth2|better-auth SSR only; --no-auth for none
654
+ --provider=<name> with --auth=oauth2: ${PROVIDERS.join(", ")}
655
+ --tokens=browser|server with --auth=oauth2: where the tokens live
656
+ -h, --help this help
657
+ `;
658
+ var FLAGS = /* @__PURE__ */ new Set(["--ssr", "--spa", "--jsx", "--html", "--ui", "--no-ui", "--tailwind", "--fluixi-css", "--no-css", "--no-auth", "--help", "-h"]);
659
+ var VALUED = ["auth", "provider", "tokens"];
640
660
  var option = (args, name) => {
641
661
  const i = args.indexOf(`--${name}`);
642
662
  if (i !== -1 && args[i + 1] && !args[i + 1].startsWith("-")) return args[i + 1];
@@ -719,6 +739,10 @@ function importStyles(target, mode, ui, css) {
719
739
  }
720
740
  async function main() {
721
741
  const args = argv.slice(2);
742
+ if (args.includes("--help") || args.includes("-h")) {
743
+ output2.write(USAGE);
744
+ exit2(0);
745
+ }
722
746
  let dir = args.find((a) => !a.startsWith("-"));
723
747
  let mode = args.includes("--spa") ? "spa" : args.includes("--ssr") ? "ssr" : void 0;
724
748
  let format = args.includes("--html") ? "html" : args.includes("--jsx") ? "jsx" : void 0;
@@ -732,6 +756,8 @@ async function main() {
732
756
  `);
733
757
  exit2(1);
734
758
  };
759
+ const unknown = args.find((a) => a.startsWith("-") && !FLAGS.has(a) && !VALUED.some((n) => a === `--${n}` || a.startsWith(`--${n}=`)));
760
+ if (unknown) refuse(`unknown option ${unknown}: create-fluixi --help lists them`);
735
761
  if (auth && !["none", "oauth2", "better-auth"].includes(auth)) refuse(`--auth is oauth2, better-auth or none`);
736
762
  if (provider && !PROVIDERS.includes(provider)) refuse(`--provider is one of ${PROVIDERS.join(", ")}`);
737
763
  if (tokens && tokens !== "browser" && tokens !== "server") refuse(`--tokens is browser or server`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fluixi",
3
- "version": "0.1.0-alpha.14",
3
+ "version": "0.1.0-alpha.15",
4
4
  "license": "MIT",
5
5
  "author": "Ibrahima Touré",
6
6
  "description": "Scaffold a new Fluixi app — `npm create fluixi <dir>`.",
@@ -28,9 +28,9 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "esbuild": "^0.24.0",
31
- "vitest": "^1.6.1",
32
- "@fluixi/cli": "0.1.0-alpha.84",
33
- "@fluixi/compiler": "1.0.0-alpha.93"
31
+ "vitest": "^5.0.3",
32
+ "@fluixi/cli": "0.1.0-alpha.86",
33
+ "@fluixi/compiler": "1.0.0-alpha.95"
34
34
  },
35
35
  "nx": {
36
36
  "targets": {
@@ -17,7 +17,7 @@
17
17
  "devDependencies": {
18
18
  "@fluixi/ts-plugin": "alpha",
19
19
  "@fluixi/vite-plugin": "alpha",
20
- "typescript": "^5.9.0",
21
- "vite": "^5.0.0"
20
+ "typescript": "^7.0.2",
21
+ "vite": "^8.3.2"
22
22
  }
23
23
  }
@@ -16,7 +16,7 @@
16
16
  "devDependencies": {
17
17
  "@fluixi/ts-plugin": "alpha",
18
18
  "@fluixi/vite-plugin": "alpha",
19
- "typescript": "^5.9.0",
20
- "vite": "^5.0.0"
19
+ "typescript": "^7.0.2",
20
+ "vite": "^8.3.2"
21
21
  }
22
22
  }
@@ -20,7 +20,7 @@
20
20
  "devDependencies": {
21
21
  "@fluixi/ts-plugin": "alpha",
22
22
  "@types/node": "^20.0.0",
23
- "typescript": "^5.9.0",
24
- "vite": "^5.0.0"
23
+ "typescript": "^7.0.2",
24
+ "vite": "^8.3.2"
25
25
  }
26
26
  }
@@ -19,7 +19,7 @@
19
19
  "devDependencies": {
20
20
  "@fluixi/ts-plugin": "alpha",
21
21
  "@types/node": "^20.0.0",
22
- "typescript": "^5.9.0",
23
- "vite": "^5.0.0"
22
+ "typescript": "^7.0.2",
23
+ "vite": "^8.3.2"
24
24
  }
25
25
  }