mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-14 21:35:25 +00:00
migrate to yarn v4
This commit is contained in:
parent
023edd1000
commit
484aea8406
14 changed files with 16207 additions and 10542 deletions
|
|
@ -11,3 +11,5 @@ packages/web/.next
|
|||
**/.env.local
|
||||
**/.sentryclirc
|
||||
**/.env.sentry-build-plugin
|
||||
.yarn
|
||||
!.yarn/releases
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -153,10 +153,10 @@ dist
|
|||
|
||||
# if you are NOT using Zero-installs, then:
|
||||
# comment the following lines
|
||||
!.yarn/cache
|
||||
# !.yarn/cache
|
||||
|
||||
# and uncomment the following lines
|
||||
# .pnp.*
|
||||
.pnp.*
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/yarn,node
|
||||
|
||||
|
|
|
|||
935
.yarn/releases/yarn-4.7.0.cjs
vendored
Executable file
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
3
.yarnrc.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
enableGlobalCache: false
|
||||
nodeLinker: node-modules
|
||||
yarnPath: .yarn/releases/yarn-4.7.0.cjs
|
||||
27
Dockerfile
27
Dockerfile
|
|
@ -28,15 +28,17 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /cmd/ ./cmd/...
|
|||
FROM node-alpine AS shared-libs-builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock* ./
|
||||
COPY package.json yarn.lock* .yarnrc.yml ./
|
||||
COPY .yarn ./.yarn
|
||||
COPY ./packages/db ./packages/db
|
||||
COPY ./packages/schemas ./packages/schemas
|
||||
COPY ./packages/crypto ./packages/crypto
|
||||
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/crypto install --frozen-lockfile
|
||||
RUN yarn workspace @sourcebot/error install --frozen-lockfile
|
||||
|
||||
RUN yarn workspace @sourcebot/db install
|
||||
RUN yarn workspace @sourcebot/schemas install
|
||||
RUN yarn workspace @sourcebot/crypto install
|
||||
RUN yarn workspace @sourcebot/error install
|
||||
# ------------------------------------
|
||||
|
||||
# ------ Build Web ------
|
||||
|
|
@ -58,7 +60,8 @@ ENV NEXT_PUBLIC_SENTRY_WEBAPP_DSN=$SENTRY_WEBAPP_DSN
|
|||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock* ./
|
||||
COPY package.json yarn.lock* .yarnrc.yml ./
|
||||
COPY .yarn ./.yarn
|
||||
COPY ./packages/web ./packages/web
|
||||
COPY --from=shared-libs-builder /app/node_modules ./node_modules
|
||||
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
|
||||
|
||||
# Fixes arm64 timeouts
|
||||
RUN yarn config set registry https://registry.npmjs.org/
|
||||
RUN yarn config set network-timeout 1200000
|
||||
RUN yarn workspace @sourcebot/web install --frozen-lockfile
|
||||
RUN yarn workspace @sourcebot/web install
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN yarn workspace @sourcebot/web build
|
||||
|
|
@ -81,7 +82,8 @@ FROM node-alpine AS backend-builder
|
|||
ENV SKIP_ENV_VALIDATION=1
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock* ./
|
||||
COPY package.json yarn.lock* .yarnrc.yml ./
|
||||
COPY .yarn ./.yarn
|
||||
COPY ./schemas ./schemas
|
||||
COPY ./packages/backend ./packages/backend
|
||||
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/crypto ./packages/crypto
|
||||
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
|
||||
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.
|
||||
# ENV SOURCEBOT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY package.json yarn.lock* .yarnrc.yml ./
|
||||
COPY .yarn ./.yarn
|
||||
|
||||
# Configure zoekt
|
||||
COPY vendor/zoekt/install-ctags-alpine.sh .
|
||||
RUN ./install-ctags-alpine.sh && rm install-ctags-alpine.sh
|
||||
|
|
|
|||
|
|
@ -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 [ -z "$POSTHOG_PAPIK" ]; then
|
||||
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
|
||||
|
||||
# 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"
|
||||
fi
|
||||
|
||||
|
|
@ -59,6 +69,11 @@ if [ -z "$AUTH_SECRET" ]; then
|
|||
set +a
|
||||
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
|
||||
# the cache directory.
|
||||
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 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 '{
|
||||
"api_key": "'"$POSTHOG_PAPIK"'",
|
||||
"event": "install",
|
||||
|
|
@ -89,7 +104,7 @@ else
|
|||
if [ "$PREVIOUS_VERSION" != "$SOURCEBOT_VERSION" ]; then
|
||||
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 '{
|
||||
"api_key": "'"$POSTHOG_PAPIK"'",
|
||||
"event": "upgrade",
|
||||
|
|
|
|||
|
|
@ -6,13 +6,11 @@
|
|||
"scripts": {
|
||||
"build": "cross-env SKIP_ENV_VALIDATION=1 yarn workspaces run build",
|
||||
"test": "yarn workspaces run test",
|
||||
|
||||
"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 --",
|
||||
"dev:zoekt": "yarn with-env zoekt-webserver -index .sourcebot/index -rpc",
|
||||
"dev:backend": "yarn with-env yarn workspace @sourcebot/backend dev:watch",
|
||||
"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:studio": "yarn with-env yarn workspace @sourcebot/db prisma:studio",
|
||||
"dev:prisma:migrate:reset": "yarn with-env yarn workspace @sourcebot/db prisma:migrate:reset"
|
||||
|
|
@ -21,5 +19,6 @@
|
|||
"cross-env": "^7.0.3",
|
||||
"dotenv-cli": "^8.0.0",
|
||||
"npm-run-all": "^4.1.5"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@4.7.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@
|
|||
"@types/argparse": "^2.0.16",
|
||||
"@types/micromatch": "^4.0.9",
|
||||
"@types/node": "^22.7.5",
|
||||
"cross-env": "^7.0.3",
|
||||
"json-schema-to-typescript": "^15.0.2",
|
||||
"tsc-watch": "^6.2.0",
|
||||
"tsx": "^4.19.1",
|
||||
"typescript": "^5.6.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"vitest": "^2.1.9"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -29,10 +29,10 @@
|
|||
"@sentry/cli": "^2.42.2",
|
||||
"@sentry/node": "^9.3.0",
|
||||
"@sentry/profiling-node": "^9.3.0",
|
||||
"@sourcebot/crypto": "^0.1.0",
|
||||
"@sourcebot/db": "^0.1.0",
|
||||
"@sourcebot/error": "^0.1.0",
|
||||
"@sourcebot/schemas": "^0.1.0",
|
||||
"@sourcebot/crypto": "workspace:*",
|
||||
"@sourcebot/db": "workspace:*",
|
||||
"@sourcebot/error": "workspace:*",
|
||||
"@sourcebot/schemas": "workspace:*",
|
||||
"@t3-oss/env-core": "^0.12.0",
|
||||
"@types/express": "^5.0.0",
|
||||
"ajv": "^8.17.1",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
"scripts": {
|
||||
"build": "yarn prisma:generate && tsc",
|
||||
"postinstall": "yarn build",
|
||||
|
||||
"prisma:generate": "prisma generate",
|
||||
"prisma:generate:watch": "prisma generate --watch",
|
||||
"prisma:migrate:dev": "prisma migrate dev",
|
||||
|
|
@ -14,7 +13,6 @@
|
|||
"prisma:migrate:reset": "prisma migrate reset",
|
||||
"prisma:db:push": "prisma db push",
|
||||
"prisma:studio": "prisma studio",
|
||||
|
||||
"tool:prisma": "tsx tools/runPrismaCommand.ts",
|
||||
"tool:run-script": "tsx tools/scriptRunner.ts"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -68,10 +68,10 @@
|
|||
"@replit/codemirror-vim": "^6.2.1",
|
||||
"@sentry/nextjs": "^9",
|
||||
"@shopify/lang-jsonc": "^1.0.0",
|
||||
"@sourcebot/crypto": "^0.1.0",
|
||||
"@sourcebot/db": "^0.1.0",
|
||||
"@sourcebot/error": "^0.1.0",
|
||||
"@sourcebot/schemas": "^0.1.0",
|
||||
"@sourcebot/crypto": "workspace:*",
|
||||
"@sourcebot/db": "workspace:*",
|
||||
"@sourcebot/error": "workspace:*",
|
||||
"@sourcebot/schemas": "workspace:*",
|
||||
"@ssddanbrown/codemirror-lang-twig": "^1.0.0",
|
||||
"@stripe/react-stripe-js": "^3.1.1",
|
||||
"@stripe/stripe-js": "^5.6.0",
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
"@viz-js/lang-dot": "^1.0.4",
|
||||
"@xiechao/codemirror-lang-handlebars": "^1.0.4",
|
||||
"ajv": "^8.17.1",
|
||||
"bcrypt": "^5.1.1",
|
||||
"bcryptjs": "^3.0.2",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"client-only": "^0.0.1",
|
||||
"clsx": "^2.1.1",
|
||||
|
|
@ -132,13 +132,11 @@
|
|||
"strip-json-comments": "^5.0.1",
|
||||
"stripe": "^17.6.0",
|
||||
"tailwind-merge": "^2.5.2",
|
||||
"tailwind-scrollbar-hide": "^1.1.7",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"usehooks-ts": "^3.1.0",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bcrypt": "^5.0.2",
|
||||
"@types/node": "^20",
|
||||
"@types/nodemailer": "^6.4.17",
|
||||
"@types/psl": "^1.1.3",
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ const config = {
|
|||
},
|
||||
plugins: [
|
||||
require("tailwindcss-animate"),
|
||||
require('tailwind-scrollbar-hide')
|
||||
],
|
||||
} satisfies Config
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue