@sidebase/base-config 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -24
- package/dist/config.d.mts +49 -67
- package/dist/config.d.ts +49 -67
- package/dist/eslint/index.d.mts +3 -6
- package/dist/eslint/index.d.ts +3 -6
- package/dist/eslint/index.mjs +25 -56
- package/dist/prisma/index.d.mts +12 -32
- package/dist/prisma/index.d.ts +12 -32
- package/dist/shared/{base-config.CuUhyvQo.d.mts → base-config.BoberVUk.d.mts} +4 -8
- package/dist/shared/{base-config.CuUhyvQo.d.ts → base-config.BoberVUk.d.ts} +4 -8
- package/docs/migration.md +12 -13
- package/package.json +1 -1
- package/presets/base/AGENTS.md +9 -0
- package/presets/base/dockerignore +7 -8
- package/presets/base/github/workflows/streamctl-upgrade.yml +13 -23
- package/presets/base/gitignore +6 -5
- package/presets/base/oxlintrc.json +3 -2
- package/presets/base/pnpm-workspace.yaml +9 -16
- package/presets/config.template.ts +2 -2
- package/presets/nuxt-app/Dockerfile +15 -20
- package/presets/nuxt-app/github/workflows/ci.yml +5 -6
- package/presets/nuxt-app/github/workflows/pr-preview-cleanup.yml +2 -2
- package/presets/nuxt-app/preset.json +1 -1
- package/presets/nuxt-app/templates/ci/e2e-job.yml +2 -5
|
@@ -5,24 +5,22 @@ ARG PNPM_VERSION=${PNPM_VERSION}
|
|
|
5
5
|
# --- BUILD STAGE ---
|
|
6
6
|
FROM $NODE_VERSION AS production-base
|
|
7
7
|
|
|
8
|
-
# A pre-`FROM` ARG is visible only to `FROM`. Re-declare it bare
|
|
9
|
-
#
|
|
8
|
+
# A pre-`FROM` ARG is visible only to `FROM`. Re-declare it bare here, or
|
|
9
|
+
# $PNPM_VERSION expands to empty below and pnpm installs at latest.
|
|
10
10
|
ARG PNPM_VERSION
|
|
11
11
|
|
|
12
12
|
WORKDIR /app
|
|
13
13
|
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
# on PATH, so no PNPM_HOME wiring is needed.
|
|
14
|
+
# Not corepack: Node 25 no longer bundles it. npm's global bin is already on
|
|
15
|
+
# PATH, so this needs no PNPM_HOME wiring.
|
|
17
16
|
RUN npm i -g pnpm@$PNPM_VERSION
|
|
18
17
|
|
|
19
18
|
# Copy pnpm files
|
|
20
19
|
COPY package.json pnpm-lock.yaml .npmrc* ./
|
|
21
20
|
${DOCKER_PRE_INSTALL}
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
# build steps below (docker.buildSteps) cover them against the full tree.
|
|
21
|
+
# --ignore-scripts: only package files exist at this layer, so a `postinstall`
|
|
22
|
+
# like `nuxt prepare` would run against no sources. The build steps below run it
|
|
23
|
+
# against the full tree instead.
|
|
26
24
|
RUN pnpm install --ignore-scripts --frozen-lockfile --prefer-offline
|
|
27
25
|
|
|
28
26
|
ARG ARG_NUXT_BUILD_CLIENT_SOURCE_MAPS=false
|
|
@@ -37,27 +35,24 @@ ${DOCKER_BUILD_STEPS}
|
|
|
37
35
|
# --- FINAL PRODUCTION STAGE ---
|
|
38
36
|
FROM $NODE_VERSION-slim AS production
|
|
39
37
|
|
|
40
|
-
# openssl is always installed: the Prisma query engine
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
# project-owned extras on top (docker.aptPackages knob, e.g. "ffmpeg").
|
|
38
|
+
# openssl is always installed: the Prisma query engine links libssl3, which slim
|
|
39
|
+
# images do not ship, and the app would crash on its first query without it.
|
|
40
|
+
# APT_PACKAGES adds project extras on top (docker.aptPackages).
|
|
44
41
|
ARG APT_PACKAGES="${APT_PACKAGES}"
|
|
45
42
|
RUN apt-get update && apt-get install -y --no-install-recommends openssl $APT_PACKAGES \
|
|
46
43
|
&& rm -rf /var/lib/apt/lists/*
|
|
47
44
|
|
|
48
|
-
#
|
|
49
|
-
# stage, owned by the runtime uid 1000 rather than root (see the USER switch below)
|
|
45
|
+
# Owned by uid 1000 so a future non-root switch needs no extra chown pass.
|
|
50
46
|
COPY --chown=node:node --from=production-base /app/.output /app/.output
|
|
51
47
|
|
|
52
48
|
WORKDIR /app
|
|
53
49
|
|
|
54
50
|
${DOCKER_PRISMA_RUNTIME}
|
|
55
51
|
${DOCKER_FINAL_STAGE}
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
59
|
-
#
|
|
60
|
-
USER node
|
|
52
|
+
# The container stays root on purpose. A `USER node` switch here breaks any
|
|
53
|
+
# deployment that overrides the CMD with a command needing root: the prisma-studio
|
|
54
|
+
# pods apt-install postgresql-client on start, which fails as an unprivileged user.
|
|
55
|
+
# Set docker.finalStage to "USER node" to opt back in.
|
|
61
56
|
|
|
62
57
|
# start the app
|
|
63
58
|
CMD [ "sh", "-c", "${DOCKER_START_COMMAND}" ]
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
# Managed by streamctl (full-own, render: ci).
|
|
2
|
-
#
|
|
3
|
-
# `packageManager` from package.json
|
|
4
|
-
# The build-and-deploy-* preview/staging/production suite is deferred to 0.2.0.
|
|
1
|
+
# Managed by streamctl (full-own, render: ci). Edits here are overwritten on sync.
|
|
2
|
+
# NODE_VERSION comes from the version baseline. pnpm is not pinned here because
|
|
3
|
+
# action-setup reads `packageManager` from package.json.
|
|
5
4
|
name: CI
|
|
6
5
|
|
|
7
6
|
on:
|
|
8
7
|
pull_request:
|
|
9
8
|
branches: [main]
|
|
10
9
|
|
|
11
|
-
#
|
|
12
|
-
#
|
|
10
|
+
# The jobs only read the repo. Install and build run third-party code, so a
|
|
11
|
+
# read-only default token limits what a malicious package can do.
|
|
13
12
|
permissions:
|
|
14
13
|
contents: read
|
|
15
14
|
|
|
@@ -5,8 +5,8 @@ on:
|
|
|
5
5
|
types:
|
|
6
6
|
- unlabeled
|
|
7
7
|
|
|
8
|
-
# Default-deny
|
|
9
|
-
#
|
|
8
|
+
# Default-deny so any future job starts read-only. The cleanup job below grants
|
|
9
|
+
# itself the exact write scopes it needs.
|
|
10
10
|
permissions:
|
|
11
11
|
contents: read
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"DOCKER_BUILD_ARGS": { "configPath": "docker.buildArgs", "default": "" },
|
|
30
30
|
"DOCKER_BUILD_STEPS": { "configPath": "docker.buildSteps", "default": "RUN pnpm nuxi prepare\nRUN pnpm prisma generate\nRUN pnpm run build" },
|
|
31
31
|
"DOCKER_FINAL_STAGE": { "configPath": "docker.finalStage", "default": "" },
|
|
32
|
-
"DOCKER_PRISMA_RUNTIME": { "configPath": "docker.prismaRuntime", "default": "COPY --chown=node:node --from=production-base /app/prisma /app/prisma\n\n# Prisma CLI
|
|
32
|
+
"DOCKER_PRISMA_RUNTIME": { "configPath": "docker.prismaRuntime", "default": "COPY --chown=node:node --from=production-base /app/prisma /app/prisma\n\n# Prisma CLI for `migrate deploy`. Override the pin with --build-arg.\nARG PRISMA_VERSION=${PRISMA_VERSION_DEFAULT}\n\n# Chowned to uid 1000 in the same layer, so a later USER switch needs no\n# second pass over node_modules.\nRUN npm i -D prisma@${PRISMA_VERSION} && chown -R node:node /app/node_modules" },
|
|
33
33
|
"PRISMA_VERSION_DEFAULT": { "configPath": "docker.prismaVersion", "fromDependency": "prisma", "default": "6.19.1", "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$" },
|
|
34
34
|
"DOCKER_START_COMMAND": { "configPath": "docker.startCommand", "default": "npm exec prisma migrate deploy && node --max-old-space-size-percentage=75 .output/server/index.mjs" }
|
|
35
35
|
},
|
|
@@ -34,9 +34,6 @@
|
|
|
34
34
|
- run: pnpm install --frozen-lockfile
|
|
35
35
|
# tests may import the generated Prisma client
|
|
36
36
|
- run: pnpm prisma generate
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
# the app's own harness owns, and CI cannot guess the reset/migrate/seed
|
|
40
|
-
# strategy. This job provides a healthy, reachable DB (DATABASE_URL above) and
|
|
41
|
-
# the generated client; test:e2e must create and seed its own schema.
|
|
37
|
+
# This job provides a reachable DB and the generated client. Schema setup and
|
|
38
|
+
# seeding belong to test:e2e, which owns the fixture strategy CI cannot guess.
|
|
42
39
|
- run: pnpm test:e2e
|