Skip to content

Commit 3bbc377

Browse files
authored
mv docs (#129)
1 parent 69ff571 commit 3bbc377

39 files changed

+24
-40
lines changed

.github/workflows/plugin-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
RUNNER: ubuntu-24.04
7777
- PKGPATH: ./plugins/bao
7878
RUNNER: ubuntu-24.04
79+
- PKGPATH: ./plugins/docs
7980
- PKGPATH: ./plugins/runtime
8081

8182
runs-on: ${{ matrix.RUNNER || needs.pick_runner.outputs.random_runner }}

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,16 @@ RUN curl -sLO https://github.com/posit-dev/shinylive/releases/download/v${SHINYL
8686
mv shinylive-${SHINYLIVE_VERSION} shinylive && \
8787
rm shinylive-${SHINYLIVE_VERSION}.tar.gz
8888

89-
# Create plugins directory for plugin installs
90-
RUN mkdir -p ./plugins
89+
# Create plugins directory and symlink @trex npm packages for plugin scanner
90+
RUN mkdir -p ./plugins && \
91+
ln -sf $(pwd)/node_modules/@trex ./plugins/@trex
9192

9293
# Copy core (overridden by volume mount in development)
9394
COPY core/ ./core/
9495

9596
# Copy functions (overridden by volume mount in development)
9697
COPY functions/ ./functions/
9798

98-
# Build documentation site
99-
COPY core/docs/ ./core/docs/
100-
RUN cd core/docs && npm ci && npm run build
101-
10299
ENV SCHEMA_DIR=/usr/src/core/schema
103100
ENV DUCKDB_EXTENSION_DIRECTORY=/usr/share/trexsql/extensions
104101

core/server/index.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -536,19 +536,6 @@ app.use(`${FUNCTIONS_BASE_PATH}/:service_name`, async (req, res, next) => {
536536
}
537537
});
538538

539-
try {
540-
const docsDistPath = join(Deno.cwd(), "docs", "build");
541-
await Deno.stat(docsDistPath);
542-
const serveDocsStatic = (await import("express")).default.static;
543-
app.use(`${BASE_PATH}/docs`, serveDocsStatic(docsDistPath));
544-
app.get(`${BASE_PATH}/docs/*`, (_req, res) => {
545-
res.sendFile(join(docsDistPath, "index.html"));
546-
});
547-
console.log("Serving docs from docs/build/");
548-
} catch (_e) {
549-
console.warn("Docs not found — /trex/docs disabled");
550-
}
551-
552539
// Serve self-hosted Shinylive assets (must be before SPA catch-all)
553540
try {
554541
const shinyliveDistPath = join(Deno.cwd(), "shinylive");
@@ -566,7 +553,7 @@ try {
566553
const serveStatic = (await import("express")).default.static;
567554
app.use(BASE_PATH, serveStatic(webDistPath));
568555
app.get(`${BASE_PATH}/*`, (_req, res, next) => {
569-
if (_req.path.startsWith(`${BASE_PATH}/api/`) || _req.path.startsWith(`${BASE_PATH}/graphql`) || _req.path.startsWith(`${BASE_PATH}/graphiql`) || _req.path.startsWith(`${BASE_PATH}/_internal`) || _req.path.startsWith(`${BASE_PATH}/docs`)) {
556+
if (_req.path.startsWith(`${BASE_PATH}/api/`) || _req.path.startsWith(`${BASE_PATH}/graphql`) || _req.path.startsWith(`${BASE_PATH}/graphiql`) || _req.path.startsWith(`${BASE_PATH}/_internal`)) {
570557
return next();
571558
}
572559
res.sendFile(join(webDistPath, "index.html"));

core/server/plugin/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class Plugins {
2525
source: "dev" | "npm"
2626
) {
2727
try {
28-
if (!pkg.trex) {
28+
if (!pkg.trex || typeof pkg.trex !== "object") {
2929
console.log(
3030
`Plugin ${fullName} has no trex config — skipping registration`
3131
);

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
- ./core/server:/usr/src/core/server
3030
- ./functions:/usr/src/functions
3131
- ./plugins-dev:/usr/src/plugins-dev
32-
- ./core/docs:/usr/src/core/docs
32+
- ./plugins/docs:/usr/src/plugins/@trex/docs
3333
depends_on:
3434
postgres:
3535
condition: service_healthy

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@trex/migration": "latest",
1616
"@trex/pgwire": "latest",
1717
"@trex/tpm": "latest",
18+
"@trex/docs": "latest",
1819
"@trex/transform": "latest"
1920
}
2021
}

plugins/docs/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@trex:registry=https://pkgs.dev.azure.com/data2evidence/d2e/_packaging/trex/npm/registry/
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)