@jskit-ai/create-app 0.1.15 → 0.1.17

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": "@jskit-ai/create-app",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Scaffold minimal JSKIT app shells.",
5
5
  "type": "module",
6
6
  "files": [
@@ -31,16 +31,16 @@
31
31
  "dependencies": {
32
32
  "@local/main": "file:packages/main",
33
33
  "@fastify/type-provider-typebox": "^6.1.0",
34
- "@jskit-ai/kernel": "0.1.8",
34
+ "@jskit-ai/kernel": "0.x",
35
35
  "fastify": "^5.7.4",
36
36
  "vue": "^3.5.13",
37
37
  "vue-router": "^4.6.4",
38
38
  "vuetify": "^4.0.0",
39
- "@jskit-ai/http-runtime": "0.1.8"
39
+ "@jskit-ai/http-runtime": "0.x"
40
40
  },
41
41
  "devDependencies": {
42
- "@jskit-ai/config-eslint": "0.1.8",
43
- "@jskit-ai/jskit-cli": "0.2.13",
42
+ "@jskit-ai/config-eslint": "0.x",
43
+ "@jskit-ai/jskit-cli": "0.x",
44
44
  "@vitejs/plugin-vue": "^5.2.1",
45
45
  "eslint": "^9.39.1",
46
46
  "unplugin-vue-router": "^0.19.2",
@@ -34,26 +34,44 @@ readarray -t dev_packages < <(
34
34
  ' "$PACKAGE_JSON_PATH"
35
35
  )
36
36
 
37
- runtime_specs=()
38
- for package_name in "${runtime_packages[@]}"; do
39
- runtime_specs+=("${package_name}@latest")
40
- done
41
-
42
- dev_specs=()
43
- for package_name in "${dev_packages[@]}"; do
44
- dev_specs+=("${package_name}@latest")
45
- done
46
-
47
37
  registry_args=()
48
38
  if [[ -n "$JSKIT_REGISTRY" ]]; then
49
39
  registry_args+=(--registry "$JSKIT_REGISTRY")
50
40
  fi
51
41
 
52
- if (( ${#runtime_specs[@]} == 0 && ${#dev_specs[@]} == 0 )); then
42
+ if (( ${#runtime_packages[@]} == 0 && ${#dev_packages[@]} == 0 )); then
53
43
  echo "[jskit:update] no @jskit-ai packages found in dependencies."
54
44
  exit 0
55
45
  fi
56
46
 
47
+ resolve_major_range() {
48
+ local package_name="$1"
49
+ local latest_version
50
+ if ! latest_version="$(npm view "${registry_args[@]}" "$package_name" version)"; then
51
+ echo "[jskit:update] failed to resolve latest version for $package_name." >&2
52
+ exit 1
53
+ fi
54
+ latest_version="$(printf "%s" "$latest_version" | tr -d '[:space:]')"
55
+
56
+ if [[ ! "$latest_version" =~ ^([0-9]+)\.[0-9]+\.[0-9]+([.+-][0-9A-Za-z.-]+)?$ ]]; then
57
+ echo "[jskit:update] invalid latest version for $package_name: $latest_version" >&2
58
+ exit 1
59
+ fi
60
+
61
+ local major="${BASH_REMATCH[1]}"
62
+ printf "%s.x" "$major"
63
+ }
64
+
65
+ runtime_specs=()
66
+ for package_name in "${runtime_packages[@]}"; do
67
+ runtime_specs+=("${package_name}@$(resolve_major_range "$package_name")")
68
+ done
69
+
70
+ dev_specs=()
71
+ for package_name in "${dev_packages[@]}"; do
72
+ dev_specs+=("${package_name}@$(resolve_major_range "$package_name")")
73
+ done
74
+
57
75
  if (( ${#runtime_specs[@]} > 0 )); then
58
76
  echo "[jskit:update] updating runtime packages: ${runtime_specs[*]}"
59
77
  (