fix(build): stop committing tsbuildinfo, wipe before tsc on docker
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m21s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m21s
Root cause of the CI "Cannot find module @anydrop/shared" error: server/tsconfig.tsbuildinfo and shared/tsconfig.tsbuildinfo were checked in. On the Gitea runner, tsc read those files, concluded the prior (local-machine) build was still valid, and skipped emitting shared/dist — so there was nothing to resolve by the time server's tsc ran. - untrack the two .tsbuildinfo files - gitignore *.tsbuildinfo - dockerignore **/dist, **/*.tsbuildinfo (belt-and-suspenders) - in both Dockerfiles, delete any stray tsbuildinfo + dist dirs before tsc
This commit is contained in:
parent
0b90d9cdb5
commit
ef2725aebf
@ -1,6 +1,10 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
**/node_modules
|
||||||
.git
|
.git
|
||||||
dist
|
dist
|
||||||
|
**/dist
|
||||||
|
*.tsbuildinfo
|
||||||
|
**/*.tsbuildinfo
|
||||||
docs
|
docs
|
||||||
*.md
|
*.md
|
||||||
.gitea
|
.gitea
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
*.tsbuildinfo
|
||||||
|
|||||||
@ -13,6 +13,11 @@ RUN pnpm install --frozen-lockfile
|
|||||||
COPY shared/ shared/
|
COPY shared/ shared/
|
||||||
COPY server/ server/
|
COPY server/ server/
|
||||||
|
|
||||||
|
# Force clean builds — any committed tsconfig.tsbuildinfo can make tsc
|
||||||
|
# skip emit when it thinks the prior build is still valid.
|
||||||
|
RUN find shared server -name "*.tsbuildinfo" -delete \
|
||||||
|
&& rm -rf shared/dist server/dist
|
||||||
|
|
||||||
# Build shared first, then materialize it as a real directory inside
|
# Build shared first, then materialize it as a real directory inside
|
||||||
# server/node_modules so TS module resolution does not rely on pnpm's
|
# server/node_modules so TS module resolution does not rely on pnpm's
|
||||||
# workspace symlink (which has been observed to break across build layers
|
# workspace symlink (which has been observed to break across build layers
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
{"root":["./src/index.ts","./src/push.ts","./src/rooms.ts","./src/db/client.ts","./src/db/migrate.ts","./src/db/schema.ts","./src/http/app.ts","./src/http/auth.ts","./src/http/me.ts","./src/http/middleware.ts","./src/http/session.ts","./src/mail/smtp.ts","./src/mail/templates.ts"],"version":"5.9.3"}
|
|
||||||
File diff suppressed because one or more lines are too long
@ -14,7 +14,9 @@ RUN pnpm install --frozen-lockfile
|
|||||||
|
|
||||||
COPY shared/ shared/
|
COPY shared/ shared/
|
||||||
COPY web/ web/
|
COPY web/ web/
|
||||||
RUN pnpm --filter @anydrop/shared run build \
|
RUN find shared web -name "*.tsbuildinfo" -delete \
|
||||||
|
&& rm -rf shared/dist web/dist \
|
||||||
|
&& pnpm --filter @anydrop/shared run build \
|
||||||
&& test -f shared/dist/index.d.ts \
|
&& test -f shared/dist/index.d.ts \
|
||||||
&& rm -rf web/node_modules/@anydrop/shared \
|
&& rm -rf web/node_modules/@anydrop/shared \
|
||||||
&& mkdir -p web/node_modules/@anydrop/shared \
|
&& mkdir -p web/node_modules/@anydrop/shared \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user