Skip to content

Commit 374e0fa

Browse files
HiDeoosarah11918delucis
authored
Update preview platforms (#93)
Co-authored-by: sarah11918 <5098874+sarah11918@users.noreply.github.com> Co-authored-by: delucis <357379+delucis@users.noreply.github.com>
1 parent 76ba20f commit 374e0fa

File tree

17 files changed

+83
-81
lines changed

17 files changed

+83
-81
lines changed

.github/workflows/format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
- name: Install dependencies
3535
run: pnpm install
3636

37-
- name: Update IDX template
38-
run: pnpm generate:idx
37+
- name: Update Firebase Studio template
38+
run: pnpm generate:firebase-studio
3939

4040
- name: Format
4141
run: pnpm run format

.idx-templates/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `.idx-templates`
22

3-
This directory contains [custom templates](https://developers.google.com/idx/guides/custom-templates) for the IDX cloud development environment.
3+
This directory contains [custom templates](https://firebase.google.com/docs/studio/custom-templates) for the Firebase Studio cloud development environment.
44

55
There is a template each for Astro's `latest` and `next` branches.
66

@@ -9,7 +9,7 @@ There is a template each for Astro's `latest` and `next` branches.
99
Each template contains the following files:
1010

1111
- `dev.nix` — a Nix configuration for the packages in the dev environment, setup commands to run, etc.
12-
- `icon.png` — the Astro logo, used in IDX’s user interface.
13-
- `idx-template.json` — configuration for the modal IDX shows when launching the template. This is kept in sync with templates from the Astro monorepo with the `pnpm generate:idx` script.
12+
- `icon.png` — the Astro logo, used in Firebase Studio’s user interface.
13+
- `idx-template.json` — configuration for the modal Firebase Studio shows when launching the template. This is kept in sync with templates from the Astro monorepo with the `pnpm generate:firebase-studio` script.
1414
- `idx-template.nix` — a Nix configuration for how to scaffold a new project. This runs `create astro` silently under the hood.
15-
- `README.md`IDX links to the template folder from its launcher, so this is a minimal welcome for visitors from that flow.
15+
- `README.md`Firebase Studio links to the template folder from its launcher, so this is a minimal welcome for visitors from that flow.

.idx-templates/latest/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Astro × IDX
1+
# Astro × Firebase Studio
22

3-
Get started on IDX with Astro’s official templates.
3+
Get started on Firebase Studio with Astro’s official templates.
44

5-
<a href="https://idx.google.com/new?template=https://github.com/withastro/astro.new/tree/main/.idx-templates/latest">
6-
<img height="32" alt="Open in IDX" src="https://cdn.idx.dev/btn/open_dark_32.svg">
5+
<a href="https://studio.firebase.google.com/new?template=https://github.com/withastro/astro.new/tree/main/.idx-templates/latest">
6+
<img height="32" alt="Open in Firebase Studio" src="https://cdn.firebasestudio.dev/btn/open_dark_32.svg">
77
</a>

.idx-templates/latest/dev.nix

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# To learn more about how to use Nix to configure your environment
2-
# see: https://developers.google.com/idx/guides/customize-idx-env
2+
# see: https://firebase.google.com/docs/studio/devnix-reference
33
{ pkgs, ... }: {
44
# Which nixpkgs channel to use.
55
channel = "stable-24.05"; # or "unstable"
@@ -9,10 +9,11 @@
99
env = { };
1010
idx = let
1111
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
12-
# Workaround for https://community.idx.dev/t/8374
13-
# `idx.extensions` only work for extensions declared in the Nixpkgs derivation used internally by IDX,
14-
# forked at some point from the official `release-24.05` channel.
15-
# Instead of relying on IDX internal installation, we also add a startup script to install/update the extensions.
12+
# Workaround for https://community.firebasestudio.dev/t/8374
13+
# `idx.extensions` only work for extensions declared in the Nixpkgs derivation used internally
14+
# by Firebase Studio, forked at some point from the official `release-24.05` channel.
15+
# Instead of relying on Firebase Studio internal installation, we also add a startup script to
16+
# install/update the extensions.
1617
extensions = [ "astro-build.astro-vscode" ];
1718
in {
1819
inherit extensions;

.idx-templates/latest/idx-template.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"--template"
2121
astroTemplate
2222
"--git" # Initialize Git repository in the new workspace
23-
"--no-install" # Skip installing dependency as it is done on a later phase of IDX startup
23+
"--no-install" # Skip installing dependency as it is done on a later phase of Firebase Studio startup
2424
"--skip-houston" # Skip the Houston animation since this command runs non-interactively
2525
"--yes" # Accept all default options
2626
]
@@ -31,15 +31,15 @@
3131
3232
cd "$out"
3333
34-
# Create IDX config directory in the workspace
34+
# Create Firebase Studio config directory in the workspace
3535
mkdir -p ".idx"
3636
37-
# Copy the template development configuration into the IDX directory
37+
# Copy the template development configuration into the `.idx` directory
3838
# Use cat piped to a file so it doesn't carry the permissions from the Nix store (read-only and owned by a different user)
3939
cat ${./dev.nix} > ".idx/dev.nix"
4040
cp ${./icon.png} "$out/.idx/icon.png"
41-
42-
# Overwrite extensions file for IDX so it doesn't show the extension recommendation popup
41+
42+
# Overwrite extensions file for Firebase Studio so it doesn't show the extension recommendation popup
4343
# The extension will be installed automatically
4444
mkdir -p .vscode
4545
cat ${./extensions.json} > ".vscode/extensions.json"

.idx-templates/next/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Astro × IDX
1+
# Astro × Firebase Studio
22

3-
Try experimental releases of Astro’s official templates in IDX.
3+
Try experimental releases of Astro’s official templates in Firebase Studio.
44

5-
<a href="https://idx.google.com/new?template=https://github.com/withastro/astro.new/tree/main/.idx-templates/next">
6-
<img height="32" alt="Try in IDX" src="https://cdn.idx.dev/btn/try_dark_32.svg">
5+
<a href="https://studio.firebase.google.com/new?template=https://github.com/withastro/astro.new/tree/main/.idx-templates/next">
6+
<img height="32" alt="Try in Firebase Studio" src="https://cdn.firebasestudio.dev/btn/try_dark_32.svg">
77
</a>

.idx-templates/next/dev.nix

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# To learn more about how to use Nix to configure your environment
2-
# see: https://developers.google.com/idx/guides/customize-idx-env
2+
# see: https://firebase.google.com/docs/studio/devnix-reference
33
{ pkgs, ... }: {
44
# Which nixpkgs channel to use.
55
channel = "stable-24.05"; # or "unstable"
@@ -9,10 +9,11 @@
99
env = { };
1010
idx = let
1111
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
12-
# Workaround for https://community.idx.dev/t/8374
13-
# `idx.extensions` only work for extensions declared in the Nixpkgs derivation used internally by IDX,
14-
# forked at some point from the official `release-24.05` channel.
15-
# Instead of relying on IDX internal installation, we also add a startup script to install/update the extensions.
12+
# Workaround for https://community.firebasestudio.dev/t/8374
13+
# `idx.extensions` only work for extensions declared in the Nixpkgs derivation used internally
14+
# by Firebase Studio, forked at some point from the official `release-24.05` channel.
15+
# Instead of relying on Firebase Studio internal installation, we also add a startup script to
16+
# install/update the extensions.
1617
extensions = [ "astro-build.astro-vscode" ];
1718
in {
1819
inherit extensions;

.idx-templates/next/idx-template.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"--template"
2424
astroTemplate
2525
"--git" # Initialize Git repository in the new workspace
26-
"--no-install" # Skip installing dependency as it is done on a later phase of IDX startup
26+
"--no-install" # Skip installing dependency as it is done on a later phase of Firebase Studio startup
2727
"--skip-houston" # Skip the Houston animation since this command runs non-interactively
2828
"--yes" # Accept all default options
2929
]
@@ -34,15 +34,15 @@
3434
3535
cd "$out"
3636
37-
# Create IDX config directory in the workspace
37+
# Create Firebase Studio config directory in the workspace
3838
mkdir -p ".idx"
3939
40-
# Copy the template development configuration into the IDX directory
40+
# Copy the template development configuration into the `.idx` directory
4141
# Use cat piped to a file so it doesn't carry the permissions from the Nix store (read-only and owned by a different user)
4242
cat ${./dev.nix} > ".idx/dev.nix"
4343
cp ${./icon.png} "$out/.idx/icon.png"
44-
45-
# Overwrite extensions file for IDX so it doesn't show the extension recommendation popup
44+
45+
# Overwrite extensions file for Firebase Studio so it doesn't show the extension recommendation popup
4646
# The extension will be installed automatically
4747
mkdir -p .vscode
4848
cat ${./extensions.json} > ".vscode/extensions.json"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lint": "astro sync && run-s --continue-on-error lint:*",
1818
"lint:biome": "biome lint .",
1919
"lint:astro": "astro check",
20-
"generate:idx": "pnpm dlx tsx ./scripts/generate-idx-template.ts"
20+
"generate:firebase-studio": "pnpm dlx tsx ./scripts/generate-firebase-studio-template.ts"
2121
},
2222
"prettier": "@astrojs/site-kit/prettier",
2323
"dependencies": {

scripts/generate-idx-template.ts renamed to scripts/generate-firebase-studio-template.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { writeFile } from 'fs/promises';
2-
import { getIdxParams } from '../src/data/examples-shared.js';
2+
import { getFirebaseStudioParams } from '../src/data/examples-shared.js';
33

4-
await generateIDXTemplate('latest');
5-
await generateIDXTemplate('next');
4+
await generateFirebaseStudioTemplate('latest');
5+
await generateFirebaseStudioTemplate('next');
66

7-
async function generateIDXTemplate(ref: 'latest' | 'next') {
7+
async function generateFirebaseStudioTemplate(ref: 'latest' | 'next') {
88
console.time(`Updated ${ref}/idx-template.json`);
99
// .idx-templates/latest/idx-template.json
1010
const template = {
@@ -17,7 +17,7 @@ async function generateIDXTemplate(ref: 'latest' | 'next') {
1717
name: 'Starter template',
1818
type: 'enum',
1919
default: 'basics',
20-
options: await getIdxParams(ref),
20+
options: await getFirebaseStudioParams(ref),
2121
required: true,
2222
},
2323
],

0 commit comments

Comments
 (0)