From 63daf2066005feaaf64545b5da47ec754d146320 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Wed, 11 Sep 2024 16:00:27 -0400 Subject: [PATCH] IDX setup --- nextjs-end/.env | 3 ++- nextjs-end/.idx/dev.nix | 7 +++++++ nextjs-end/.idx/setup.mjs | 0 nextjs-end/idx-template.json | 12 +++++++++--- nextjs-end/idx-template.nix | 4 ++-- nextjs-start/.env | 1 + 6 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 nextjs-end/.idx/setup.mjs diff --git a/nextjs-end/.env b/nextjs-end/.env index 9da8141a7..b2e6bcbf7 100644 --- a/nextjs-end/.env +++ b/nextjs-end/.env @@ -3,4 +3,5 @@ NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="" NEXT_PUBLIC_FIREBASE_PROJECT_ID="" NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="" NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="" -NEXT_PUBLIC_FIREBASE_APP_ID="" \ No newline at end of file +NEXT_PUBLIC_FIREBASE_APP_ID="" +GEMINI_API_KEY="" \ No newline at end of file diff --git a/nextjs-end/.idx/dev.nix b/nextjs-end/.idx/dev.nix index afdd177b5..45c490932 100644 --- a/nextjs-end/.idx/dev.nix +++ b/nextjs-end/.idx/dev.nix @@ -3,11 +3,18 @@ packages = [ pkgs.nodejs_20 ]; + env = { + GOOGLE_PROJECT = ""; + NEXT_TELEMETRY_DISABLED = "1"; + }; idx.workspace = { onStart = { npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing"; default.openFiles = [".env"]; }; + onCreate = { + firebase-use = "firebase use "; + }; }; idx.extensions = [ ]; diff --git a/nextjs-end/.idx/setup.mjs b/nextjs-end/.idx/setup.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/nextjs-end/idx-template.json b/nextjs-end/idx-template.json index d4b30f374..cdab444d3 100644 --- a/nextjs-end/idx-template.json +++ b/nextjs-end/idx-template.json @@ -15,13 +15,19 @@ "required": true }, { - "id": "apiKey", - "name": "Firebase API Key", + "id": "firebaseAppId", + "name": "Firebase Web App API Key", "type": "string", "required": true }, { - "id": "apiKey", + "id": "firebaseApiKey", + "name": "Firebase Web App ID", + "type": "string", + "required": true + }, + { + "id": "geminiApiKey", "name": "Gemini API Key", "type": "string", "required": true diff --git a/nextjs-end/idx-template.nix b/nextjs-end/idx-template.nix index 1d8dac676..89708abec 100644 --- a/nextjs-end/idx-template.nix +++ b/nextjs-end/idx-template.nix @@ -6,8 +6,8 @@ ]; bootstrap = '' npx -y giget gh:firebase/friendlyeats-web/nextjs-end#jamesdaniels_fixServiceWorkers "$WS_NAME" - rm "$WS_NAME/idx-template.json" - rm "$WS_NAME/idx-template.nix" + rm "$WS_NAME/idx-template".{nix|json} + sed -e 's//${projectId}/' ${.idx/dev.nix} > "$WS_NAME/.idx/dev.nix" mv "$WS_NAME" "$out" ''; } \ No newline at end of file diff --git a/nextjs-start/.env b/nextjs-start/.env index adbeda666..b2e6bcbf7 100644 --- a/nextjs-start/.env +++ b/nextjs-start/.env @@ -4,3 +4,4 @@ NEXT_PUBLIC_FIREBASE_PROJECT_ID="" NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="" NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="" NEXT_PUBLIC_FIREBASE_APP_ID="" +GEMINI_API_KEY="" \ No newline at end of file