create-flow-os 0.0.1-dev.1771781977 → 0.0.1-dev.1771782345
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/bin/index.js +15 -9
- package/package.json +1 -1
- package/profiles/client/package.json +0 -1
package/bin/index.js
CHANGED
|
@@ -925,7 +925,11 @@ async function runDev(cwd) {
|
|
|
925
925
|
});
|
|
926
926
|
await devProc.exited;
|
|
927
927
|
}
|
|
928
|
-
var
|
|
928
|
+
var PROFILE_LABELS = {
|
|
929
|
+
full: "Full stack (client + server)",
|
|
930
|
+
client: "Client only",
|
|
931
|
+
server: "Server only"
|
|
932
|
+
};
|
|
929
933
|
function optsForProfile(config, profileId) {
|
|
930
934
|
return Object.entries(config.packages).filter(([, e2]) => {
|
|
931
935
|
const inc = e2.includeIn ?? [];
|
|
@@ -942,12 +946,13 @@ function optionalPackageIdsForProfile(config, profileId) {
|
|
|
942
946
|
const defaultIds = config.profiles[profileId]?.defaultPackages ?? [];
|
|
943
947
|
return optIds.filter((id) => !defaultIds.includes(id));
|
|
944
948
|
}
|
|
945
|
-
function profileFromArgv(argv2) {
|
|
949
|
+
function profileFromArgv(argv2, profileIds) {
|
|
950
|
+
const set = new Set(profileIds);
|
|
946
951
|
for (const arg of argv2) {
|
|
947
952
|
if (!arg.startsWith("--"))
|
|
948
953
|
continue;
|
|
949
954
|
const key = arg.slice(2);
|
|
950
|
-
if (
|
|
955
|
+
if (set.has(key))
|
|
951
956
|
return key;
|
|
952
957
|
}
|
|
953
958
|
return null;
|
|
@@ -982,6 +987,7 @@ async function main() {
|
|
|
982
987
|
} catch {}
|
|
983
988
|
}
|
|
984
989
|
const config = await Bun.file(join2(DIR, "config.json")).json();
|
|
990
|
+
const profileIds = Object.keys(config.profiles);
|
|
985
991
|
const hasDeps = Object.values(config.packages).every((e2) => Array.isArray(e2.deps));
|
|
986
992
|
if (!hasDeps) {
|
|
987
993
|
he(c2.dim("Run ") + c2.brand("bun run gen") + c2.dim(" from create-flow first."));
|
|
@@ -1001,7 +1007,7 @@ async function main() {
|
|
|
1001
1007
|
}
|
|
1002
1008
|
if (!name)
|
|
1003
1009
|
name = "my-flow-app";
|
|
1004
|
-
const profileFlag = profileFromArgv(argv);
|
|
1010
|
+
const profileFlag = profileFromArgv(argv, profileIds);
|
|
1005
1011
|
const optsFull = optsForProfile(config, "full");
|
|
1006
1012
|
let profileId;
|
|
1007
1013
|
let selected = [];
|
|
@@ -1015,13 +1021,13 @@ async function main() {
|
|
|
1015
1021
|
profileId = "full";
|
|
1016
1022
|
selected = optsFull.map(([id]) => id);
|
|
1017
1023
|
} else {
|
|
1024
|
+
const options = profileIds.map((id) => ({
|
|
1025
|
+
value: id,
|
|
1026
|
+
label: `${ICON[id] ?? ""} ${PROFILE_LABELS[id] ?? id}`.trim() || id
|
|
1027
|
+
}));
|
|
1018
1028
|
const choice = await le({
|
|
1019
1029
|
message: c2.muted("Template"),
|
|
1020
|
-
options
|
|
1021
|
-
{ value: "full", label: `${ICON.full} Full stack ${c2.dim("(client + server)")}` },
|
|
1022
|
-
{ value: "client", label: `${ICON.client} Client only` },
|
|
1023
|
-
{ value: "server", label: `${ICON.server} Server only` }
|
|
1024
|
-
]
|
|
1030
|
+
options
|
|
1025
1031
|
});
|
|
1026
1032
|
if (lD(choice))
|
|
1027
1033
|
process.exit(0);
|
package/package.json
CHANGED