diff --git a/affinescript-ecosystem/affinescript-vite/Justfile b/affinescript-ecosystem/affinescript-vite/Justfile index 14f51c62..dc21090e 100644 --- a/affinescript-ecosystem/affinescript-vite/Justfile +++ b/affinescript-ecosystem/affinescript-vite/Justfile @@ -356,90 +356,6 @@ verify-template: exit 1 fi -# Generate a V-lang connector scaffold from the Groove manifest -gen-v-connector: - #!/usr/bin/env bash - set -euo pipefail - MANIFEST=".machine_readable/integrations/groove.a2ml" - if [ ! -f "$MANIFEST" ]; then - echo "Error: No Groove manifest. Run 'just groove-setup' first." - exit 1 - fi - - # Extract service name and port from manifest - SERVICE=$(grep '(service "' "$MANIFEST" | head -1 | sed 's/.*"\(.*\)".*/\1/') - PORT=$(grep '(port ' "$MANIFEST" | head -1 | sed 's/.*(port \([0-9]*\)).*/\1/') - - if [ "$PORT" = "0" ] || [ -z "$PORT" ]; then - echo "Error: Port not assigned. Run 'just groove-setup' first." - exit 1 - fi - - # Check which API surfaces are enabled - REST=$(grep -q '(rest.*enabled true)' "$MANIFEST" && echo "true" || echo "false") - GRPC=$(grep -q '(grpc.*enabled true)' "$MANIFEST" && echo "true" || echo "false") - GRAPHQL=$(grep -q '(graphql.*enabled true)' "$MANIFEST" && echo "true" || echo "false") - - OUTDIR="connectors/v-${SERVICE}" - mkdir -p "${OUTDIR}/src" - - cat << VEOF | sed "s/^ //" > "${OUTDIR}/src/main.v" - // SPDX-License-Identifier: PMPL-1.0-or-later - // V-${SERVICE} — auto-generated V-lang connector. - // Generated by: just gen-v-connector - // From: ${MANIFEST} - - module v_${SERVICE//-/_} - - import net.http - import json - - pub struct Config { - pub mut: - base_url string = 'http://localhost:${PORT}' - } - - pub fn new_client(config Config) &Client { - return &Client{ config: config } - } - - pub fn new_default() &Client { - return new_client(Config{}) - } - - pub struct Client { - config Config - } - - pub fn (c &Client) health() !string { - resp := http.get('\${c.config.base_url}/health') or { - return error('${SERVICE} unreachable: \${err}') - } - if resp.status_code != 200 { - return error('${SERVICE} unhealthy: HTTP \${resp.status_code}') - } - return resp.body - } - - // Groove discovery - pub fn discover() ?&Client { - client := new_default() - if _ := client.health() { return client } - return none - } - - // PENDING: Add endpoint-specific methods for your API - // REST=${REST} gRPC=${GRPC} GraphQL=${GRAPHQL} - VEOF - - echo "Generated: ${OUTDIR}/src/main.v" - echo " Service: "${SERVICE}"" - echo " Port: "${PORT}"" - echo " REST: "${REST}", gRPC: "${GRPC}", GraphQL: "${GRAPHQL}"" - echo "" - echo "Next: add endpoint methods to ${OUTDIR}/src/main.v" - echo "Then copy to developer-ecosystem/v-ecosystem/connectors/" - # ═══════════════════════════════════════════════════════════════════════════════ # PROJECT SELF-ASSESSMENT # ═══════════════════════════════════════════════════════════════════════════════ diff --git a/affinescript-ecosystem/rattlescript/Justfile b/affinescript-ecosystem/rattlescript/Justfile index 3d116f56..88437369 100644 --- a/affinescript-ecosystem/rattlescript/Justfile +++ b/affinescript-ecosystem/rattlescript/Justfile @@ -360,90 +360,6 @@ verify-template: exit 1 fi -# Generate a V-lang connector scaffold from the Groove manifest -gen-v-connector: - #!/usr/bin/env bash - set -euo pipefail - MANIFEST=".machine_readable/integrations/groove.a2ml" - if [ ! -f "$MANIFEST" ]; then - echo "Error: No Groove manifest. Run 'just groove-setup' first." - exit 1 - fi - - # Extract service name and port from manifest - SERVICE=$(grep '(service "' "$MANIFEST" | head -1 | sed 's/.*"\(.*\)".*/\1/') - PORT=$(grep '(port ' "$MANIFEST" | head -1 | sed 's/.*(port \([0-9]*\)).*/\1/') - - if [ "$PORT" = "0" ] || [ -z "$PORT" ]; then - echo "Error: Port not assigned. Run 'just groove-setup' first." - exit 1 - fi - - # Check which API surfaces are enabled - REST=$(grep -q '(rest.*enabled true)' "$MANIFEST" && echo "true" || echo "false") - GRPC=$(grep -q '(grpc.*enabled true)' "$MANIFEST" && echo "true" || echo "false") - GRAPHQL=$(grep -q '(graphql.*enabled true)' "$MANIFEST" && echo "true" || echo "false") - - OUTDIR="connectors/v-${SERVICE}" - mkdir -p "${OUTDIR}/src" - - cat << VEOF | sed "s/^ //" > "${OUTDIR}/src/main.v" - // SPDX-License-Identifier: PMPL-1.0-or-later - // V-${SERVICE} — auto-generated V-lang connector. - // Generated by: just gen-v-connector - // From: ${MANIFEST} - - module v_${SERVICE//-/_} - - import net.http - import json - - pub struct Config { - pub mut: - base_url string = 'http://localhost:${PORT}' - } - - pub fn new_client(config Config) &Client { - return &Client{ config: config } - } - - pub fn new_default() &Client { - return new_client(Config{}) - } - - pub struct Client { - config Config - } - - pub fn (c &Client) health() !string { - resp := http.get('\${c.config.base_url}/health') or { - return error('${SERVICE} unreachable: \${err}') - } - if resp.status_code != 200 { - return error('${SERVICE} unhealthy: HTTP \${resp.status_code}') - } - return resp.body - } - - // Groove discovery - pub fn discover() ?&Client { - client := new_default() - if _ := client.health() { return client } - return none - } - - // TODO: Add endpoint-specific methods for your API - // REST=${REST} gRPC=${GRPC} GraphQL=${GRAPHQL} - VEOF - - echo "Generated: ${OUTDIR}/src/main.v" - echo " Service: ${SERVICE}" - echo " Port: ${PORT}" - echo " REST: ${REST}, gRPC: ${GRPC}, GraphQL: ${GRAPHQL}" - echo "" - echo "Next: add endpoint methods to ${OUTDIR}/src/main.v" - echo "Then copy to developer-ecosystem/v-ecosystem/connectors/" - # ═══════════════════════════════════════════════════════════════════════════════ # PROJECT SELF-ASSESSMENT # ═══════════════════════════════════════════════════════════════════════════════