create-flow-os 0.0.1-dev.1771615498 → 0.0.1-dev.1771621483
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/index.ts
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { rm, stat } from "node:fs/promises";
|
|
8
|
-
import { join } from "node:path";
|
|
8
|
+
import { join, relative } from "node:path";
|
|
9
9
|
import * as p from "@clack/prompts";
|
|
10
10
|
import pc from "picocolors";
|
|
11
|
-
import { copyWithExclude, transformPackageJson } from "./utils.ts";
|
|
11
|
+
import { copyWithExclude, transformPackageJson, findPackageDir } from "./utils.ts";
|
|
12
12
|
|
|
13
13
|
const argv = process.argv.slice(2);
|
|
14
14
|
const noInstall = argv.includes("--no-install");
|
|
@@ -140,9 +140,34 @@ async function main() {
|
|
|
140
140
|
const finalPkg = (await Bun.file(pkgPath).json()) as { workspaces?: string[]; dependencies?: Record<string, string> };
|
|
141
141
|
delete finalPkg.workspaces;
|
|
142
142
|
if (finalPkg.dependencies) {
|
|
143
|
+
const isDevFromRepo =
|
|
144
|
+
useDevTag &&
|
|
145
|
+
(await findPackageDir(REPO_ROOT, "@flow-os/client").then((d) => !!d));
|
|
146
|
+
|
|
147
|
+
if (useDevTag && !isDevFromRepo) {
|
|
148
|
+
p.note(
|
|
149
|
+
"Per usare i package locali con --dev esegui dal repo Flow-framework oppure imposta FLOW_FRAMEWORK_ROOT al path del repo. Uso ^0.0.1 da npm.",
|
|
150
|
+
"Dev senza repo"
|
|
151
|
+
);
|
|
152
|
+
} else if (useDevTag && isDevFromRepo) {
|
|
153
|
+
p.note("Uso package locali da " + REPO_ROOT, "Dev da repo");
|
|
154
|
+
}
|
|
155
|
+
|
|
143
156
|
for (const k of Object.keys(finalPkg.dependencies)) {
|
|
144
157
|
if (finalPkg.dependencies[k] === "workspace:*") finalPkg.dependencies[k] = "^0.0.1";
|
|
145
|
-
if (useDevTag && (k === "@flow-os" || k.startsWith("@flow-os/")))
|
|
158
|
+
if (useDevTag && (k === "@flow-os" || k.startsWith("@flow-os/"))) {
|
|
159
|
+
if (isDevFromRepo) {
|
|
160
|
+
const pkgDir = await findPackageDir(REPO_ROOT, k);
|
|
161
|
+
if (pkgDir) {
|
|
162
|
+
const rel = relative(projectPath, pkgDir).replace(/\\/g, "/");
|
|
163
|
+
finalPkg.dependencies[k] = "file:" + (rel.startsWith("..") ? rel : "./" + rel);
|
|
164
|
+
} else {
|
|
165
|
+
finalPkg.dependencies[k] = "^0.0.1";
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
finalPkg.dependencies[k] = "^0.0.1";
|
|
169
|
+
}
|
|
170
|
+
}
|
|
146
171
|
}
|
|
147
172
|
delete finalPkg.dependencies["@flow-os"];
|
|
148
173
|
finalPkg.dependencies = Object.fromEntries(Object.entries(finalPkg.dependencies).filter(([key]) => key !== "@flow-os"));
|
package/package.json
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"start": "bun node_modules/@flow-os/server/start.ts",
|
|
11
11
|
"lint": "oxlint .",
|
|
12
12
|
"fmt": "oxfmt",
|
|
13
|
-
"fmt:check": "oxfmt --check"
|
|
13
|
+
"fmt:check": "oxfmt --check",
|
|
14
|
+
"gen": "bun run --cwd packages/create-flow gen",
|
|
15
|
+
"publish:dev": "bun run --cwd packages/create-flow publish:dev"
|
|
14
16
|
},
|
|
15
17
|
"dependencies": {
|
|
16
18
|
"@flow-os/client": "file:./packages/client",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"start": "bun node_modules/@flow-os/server/start.ts",
|
|
11
11
|
"lint": "oxlint .",
|
|
12
12
|
"fmt": "oxfmt",
|
|
13
|
-
"fmt:check": "oxfmt --check"
|
|
13
|
+
"fmt:check": "oxfmt --check",
|
|
14
|
+
"gen": "bun run --cwd packages/create-flow gen",
|
|
15
|
+
"publish:dev": "bun run --cwd packages/create-flow publish:dev"
|
|
14
16
|
},
|
|
15
17
|
"dependencies": {
|
|
16
18
|
"@flow-os/client": "file:./packages/client",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"start": "bun node_modules/@flow-os/server/start.ts",
|
|
11
11
|
"lint": "oxlint .",
|
|
12
12
|
"fmt": "oxfmt",
|
|
13
|
-
"fmt:check": "oxfmt --check"
|
|
13
|
+
"fmt:check": "oxfmt --check",
|
|
14
|
+
"gen": "bun run --cwd packages/create-flow gen",
|
|
15
|
+
"publish:dev": "bun run --cwd packages/create-flow publish:dev"
|
|
14
16
|
},
|
|
15
17
|
"dependencies": {
|
|
16
18
|
"@flow-os/client": "^0.0.1",
|