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
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)
|
|
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
|
|
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.
|
|
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": "^
|
|
32
|
-
"@fluixi/cli": "0.1.0-alpha.
|
|
33
|
-
"@fluixi/compiler": "1.0.0-alpha.
|
|
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": {
|