From b63c84a2859a881b1c8a21f784da209a55c76f29 Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Wed, 1 Jul 2026 16:00:34 +0200 Subject: [PATCH] Enforce devcontainer --- .devcontainer/frontend/devcontainer.json | 3 ++- .github/workflows/ci.yml | 2 ++ .github/workflows/publish-website.yml | 2 ++ website/.yarn/plugins/enforce-devcontainer.cjs | 16 ++++++++++++++++ website/.yarnrc.yml | 3 +++ 5 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 website/.yarn/plugins/enforce-devcontainer.cjs diff --git a/.devcontainer/frontend/devcontainer.json b/.devcontainer/frontend/devcontainer.json index 90029cbc692..29570c1cabb 100644 --- a/.devcontainer/frontend/devcontainer.json +++ b/.devcontainer/frontend/devcontainer.json @@ -22,7 +22,8 @@ "workspaceFolder": "/workspaces/graphql-platform/website", "postCreateCommand": "yarn install --immutable && yarn playwright install chromium", "containerEnv": { - "NEXT_TELEMETRY_DISABLED": "1" + "NEXT_TELEMETRY_DISABLED": "1", + "CHILLICREAM_FRONTEND_ENV": "devcontainer" }, "customizations": { "vscode": { diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c392c22b580..856b15d065c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,6 +141,8 @@ jobs: - name: Install Packages run: yarn --immutable --network-timeout 100000 working-directory: website + env: + CHILLICREAM_FRONTEND_ENV: ci - name: Install Playwright Chromium run: yarn playwright install --with-deps chromium diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml index 7a3283b0e4b..187f3377b7c 100644 --- a/.github/workflows/publish-website.yml +++ b/.github/workflows/publish-website.yml @@ -48,6 +48,8 @@ jobs: - name: Install Packages run: yarn --immutable --network-timeout 100000 working-directory: website + env: + CHILLICREAM_FRONTEND_ENV: ci - name: Install Playwright Chromium run: yarn playwright install --with-deps chromium diff --git a/website/.yarn/plugins/enforce-devcontainer.cjs b/website/.yarn/plugins/enforce-devcontainer.cjs new file mode 100644 index 00000000000..d91bf0ddd90 --- /dev/null +++ b/website/.yarn/plugins/enforce-devcontainer.cjs @@ -0,0 +1,16 @@ +module.exports = { + name: `plugin-enforce-devcontainer`, + factory: () => ({ + hooks: { + validateProject(project, report) { + if (!process.env.CHILLICREAM_FRONTEND_ENV) { + report.reportError( + 0, + `yarn install is only allowed inside the frontend devcontainer or CI. ` + + `Open the "ChilliCream Frontend" devcontainer for development on the website.`, + ); + } + }, + }, + }), +}; diff --git a/website/.yarnrc.yml b/website/.yarnrc.yml index 25d744151df..35307537963 100644 --- a/website/.yarnrc.yml +++ b/website/.yarnrc.yml @@ -4,6 +4,9 @@ enableScripts: false nodeLinker: node-modules +plugins: + - path: .yarn/plugins/enforce-devcontainer.cjs + # 7 days (in minutes) npmMinimalAgeGate: 10080