mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 18:41:08 +02:00
feat(infra): auto-generate Dockerfile COPY statements from package.json
New script generates COPY blocks between marker comments, eliminating manual maintenance. All 17 web Dockerfiles updated with markers. Supports --check flag for CI validation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
23dac3272e
commit
90c438e267
19 changed files with 592 additions and 219 deletions
|
|
@ -20,38 +20,34 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy shared packages needed by calendar web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-splitscreen ./packages/shared-splitscreen
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tags ./packages/shared-tags
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-tags ./packages/shared-tags
|
||||
COPY packages/shared-splitscreen ./packages/shared-splitscreen
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY apps/calendar/packages/shared ./apps/calendar/packages/shared
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy calendar packages and web
|
||||
COPY apps/calendar/packages ./apps/calendar/packages
|
||||
COPY apps/calendar/apps/web ./apps/calendar/apps/web
|
||||
|
||||
# Install dependencies
|
||||
|
|
|
|||
|
|
@ -20,36 +20,31 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy shared packages needed by chat web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY apps/chat/packages/chat-types ./apps/chat/packages/chat-types
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Copy chat packages
|
||||
COPY apps/chat/packages ./apps/chat/packages
|
||||
COPY apps/chat/apps/web ./apps/chat/apps/web
|
||||
|
||||
# Install dependencies
|
||||
|
|
|
|||
|
|
@ -19,13 +19,12 @@ WORKDIR /app
|
|||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy shared packages needed by citycorners web
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-config ./packages/shared-config
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
|
|
@ -33,11 +32,9 @@ COPY packages/shared-pwa ./packages/shared-pwa
|
|||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy citycorners web
|
||||
COPY apps/citycorners/apps/web ./apps/citycorners/apps/web
|
||||
|
|
|
|||
|
|
@ -20,36 +20,31 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy shared packages needed by clock web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY apps/clock/packages/shared ./apps/clock/packages/shared
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Copy clock packages and web
|
||||
COPY apps/clock/packages ./apps/clock/packages
|
||||
COPY apps/clock/apps/web ./apps/clock/apps/web
|
||||
|
||||
# Install dependencies
|
||||
|
|
|
|||
|
|
@ -19,38 +19,36 @@ WORKDIR /app
|
|||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy shared packages needed by contacts web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-help-content ./packages/shared-help-content
|
||||
COPY packages/shared-help-types ./packages/shared-help-types
|
||||
COPY packages/shared-help-ui ./packages/shared-help-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-splitscreen ./packages/shared-splitscreen
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tags ./packages/shared-tags
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-tags ./packages/shared-tags
|
||||
COPY packages/shared-splitscreen ./packages/shared-splitscreen
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/spiral-db ./packages/spiral-db
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy contacts web
|
||||
COPY apps/contacts/apps/web ./apps/contacts/apps/web
|
||||
|
|
|
|||
|
|
@ -19,34 +19,34 @@ WORKDIR /app
|
|||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy shared packages needed by manacore web
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/credit-operations ./packages/credit-operations
|
||||
COPY packages/qr-export ./packages/qr-export
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-config ./packages/shared-config
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/qr-export ./packages/qr-export
|
||||
COPY packages/wallpaper-generator ./packages/wallpaper-generator
|
||||
COPY packages/credit-operations ./packages/credit-operations
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy manacore web
|
||||
COPY apps/manacore/apps/web ./apps/manacore/apps/web
|
||||
|
|
|
|||
|
|
@ -17,22 +17,19 @@ WORKDIR /app
|
|||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy shared packages needed by matrix web
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-config ./packages/shared-config
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/eslint-config ./packages/eslint-config
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy matrix web app
|
||||
COPY apps/matrix/apps/web ./apps/matrix/apps/web
|
||||
|
|
|
|||
|
|
@ -19,16 +19,16 @@ WORKDIR /app
|
|||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy shared packages needed by mukke web
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-config ./packages/shared-config
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
|
|
@ -38,15 +38,11 @@ COPY packages/shared-stores ./packages/shared-stores
|
|||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
|
||||
# Copy mukke shared package
|
||||
COPY apps/mukke/packages ./apps/mukke/packages
|
||||
COPY apps/mukke/packages/shared ./apps/mukke/packages/shared
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy mukke web
|
||||
COPY apps/mukke/apps/web ./apps/mukke/apps/web
|
||||
|
|
|
|||
|
|
@ -20,35 +20,30 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy shared packages needed by nutriphi web
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-tsconfig ./packages/shared-tsconfig
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY apps/nutriphi/packages/shared ./apps/nutriphi/packages/shared
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Copy nutriphi packages and web
|
||||
COPY apps/nutriphi/packages ./apps/nutriphi/packages
|
||||
COPY apps/nutriphi/apps/web ./apps/nutriphi/apps/web
|
||||
|
||||
# Install dependencies
|
||||
|
|
|
|||
|
|
@ -22,41 +22,35 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy shared packages needed by photos web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-help-content ./packages/shared-help-content
|
||||
COPY packages/shared-help-types ./packages/shared-help-types
|
||||
COPY packages/shared-help-ui ./packages/shared-help-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-splitscreen ./packages/shared-splitscreen
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tags ./packages/shared-tags
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-tags ./packages/shared-tags
|
||||
COPY packages/shared-splitscreen ./packages/shared-splitscreen
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Copy photos shared package
|
||||
COPY apps/photos/packages/shared ./apps/photos/packages/shared
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy photos web
|
||||
COPY apps/photos/apps/web ./apps/photos/apps/web
|
||||
|
|
|
|||
|
|
@ -23,36 +23,32 @@ WORKDIR /app
|
|||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy shared packages needed by picture web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
|
||||
# Copy picture packages
|
||||
COPY apps/picture/packages/shared ./apps/picture/packages/shared
|
||||
COPY apps/picture/packages/design-tokens ./apps/picture/packages/design-tokens
|
||||
COPY apps/picture/packages/shared ./apps/picture/packages/shared
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy picture web
|
||||
COPY apps/picture/apps/web ./apps/picture/apps/web
|
||||
|
|
|
|||
|
|
@ -20,15 +20,14 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy shared packages needed by llm-playground
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches/ ./patches/
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy llm-playground service
|
||||
COPY apps/playground/apps/web ./apps/playground/apps/web
|
||||
|
|
|
|||
|
|
@ -20,37 +20,29 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy shared packages needed by presi web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-help-content ./packages/shared-help-content
|
||||
COPY packages/shared-help-types ./packages/shared-help-types
|
||||
COPY packages/shared-help-ui ./packages/shared-help-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Copy presi shared package
|
||||
COPY apps/presi/packages/shared ./apps/presi/packages/shared
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy presi web
|
||||
COPY apps/presi/apps/web ./apps/presi/apps/web
|
||||
|
|
|
|||
|
|
@ -20,25 +20,23 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy shared packages needed by skilltree web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy skilltree web
|
||||
COPY apps/skilltree/apps/web ./apps/skilltree/apps/web
|
||||
|
|
|
|||
|
|
@ -19,35 +19,30 @@ WORKDIR /app
|
|||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy shared packages needed by storage web
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-help-content ./packages/shared-help-content
|
||||
COPY packages/shared-help-types ./packages/shared-help-types
|
||||
COPY packages/shared-help-ui ./packages/shared-help-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy storage web
|
||||
COPY apps/storage/apps/web ./apps/storage/apps/web
|
||||
|
|
|
|||
|
|
@ -20,39 +20,35 @@ COPY pnpm-workspace.yaml ./
|
|||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy patches (referenced by pnpm-lock.yaml)
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy shared packages needed by todo web
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-splitscreen ./packages/shared-splitscreen
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-splitscreen ./packages/shared-splitscreen
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tags ./packages/shared-tags
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-tags ./packages/shared-tags
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/spiral-db ./packages/spiral-db
|
||||
COPY apps/todo/packages/shared ./apps/todo/packages/shared
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy todo packages and web
|
||||
COPY apps/todo/packages ./apps/todo/packages
|
||||
COPY apps/todo/apps/web ./apps/todo/apps/web
|
||||
|
||||
# Install dependencies
|
||||
|
|
|
|||
|
|
@ -19,37 +19,32 @@ WORKDIR /app
|
|||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Copy shared packages needed by zitare web
|
||||
# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/shared-api-client ./packages/shared-api-client
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/shared-auth ./packages/shared-auth
|
||||
COPY packages/shared-auth-ui ./packages/shared-auth-ui
|
||||
COPY packages/shared-branding ./packages/shared-branding
|
||||
COPY packages/shared-config ./packages/shared-config
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-feedback-service ./packages/shared-feedback-service
|
||||
COPY packages/shared-feedback-types ./packages/shared-feedback-types
|
||||
COPY packages/shared-feedback-ui ./packages/shared-feedback-ui
|
||||
COPY packages/shared-i18n ./packages/shared-i18n
|
||||
COPY packages/shared-icons ./packages/shared-icons
|
||||
COPY packages/shared-profile-ui ./packages/shared-profile-ui
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-stores ./packages/shared-stores
|
||||
COPY packages/shared-subscription-types ./packages/shared-subscription-types
|
||||
COPY packages/shared-subscription-ui ./packages/shared-subscription-ui
|
||||
COPY packages/shared-tailwind ./packages/shared-tailwind
|
||||
COPY packages/shared-theme ./packages/shared-theme
|
||||
COPY packages/shared-theme-ui ./packages/shared-theme-ui
|
||||
COPY packages/shared-types ./packages/shared-types
|
||||
COPY packages/shared-ui ./packages/shared-ui
|
||||
COPY packages/shared-utils ./packages/shared-utils
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-vite-config ./packages/shared-vite-config
|
||||
COPY packages/shared-pwa ./packages/shared-pwa
|
||||
COPY packages/shared-app-onboarding ./packages/shared-app-onboarding
|
||||
COPY packages/spiral-db ./packages/spiral-db
|
||||
|
||||
# Copy zitare content package
|
||||
COPY apps/zitare/packages/content ./apps/zitare/packages/content
|
||||
# --- END AUTO-GENERATED ---
|
||||
|
||||
# Copy zitare web
|
||||
COPY apps/zitare/apps/web ./apps/zitare/apps/web
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
"format": "prettier --config .prettierrc.json --write \"**/*.{ts,tsx,js,jsx,json,md,svelte,astro}\"",
|
||||
"format:check": "prettier --config .prettierrc.json --check \"**/*.{ts,tsx,js,jsx,json,md,svelte,astro}\"",
|
||||
"validate:dockerfiles": "node scripts/validate-dockerfiles.mjs",
|
||||
"audit:deps": "node scripts/audit-workspace-deps.mjs",
|
||||
"generate:dockerfiles": "node scripts/generate-dockerfiles.mjs",
|
||||
"setup:env": "node scripts/generate-env.mjs",
|
||||
"setup:db": "./scripts/setup-databases.sh",
|
||||
"setup:db:chat": "./scripts/setup-databases.sh chat",
|
||||
|
|
|
|||
437
scripts/generate-dockerfiles.mjs
Executable file
437
scripts/generate-dockerfiles.mjs
Executable file
|
|
@ -0,0 +1,437 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// Generate COPY statements in web app Dockerfiles from package.json workspace dependencies.
|
||||
//
|
||||
// For each apps/{name}/apps/web/Dockerfile, reads the corresponding package.json,
|
||||
// resolves workspace dependencies to their directory paths, and updates the
|
||||
// COPY block between marker comments.
|
||||
//
|
||||
// Usage:
|
||||
// node scripts/generate-dockerfiles.mjs # Update all Dockerfiles
|
||||
// node scripts/generate-dockerfiles.mjs --check # Check only, exit 1 if changes needed
|
||||
|
||||
import { readFileSync, writeFileSync, readdirSync, existsSync } from 'node:fs';
|
||||
import { join, resolve } from 'node:path';
|
||||
|
||||
const ROOT = resolve(import.meta.dirname, '..');
|
||||
const START_MARKER = '# --- AUTO-GENERATED COPY STATEMENTS (do not edit manually) ---';
|
||||
const END_MARKER = '# --- END AUTO-GENERATED ---';
|
||||
|
||||
const isCheck = process.argv.includes('--check');
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Package map: package name -> directory path relative to repo root
|
||||
// Reuses the same logic from validate-dockerfiles.mjs
|
||||
// ---------------------------------------------------------------------------
|
||||
function buildPackageMap() {
|
||||
const map = new Map();
|
||||
|
||||
const packagesDir = join(ROOT, 'packages');
|
||||
if (existsSync(packagesDir)) {
|
||||
for (const entry of readdirSync(packagesDir, { withFileTypes: true })) {
|
||||
if (!entry.isDirectory()) continue;
|
||||
const pkgJsonPath = join(packagesDir, entry.name, 'package.json');
|
||||
if (!existsSync(pkgJsonPath)) continue;
|
||||
try {
|
||||
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
|
||||
map.set(pkg.name, `packages/${entry.name}`);
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
const appsDir = join(ROOT, 'apps');
|
||||
if (existsSync(appsDir)) {
|
||||
for (const appEntry of readdirSync(appsDir, { withFileTypes: true })) {
|
||||
if (!appEntry.isDirectory()) continue;
|
||||
const appPkgsDir = join(appsDir, appEntry.name, 'packages');
|
||||
if (!existsSync(appPkgsDir)) continue;
|
||||
for (const pkgEntry of readdirSync(appPkgsDir, { withFileTypes: true })) {
|
||||
if (!pkgEntry.isDirectory()) continue;
|
||||
const pkgJsonPath = join(appPkgsDir, pkgEntry.name, 'package.json');
|
||||
if (!existsSync(pkgJsonPath)) continue;
|
||||
try {
|
||||
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
|
||||
map.set(pkg.name, `apps/${appEntry.name}/packages/${pkgEntry.name}`);
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Extract workspace deps from package.json
|
||||
// ---------------------------------------------------------------------------
|
||||
function getWorkspaceDeps(pkgJsonPath) {
|
||||
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
|
||||
const deps = [];
|
||||
for (const section of ['dependencies', 'devDependencies']) {
|
||||
if (!pkg[section]) continue;
|
||||
for (const [name, version] of Object.entries(pkg[section])) {
|
||||
if (typeof version === 'string' && version.startsWith('workspace:')) {
|
||||
deps.push(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return deps;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Generate the COPY block content (lines between the markers)
|
||||
// ---------------------------------------------------------------------------
|
||||
function generateCopyBlock(workspaceDeps, packageMap) {
|
||||
const copyLines = [];
|
||||
|
||||
// Always include patches
|
||||
copyLines.push('COPY patches/ ./patches/');
|
||||
|
||||
const depPaths = [];
|
||||
const unknownDeps = [];
|
||||
|
||||
for (const dep of workspaceDeps) {
|
||||
const dirPath = packageMap.get(dep);
|
||||
if (!dirPath) {
|
||||
unknownDeps.push(dep);
|
||||
continue;
|
||||
}
|
||||
depPaths.push(dirPath);
|
||||
}
|
||||
|
||||
depPaths.sort();
|
||||
|
||||
// Root packages first, then app-specific packages
|
||||
const rootPackages = depPaths.filter((p) => p.startsWith('packages/'));
|
||||
const appPackages = depPaths.filter((p) => p.startsWith('apps/'));
|
||||
|
||||
for (const p of rootPackages) {
|
||||
copyLines.push(`COPY ${p} ./${p}`);
|
||||
}
|
||||
for (const p of appPackages) {
|
||||
copyLines.push(`COPY ${p} ./${p}`);
|
||||
}
|
||||
|
||||
if (unknownDeps.length > 0) {
|
||||
copyLines.push('');
|
||||
copyLines.push(
|
||||
`# WARNING: Unknown workspace deps (not found in workspace): ${unknownDeps.join(', ')}`
|
||||
);
|
||||
}
|
||||
|
||||
return copyLines;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Process a Dockerfile: insert/update markers and generated COPY block.
|
||||
// Returns the updated content string.
|
||||
// ---------------------------------------------------------------------------
|
||||
function processDockerfile(content, appName, copyLines) {
|
||||
const lines = content.split('\n');
|
||||
|
||||
// Collect all generated COPY paths for dedup detection
|
||||
const generatedPaths = new Set();
|
||||
for (const line of copyLines) {
|
||||
const m = line.match(/^COPY\s+(\S+)/);
|
||||
if (m) generatedPaths.add(m[1]);
|
||||
}
|
||||
|
||||
// If markers already exist, replace the block between them and clean up duplicates after
|
||||
if (content.includes(START_MARKER)) {
|
||||
return updateExistingMarkers(lines, copyLines, generatedPaths);
|
||||
}
|
||||
|
||||
// Otherwise, find the right place to insert markers
|
||||
return insertMarkersAndBlock(lines, copyLines, generatedPaths, appName);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Update content that already has markers
|
||||
// ---------------------------------------------------------------------------
|
||||
function updateExistingMarkers(lines, copyLines, generatedPaths) {
|
||||
const result = [];
|
||||
let i = 0;
|
||||
|
||||
// Copy lines up to and including the start marker
|
||||
while (i < lines.length) {
|
||||
result.push(lines[i]);
|
||||
if (lines[i].trim() === START_MARKER) {
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
// Skip old content until end marker
|
||||
while (i < lines.length) {
|
||||
if (lines[i].trim() === END_MARKER) break;
|
||||
i++;
|
||||
}
|
||||
|
||||
// Insert new copy lines
|
||||
for (const line of copyLines) {
|
||||
result.push(line);
|
||||
}
|
||||
|
||||
// Add end marker
|
||||
if (i < lines.length && lines[i].trim() === END_MARKER) {
|
||||
result.push(lines[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
// Now process remaining lines, removing duplicates of what we generated
|
||||
// and cleaning up orphaned comments about shared packages/patches
|
||||
while (i < lines.length) {
|
||||
const trimmed = lines[i].trim();
|
||||
|
||||
// Remove duplicate COPY lines that are already in the generated block
|
||||
const copyMatch = trimmed.match(/^COPY\s+(\S+)/);
|
||||
if (copyMatch) {
|
||||
const srcPath = copyMatch[1];
|
||||
const normalized = srcPath.replace(/\/$/, '');
|
||||
// Exact match
|
||||
if (
|
||||
generatedPaths.has(srcPath) ||
|
||||
generatedPaths.has(normalized) ||
|
||||
generatedPaths.has(normalized + '/')
|
||||
) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
// Broader COPY (e.g., apps/todo/packages) where specific sub-paths are generated
|
||||
// Remove if ANY generated path starts with this broader path
|
||||
const isBroaderCovered = [...generatedPaths].some((gp) => gp.startsWith(normalized + '/'));
|
||||
if (isBroaderCovered) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove orphaned comments that referred to the old manual copy section
|
||||
if (trimmed.startsWith('#')) {
|
||||
const isOrphanedComment =
|
||||
trimmed.match(/^#\s*Copy\s+(shared\s+)?packages\s+needed\s+by/i) ||
|
||||
trimmed.match(/^#\s*Copy\s+patches/i) ||
|
||||
trimmed.match(/^#\s*Copy\s+\w+\s+(content\s+)?package$/i) ||
|
||||
trimmed.match(/^#\s*Copy\s+\w+\s+shared\s+package$/i) ||
|
||||
trimmed.match(/^#\s*Copy\s+\w+\s+packages(\s+and\s+web)?$/i);
|
||||
if (isOrphanedComment) {
|
||||
// Check if the next non-empty line is a COPY that was removed or will be removed
|
||||
let j = i + 1;
|
||||
while (j < lines.length && lines[j].trim() === '') j++;
|
||||
const nextTrimmed = j < lines.length ? lines[j].trim() : '';
|
||||
const nextCopy = nextTrimmed.match(/^COPY\s+(\S+)/);
|
||||
let nextIsRemoved = false;
|
||||
if (nextCopy) {
|
||||
const np = nextCopy[1].replace(/\/$/, '');
|
||||
nextIsRemoved =
|
||||
generatedPaths.has(nextCopy[1]) ||
|
||||
generatedPaths.has(np) ||
|
||||
generatedPaths.has(np + '/') ||
|
||||
[...generatedPaths].some((gp) => gp.startsWith(np + '/'));
|
||||
}
|
||||
// Remove if the associated COPY is removed, or if the comment
|
||||
// is about something now handled by the generated block
|
||||
if (nextIsRemoved || !nextCopy) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result.push(lines[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
// Ensure blank line after END_MARKER
|
||||
const cleaned = cleanBlankLines(result);
|
||||
for (let k = 0; k < cleaned.length - 1; k++) {
|
||||
if (cleaned[k].trim() === END_MARKER && cleaned[k + 1].trim() !== '') {
|
||||
cleaned.splice(k + 1, 0, '');
|
||||
}
|
||||
}
|
||||
return cleaned.join('\n');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Insert markers into a Dockerfile that doesn't have them yet
|
||||
// ---------------------------------------------------------------------------
|
||||
function insertMarkersAndBlock(lines, copyLines, generatedPaths, appName) {
|
||||
const result = [];
|
||||
let i = 0;
|
||||
|
||||
// Pass through until we find COPY pnpm-lock.yaml
|
||||
let foundLockfile = false;
|
||||
while (i < lines.length) {
|
||||
result.push(lines[i]);
|
||||
if (lines[i].trim().match(/^COPY\s+pnpm-lock\.yaml/)) {
|
||||
foundLockfile = true;
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!foundLockfile) {
|
||||
// Can't find the pattern, return unchanged
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
// Now skip all lines that are part of the old manual copy block:
|
||||
// - blank lines
|
||||
// - comments about shared packages / patches
|
||||
// - COPY statements for packages/* or patches
|
||||
// - COPY statements for apps/{appName}/packages/*
|
||||
// Stop when we hit the COPY for apps/{appName}/apps/web or RUN install
|
||||
while (i < lines.length) {
|
||||
const trimmed = lines[i].trim();
|
||||
|
||||
if (trimmed === '') {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Comments about shared packages, patches, or app packages
|
||||
if (
|
||||
trimmed.startsWith('#') &&
|
||||
(trimmed.match(/copy\s+(shared\s+)?packages/i) ||
|
||||
trimmed.match(/copy\s+patches/i) ||
|
||||
trimmed.match(/copy\s+\w+\s+(content\s+)?package/i))
|
||||
) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// COPY for packages/* or patches
|
||||
if (trimmed.match(/^COPY\s+(packages|patches)[/\s]/)) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// COPY for apps/{appName}/packages (app-specific workspace packages)
|
||||
if (trimmed.match(new RegExp(`^COPY\\s+apps/${appName}/packages`))) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// End of the block we want to replace
|
||||
break;
|
||||
}
|
||||
|
||||
// Insert the marker block
|
||||
result.push('');
|
||||
result.push(START_MARKER);
|
||||
for (const line of copyLines) {
|
||||
result.push(line);
|
||||
}
|
||||
result.push(END_MARKER);
|
||||
|
||||
// Ensure a blank line before the next section
|
||||
if (i < lines.length && lines[i].trim() !== '') {
|
||||
result.push('');
|
||||
}
|
||||
|
||||
// Add remaining lines, removing any further duplicates
|
||||
while (i < lines.length) {
|
||||
const trimmed = lines[i].trim();
|
||||
const copyMatch = trimmed.match(/^COPY\s+(\S+)/);
|
||||
if (copyMatch) {
|
||||
const srcPath = copyMatch[1].replace(/\/$/, '');
|
||||
if (
|
||||
generatedPaths.has(copyMatch[1]) ||
|
||||
generatedPaths.has(srcPath) ||
|
||||
generatedPaths.has(srcPath + '/')
|
||||
) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
result.push(lines[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
return cleanBlankLines(result).join('\n');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Remove runs of 3+ consecutive blank lines, keep at most 1
|
||||
// ---------------------------------------------------------------------------
|
||||
function cleanBlankLines(lines) {
|
||||
const result = [];
|
||||
let blankCount = 0;
|
||||
for (const line of lines) {
|
||||
if (line.trim() === '') {
|
||||
blankCount++;
|
||||
if (blankCount <= 1) {
|
||||
result.push(line);
|
||||
}
|
||||
} else {
|
||||
blankCount = 0;
|
||||
result.push(line);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Main
|
||||
// ---------------------------------------------------------------------------
|
||||
function main() {
|
||||
const packageMap = buildPackageMap();
|
||||
const appsDir = join(ROOT, 'apps');
|
||||
let changed = 0;
|
||||
let unchanged = 0;
|
||||
let errors = 0;
|
||||
|
||||
const appDirs = readdirSync(appsDir, { withFileTypes: true })
|
||||
.filter((e) => e.isDirectory())
|
||||
.map((e) => e.name)
|
||||
.sort();
|
||||
|
||||
for (const appName of appDirs) {
|
||||
const dockerfilePath = join(appsDir, appName, 'apps', 'web', 'Dockerfile');
|
||||
if (!existsSync(dockerfilePath)) continue;
|
||||
|
||||
const pkgJsonPath = join(appsDir, appName, 'apps', 'web', 'package.json');
|
||||
if (!existsSync(pkgJsonPath)) {
|
||||
console.error(` ERROR: ${appName} - package.json not found`);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
const relPath = `apps/${appName}/apps/web/Dockerfile`;
|
||||
const original = readFileSync(dockerfilePath, 'utf8');
|
||||
|
||||
const workspaceDeps = getWorkspaceDeps(pkgJsonPath);
|
||||
const copyLines = generateCopyBlock(workspaceDeps, packageMap);
|
||||
const updated = processDockerfile(original, appName, copyLines);
|
||||
|
||||
if (updated !== original) {
|
||||
if (isCheck) {
|
||||
console.log(` NEEDS UPDATE: ${relPath}`);
|
||||
changed++;
|
||||
} else {
|
||||
writeFileSync(dockerfilePath, updated, 'utf8');
|
||||
console.log(` UPDATED: ${relPath} (${workspaceDeps.length} deps)`);
|
||||
changed++;
|
||||
}
|
||||
} else {
|
||||
console.log(` OK: ${relPath} (${workspaceDeps.length} deps)`);
|
||||
unchanged++;
|
||||
}
|
||||
}
|
||||
|
||||
console.log('');
|
||||
console.log(
|
||||
`Processed ${changed + unchanged + errors} Dockerfiles: ${changed} ${isCheck ? 'need updates' : 'updated'}, ${unchanged} unchanged, ${errors} errors`
|
||||
);
|
||||
|
||||
if (isCheck && changed > 0) {
|
||||
console.log('\nRun `pnpm generate:dockerfiles` to fix.');
|
||||
process.exit(1);
|
||||
}
|
||||
if (errors > 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue