Skip to content

Commit

Permalink
IDX setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels committed Sep 11, 2024
1 parent 019d4e6 commit 63daf20
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
3 changes: 2 additions & 1 deletion nextjs-end/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
NEXT_PUBLIC_FIREBASE_APP_ID=""
GEMINI_API_KEY=""
7 changes: 7 additions & 0 deletions nextjs-end/.idx/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
packages = [
pkgs.nodejs_20
];
env = {
GOOGLE_PROJECT = "<project-id>";
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 <project-id>";
};
};
idx.extensions = [
];
Expand Down
Empty file added nextjs-end/.idx/setup.mjs
Empty file.
12 changes: 9 additions & 3 deletions nextjs-end/idx-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions nextjs-end/idx-template.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/<project-id>/${projectId}/' ${.idx/dev.nix} > "$WS_NAME/.idx/dev.nix"
mv "$WS_NAME" "$out"
'';
}
1 change: 1 addition & 0 deletions nextjs-start/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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=""

0 comments on commit 63daf20

Please sign in to comment.