Skip to content

Commit 4df1e48

Browse files
authored
refactor(frontend) :: move the browser sources to frontend/src
Before the frontend code was in the same folder as the handlebars templates, migrations, and config file. Now frontend code is in `frontend/src`, following the common pattern for node projects. The frontend stil builds out to `frontend/dist`.
1 parent e27b054 commit 4df1e48

15 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ jobs:
259259
ref_scope="pr-${{ github.event.pull_request.number }}"
260260
fi
261261
262-
recipe_hash="${{ hashFiles('Dockerfile', '.cargo/**', 'Cargo.toml', 'Cargo.lock', 'build.rs', 'scripts/**', 'sqlpage/**', 'package.json', 'package-lock.json') }}"
262+
recipe_hash="${{ hashFiles('Dockerfile', '.cargo/**', 'Cargo.toml', 'Cargo.lock', 'build.rs', 'scripts/**', 'sqlpage/**', 'frontend/src/**', 'package.json', 'package-lock.json') }}"
263263
{
264264
echo "current=sqlpage-${ref_scope}${{ matrix.tag_suffix }}-${recipe_hash}"
265265
echo "main=sqlpage-main${{ matrix.tag_suffix }}-${recipe_hash}"
@@ -339,7 +339,7 @@ jobs:
339339
ref_scope="pr-${{ github.event.pull_request.number }}"
340340
fi
341341
342-
recipe_hash="${{ hashFiles('Dockerfile', '.cargo/**', 'Cargo.toml', 'Cargo.lock', 'build.rs', 'scripts/**', 'sqlpage/**', 'package.json', 'package-lock.json') }}"
342+
recipe_hash="${{ hashFiles('Dockerfile', '.cargo/**', 'Cargo.toml', 'Cargo.lock', 'build.rs', 'scripts/**', 'sqlpage/**', 'frontend/src/**', 'package.json', 'package-lock.json') }}"
343343
{
344344
echo "artifact=sqlpage-${ref_scope}-linux-amd64-hurl-${recipe_hash}"
345345
echo "current=sqlpage-${ref_scope}-linux-amd64-${recipe_hash}"

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ JavaScript where needed.
3434
retries, and optional `on_connect.sql`/`on_reset.sql` hooks. Database-specific SQL should be isolated or
3535
covered by the relevant database tests.
3636
- **Rendering and components** (`src/render.rs`, `src/templates.rs`, `src/dynamic_component.rs`,
37-
`src/template_helpers.rs`, `sqlpage/templates/`, `sqlpage/sqlpage.css`, `sqlpage/sqlpage.js`). Built-in components live in `sqlpage/templates/*.handlebars` and cover shells, text,
37+
`src/template_helpers.rs`, `sqlpage/templates/`, `frontend/src/`). Built-in components live in `sqlpage/templates/*.handlebars` and cover shells, text,
3838
tables, lists, cards, charts, forms, navigation, modals, downloads, maps, and more. Query columns map to
3939
component properties; nested/dynamic components and `sqlpage.run_sql` support composition and lazy loading.
4040
Custom Handlebars components can be placed in the configured `sqlpage/templates` directory. Raw HTML and
@@ -145,4 +145,4 @@ official documentation website sql tables:
145145
- Routing: file-based in `src/webserver/routing.rs`. Missing paths use the nearest ancestor `404.sql`; without one, HTML uses `src/default_404.sql` and other formats receive a plain-text 404.
146146
- Playwright component suites: `tests/end-to-end/fixtures/<suite>/{index.sql,test.ts}` using `tests/end-to-end/fixture.ts`; official-site smoke tests remain in `tests/end-to-end/*.spec.ts`.
147147
- Follow patterns from similar modules before introducing new abstractions.
148-
- frontend: see [css](./sqlpage/sqlpage.css) and [js](./sqlpage/sqlpage.js)
148+
- frontend: see [frontend/src](./frontend/src/), bundled by `npm run build`

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM node:26-slim AS frontend
22
WORKDIR /usr/src/sqlpage
33
COPY package.json package-lock.json ./
44
RUN npm ci --ignore-scripts
5-
COPY sqlpage/ sqlpage/
5+
COPY frontend/src/ frontend/src/
66
COPY scripts/build-frontend.mjs scripts/
77
RUN node scripts/build-frontend.mjs
88

File renamed without changes.

0 commit comments

Comments
 (0)