@jskit-ai/create-app 0.1.83 → 0.1.84

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.83",
3
+ "version": "0.1.84",
4
4
  "description": "Scaffold minimal JSKIT app shells.",
5
5
  "type": "module",
6
6
  "files": [
@@ -13,6 +13,7 @@
13
13
  "server:home": "SERVER_SURFACE=home node ./bin/server.js",
14
14
  "start": "node ./bin/server.js",
15
15
  "devlinks": "jskit app link-local-packages",
16
+ "postinstall": "bash scripts/devel-link-local-packages-postinstall.sh",
16
17
  "dev": "vite",
17
18
  "dev:all": "vite",
18
19
  "dev:home": "VITE_SURFACE=home vite",
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Development-only postinstall hook.
5
+ # Normal installs no-op. Set JSKIT_DEVLINKS to opt into local JSKIT package
6
+ # links, for example:
7
+ # JSKIT_DEVLINKS=/path/to/jskit-ai npm install
8
+ # JSKIT_DEVLINKS=1 JSKIT_AI_ROOT=/path/to/jskit-ai npm install
9
+
10
+ SCRIPT_NAME="devel-link-local-packages-postinstall"
11
+
12
+ log() {
13
+ printf '[%s] %s\n' "$SCRIPT_NAME" "$*" >&2
14
+ }
15
+
16
+ fail() {
17
+ printf '[%s] ERROR: %s\n' "$SCRIPT_NAME" "$*" >&2
18
+ exit 1
19
+ }
20
+
21
+ devlinks_value="${JSKIT_DEVLINKS-}"
22
+ case "$devlinks_value" in
23
+ "" | "0" | "false" | "False" | "FALSE" | "no" | "No" | "NO" | "off" | "Off" | "OFF")
24
+ log "JSKIT_DEVLINKS is not set; skipping local JSKIT package links."
25
+ exit 0
26
+ ;;
27
+ esac
28
+
29
+ repo_root=""
30
+ case "$devlinks_value" in
31
+ "1" | "true" | "True" | "TRUE" | "yes" | "Yes" | "YES" | "on" | "On" | "ON" | "auto" | "Auto" | "AUTO")
32
+ repo_root="${JSKIT_AI_ROOT-}"
33
+ ;;
34
+ *)
35
+ repo_root="$devlinks_value"
36
+ ;;
37
+ esac
38
+
39
+ if [ -z "$repo_root" ]; then
40
+ fail "JSKIT_DEVLINKS is enabled, but no repo root was provided. Set JSKIT_DEVLINKS=/path/to/jskit-ai or JSKIT_AI_ROOT=/path/to/jskit-ai."
41
+ fi
42
+
43
+ if ! git -C "$repo_root" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
44
+ fail "JSKIT_DEVLINKS repo root is not a git work tree: $repo_root"
45
+ fi
46
+
47
+ repo_root="$(cd "$repo_root" && pwd -P)"
48
+ log "Linking local JSKIT packages from $repo_root."
49
+ npx --no-install jskit app link-local-packages --repo-root "$repo_root"
@@ -10,6 +10,7 @@ const APP_ROOT = path.resolve(__dirname, "../..");
10
10
 
11
11
  const EXPECTED_MANAGED_SCRIPTS = Object.freeze({
12
12
  devlinks: "jskit app link-local-packages",
13
+ postinstall: "bash scripts/devel-link-local-packages-postinstall.sh",
13
14
  verify: "jskit app verify && npm run --if-present verify:app",
14
15
  release: "jskit app release",
15
16
  "jskit:update": "jskit app update-packages"