migrate to yarn v4

This commit is contained in:
bkellam 2025-03-23 21:21:14 -07:00
parent 023edd1000
commit 484aea8406
14 changed files with 16207 additions and 10542 deletions

View file

@ -10,4 +10,6 @@ packages/web/.next
**/node_modules **/node_modules
**/.env.local **/.env.local
**/.sentryclirc **/.sentryclirc
**/.env.sentry-build-plugin **/.env.sentry-build-plugin
.yarn
!.yarn/releases

4
.gitignore vendored
View file

@ -153,10 +153,10 @@ dist
# if you are NOT using Zero-installs, then: # if you are NOT using Zero-installs, then:
# comment the following lines # comment the following lines
!.yarn/cache # !.yarn/cache
# and uncomment the following lines # and uncomment the following lines
# .pnp.* .pnp.*
# End of https://www.toptal.com/developers/gitignore/api/yarn,node # End of https://www.toptal.com/developers/gitignore/api/yarn,node

935
.yarn/releases/yarn-4.7.0.cjs vendored Executable file

File diff suppressed because one or more lines are too long

3
.yarnrc.yml Normal file
View file

@ -0,0 +1,3 @@
enableGlobalCache: false
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.7.0.cjs

View file

@ -28,15 +28,17 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /cmd/ ./cmd/...
FROM node-alpine AS shared-libs-builder FROM node-alpine AS shared-libs-builder
WORKDIR /app WORKDIR /app
COPY package.json yarn.lock* ./ COPY package.json yarn.lock* .yarnrc.yml ./
COPY .yarn ./.yarn
COPY ./packages/db ./packages/db COPY ./packages/db ./packages/db
COPY ./packages/schemas ./packages/schemas COPY ./packages/schemas ./packages/schemas
COPY ./packages/crypto ./packages/crypto COPY ./packages/crypto ./packages/crypto
COPY ./packages/error ./packages/error COPY ./packages/error ./packages/error
RUN yarn workspace @sourcebot/db install --frozen-lockfile
RUN yarn workspace @sourcebot/schemas install --frozen-lockfile RUN yarn workspace @sourcebot/db install
RUN yarn workspace @sourcebot/crypto install --frozen-lockfile RUN yarn workspace @sourcebot/schemas install
RUN yarn workspace @sourcebot/error install --frozen-lockfile RUN yarn workspace @sourcebot/crypto install
RUN yarn workspace @sourcebot/error install
# ------------------------------------ # ------------------------------------
# ------ Build Web ------ # ------ Build Web ------
@ -58,7 +60,8 @@ ENV NEXT_PUBLIC_SENTRY_WEBAPP_DSN=$SENTRY_WEBAPP_DSN
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
COPY package.json yarn.lock* ./ COPY package.json yarn.lock* .yarnrc.yml ./
COPY .yarn ./.yarn
COPY ./packages/web ./packages/web COPY ./packages/web ./packages/web
COPY --from=shared-libs-builder /app/node_modules ./node_modules COPY --from=shared-libs-builder /app/node_modules ./node_modules
COPY --from=shared-libs-builder /app/packages/db ./packages/db COPY --from=shared-libs-builder /app/packages/db ./packages/db
@ -67,9 +70,7 @@ COPY --from=shared-libs-builder /app/packages/crypto ./packages/crypto
COPY --from=shared-libs-builder /app/packages/error ./packages/error COPY --from=shared-libs-builder /app/packages/error ./packages/error
# Fixes arm64 timeouts # Fixes arm64 timeouts
RUN yarn config set registry https://registry.npmjs.org/ RUN yarn workspace @sourcebot/web install
RUN yarn config set network-timeout 1200000
RUN yarn workspace @sourcebot/web install --frozen-lockfile
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
RUN yarn workspace @sourcebot/web build RUN yarn workspace @sourcebot/web build
@ -81,7 +82,8 @@ FROM node-alpine AS backend-builder
ENV SKIP_ENV_VALIDATION=1 ENV SKIP_ENV_VALIDATION=1
WORKDIR /app WORKDIR /app
COPY package.json yarn.lock* ./ COPY package.json yarn.lock* .yarnrc.yml ./
COPY .yarn ./.yarn
COPY ./schemas ./schemas COPY ./schemas ./schemas
COPY ./packages/backend ./packages/backend COPY ./packages/backend ./packages/backend
COPY --from=shared-libs-builder /app/node_modules ./node_modules COPY --from=shared-libs-builder /app/node_modules ./node_modules
@ -89,7 +91,7 @@ COPY --from=shared-libs-builder /app/packages/db ./packages/db
COPY --from=shared-libs-builder /app/packages/schemas ./packages/schemas COPY --from=shared-libs-builder /app/packages/schemas ./packages/schemas
COPY --from=shared-libs-builder /app/packages/crypto ./packages/crypto COPY --from=shared-libs-builder /app/packages/crypto ./packages/crypto
COPY --from=shared-libs-builder /app/packages/error ./packages/error COPY --from=shared-libs-builder /app/packages/error ./packages/error
RUN yarn workspace @sourcebot/backend install --frozen-lockfile RUN yarn workspace @sourcebot/backend install
RUN yarn workspace @sourcebot/backend build RUN yarn workspace @sourcebot/backend build
ENV SKIP_ENV_VALIDATION=0 ENV SKIP_ENV_VALIDATION=0
# ------------------------------ # ------------------------------
@ -129,6 +131,9 @@ ENV DOMAIN_SUB_PATH=/
# Sourcebot collects anonymous usage data using [PostHog](https://posthog.com/). Uncomment this line to disable. # Sourcebot collects anonymous usage data using [PostHog](https://posthog.com/). Uncomment this line to disable.
# ENV SOURCEBOT_TELEMETRY_DISABLED=1 # ENV SOURCEBOT_TELEMETRY_DISABLED=1
COPY package.json yarn.lock* .yarnrc.yml ./
COPY .yarn ./.yarn
# Configure zoekt # Configure zoekt
COPY vendor/zoekt/install-ctags-alpine.sh . COPY vendor/zoekt/install-ctags-alpine.sh .
RUN ./install-ctags-alpine.sh && rm install-ctags-alpine.sh RUN ./install-ctags-alpine.sh && rm install-ctags-alpine.sh

