fix(build): align Next.js, Docusaurus, and Node TS builds across the monorepo - #343
Open
vijay11149 wants to merge 1 commit into
Open
fix(build): align Next.js, Docusaurus, and Node TS builds across the monorepo#343vijay11149 wants to merge 1 commit into
vijay11149 wants to merge 1 commit into
Conversation
…monorepo - Migrate Docusaurus onBrokenMarkdownLinks to markdown.hooks (v3 deprecation) - Fix dashboard monorepo-package transpilation by removing the @guildpass/env source path mapping and adding @guildpass/metrics to transpilePackages - Emit apps/access-api dist/index.js (ES2022, rootDir src) and document its Node http + ESM setup - Add the previousState column and FailedEvent model referenced by the indexer so access-api type-checks and builds - Document Node/pnpm/TypeScript/app versions in VERSIONS.md and add a Node 18/20 build matrix to CI 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Contributor
|
This PR cannot be merged automatically because one or more workflow checks failed. Please review the failed checks, push a fix, and wait for the workflows to pass. After the checks pass and there are no merge conflicts, the automation can review it again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR audits and repairs build compatibility across the three build systems in the monorepo (Next.js 14, Docusaurus 3, and the Node.js TypeScript services), resolves the Docusaurus v3 deprecation warning, fixes the dashboard's monorepo-package transpilation, and makes
apps/access-apiemit a correct, runnable ESM build. It also adds a single source of truth for dependency versions (VERSIONS.md) and a CI workflow that builds every app across Node 18 and 20 so future major-version drift is caught automatically.The headline fix is a previously-silent
next buildfailure: the dashboardtsconfig.jsonmapped@guildpass/envto its raw TypeScript source, whose NodeNext.js-extension imports webpack cannot resolve. The workspace packages already ship compileddist, so the dashboard now resolves them through theirexports.Linked Issue
Closes #342
Type of Change
Changes Made
Docusaurus (deprecation)
apps/docs/docusaurus.config.js— migratedonBrokenMarkdownLinksfrom the deprecated root-level option to the v3.9+markdown.hooks.onBrokenMarkdownLinksform.Next.js dashboard (transpilation)
apps/dashboard/next.config.mjs— added@guildpass/metricstotranspilePackages(its entry isindex.ts).apps/dashboard/tsconfig.json— removed the@guildpass/env(and unused@guildpass/integration-client/*,@guildpass/mock-repositories)pathsmappings that pointed at TypeScript source. Packages now resolve via their compiledexports.access-api (TypeScript / ESM / build output)
apps/access-api/tsconfig.json—target: ES2022,rootDir: "src",include: ["src"]. PreviouslyrootDir: "."emitteddist/src/index.jswhilepnpm startand the Dockerfile expectdist/index.js.apps/access-api/prisma/schema.prisma— added thepreviousStatecolumn onProcessedEventand theFailedEventmodel thatsrc/workers/indexer.tsalready referenced (this was blockingtsc).apps/access-api/src/utils/backfill-lock.ts— removed an incorrectliveHead: Date | nullannotation (the column isBigInt?).apps/access-api/src/workers/indexer.ts— annotatedapplyEventApplication's return type so thepreviousStatewrite type-checks.apps/access-api/README.md— new "TypeScript, ESM & Node.js" section clarifying it is a plain Nodehttpserver (not Fastify), targets Node 18+, and emitsdist/index.js.Tests (typecheck blockers)
apps/dashboard/test/activity-hash-chain.test.tsandactivity-hash-chain-durable.test.ts— passed the requiredguildIdargument toDurableActivityRepository.append().Version + CI documentation
VERSIONS.md(new) — Node/pnpm/TypeScript/app framework matrix plus an update policy for major versions..github/workflows/ci.yml(new) —[18.x, 20.x]matrix running install → prisma generate → build packages → typecheck → build apps.README.md,CONTRIBUTING.md— prerequisites now link toVERSIONS.md.Lint (small, pre-existing)
eslint.config.js— registered Node 18+ Web/fetch globals (Response,fetch, …) so the.jstests lint correctly.packages/integration-client/src/contracts/contract.types.ts— replaced an emptyinterfacewith a type alias.apps/discord-bot— removed one unused import, one unused helper, and alet→const.Test Evidence
Checklist
pnpm typecheckpasses with no errorspnpm lintpasses (or issues are pre-existing and documented) — see Additional Notespnpm testpasses (all existing tests still pass) — see Additional Notesnext buildtscpnpm build:docs.env.example(no env changes)Screenshots / Recordings
N/A — build/CI changes only; terminal evidence above.
Additional Notes
Pre-existing issues intentionally left out of this PR (not build-compatibility, and unrelated to #342):
pnpm lintstill reports 26 pre-existing errors inapps/dashboard(unused imports/variables,prefer-const, oneno-useless-assignment) spread across ~15 files. This PR fixed the same class of trivial errors inintegration-clientanddiscord-bot, but the dashboard debt is large enough to warrant its own cleanup. CI is scoped totypecheck+ build, which is what this issue's acceptance criteria require.pnpm testrequires a live Postgres.apps/access-api/test/leader-election.test.ts(and the durable-hash-chain dashboard tests) instantiate a realPrismaClient/pgpool and fail onDATABASE_URLnot found, despite the access-api README claiming tests are "fully mocked". Wiring a Postgres service into CI (plus migrations) is a separate follow-up.Note on Fastify: the issue title mentions Fastify, but
apps/access-apidoes not use it — it's a plain Nodehttpserver.VERSIONS.mdand the access-api README now state this explicitly so the misconception doesn't propagate.