create-entity-server 0.2.2 → 0.2.5

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/bin/create.js CHANGED
@@ -289,6 +289,10 @@ ${cdCmd ? ` ${cdCmd}` : ""}
289
289
  같은 머신에서 여러 프로젝트를 동시에 운영할 수 있습니다.
290
290
 
291
291
  문서: https://github.com/${REPO}#readme
292
+
293
+ 참고:
294
+ 설치 요약이 출력된 뒤에도 npm/npx 마무리 작업 때문에 프롬프트가 바로 돌아오지 않을 수 있습니다.
295
+ 설치 완료 전까지 잠시만 기다려주세요.
292
296
  `);
293
297
  }
294
298
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-entity-server",
3
- "version": "0.2.2",
3
+ "version": "0.2.5",
4
4
  "description": "Create a new entity-server project in one command — like create-react-app or create-vite.",
5
5
  "keywords": [
6
6
  "entity-server",
@@ -1,28 +1,17 @@
1
1
  {
2
- "default": "distance_es",
2
+ "default": "development",
3
3
  "groups": {
4
- "distance_es": {
4
+ "development": {
5
5
  "driver": "mysql",
6
- "host": "${DB_HOST_DISTANCE_DEV}",
7
- "port": "${DB_PORT_DISTANCE_DEV}",
8
- "database": "${DB_NAME_DISTANCE_DEV}",
9
- "user": "${DB_USER_DISTANCE_DEV}",
10
- "password": "${DB_PASSWORD_DISTANCE_DEV}",
6
+ "host": "${DB_HOST_DEVELOPMENT}",
7
+ "port": "${DB_PORT_DEVELOPMENT}",
8
+ "database": "${DB_NAME_DEVELOPMENT}",
9
+ "user": "${DB_USER_DEVELOPMENT}",
10
+ "password": "${DB_PASSWORD_DEVELOPMENT}",
11
11
  "maxOpenConns": 50,
12
12
  "maxIdleConns": 25,
13
13
  "connMaxLifetimeSec": 3600
14
14
  },
15
- "codeshop_entities": {
16
- "driver": "mysql",
17
- "host": "${DB_HOST_CODESHOP_DEV}",
18
- "port": "${DB_PORT_CODESHOP_DEV}",
19
- "database": "${DB_NAME_CODESHOP_DEV}",
20
- "user": "${DB_USER_CODESHOP_DEV}",
21
- "password": "${DB_PASSWORD_CODESHOP_DEV}",
22
- "maxOpenConns": 20,
23
- "maxIdleConns": 10,
24
- "connMaxLifetimeSec": 3600
25
- },
26
15
  "production": {
27
16
  "driver": "mysql",
28
17
  "host": "${DB_HOST_PRODUCTION}",
@@ -6,6 +6,9 @@
6
6
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
7
  PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
8
8
  BIN_PATH="$PROJECT_ROOT/bin/entity-cli"
9
+ if [ ! -f "$BIN_PATH" ] && [ -f "$PROJECT_ROOT/entity-cli" ]; then
10
+ BIN_PATH="$PROJECT_ROOT/entity-cli"
11
+ fi
9
12
 
10
13
  cd "$PROJECT_ROOT"
11
14
 
@@ -100,9 +103,9 @@ fi
100
103
  # CLI 바이너리 존재 확인
101
104
  if [ ! -f "$BIN_PATH" ]; then
102
105
  if [ "$LANGUAGE" = "en" ]; then
103
- echo "❌ bin/entity-cli not found. Run: ./scripts/build.sh"
106
+ echo "❌ entity-cli not found (bin/entity-cli or ./entity-cli). Run: ./scripts/build.sh"
104
107
  else
105
- echo "❌ bin/entity-cli 파일이 없습니다. 먼저 ./scripts/build.sh 를 실행하세요."
108
+ echo "❌ entity-cli 파일이 없습니다 (bin/entity-cli 또는 ./entity-cli). 먼저 ./scripts/build.sh 를 실행하세요."
106
109
  fi
107
110
  exit 1
108
111
  fi
@@ -7,6 +7,11 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
8
  cd "$PROJECT_ROOT"
9
9
 
10
+ ENTITY_CLI_BIN="$PROJECT_ROOT/bin/entity-cli"
11
+ if [ ! -f "$ENTITY_CLI_BIN" ] && [ -f "$PROJECT_ROOT/entity-cli" ]; then
12
+ ENTITY_CLI_BIN="$PROJECT_ROOT/entity-cli"
13
+ fi
14
+
10
15
  # Load language from .env
11
16
  if [ -f .env ]; then
12
17
  LANGUAGE=$(grep '^LANGUAGE=' .env | cut -d '=' -f2)
@@ -41,14 +46,14 @@ if [ $# -eq 0 ]; then
41
46
  fi
42
47
 
43
48
  # Require prebuilt CLI binary
44
- if [ ! -f "$PROJECT_ROOT/bin/entity-cli" ]; then
49
+ if [ ! -f "$ENTITY_CLI_BIN" ]; then
45
50
  if [ "$LANGUAGE" = "en" ]; then
46
- echo "❌ bin/entity-cli not found"
51
+ echo "❌ entity-cli not found (bin/entity-cli or ./entity-cli)"
47
52
  else
48
- echo "❌ bin/entity-cli 파일이 없습니다"
53
+ echo "❌ entity-cli 파일이 없습니다 (bin/entity-cli 또는 ./entity-cli)"
49
54
  fi
50
55
  exit 1
51
56
  fi
52
57
 
53
58
  # Pass-through to CLI
54
- "$PROJECT_ROOT/bin/entity-cli" cleanup-history "$@"
59
+ "$ENTITY_CLI_BIN" cleanup-history "$@"
@@ -5,6 +5,9 @@
5
5
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
6
  PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
  BIN_PATH="$PROJECT_ROOT/bin/entity-cli"
8
+ if [ ! -f "$BIN_PATH" ] && [ -f "$PROJECT_ROOT/entity-cli" ]; then
9
+ BIN_PATH="$PROJECT_ROOT/entity-cli"
10
+ fi
8
11
 
9
12
  # Load language from .env
10
13
  if [ -f "$PROJECT_ROOT/.env" ]; then
@@ -15,9 +18,9 @@ LANGUAGE=${LANGUAGE:-ko}
15
18
  # Require prebuilt CLI binary
16
19
  if [ ! -f "$BIN_PATH" ]; then
17
20
  if [ "$LANGUAGE" = "en" ]; then
18
- echo "❌ bin/entity-cli not found"
21
+ echo "❌ entity-cli not found (bin/entity-cli or ./entity-cli)"
19
22
  else
20
- echo "❌ bin/entity-cli 파일이 없습니다"
23
+ echo "❌ entity-cli 파일이 없습니다 (bin/entity-cli 또는 ./entity-cli)"
21
24
  fi
22
25
  exit 1
23
26
  fi
@@ -7,6 +7,11 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
8
  cd "$PROJECT_ROOT"
9
9
 
10
+ ENTITY_CLI_BIN="$PROJECT_ROOT/bin/entity-cli"
11
+ if [ ! -f "$ENTITY_CLI_BIN" ] && [ -f "$PROJECT_ROOT/entity-cli" ]; then
12
+ ENTITY_CLI_BIN="$PROJECT_ROOT/entity-cli"
13
+ fi
14
+
10
15
  # Load language from .env
11
16
  if [ -f .env ]; then
12
17
  LANGUAGE=$(grep '^LANGUAGE=' .env | cut -d '=' -f2)
@@ -59,14 +64,14 @@ if [ $# -eq 0 ]; then
59
64
  fi
60
65
 
61
66
  # Require prebuilt CLI binary
62
- if [ ! -f "$PROJECT_ROOT/bin/entity-cli" ]; then
67
+ if [ ! -f "$ENTITY_CLI_BIN" ]; then
63
68
  if [ "$LANGUAGE" = "en" ]; then
64
- echo "❌ bin/entity-cli not found"
69
+ echo "❌ entity-cli not found (bin/entity-cli or ./entity-cli)"
65
70
  else
66
- echo "❌ bin/entity-cli 파일이 없습니다"
71
+ echo "❌ entity-cli 파일이 없습니다 (bin/entity-cli 또는 ./entity-cli)"
67
72
  fi
68
73
  exit 1
69
74
  fi
70
75
 
71
76
  # Pass-through to CLI
72
- "$PROJECT_ROOT/bin/entity-cli" init-entity "$@"
77
+ "$ENTITY_CLI_BIN" init-entity "$@"
@@ -19,6 +19,10 @@ RUN_GROUP="$(id -gn "$RUN_USER" 2>/dev/null || true)"
19
19
  START_NOW=true
20
20
  INTERACTIVE=false
21
21
  SERVER_CONFIG="$PROJECT_ROOT/configs/server.json"
22
+ SERVER_BIN="$PROJECT_ROOT/bin/entity-server"
23
+ if [ ! -f "$SERVER_BIN" ] && [ -f "$PROJECT_ROOT/entity-server" ]; then
24
+ SERVER_BIN="$PROJECT_ROOT/entity-server"
25
+ fi
22
26
 
23
27
  load_namespace() {
24
28
  local namespace=""
@@ -151,12 +155,12 @@ if [ ! -x "$PROJECT_ROOT/scripts/run.sh" ]; then
151
155
  chmod +x "$PROJECT_ROOT/scripts/run.sh"
152
156
  fi
153
157
 
154
- if [ ! -f "$PROJECT_ROOT/bin/entity-server" ]; then
158
+ if [ ! -f "$SERVER_BIN" ]; then
155
159
  if [ "$LANGUAGE" = "en" ]; then
156
- echo "❌ bin/entity-server not found"
160
+ echo "❌ entity-server not found (bin/entity-server or ./entity-server)"
157
161
  echo "Run ./scripts/build.sh first."
158
162
  else
159
- echo "❌ bin/entity-server 파일이 없습니다"
163
+ echo "❌ entity-server 파일이 없습니다 (bin/entity-server 또는 ./entity-server)"
160
164
  echo "먼저 ./scripts/build.sh 를 실행하세요."
161
165
  fi
162
166
  exit 1
@@ -7,6 +7,11 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
8
  cd "$PROJECT_ROOT"
9
9
 
10
+ ENTITY_CLI_BIN="$PROJECT_ROOT/bin/entity-cli"
11
+ if [ ! -f "$ENTITY_CLI_BIN" ] && [ -f "$PROJECT_ROOT/entity-cli" ]; then
12
+ ENTITY_CLI_BIN="$PROJECT_ROOT/entity-cli"
13
+ fi
14
+
10
15
  # Load language from .env
11
16
  if [ -f .env ]; then
12
17
  LANGUAGE=$(grep '^LANGUAGE=' .env | cut -d '=' -f2)
@@ -92,11 +97,11 @@ if [ $# -eq 0 ]; then
92
97
  fi
93
98
 
94
99
  # Require prebuilt CLI binary
95
- if [ ! -f "$PROJECT_ROOT/bin/entity-cli" ]; then
100
+ if [ ! -f "$ENTITY_CLI_BIN" ]; then
96
101
  if [ "$LANGUAGE" = "en" ]; then
97
- echo "❌ bin/entity-cli not found. Run scripts/build.sh first."
102
+ echo "❌ entity-cli not found (bin/entity-cli or ./entity-cli). Run scripts/build.sh first."
98
103
  else
99
- echo "❌ bin/entity-cli 파일이 없습니다. scripts/build.sh 를 먼저 실행하세요."
104
+ echo "❌ entity-cli 파일이 없습니다 (bin/entity-cli 또는 ./entity-cli). scripts/build.sh 를 먼저 실행하세요."
100
105
  fi
101
106
  exit 1
102
107
  fi
@@ -125,7 +130,7 @@ for arg in "$@"; do
125
130
  esac
126
131
  done
127
132
 
128
- CMD=("$PROJECT_ROOT/bin/entity-cli" normalize-entities)
133
+ CMD=("$ENTITY_CLI_BIN" normalize-entities)
129
134
  [ -n "$ENTITY_FLAG" ] && CMD+=("$ENTITY_FLAG")
130
135
  [ -n "$APPLY_FLAG" ] && CMD+=("$APPLY_FLAG")
131
136
 
@@ -5,6 +5,9 @@
5
5
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
6
  PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
  BIN_PATH="$PROJECT_ROOT/bin/entity-cli"
8
+ if [ ! -f "$BIN_PATH" ] && [ -f "$PROJECT_ROOT/entity-cli" ]; then
9
+ BIN_PATH="$PROJECT_ROOT/entity-cli"
10
+ fi
8
11
 
9
12
  cd "$PROJECT_ROOT"
10
13
 
@@ -97,9 +100,9 @@ fi
97
100
  # CLI 바이너리 존재 확인
98
101
  if [ ! -f "$BIN_PATH" ]; then
99
102
  if [ "$LANGUAGE" = "en" ]; then
100
- echo "❌ bin/entity-cli not found. Run: ./scripts/build.sh"
103
+ echo "❌ entity-cli not found (bin/entity-cli or ./entity-cli). Run: ./scripts/build.sh"
101
104
  else
102
- echo "❌ bin/entity-cli 파일이 없습니다. 먼저 ./scripts/build.sh 를 실행하세요."
105
+ echo "❌ entity-cli 파일이 없습니다 (bin/entity-cli 또는 ./entity-cli). 먼저 ./scripts/build.sh 를 실행하세요."
103
106
  fi
104
107
  exit 1
105
108
  fi
@@ -19,6 +19,11 @@ trap cleanup EXIT
19
19
 
20
20
  cd "$PROJECT_ROOT"
21
21
 
22
+ ENTITY_CLI_BIN="$PROJECT_ROOT/bin/entity-cli"
23
+ if [ ! -f "$ENTITY_CLI_BIN" ] && [ -f "$PROJECT_ROOT/entity-cli" ]; then
24
+ ENTITY_CLI_BIN="$PROJECT_ROOT/entity-cli"
25
+ fi
26
+
22
27
  # Load language from .env
23
28
  if [ -f .env ]; then
24
29
  LANGUAGE=$(grep '^LANGUAGE=' .env | cut -d '=' -f2 || true)
@@ -135,11 +140,11 @@ if [ $# -eq 0 ]; then
135
140
  fi
136
141
 
137
142
  # Require prebuilt CLI binary
138
- if [ ! -f "$PROJECT_ROOT/bin/entity-cli" ]; then
143
+ if [ ! -f "$ENTITY_CLI_BIN" ]; then
139
144
  if [ "$LANGUAGE" = "en" ]; then
140
- echo "❌ bin/entity-cli not found"
145
+ echo "❌ entity-cli not found (bin/entity-cli or ./entity-cli)"
141
146
  else
142
- echo "❌ bin/entity-cli 파일이 없습니다"
147
+ echo "❌ entity-cli 파일이 없습니다 (bin/entity-cli 또는 ./entity-cli)"
143
148
  fi
144
149
  exit 1
145
150
  fi
@@ -148,7 +153,7 @@ fi
148
153
  case "$1" in
149
154
  --dry-run)
150
155
  print_target_database
151
- "$PROJECT_ROOT/bin/entity-cli" reset-all
156
+ "$ENTITY_CLI_BIN" reset-all
152
157
  ;;
153
158
  --force|--apply)
154
159
  print_target_database
@@ -163,12 +168,12 @@ case "$1" in
163
168
  RESET_LOG=$(mktemp)
164
169
  if [ "$1" = "--force" ]; then
165
170
  set +e
166
- "$PROJECT_ROOT/bin/entity-cli" reset-all --apply --force 2>&1 | tee "$RESET_LOG"
171
+ "$ENTITY_CLI_BIN" reset-all --apply --force 2>&1 | tee "$RESET_LOG"
167
172
  RESET_STATUS=${PIPESTATUS[0]}
168
173
  set -e
169
174
  else
170
175
  set +e
171
- "$PROJECT_ROOT/bin/entity-cli" reset-all --apply 2>&1 | tee "$RESET_LOG"
176
+ "$ENTITY_CLI_BIN" reset-all --apply 2>&1 | tee "$RESET_LOG"
172
177
  RESET_STATUS=${PIPESTATUS[0]}
173
178
  set -e
174
179
  fi
@@ -182,8 +187,8 @@ case "$1" in
182
187
  fi
183
188
 
184
189
  # 새로 생성된 API 키 조회 후 .env 업데이트
185
- NEW_API_KEY=$("$PROJECT_ROOT/bin/entity-cli" api-key show --seq=1 --reveal-secret 2>/dev/null | grep -E '^key_value' | awk '{print $NF}')
186
- NEW_HMAC=$("$PROJECT_ROOT/bin/entity-cli" api-key show --seq=1 --reveal-secret 2>/dev/null | grep -E '^hmac_secret' | awk '{print $NF}')
190
+ NEW_API_KEY=$("$ENTITY_CLI_BIN" api-key show --seq=1 --reveal-secret 2>/dev/null | grep -E '^key_value' | awk '{print $NF}')
191
+ NEW_HMAC=$("$ENTITY_CLI_BIN" api-key show --seq=1 --reveal-secret 2>/dev/null | grep -E '^hmac_secret' | awk '{print $NF}')
187
192
 
188
193
  if [ -n "$NEW_API_KEY" ] && [ -n "$NEW_HMAC" ]; then
189
194
  echo ""
@@ -7,6 +7,11 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
7
7
 
8
8
  cd "$PROJECT_ROOT"
9
9
 
10
+ ENTITY_CLI_BIN="$PROJECT_ROOT/bin/entity-cli"
11
+ if [ ! -f "$ENTITY_CLI_BIN" ] && [ -f "$PROJECT_ROOT/entity-cli" ]; then
12
+ ENTITY_CLI_BIN="$PROJECT_ROOT/entity-cli"
13
+ fi
14
+
10
15
  # Load language from .env
11
16
  if [ -f .env ]; then
12
17
  LANGUAGE=$(grep '^LANGUAGE=' .env | cut -d '=' -f2)
@@ -70,11 +75,11 @@ if [ $# -eq 0 ]; then
70
75
  fi
71
76
 
72
77
  # Require prebuilt CLI binary
73
- if [ ! -f "$PROJECT_ROOT/bin/entity-cli" ]; then
78
+ if [ ! -f "$ENTITY_CLI_BIN" ]; then
74
79
  if [ "$LANGUAGE" = "en" ]; then
75
- echo "❌ bin/entity-cli not found"
80
+ echo "❌ entity-cli not found (bin/entity-cli or ./entity-cli)"
76
81
  else
77
- echo "❌ bin/entity-cli 파일이 없습니다"
82
+ echo "❌ entity-cli 파일이 없습니다 (bin/entity-cli 또는 ./entity-cli)"
78
83
  fi
79
84
  exit 1
80
85
  fi
@@ -115,7 +120,7 @@ fi
115
120
 
116
121
  build_cmd() {
117
122
  local entity_name="$1"
118
- local cmd=("$PROJECT_ROOT/bin/entity-cli" sync-index --entity="$entity_name")
123
+ local cmd=("$ENTITY_CLI_BIN" sync-index --entity="$entity_name")
119
124
  if [ "$APPLY_MODE" = "--apply" ]; then
120
125
  cmd+=(--apply)
121
126
  fi