@coze-arch/cli 0.1.4-alpha.0e7259 → 0.1.4-alpha.0f9595

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.
@@ -199,7 +199,9 @@ start_expo() {
199
199
  local -a expo_env
200
200
  expo_env=(
201
201
  "EXPO_NO_DEPENDENCY_VALIDATION=1"
202
+ "EXPO_SDK_VERSION=54.0.0"
202
203
  "EXPO_PUBLIC_BACKEND_BASE_URL=$EXPO_PUBLIC_BACKEND_BASE_URL"
204
+ "EXPO_PUBLIC_API_BASE=$EXPO_PUBLIC_BACKEND_BASE_URL"
203
205
  "EXPO_PACKAGER_PROXY_URL=$EXPO_PACKAGER_PROXY_URL"
204
206
  "EXPO_PUBLIC_COZE_PROJECT_ID=$EXPO_PUBLIC_COZE_PROJECT_ID"
205
207
  )
@@ -14,6 +14,54 @@ command -v pnpm >/dev/null 2>&1 || {
14
14
  exit 1
15
15
  }
16
16
 
17
+ install_dependencies() {
18
+ local install_root="$1"
19
+ local client_dir="$install_root/client"
20
+ local -a client_dependencies=()
21
+ local attempt
22
+ local expo_install_succeeded=false
23
+ shift
24
+
25
+ if [ ! -f "$client_dir/package.json" ]; then
26
+ (cd "$install_root" && pnpm install "$@")
27
+ return
28
+ fi
29
+
30
+ while IFS= read -r dependency; do
31
+ client_dependencies+=("$dependency")
32
+ done < <(
33
+ node -e '
34
+ const manifest = require(process.argv[1]);
35
+ for (const dependency of Object.keys(manifest.dependencies || {})) {
36
+ console.log(dependency);
37
+ }
38
+ ' "$client_dir/package.json"
39
+ )
40
+
41
+ if command -v npx >/dev/null 2>&1 && [ "${#client_dependencies[@]}" -gt 0 ]; then
42
+ for attempt in 1 2 3; do
43
+ if (cd "$client_dir" && npx expo install --pnpm "${client_dependencies[@]}" -- "$@"); then
44
+ expo_install_succeeded=true
45
+ break
46
+ fi
47
+ if [ "$attempt" -lt 3 ]; then
48
+ echo "[node_modules] Expo install failed, retrying ($attempt/2)..."
49
+ fi
50
+ done
51
+ fi
52
+
53
+ if [ "$expo_install_succeeded" = false ]; then
54
+ echo "[node_modules] Expo install failed after 3 attempts, falling back to pnpm for client"
55
+ (cd "$install_root" && pnpm --filter ./client install "$@") || return 1
56
+ fi
57
+
58
+ local -a pnpm_filters=(--filter .)
59
+ if [ -f "$install_root/server/package.json" ]; then
60
+ pnpm_filters+=(--filter ./server)
61
+ fi
62
+ (cd "$install_root" && pnpm "${pnpm_filters[@]}" install "$@") || return 1
63
+ }
64
+
17
65
  DRIVE_ROOT="${COZE_DRIVE_ROOT:-/Coze/Drive}"
18
66
  if [ -d "$DRIVE_ROOT" ]; then
19
67
  DRIVE_ROOT="$(cd "$DRIVE_ROOT" && pwd -P)"
@@ -23,7 +71,7 @@ fi
23
71
  case "$PROJECT_ROOT" in
24
72
  "$DRIVE_ROOT"|"$DRIVE_ROOT"/*) ;;
25
73
  *)
26
- (cd "$PROJECT_ROOT" && pnpm install "$@")
74
+ install_dependencies "$PROJECT_ROOT" "$@"
27
75
  exit 0
28
76
  ;;
29
77
  esac
@@ -72,7 +120,7 @@ cleanup_legacy_shadow_project() {
72
120
  while IFS= read -r -d '' entry; do
73
121
  name="$(basename "$entry")"
74
122
  case "$name" in
75
- node_modules|.next|client|server) continue ;;
123
+ node_modules|client|server) continue ;;
76
124
  esac
77
125
  rm -rf "$entry"
78
126
  done < <(find "$WORK_DIR" -mindepth 1 -maxdepth 1 -print0)
@@ -82,9 +130,17 @@ cleanup_legacy_shadow_project() {
82
130
  done
83
131
  }
84
132
 
85
- copy_install_metadata() {
133
+ link_install_entry() {
134
+ local source_path="$1" target_path="$2"
135
+ rm -rf "$target_path"
136
+ if [ -e "$source_path" ]; then
137
+ ln -s "$source_path" "$target_path"
138
+ fi
139
+ }
140
+
141
+ prepare_install_metadata() {
86
142
  local filename source_file target_file workspace
87
- for filename in package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
143
+ for filename in pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
88
144
  source_file="$PROJECT_ROOT/$filename"
89
145
  target_file="$WORK_DIR/$filename"
90
146
  rm -f "$target_file"
@@ -93,15 +149,28 @@ copy_install_metadata() {
93
149
  fi
94
150
  done
95
151
 
152
+ link_install_entry "$PROJECT_ROOT/package.json" "$WORK_DIR/package.json"
153
+ link_install_entry "$PROJECT_ROOT/patches" "$WORK_DIR/patches"
154
+ link_install_entry "$PROJECT_ROOT/scripts" "$WORK_DIR/scripts"
155
+
96
156
  for workspace in client server; do
97
157
  if [ -f "$PROJECT_ROOT/$workspace/package.json" ]; then
98
158
  mkdir -p "$WORK_DIR/$workspace"
99
- rm -f "$WORK_DIR/$workspace/package.json"
100
- cp "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
159
+ link_install_entry "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
160
+ link_install_entry "$PROJECT_ROOT/$workspace/scripts" "$WORK_DIR/$workspace/scripts"
101
161
  else
102
162
  rm -rf "$WORK_DIR/$workspace"
103
163
  fi
104
164
  done
165
+
166
+ for filename in app.config.ts app.config.js app.json; do
167
+ source_file="$PROJECT_ROOT/client/$filename"
168
+ target_file="$WORK_DIR/client/$filename"
169
+ rm -f "$target_file"
170
+ if [ -f "$source_file" ]; then
171
+ cp "$source_file" "$target_file"
172
+ fi
173
+ done
105
174
  }
106
175
 
107
176
  link_node_modules() {
@@ -125,10 +194,10 @@ link_node_modules() {
125
194
  }
126
195
 
127
196
  cleanup_legacy_shadow_project
128
- copy_install_metadata
197
+ prepare_install_metadata
129
198
 
130
199
  echo "[node_modules] Installing dependencies in $WORK_DIR"
131
- if ! (cd "$WORK_DIR" && pnpm install "$@"); then
200
+ if ! install_dependencies "$WORK_DIR" "$@"; then
132
201
  exit 1
133
202
  fi
134
203
 
@@ -138,7 +207,6 @@ if [ -f "$WORK_DIR/pnpm-lock.yaml" ]; then
138
207
  chmod 0644 "$temporary_lockfile"
139
208
  mv -f "$temporary_lockfile" "$PROJECT_ROOT/pnpm-lock.yaml"
140
209
  fi
141
-
142
210
  link_node_modules "$PROJECT_ROOT" "$WORK_DIR/node_modules"
143
211
  for workspace in client server; do
144
212
  if [ -f "$PROJECT_ROOT/$workspace/package.json" ]; then
@@ -1,4 +1,4 @@
1
- import { ExpoConfig, ConfigContext } from 'expo/config';
1
+ import type { ExpoConfig, ConfigContext } from 'expo/config';
2
2
 
3
3
  const appName = process.env.COZE_PROJECT_NAME || process.env.EXPO_PUBLIC_COZE_PROJECT_NAME || '应用';
4
4
  const projectId = process.env.COZE_PROJECT_ID || process.env.EXPO_PUBLIC_COZE_PROJECT_ID;
@@ -10,6 +10,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
10
10
  "name": appName,
11
11
  "slug": slugAppName,
12
12
  "version": "1.0.0",
13
+ "sdkVersion": "54.0.0",
13
14
  "orientation": "portrait",
14
15
  "icon": "./assets/images/icon.png",
15
16
  "scheme": "myapp",
@@ -7,7 +7,6 @@ cd "${COZE_WORKSPACE_PATH}"
7
7
 
8
8
  echo "Installing dependencies..."
9
9
  bash "$COZE_WORKSPACE_PATH/scripts/prepare-node-modules.sh" --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
10
- bash "$COZE_WORKSPACE_PATH/scripts/prepare-next-output.sh"
11
10
 
12
11
  echo "Building the Next.js project..."
13
12
  pnpm next build --webpack
@@ -56,7 +56,6 @@ kill_port_if_listening() {
56
56
  echo "Clearing port ${DEPLOY_RUN_PORT} before start."
57
57
  kill_port_if_listening
58
58
  bash "${COZE_WORKSPACE_PATH}/scripts/prepare-node-modules.sh" --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
59
- bash "${COZE_WORKSPACE_PATH}/scripts/prepare-next-output.sh"
60
59
  echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for dev..."
61
60
 
62
61
  # 测试环境保持服务为前台进程,便于 e2e 收集输出并停止进程。
@@ -229,7 +228,6 @@ fi
229
228
  echo "Clearing port ${DEPLOY_RUN_PORT} before start."
230
229
  kill_port_if_listening
231
230
  bash "${COZE_WORKSPACE_PATH}/scripts/prepare-node-modules.sh" --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
232
- bash "${COZE_WORKSPACE_PATH}/scripts/prepare-next-output.sh"
233
231
  echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for dev..."
234
232
 
235
233
  mkdir -p "${LOG_DIR}"
@@ -72,7 +72,7 @@ cleanup_legacy_shadow_project() {
72
72
  while IFS= read -r -d '' entry; do
73
73
  name="$(basename "$entry")"
74
74
  case "$name" in
75
- node_modules|.next|client|server) continue ;;
75
+ node_modules|client|server) continue ;;
76
76
  esac
77
77
  rm -rf "$entry"
78
78
  done < <(find "$WORK_DIR" -mindepth 1 -maxdepth 1 -print0)
@@ -82,9 +82,17 @@ cleanup_legacy_shadow_project() {
82
82
  done
83
83
  }
84
84
 
85
- copy_install_metadata() {
85
+ link_install_entry() {
86
+ local source_path="$1" target_path="$2"
87
+ rm -rf "$target_path"
88
+ if [ -e "$source_path" ]; then
89
+ ln -s "$source_path" "$target_path"
90
+ fi
91
+ }
92
+
93
+ prepare_install_metadata() {
86
94
  local filename source_file target_file workspace
87
- for filename in package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
95
+ for filename in pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
88
96
  source_file="$PROJECT_ROOT/$filename"
89
97
  target_file="$WORK_DIR/$filename"
90
98
  rm -f "$target_file"
@@ -93,11 +101,15 @@ copy_install_metadata() {
93
101
  fi
94
102
  done
95
103
 
104
+ link_install_entry "$PROJECT_ROOT/package.json" "$WORK_DIR/package.json"
105
+ link_install_entry "$PROJECT_ROOT/patches" "$WORK_DIR/patches"
106
+ link_install_entry "$PROJECT_ROOT/scripts" "$WORK_DIR/scripts"
107
+
96
108
  for workspace in client server; do
97
109
  if [ -f "$PROJECT_ROOT/$workspace/package.json" ]; then
98
110
  mkdir -p "$WORK_DIR/$workspace"
99
- rm -f "$WORK_DIR/$workspace/package.json"
100
- cp "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
111
+ link_install_entry "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
112
+ link_install_entry "$PROJECT_ROOT/$workspace/scripts" "$WORK_DIR/$workspace/scripts"
101
113
  else
102
114
  rm -rf "$WORK_DIR/$workspace"
103
115
  fi
@@ -125,7 +137,7 @@ link_node_modules() {
125
137
  }
126
138
 
127
139
  cleanup_legacy_shadow_project
128
- copy_install_metadata
140
+ prepare_install_metadata
129
141
 
130
142
  echo "[node_modules] Installing dependencies in $WORK_DIR"
131
143
  if ! (cd "$WORK_DIR" && pnpm install "$@"); then
@@ -72,7 +72,7 @@ cleanup_legacy_shadow_project() {
72
72
  while IFS= read -r -d '' entry; do
73
73
  name="$(basename "$entry")"
74
74
  case "$name" in
75
- node_modules|.next|client|server) continue ;;
75
+ node_modules|client|server) continue ;;
76
76
  esac
77
77
  rm -rf "$entry"
78
78
  done < <(find "$WORK_DIR" -mindepth 1 -maxdepth 1 -print0)
@@ -82,9 +82,17 @@ cleanup_legacy_shadow_project() {
82
82
  done
83
83
  }
84
84
 
85
- copy_install_metadata() {
85
+ link_install_entry() {
86
+ local source_path="$1" target_path="$2"
87
+ rm -rf "$target_path"
88
+ if [ -e "$source_path" ]; then
89
+ ln -s "$source_path" "$target_path"
90
+ fi
91
+ }
92
+
93
+ prepare_install_metadata() {
86
94
  local filename source_file target_file workspace
87
- for filename in package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
95
+ for filename in pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
88
96
  source_file="$PROJECT_ROOT/$filename"
89
97
  target_file="$WORK_DIR/$filename"
90
98
  rm -f "$target_file"
@@ -93,11 +101,15 @@ copy_install_metadata() {
93
101
  fi
94
102
  done
95
103
 
104
+ link_install_entry "$PROJECT_ROOT/package.json" "$WORK_DIR/package.json"
105
+ link_install_entry "$PROJECT_ROOT/patches" "$WORK_DIR/patches"
106
+ link_install_entry "$PROJECT_ROOT/scripts" "$WORK_DIR/scripts"
107
+
96
108
  for workspace in client server; do
97
109
  if [ -f "$PROJECT_ROOT/$workspace/package.json" ]; then
98
110
  mkdir -p "$WORK_DIR/$workspace"
99
- rm -f "$WORK_DIR/$workspace/package.json"
100
- cp "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
111
+ link_install_entry "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
112
+ link_install_entry "$PROJECT_ROOT/$workspace/scripts" "$WORK_DIR/$workspace/scripts"
101
113
  else
102
114
  rm -rf "$WORK_DIR/$workspace"
103
115
  fi
@@ -125,7 +137,7 @@ link_node_modules() {
125
137
  }
126
138
 
127
139
  cleanup_legacy_shadow_project
128
- copy_install_metadata
140
+ prepare_install_metadata
129
141
 
130
142
  echo "[node_modules] Installing dependencies in $WORK_DIR"
131
143
  if ! (cd "$WORK_DIR" && pnpm install "$@"); then
@@ -72,7 +72,7 @@ cleanup_legacy_shadow_project() {
72
72
  while IFS= read -r -d '' entry; do
73
73
  name="$(basename "$entry")"
74
74
  case "$name" in
75
- node_modules|.next|client|server) continue ;;
75
+ node_modules|client|server) continue ;;
76
76
  esac
77
77
  rm -rf "$entry"
78
78
  done < <(find "$WORK_DIR" -mindepth 1 -maxdepth 1 -print0)
@@ -82,9 +82,17 @@ cleanup_legacy_shadow_project() {
82
82
  done
83
83
  }
84
84
 
85
- copy_install_metadata() {
85
+ link_install_entry() {
86
+ local source_path="$1" target_path="$2"
87
+ rm -rf "$target_path"
88
+ if [ -e "$source_path" ]; then
89
+ ln -s "$source_path" "$target_path"
90
+ fi
91
+ }
92
+
93
+ prepare_install_metadata() {
86
94
  local filename source_file target_file workspace
87
- for filename in package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
95
+ for filename in pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
88
96
  source_file="$PROJECT_ROOT/$filename"
89
97
  target_file="$WORK_DIR/$filename"
90
98
  rm -f "$target_file"
@@ -93,11 +101,15 @@ copy_install_metadata() {
93
101
  fi
94
102
  done
95
103
 
104
+ link_install_entry "$PROJECT_ROOT/package.json" "$WORK_DIR/package.json"
105
+ link_install_entry "$PROJECT_ROOT/patches" "$WORK_DIR/patches"
106
+ link_install_entry "$PROJECT_ROOT/scripts" "$WORK_DIR/scripts"
107
+
96
108
  for workspace in client server; do
97
109
  if [ -f "$PROJECT_ROOT/$workspace/package.json" ]; then
98
110
  mkdir -p "$WORK_DIR/$workspace"
99
- rm -f "$WORK_DIR/$workspace/package.json"
100
- cp "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
111
+ link_install_entry "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
112
+ link_install_entry "$PROJECT_ROOT/$workspace/scripts" "$WORK_DIR/$workspace/scripts"
101
113
  else
102
114
  rm -rf "$WORK_DIR/$workspace"
103
115
  fi
@@ -125,7 +137,7 @@ link_node_modules() {
125
137
  }
126
138
 
127
139
  cleanup_legacy_shadow_project
128
- copy_install_metadata
140
+ prepare_install_metadata
129
141
 
130
142
  echo "[node_modules] Installing dependencies in $WORK_DIR"
131
143
  if ! (cd "$WORK_DIR" && pnpm install "$@"); then
@@ -72,7 +72,7 @@ cleanup_legacy_shadow_project() {
72
72
  while IFS= read -r -d '' entry; do
73
73
  name="$(basename "$entry")"
74
74
  case "$name" in
75
- node_modules|.next|client|server) continue ;;
75
+ node_modules|client|server) continue ;;
76
76
  esac
77
77
  rm -rf "$entry"
78
78
  done < <(find "$WORK_DIR" -mindepth 1 -maxdepth 1 -print0)
@@ -82,9 +82,17 @@ cleanup_legacy_shadow_project() {
82
82
  done
83
83
  }
84
84
 
85
- copy_install_metadata() {
85
+ link_install_entry() {
86
+ local source_path="$1" target_path="$2"
87
+ rm -rf "$target_path"
88
+ if [ -e "$source_path" ]; then
89
+ ln -s "$source_path" "$target_path"
90
+ fi
91
+ }
92
+
93
+ prepare_install_metadata() {
86
94
  local filename source_file target_file workspace
87
- for filename in package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
95
+ for filename in pnpm-lock.yaml pnpm-workspace.yaml .npmrc; do
88
96
  source_file="$PROJECT_ROOT/$filename"
89
97
  target_file="$WORK_DIR/$filename"
90
98
  rm -f "$target_file"
@@ -93,11 +101,15 @@ copy_install_metadata() {
93
101
  fi
94
102
  done
95
103
 
104
+ link_install_entry "$PROJECT_ROOT/package.json" "$WORK_DIR/package.json"
105
+ link_install_entry "$PROJECT_ROOT/patches" "$WORK_DIR/patches"
106
+ link_install_entry "$PROJECT_ROOT/scripts" "$WORK_DIR/scripts"
107
+
96
108
  for workspace in client server; do
97
109
  if [ -f "$PROJECT_ROOT/$workspace/package.json" ]; then
98
110
  mkdir -p "$WORK_DIR/$workspace"
99
- rm -f "$WORK_DIR/$workspace/package.json"
100
- cp "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
111
+ link_install_entry "$PROJECT_ROOT/$workspace/package.json" "$WORK_DIR/$workspace/package.json"
112
+ link_install_entry "$PROJECT_ROOT/$workspace/scripts" "$WORK_DIR/$workspace/scripts"
101
113
  else
102
114
  rm -rf "$WORK_DIR/$workspace"
103
115
  fi
@@ -125,7 +137,7 @@ link_node_modules() {
125
137
  }
126
138
 
127
139
  cleanup_legacy_shadow_project
128
- copy_install_metadata
140
+ prepare_install_metadata
129
141
 
130
142
  echo "[node_modules] Installing dependencies in $WORK_DIR"
131
143
  if ! (cd "$WORK_DIR" && pnpm install "$@"); then
package/lib/cli.js CHANGED
@@ -2114,7 +2114,7 @@ const EventBuilder = {
2114
2114
  };
2115
2115
 
2116
2116
  var name = "@coze-arch/cli";
2117
- var version = "0.1.4-alpha.0e7259";
2117
+ var version = "0.1.4-alpha.0f9595";
2118
2118
  var description = "coze coding devtools cli";
2119
2119
  var license = "MIT";
2120
2120
  var author = "fanwenjie.fe@bytedance.com";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.1.4-alpha.0e7259",
3
+ "version": "0.1.4-alpha.0f9595",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Keep Next.js compiler output off Coze Drive while leaving source files in place.
3
- set -euo pipefail
4
-
5
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
6
- PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
7
-
8
- DRIVE_ROOT="${COZE_DRIVE_ROOT:-/Coze/Drive}"
9
- if [ -d "$DRIVE_ROOT" ]; then
10
- DRIVE_ROOT="$(cd "$DRIVE_ROOT" && pwd -P)"
11
- else
12
- DRIVE_ROOT="${DRIVE_ROOT%/}"
13
- fi
14
- case "$PROJECT_ROOT" in
15
- "$DRIVE_ROOT"|"$DRIVE_ROOT"/*) ;;
16
- *) exit 0 ;;
17
- esac
18
-
19
- NM_ROOT="/tmp/nm"
20
- PROJECT_ID="$(basename "$PROJECT_ROOT")-$(printf '%s' "$PROJECT_ROOT" | cksum | awk '{print $1}')"
21
- NEXT_DIR="$NM_ROOT/$PROJECT_ID/.next"
22
- LEGACY_NEXT_DIR="$NM_ROOT/next/$PROJECT_ID"
23
-
24
- if [ -L "$NEXT_DIR" ]; then
25
- current="$(readlink "$NEXT_DIR")"
26
- if [ "$current" = "$PROJECT_ROOT/.next" ]; then
27
- rm "$NEXT_DIR"
28
- else
29
- echo "[next] refusing to replace unmanaged local output symlink: $NEXT_DIR" >&2
30
- exit 1
31
- fi
32
- elif [ -e "$NEXT_DIR" ] && [ ! -d "$NEXT_DIR" ]; then
33
- echo "[next] local output path is not a directory: $NEXT_DIR" >&2
34
- exit 1
35
- fi
36
- mkdir -p "$NEXT_DIR"
37
-
38
- if [ -L "$PROJECT_ROOT/.next" ]; then
39
- current="$(readlink "$PROJECT_ROOT/.next")"
40
- if [ "$current" = "$NEXT_DIR" ]; then
41
- exit 0
42
- fi
43
- if [ "$current" = "$LEGACY_NEXT_DIR" ]; then
44
- rm "$PROJECT_ROOT/.next"
45
- else
46
- echo "[next] refusing to replace unmanaged symlink: $PROJECT_ROOT/.next" >&2
47
- exit 1
48
- fi
49
- fi
50
-
51
- if [ -e "$PROJECT_ROOT/.next" ]; then
52
- rm -rf "$PROJECT_ROOT/.next"
53
- fi
54
-
55
- if ! ln -s "$NEXT_DIR" "$PROJECT_ROOT/.next"; then
56
- if [ ! -L "$PROJECT_ROOT/.next" ] || [ "$(readlink "$PROJECT_ROOT/.next")" != "$NEXT_DIR" ]; then
57
- echo "[next] failed to link $PROJECT_ROOT/.next to $NEXT_DIR" >&2
58
- exit 1
59
- fi
60
- fi
61
-
62
- echo "[next] Compiler output ready at $NEXT_DIR"