@ankhorage/infra 4.0.0 → 4.1.0
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/CHANGELOG.md +6 -0
- package/README.md +6 -1
- package/dist/adapters/minikube/base/index.js +26 -10
- package/dist/adapters/minikube/base/index.js.map +1 -1
- package/dist/project/index.d.ts +1 -1
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/index.js +1 -1
- package/dist/project/index.js.map +1 -1
- package/dist/readme-usage.js +5 -0
- package/dist/readme-usage.js.map +1 -1
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +24 -0
- package/dist/runtime.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/minikube/README.md +9 -1
- package/src/adapters/minikube/base/index.test.ts +33 -0
- package/src/adapters/minikube/base/index.ts +28 -10
- package/src/adapters/minikube/base/portForwardRuntime.test.ts +288 -0
- package/src/adapters/minikube/base/twoAppIsolation.integration.test.ts +272 -9
- package/src/project/index.test.ts +46 -0
- package/src/project/index.ts +1 -0
- package/src/readme-usage.ts +5 -0
- package/src/runtime.ts +31 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# INFRA
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Executable infra provider and standalone CLI for Ankhorage project workflows.
|
|
9
9
|
|
|
@@ -37,6 +37,11 @@ omit it when cwd is already inside `apps/<project>`. Programmatic project
|
|
|
37
37
|
operations accept an explicit project path and do not require Studio or a
|
|
38
38
|
particular workspace layout.
|
|
39
39
|
|
|
40
|
+
Running applications can repair their provider-aware host endpoints through
|
|
41
|
+
`ensureProjectInfrastructureRuntime()` from `@ankhorage/infra/project`. This
|
|
42
|
+
operation only ensures the generated runtime port-forward group; it does not
|
|
43
|
+
deploy, bootstrap, or reconcile infrastructure.
|
|
44
|
+
|
|
40
45
|
Source: `src/readme-usage.ts`
|
|
41
46
|
|
|
42
47
|
```ts
|
|
@@ -290,6 +290,13 @@ host-level Supabase Compose runtime.
|
|
|
290
290
|
- \`reset.sh\`: requires \`ANKH_RESET_CONFIRM=${appSlug}\`; ${resetDescription}. It does not delete the Minikube profile.
|
|
291
291
|
- \`destroy.sh\`: deletes only \`minikube -p ${appSlug}\`.
|
|
292
292
|
|
|
293
|
+
### Port-forward groups
|
|
294
|
+
|
|
295
|
+
- \`./scripts/port-forward.sh start runtime\` idempotently ensures ${supabaseKubernetesEnabled ? '`app` and `supabase-gateway`' : '`app` only'}, the host endpoints required by the running application. The same group supports \`stop\` and \`status\`.
|
|
296
|
+
- \`runtime\` excludes \`studio\` and \`db-migration\`, which are operational/bootstrap endpoints.
|
|
297
|
+
- \`all\` retains every generated forward, including operational/bootstrap endpoints.
|
|
298
|
+
- Concrete targets remain available for individual lifecycle control.
|
|
299
|
+
|
|
293
300
|
## Generated Resources
|
|
294
301
|
|
|
295
302
|
${resourceLines}
|
|
@@ -2711,6 +2718,11 @@ CMD ["nginx", "-g", "daemon off;"]
|
|
|
2711
2718
|
}
|
|
2712
2719
|
function getPortForwardScript(args) {
|
|
2713
2720
|
const { appSlug, supabaseKubernetesEnabled, supabaseHostPorts } = args;
|
|
2721
|
+
const runtimeForwardNames = ['app', ...(supabaseKubernetesEnabled ? ['supabase-gateway'] : [])];
|
|
2722
|
+
const allForwardNames = [
|
|
2723
|
+
...runtimeForwardNames,
|
|
2724
|
+
...(supabaseKubernetesEnabled ? ['studio', 'db-migration'] : []),
|
|
2725
|
+
];
|
|
2714
2726
|
return `#!/usr/bin/env bash
|
|
2715
2727
|
set -euo pipefail
|
|
2716
2728
|
|
|
@@ -2728,6 +2740,8 @@ SUPABASE_STUDIO_FORWARD_LOCAL_PORT="\${SUPABASE_STUDIO_FORWARD_LOCAL_PORT:-${sup
|
|
|
2728
2740
|
SUPABASE_STUDIO_FORWARD_REMOTE_PORT="\${SUPABASE_STUDIO_FORWARD_REMOTE_PORT:-3000}"
|
|
2729
2741
|
SUPABASE_DB_FORWARD_LOCAL_PORT="\${SUPABASE_DB_FORWARD_LOCAL_PORT:-${supabaseHostPorts.db}}"
|
|
2730
2742
|
SUPABASE_DB_FORWARD_REMOTE_PORT="\${SUPABASE_DB_FORWARD_REMOTE_PORT:-5432}"
|
|
2743
|
+
RUNTIME_FORWARD_NAMES=(${runtimeForwardNames.join(' ')})
|
|
2744
|
+
ALL_FORWARD_NAMES=(${allForwardNames.join(' ')})
|
|
2731
2745
|
|
|
2732
2746
|
if [[ -f "\${ROOT_DIR}/.env" ]]; then
|
|
2733
2747
|
set -a
|
|
@@ -3013,26 +3027,28 @@ status_forward() {
|
|
|
3013
3027
|
|
|
3014
3028
|
for_each_forward() {
|
|
3015
3029
|
local action="\${1}"
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
"\${action}_forward"
|
|
3020
|
-
|
|
3021
|
-
fi
|
|
3030
|
+
shift
|
|
3031
|
+
local name
|
|
3032
|
+
for name in "\${@}"; do
|
|
3033
|
+
"\${action}_forward" "\${name}"
|
|
3034
|
+
done
|
|
3022
3035
|
}
|
|
3023
3036
|
|
|
3024
3037
|
ACTION="\${1:-start}"
|
|
3025
3038
|
NAME="\${2:-all}"
|
|
3026
3039
|
|
|
3027
3040
|
case "\${ACTION}:\${NAME}" in
|
|
3028
|
-
start:
|
|
3029
|
-
stop:
|
|
3030
|
-
status:
|
|
3041
|
+
start:runtime) for_each_forward start "\${RUNTIME_FORWARD_NAMES[@]}" ;;
|
|
3042
|
+
stop:runtime) for_each_forward stop "\${RUNTIME_FORWARD_NAMES[@]}" ;;
|
|
3043
|
+
status:runtime) for_each_forward status "\${RUNTIME_FORWARD_NAMES[@]}" ;;
|
|
3044
|
+
start:all) for_each_forward start "\${ALL_FORWARD_NAMES[@]}" ;;
|
|
3045
|
+
stop:all) for_each_forward stop "\${ALL_FORWARD_NAMES[@]}" ;;
|
|
3046
|
+
status:all) for_each_forward status "\${ALL_FORWARD_NAMES[@]}" ;;
|
|
3031
3047
|
start:*) start_forward "\${NAME}" ;;
|
|
3032
3048
|
stop:*) stop_forward "\${NAME}" ;;
|
|
3033
3049
|
status:*) status_forward "\${NAME}" ;;
|
|
3034
3050
|
*)
|
|
3035
|
-
echo "Usage: ./scripts/port-forward.sh {start|stop|status} {app|supabase-gateway|studio|db-migration|all}"
|
|
3051
|
+
echo "Usage: ./scripts/port-forward.sh {start|stop|status} {app|supabase-gateway|studio|db-migration|runtime|all}"
|
|
3036
3052
|
exit 1
|
|
3037
3053
|
;;
|
|
3038
3054
|
esac
|