View file

@ -6,11 +6,21 @@ echo -e "\e[34m[Info] Sourcebot version: $SOURCEBOT_VERSION\e[0m"
# If we don't have a PostHog key, then we need to disable telemetry. # If we don't have a PostHog key, then we need to disable telemetry.
if [ -z "$POSTHOG_PAPIK" ]; then if [ -z "$POSTHOG_PAPIK" ]; then
echo -e "\e[33m[Warning] POSTHOG_PAPIK was not set. Setting SOURCEBOT_TELEMETRY_DISABLED.\e[0m" echo -e "\e[33m[Warning] POSTHOG_PAPIK was not set. Setting SOURCEBOT_TELEMETRY_DISABLED.\e[0m"
export SOURCEBOT_TELEMETRY_DISABLED=1 export SOURCEBOT_TELEMETRY_DISABLED=true
fi
if [ -n "$SOURCEBOT_TELEMETRY_DISABLED" ]; then
# Validate that SOURCEBOT_TELEMETRY_DISABLED is either "true" or "false"
if [ "$SOURCEBOT_TELEMETRY_DISABLED" != "true" ] && [ "$SOURCEBOT_TELEMETRY_DISABLED" != "false" ]; then
echo -e "\e[31m[Error] SOURCEBOT_TELEMETRY_DISABLED must be either 'true' or 'false'. Got '$SOURCEBOT_TELEMETRY_DISABLED'\e[0m"
exit 1
fi
else
export SOURCEBOT_TELEMETRY_DISABLED=false
fi fi
# Issue a info message about telemetry # Issue a info message about telemetry
if [ ! -z "$SOURCEBOT_TELEMETRY_DISABLED" ]; then if [ "$SOURCEBOT_TELEMETRY_DISABLED" = "true" ]; then
echo -e "\e[34m[Info] Disabling telemetry since SOURCEBOT_TELEMETRY_DISABLED was set.\e[0m" echo -e "\e[34m[Info] Disabling telemetry since SOURCEBOT_TELEMETRY_DISABLED was set.\e[0m"
fi fi
@ -59,6 +69,11 @@ if [ -z "$AUTH_SECRET" ]; then
set +a set +a
fi fi
if [ -z "$AUTH_URL" ]; then
echo -e "\e[33m[Warning] AUTH_URL is not set.\e[0m"
export AUTH_URL="http://localhost:3000"
fi
# In order to detect if this is the first run, we create a `.installed` file in # In order to detect if this is the first run, we create a `.installed` file in
# the cache directory. # the cache directory.
FIRST_RUN_FILE="$DATA_CACHE_DIR/.installedv2" FIRST_RUN_FILE="$DATA_CACHE_DIR/.installedv2"
@ -69,7 +84,7 @@ if [ ! -f "$FIRST_RUN_FILE" ]; then
# If this is our first run, send a `install` event to PostHog # If this is our first run, send a `install` event to PostHog
# (if telemetry is enabled) # (if telemetry is enabled)
if [ -z "$SOURCEBOT_TELEMETRY_DISABLED" ]; then if [ "$SOURCEBOT_TELEMETRY_DISABLED" = "false" ]; then
if ! ( curl -L --output /dev/null --silent --fail --header "Content-Type: application/json" -d '{ if ! ( curl -L --output /dev/null --silent --fail --header "Content-Type: application/json" -d '{
"api_key": "'"$POSTHOG_PAPIK"'", "api_key": "'"$POSTHOG_PAPIK"'",
"event": "install", "event": "install",
@ -89,7 +104,7 @@ else
if [ "$PREVIOUS_VERSION" != "$SOURCEBOT_VERSION" ]; then if [ "$PREVIOUS_VERSION" != "$SOURCEBOT_VERSION" ]; then
echo -e "\e[34m[Info] Upgraded from version $PREVIOUS_VERSION to $SOURCEBOT_VERSION\e[0m" echo -e "\e[34m[Info] Upgraded from version $PREVIOUS_VERSION to $SOURCEBOT_VERSION\e[0m"
if [ -z "$SOURCEBOT_TELEMETRY_DISABLED" ]; then if [ "$SOURCEBOT_TELEMETRY_DISABLED" = "false" ]; then
if ! ( curl -L --output /dev/null --silent --fail --header "Content-Type: application/json" -d '{ if ! ( curl -L --output /dev/null --silent --fail --header "Content-Type: application/json" -d '{
"api_key": "'"$POSTHOG_PAPIK"'", "api_key": "'"$POSTHOG_PAPIK"'",
"event": "upgrade", "event": "upgrade",

View file

@ -6,13 +6,11 @@
"scripts": { "scripts": {
"build": "cross-env SKIP_ENV_VALIDATION=1 yarn workspaces run build", "build": "cross-env SKIP_ENV_VALIDATION=1 yarn workspaces run build",
"test": "yarn workspaces run test", "test": "yarn workspaces run test",
"dev": "yarn dev:prisma:migrate:dev && npm-run-all --print-label --parallel dev:zoekt dev:backend dev:web", "dev": "yarn dev:prisma:migrate:dev && npm-run-all --print-label --parallel dev:zoekt dev:backend dev:web",
"with-env": "cross-env PATH=\"$PWD/bin:$PATH\" dotenv -e .env.development -c --", "with-env": "cross-env PATH=\"$PWD/bin:$PATH\" dotenv -e .env.development -c --",
"dev:zoekt": "yarn with-env zoekt-webserver -index .sourcebot/index -rpc", "dev:zoekt": "yarn with-env zoekt-webserver -index .sourcebot/index -rpc",
"dev:backend": "yarn with-env yarn workspace @sourcebot/backend dev:watch", "dev:backend": "yarn with-env yarn workspace @sourcebot/backend dev:watch",
"dev:web": "yarn with-env yarn workspace @sourcebot/web dev", "dev:web": "yarn with-env yarn workspace @sourcebot/web dev",
"dev:prisma:migrate:dev": "yarn with-env yarn workspace @sourcebot/db prisma:migrate:dev", "dev:prisma:migrate:dev": "yarn with-env yarn workspace @sourcebot/db prisma:migrate:dev",
"dev:prisma:studio": "yarn with-env yarn workspace @sourcebot/db prisma:studio", "dev:prisma:studio": "yarn with-env yarn workspace @sourcebot/db prisma:studio",
"dev:prisma:migrate:reset": "yarn with-env yarn workspace @sourcebot/db prisma:migrate:reset" "dev:prisma:migrate:reset": "yarn with-env yarn workspace @sourcebot/db prisma:migrate:reset"
@ -21,5 +19,6 @@
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"dotenv-cli": "^8.0.0", "dotenv-cli": "^8.0.0",
"npm-run-all": "^4.1.5" "npm-run-all": "^4.1.5"
} },
"packageManager": "yarn@4.7.0"
} }

View file

@ -14,11 +14,11 @@
"@types/argparse": "^2.0.16", "@types/argparse": "^2.0.16",
"@types/micromatch": "^4.0.9", "@types/micromatch": "^4.0.9",
"@types/node": "^22.7.5", "@types/node": "^22.7.5",
"cross-env": "^7.0.3",
"json-schema-to-typescript": "^15.0.2", "json-schema-to-typescript": "^15.0.2",
"tsc-watch": "^6.2.0", "tsc-watch": "^6.2.0",
"tsx": "^4.19.1", "tsx": "^4.19.1",
"typescript": "^5.6.2", "typescript": "^5.6.2",
"cross-env": "^7.0.3",
"vitest": "^2.1.9" "vitest": "^2.1.9"
}, },
"dependencies": { "dependencies": {
@ -29,10 +29,10 @@
"@sentry/cli": "^2.42.2", "@sentry/cli": "^2.42.2",
"@sentry/node": "^9.3.0", "@sentry/node": "^9.3.0",
"@sentry/profiling-node": "^9.3.0", "@sentry/profiling-node": "^9.3.0",
"@sourcebot/crypto": "^0.1.0", "@sourcebot/crypto": "workspace:*",
"@sourcebot/db": "^0.1.0", "@sourcebot/db": "workspace:*",
"@sourcebot/error": "^0.1.0", "@sourcebot/error": "workspace:*",
"@sourcebot/schemas": "^0.1.0", "@sourcebot/schemas": "workspace:*",
"@t3-oss/env-core": "^0.12.0", "@t3-oss/env-core": "^0.12.0",
"@types/express": "^5.0.0", "@types/express": "^5.0.0",
"ajv": "^8.17.1", "ajv": "^8.17.1",

View file

@ -12,6 +12,6 @@
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^22.7.5", "@types/node": "^22.7.5",
"typescript": "^5.7.3" "typescript": "^5.7.3"
} }
} }

