Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ jobs:
ref_scope="pr-${{ github.event.pull_request.number }}"
fi

recipe_hash="${{ hashFiles('Dockerfile', '.cargo/**', 'Cargo.toml', 'Cargo.lock', 'build.rs', 'scripts/**', 'sqlpage/**', 'package.json', 'package-lock.json') }}"
recipe_hash="${{ hashFiles('Dockerfile', '.cargo/**', 'Cargo.toml', 'Cargo.lock', 'build.rs', 'scripts/**', 'sqlpage/**', 'frontend/src/**', 'package.json', 'package-lock.json') }}"
{
echo "current=sqlpage-${ref_scope}${{ matrix.tag_suffix }}-${recipe_hash}"
echo "main=sqlpage-main${{ matrix.tag_suffix }}-${recipe_hash}"
Expand Down Expand Up @@ -360,7 +360,7 @@ jobs:
ref_scope="pr-${{ github.event.pull_request.number }}"
fi

recipe_hash="${{ hashFiles('Dockerfile', '.cargo/**', 'Cargo.toml', 'Cargo.lock', 'build.rs', 'scripts/**', 'sqlpage/**', 'package.json', 'package-lock.json') }}"
recipe_hash="${{ hashFiles('Dockerfile', '.cargo/**', 'Cargo.toml', 'Cargo.lock', 'build.rs', 'scripts/**', 'sqlpage/**', 'frontend/src/**', 'package.json', 'package-lock.json') }}"
{
echo "artifact=sqlpage-${ref_scope}-linux-amd64-hurl-${recipe_hash}"
echo "current=sqlpage-${ref_scope}-linux-amd64-${recipe_hash}"
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ JavaScript where needed.
retries, and optional `on_connect.sql`/`on_reset.sql` hooks. Database-specific SQL should be isolated or
covered by the relevant database tests.
- **Rendering and components** (`src/render.rs`, `src/templates.rs`, `src/dynamic_component.rs`,
`src/template_helpers.rs`, `sqlpage/templates/`, `sqlpage/sqlpage.css`, `sqlpage/sqlpage.js`). Built-in components live in `sqlpage/templates/*.handlebars` and cover shells, text,
`src/template_helpers.rs`, `sqlpage/templates/`, `frontend/src/`). Built-in components live in `sqlpage/templates/*.handlebars` and cover shells, text,
tables, lists, cards, charts, forms, navigation, modals, downloads, maps, and more. Query columns map to
component properties; nested/dynamic components and `sqlpage.run_sql` support composition and lazy loading.
Custom Handlebars components can be placed in the configured `sqlpage/templates` directory. Raw HTML and
Expand Down Expand Up @@ -145,4 +145,4 @@ official documentation website sql tables:
- 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.
- 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`.
- Follow patterns from similar modules before introducing new abstractions.
- frontend: see [css](./sqlpage/sqlpage.css) and [js](./sqlpage/sqlpage.js)
- frontend: see [frontend/src](./frontend/src/), bundled by `npm run build`
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM node:26-slim AS frontend
WORKDIR /usr/src/sqlpage
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
COPY sqlpage/ sqlpage/
COPY frontend/src/ frontend/src/
COPY scripts/build-frontend.mjs scripts/
RUN node scripts/build-frontend.mjs

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lambda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM node:26-slim AS frontend
WORKDIR /usr/src/sqlpage
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
COPY sqlpage/ sqlpage/
COPY frontend/src/ frontend/src/
COPY scripts/build-frontend.mjs scripts/
RUN node scripts/build-frontend.mjs

Expand Down
6 changes: 3 additions & 3 deletions scripts/build-frontend.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const STYLESHEET = [
];

const COPIED = {
"favicon.svg": "sqlpage/favicon.svg",
"favicon.svg": "frontend/src/favicon.svg",
"tabler-sprite.svg":
"node_modules/@tabler/icons-sprite/dist/tabler-sprite.svg",
};
Expand All @@ -25,7 +25,7 @@ function refuse(warning) {

async function bundle(entry) {
const build = await rolldown({
input: { [entry]: `sqlpage/${entry}.js` },
input: { [entry]: `frontend/src/${entry}.js` },
onwarn: refuse,
});
await build.write({ dir: DIST, format: "iife", minify: true });
Expand All @@ -34,7 +34,7 @@ async function bundle(entry) {

async function stylesheet() {
const vendored = await Promise.all(STYLESHEET.map((s) => readFile(s)));
const own = await readFile("sqlpage/sqlpage.css");
const own = await readFile("frontend/src/sqlpage.css");
const parts = [...vendored.map((v) => `${v}\n`), own];
await writeFile(`${DIST}/sqlpage.css`, parts.join(""));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/js/chart_series.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
align_series_for,
merged_x_values,
xaxis_type_for,
} from "../../sqlpage/chart_series.js";
} from "../../frontend/src/chart_series.js";

const ADDS_NOTHING_TO_THE_STACK = 0;
const LEAVES_A_GAP = null;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"noImplicitAny": false,
"types": []
},
"include": ["sqlpage/*.js", "sqlpage/globals.d.ts"]
"include": ["frontend/src"]
}