@decocms/start 0.34.0 → 0.34.1

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/start",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "type": "module",
5
5
  "description": "Deco framework for TanStack Start - CMS bridge, admin protocol, hooks, schema generation",
6
6
  "main": "./src/index.ts",
@@ -1,5 +1,23 @@
1
+ import { execSync } from "node:child_process";
1
2
  import type { MigrationContext } from "../types.ts";
2
3
 
4
+ /**
5
+ * Get the latest published version of an npm package.
6
+ * Falls back to the provided default if the lookup fails.
7
+ */
8
+ function getLatestVersion(pkg: string, fallback: string): string {
9
+ try {
10
+ const version = execSync(`npm view ${pkg} version`, {
11
+ encoding: "utf-8",
12
+ timeout: 10000,
13
+ stdio: ["pipe", "pipe", "pipe"],
14
+ }).trim();
15
+ return version || fallback;
16
+ } catch {
17
+ return fallback;
18
+ }
19
+ }
20
+
3
21
  /**
4
22
  * Extract npm dependencies from deno.json import map.
5
23
  * Entries like `"fuse.js": "npm:fuse.js@7.0.0"` become `"fuse.js": "^7.0.0"`.
@@ -40,6 +58,10 @@ export function generatePackageJson(ctx: MigrationContext): string {
40
58
  ...ctx.discoveredNpmDeps,
41
59
  };
42
60
 
61
+ // Fetch latest versions from npm registry
62
+ const startVersion = getLatestVersion("@decocms/start", "0.34.0");
63
+ const appsVersion = getLatestVersion("@decocms/apps", "0.26.0");
64
+
43
65
  const pkg = {
44
66
  name: ctx.siteName,
45
67
  version: "0.1.0",
@@ -72,8 +94,8 @@ export function generatePackageJson(ctx: MigrationContext): string {
72
94
  author: "deco.cx",
73
95
  license: "MIT",
74
96
  dependencies: {
75
- "@decocms/apps": "^0.25.2",
76
- "@decocms/start": "^0.32.0",
97
+ "@decocms/apps": `^${appsVersion}`,
98
+ "@decocms/start": `^${startVersion}`,
77
99
  "@tanstack/react-query": "5.90.21",
78
100
  "@tanstack/react-router": "1.166.7",
79
101
  "@tanstack/react-start": "1.166.8",