View file

@ -6,7 +6,6 @@
"scripts": { "scripts": {
"build": "yarn prisma:generate && tsc", "build": "yarn prisma:generate && tsc",
"postinstall": "yarn build", "postinstall": "yarn build",
"prisma:generate": "prisma generate", "prisma:generate": "prisma generate",
"prisma:generate:watch": "prisma generate --watch", "prisma:generate:watch": "prisma generate --watch",
"prisma:migrate:dev": "prisma migrate dev", "prisma:migrate:dev": "prisma migrate dev",
@ -14,7 +13,6 @@
"prisma:migrate:reset": "prisma migrate reset", "prisma:migrate:reset": "prisma migrate reset",
"prisma:db:push": "prisma db push", "prisma:db:push": "prisma db push",
"prisma:studio": "prisma studio", "prisma:studio": "prisma studio",
"tool:prisma": "tsx tools/runPrismaCommand.ts", "tool:prisma": "tsx tools/runPrismaCommand.ts",
"tool:run-script": "tsx tools/scriptRunner.ts" "tool:run-script": "tsx tools/scriptRunner.ts"
}, },

View file

@ -11,4 +11,4 @@
"@types/node": "^22.7.5", "@types/node": "^22.7.5",
"typescript": "^5.7.3" "typescript": "^5.7.3"
} }
} }

