mirror of
https://github.com/storytold/artcraft-services.git
synced 2026-11-20 17:31:45 +01:00
- **shell:S7688 (43)**: `[[ ]]` in place of `[ ]` in
`script/metrics/apply_{dashboards,metric_configs,monitors}.sh`,
`script/common/frontend_preflight.sh` and
`script/website/unix_frontend_dashboard_dev.sh`. Every script has a bash
shebang and `bash -n` passes. No test uses `-a`/`-o`, escaped
parentheses or an unquoted pattern on the right of `=`. The numeric
operands are `$#`, internal flags, exit codes, a parsed Node major
version and curl's status code, so `[[ ]]`'s arithmetic reading changes
nothing.
- **shell:S6505 (4)**: `npm install --ignore-scripts` in
`frontend_preflight.sh`, `unix_frontend_webapp_dev.sh` and
`frontend/build_modules.sh`. The frontend has no install scripts of its
own, and this repo's CI already builds with `npm ci --ignore-scripts`.
Same change as storytold/artcraft#2818.
- **Scope**: `_docs/old/**` joins `sonar.exclusions`. It's the retired
local-dev setup (an old Dockerfile, `kubernetes.yml`, nginx config) that
nothing references, and it held the docker and kubernetes findings under
`_docs/old/old_localdev_setup`.
Same as the other PRs here: not merged without the owner's go-ahead
(production service).
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Chores**
* Frontend dependency installation now skips package-provided lifecycle
scripts, including during development setup. This changes which scripts
run during installation but does not change the frontend’s intended
features or behavior.
* Updated internal checks used by dashboard, metric, and monitor scripts
without changing their conditions or outcomes.
* Expanded static-analysis exclusions to include archived documentation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
43 lines
1.4 KiB
Bash
Executable File
43 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# This works on Linux and MacOS to launch the frontend dev server
|
|
|
|
set -e
|
|
|
|
root_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
frontend_path="${root_dir}/frontend"
|
|
|
|
source "${root_dir}/script/common/frontend_preflight.sh"
|
|
frontend_preflight "${frontend_path}"
|
|
|
|
echo "Running Artcraft Webapp in Dev Mode..."
|
|
echo ""
|
|
|
|
# Free the webapp's dev port before startup.
|
|
if lsof -i tcp:4201 &>/dev/null; then
|
|
lsof -i tcp:4201 -t | xargs kill -9
|
|
echo "Killed process running on port 4201"
|
|
else
|
|
echo "No process running on port 4201"
|
|
fi
|
|
|
|
cd "${frontend_path}"
|
|
|
|
npm install --ignore-scripts
|
|
|
|
export VITE_ENVIRONMENT_TYPE="production"
|
|
|
|
# # Backend devs: launch with USE_LOCAL_API=1 (or `export USE_LOCAL_API=1` once
|
|
# # in your shell profile) to point the frontend at a local storyteller-web on
|
|
# # http://localhost:12345. Unset/0 — the frontend-dev default — hits
|
|
# # production. This replaces the comment/uncomment dance around
|
|
# # StorytellerApiHostStore.setDevelopment() in src/main.tsx.
|
|
# export VITE_USE_LOCAL_API="${USE_LOCAL_API:-0}"
|
|
# if [[ "${VITE_USE_LOCAL_API}" == "1" ]]; then
|
|
# echo "USE_LOCAL_API=1 — API calls will target http://localhost:12345"
|
|
# else
|
|
# echo "API calls will target production (set USE_LOCAL_API=1 for a local backend)"
|
|
# fi
|
|
export VITE_USE_LOCAL_API="true"
|
|
|
|
exec ./node_modules/.bin/nx dev @frontend/artcraft-webapp "$@"
|