create-flow-os 0.0.57 → 0.0.59

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "create-flow-os",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "license": "PolyForm-Shield-1.0.0",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@flow-os/client": "^0.0.57"
7
+ "@flow-os/client": "^0.0.59"
8
8
  },
9
9
  "bin": {
10
10
  "create-flow-os": "./src/index.ts"
@@ -98,8 +98,19 @@ export function shouldUseWorkspace(cwd: string): boolean {
98
98
  return !!findFlowOsRepoRoot(cwd);
99
99
  }
100
100
 
101
- /** Recupera versione dal registry npm (sempre real-time, no cache) */
101
+ /** Recupera versione: in prod per @flow-os/client usa quella in create-flow-os package.json (pubblicata, già propagata) */
102
102
  async function fetchFlowPackageVersion(pkgName: string): Promise<string | undefined> {
103
+ if (!isCreateFlowOsDev() && pkgName === "@flow-os/client") {
104
+ try {
105
+ const cliRoot = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
106
+ const pkg = JSON.parse(readFileSync(join(cliRoot, "package.json"), "utf-8")) as { dependencies?: Record<string, string> };
107
+ const spec = pkg.dependencies?.["@flow-os/client"];
108
+ if (spec) {
109
+ const m = spec.match(/(\d+\.\d+\.\d+)/);
110
+ if (m) return m[1];
111
+ }
112
+ } catch {}
113
+ }
103
114
  const tag = isCreateFlowOsDev() ? "dev" : "latest";
104
115
  try {
105
116
  const res = await fetch(`${NPM_REGISTRY}/${pkgName}`, {