Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip Vscode #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# syntax = docker/dockerfile:1

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=23.1.0
ARG NODE_VERSION=20.10.0
FROM node:${NODE_VERSION}-slim as base

LABEL fly_launch_runtime="Astro"

# Install code-server
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
curl \
git \
ca-certificates && \
curl -fsSL https://code-server.dev/install.sh | sh && \
rm -rf /var/lib/apt/lists/*

# Astro app lives here
WORKDIR /app

Expand Down Expand Up @@ -83,6 +92,9 @@ COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
COPY --from=build /app/template /app/template

# Pre-run flutter pub get in template directory
RUN cd /app/template && flutter pub get

ENV PORT=4321
ENV HOST=0.0.0.0

Expand Down
10 changes: 5 additions & 5 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// @ts-check
import { defineConfig } from 'astro/config';

import react from '@astrojs/react';

import tailwind from '@astrojs/tailwind';

import node from '@astrojs/node';

// https://astro.build/config
export default defineConfig({
output: 'server',
integrations: [react(), tailwind()],

adapter: node({
mode: 'standalone'
})
}),
server: {
port: 4321,
host: true
}
});
2 changes: 1 addition & 1 deletion fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ primary_region = 'cdg'
[[vm]]
memory = '4gb'
cpu_kind = 'performance'
cpus = 1
cpus = 2
8 changes: 8 additions & 0 deletions lsp_testing/hot-restart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
JOB_ID="$1"

curl -X POST http://localhost:4321/api/flutter/hot-restart.json \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "{\"jobId\": \"$JOB_ID\"}" \
--trace-ascii /dev/stdout
8 changes: 8 additions & 0 deletions lsp_testing/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
FILE_CONTENT=$(base64 -i "$1")

curl -X POST http://localhost:4321/api/flutter/start.json \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "{\"fileContent\": \"$FILE_CONTENT\", \"path\": \"$2\"}" \
--trace-ascii /dev/stdout
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,23 @@
"@astrojs/node": "^9.0.0",
"@astrojs/react": "^4.0.0",
"@astrojs/tailwind": "^5.1.3",
"@microsoft/1ds-core-js": "^4.3.4",
"@parcel/watcher": "^2.5.0",
"@types/react": "^18.3.14",
"@types/react-dom": "^18.3.2",
"@vscode/proxy-agent": "^0.27.0",
"@vscode/ripgrep": "^1.15.9",
"astro": "^5.0.3",
"install": "^0.13.0",
"node-fetch": "^3.3.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwindcss": "^3.4.16"
"tailwindcss": "^3.4.16",
"vscode-regexpp": "^3.1.0"
},
"devDependencies": {
"@flydotio/dockerfile": "^0.5.9",
"@types/node": "^22.10.1"
"@types/node": "^22.10.1",
"@types/node-fetch": "^2.6.12"
}
}
Loading