View file

@ -68,10 +68,10 @@
"@replit/codemirror-vim": "^6.2.1", "@replit/codemirror-vim": "^6.2.1",
"@sentry/nextjs": "^9", "@sentry/nextjs": "^9",
"@shopify/lang-jsonc": "^1.0.0", "@shopify/lang-jsonc": "^1.0.0",
"@sourcebot/crypto": "^0.1.0", "@sourcebot/crypto": "workspace:*",
"@sourcebot/db": "^0.1.0", "@sourcebot/db": "workspace:*",
"@sourcebot/error": "^0.1.0", "@sourcebot/error": "workspace:*",
"@sourcebot/schemas": "^0.1.0", "@sourcebot/schemas": "workspace:*",
"@ssddanbrown/codemirror-lang-twig": "^1.0.0", "@ssddanbrown/codemirror-lang-twig": "^1.0.0",
"@stripe/react-stripe-js": "^3.1.1", "@stripe/react-stripe-js": "^3.1.1",
"@stripe/stripe-js": "^5.6.0", "@stripe/stripe-js": "^5.6.0",
@ -84,7 +84,7 @@
"@viz-js/lang-dot": "^1.0.4", "@viz-js/lang-dot": "^1.0.4",
"@xiechao/codemirror-lang-handlebars": "^1.0.4", "@xiechao/codemirror-lang-handlebars": "^1.0.4",
"ajv": "^8.17.1", "ajv": "^8.17.1",
"bcrypt": "^5.1.1", "bcryptjs": "^3.0.2",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"client-only": "^0.0.1", "client-only": "^0.0.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
@ -132,13 +132,11 @@
"strip-json-comments": "^5.0.1", "strip-json-comments": "^5.0.1",
"stripe": "^17.6.0", "stripe": "^17.6.0",
"tailwind-merge": "^2.5.2", "tailwind-merge": "^2.5.2",
"tailwind-scrollbar-hide": "^1.1.7",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^3.1.0", "usehooks-ts": "^3.1.0",
"zod": "^3.24.2" "zod": "^3.24.2"
}, },
"devDependencies": { "devDependencies": {
"@types/bcrypt": "^5.0.2",
"@types/node": "^20", "@types/node": "^20",
"@types/nodemailer": "^6.4.17", "@types/nodemailer": "^6.4.17",
"@types/psl": "^1.1.3", "@types/psl": "^1.1.3",

View file

@ -97,7 +97,6 @@ const config = {
}, },
plugins: [ plugins: [
require("tailwindcss-animate"), require("tailwindcss-animate"),
require('tailwind-scrollbar-hide')
], ],
} satisfies Config } satisfies Config

25719
yarn.lock

File diff suppressed because it is too large Load diff