create-flow-os 0.0.1-dev.1771670224 → 0.0.1-dev.1771691512

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 CHANGED
@@ -910,6 +910,7 @@ async function runDev(cwd) {
910
910
  });
911
911
  await devProc.exited;
912
912
  }
913
+ var PROFILE_FLAGS = ["client", "full", "server"];
913
914
  function optsForProfile(config, profileId) {
914
915
  return Object.entries(config.packages).filter(([, e2]) => {
915
916
  const inc = e2.includeIn ?? [];
@@ -920,14 +921,36 @@ function optsForProfile(config, profileId) {
920
921
  return false;
921
922
  });
922
923
  }
924
+ function optionalPackageIdsForProfile(config, profileId) {
925
+ const opts = optsForProfile(config, profileId);
926
+ const optIds = opts.map(([id]) => id);
927
+ const defaultIds = config.profiles[profileId]?.defaultPackages ?? [];
928
+ return optIds.filter((id) => !defaultIds.includes(id));
929
+ }
930
+ function profileFromArgv(argv2) {
931
+ for (const arg of argv2) {
932
+ if (!arg.startsWith("--"))
933
+ continue;
934
+ const key = arg.slice(2);
935
+ if (PROFILE_FLAGS.includes(key))
936
+ return key;
937
+ }
938
+ return null;
939
+ }
940
+ function addOnsFromArgv(argv2, optionalIds) {
941
+ return optionalIds.filter((id) => argv2.includes("--" + id));
942
+ }
923
943
  async function main() {
924
944
  const devBadge = useDevTag ? c2.dim(" \xB7 dev") : "";
925
- const CONTENT_W = 42;
926
- const BORDER_W = 46;
945
+ const CONTENT_W = 46;
946
+ const BORDER_W = 50;
927
947
  const introLine = (content) => {
928
948
  const plain = stripAnsi(content);
929
- const pad = Math.max(0, CONTENT_W - plain.length);
930
- return c2.dim(" \u2502 ") + content + " ".repeat(pad) + c2.dim(" \u2502");
949
+ const len = plain.length;
950
+ const pad = Math.max(0, CONTENT_W - len);
951
+ const left = Math.floor(pad / 2);
952
+ const right = pad - left;
953
+ return c2.dim(" \u2502 ") + " ".repeat(left) + content + " ".repeat(right) + c2.dim(" \u2502");
931
954
  };
932
955
  const introBorder = (ch) => c2.dim(" " + (ch === "t" ? "\u256D" : "\u2570") + "\u2500".repeat(BORDER_W) + (ch === "t" ? "\u256E" : "\u256F"));
933
956
  const singleLine = "Create " + c2.bold(c2.cyan("Flow OS")) + devBadge + " application";
@@ -956,10 +979,17 @@ async function main() {
956
979
  }
957
980
  if (!name)
958
981
  name = "my-flow-app";
982
+ const profileFlag = profileFromArgv(argv);
983
+ const optsFull = optsForProfile(config, "full");
959
984
  let profileId;
960
985
  let selected = [];
961
- const optsFull = optsForProfile(config, "full");
962
- if (yes) {
986
+ if (profileFlag) {
987
+ profileId = profileFlag;
988
+ const defaultIds = config.profiles[profileId]?.defaultPackages ?? [];
989
+ const optionalIds = optionalPackageIdsForProfile(config, profileId);
990
+ const addOns = addOnsFromArgv(argv, optionalIds);
991
+ selected = [...defaultIds, ...addOns];
992
+ } else if (yes) {
963
993
  profileId = "full";
964
994
  selected = optsFull.map(([id]) => id);
965
995
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-flow-os",
3
- "version": "0.0.1-dev.1771670224",
3
+ "version": "0.0.1-dev.1771691512",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "create-flow-os": "bin/index.js"
@@ -4,9 +4,9 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "bun dev.ts",
8
- "build": "tsc -b && bun node_modules/@flow.os/client/build.ts",
9
- "preview": "bun node_modules/@flow.os/client/preview.ts",
7
+ "dev": "bun packages/client/start-dev.ts",
8
+ "build": "tsc -b && bun packages/client/build.ts",
9
+ "preview": "bun packages/client/preview.ts",
10
10
  "start": "bun node_modules/@flow.os/server/start.ts",
11
11
  "lint": "oxlint .",
12
12
  "fmt": "oxfmt",
@@ -4,9 +4,9 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "bun dev.ts",
8
- "build": "tsc -b && bun node_modules/@flow.os/client/build.ts",
9
- "preview": "bun node_modules/@flow.os/client/preview.ts",
7
+ "dev": "bun packages/client/start-dev.ts",
8
+ "build": "tsc -b && bun packages/client/build.ts",
9
+ "preview": "bun packages/client/preview.ts",
10
10
  "start": "bun node_modules/@flow.os/server/start.ts",
11
11
  "lint": "oxlint .",
12
12
  "fmt": "oxfmt",
@@ -4,9 +4,9 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "bun dev.ts",
8
- "build": "tsc -b && bun node_modules/@flow.os/client/build.ts",
9
- "preview": "bun node_modules/@flow.os/client/preview.ts",
7
+ "dev": "bun packages/client/start-dev.ts",
8
+ "build": "tsc -b && bun packages/client/build.ts",
9
+ "preview": "bun packages/client/preview.ts",
10
10
  "start": "bun node_modules/@flow.os/server/start.ts",
11
11
  "lint": "oxlint .",
12
12
  "fmt": "oxfmt",
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { pathToFileURL } from 'node:url';
3
- import { join } from 'node:path';
4
-
5
- await import(pathToFileURL(join(import.meta.dir, 'node_modules/@flow.os/client/start-dev.ts')).href);
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { pathToFileURL } from 'node:url';
3
- import { join } from 'node:path';
4
-
5
- await import(pathToFileURL(join(import.meta.dir, 'node_modules/@flow.os/client/start-dev.ts')).href);
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { pathToFileURL } from 'node:url';
3
- import { join } from 'node:path';
4
-
5
- await import(pathToFileURL(join(import.meta.dir, 'node_modules/@flow.os/client/start-dev.ts')).href);