fix(ci): transform ESM @docmost/prosemirror-markdown in server int/e2e jest
The develop build failed in two jobs, both rooted in the ESM-only workspace package @docmost/prosemirror-markdown (type: module, built to build/index.js with `export * from`), which the server imports at runtime (collaboration.util, page.service). Refactor #345 taught only the unit jest config (package.json "jest" key) to consume it, leaving the integration and e2e configs — and the e2e-server CI job — broken: - `pnpm --filter server test:int` -> SyntaxError: Unexpected token 'export' (jest did not transform prosemirror-markdown/build/*.js). - e2e-server job -> TS2307 Cannot find module '@docmost/prosemirror-markdown' (the package was never built in that job). Mirror the proven unit config into the two failing jest configs and add the missing build step: - jest-integration.json / jest-e2e.json: add a babel-jest transform rule for `prosemirror-markdown/build/.+\.js$` (before the ts-jest rule so it wins) and add @docmost/prosemirror-markdown to the transformIgnorePatterns allowlist so the pnpm-symlinked package is transformed instead of ignored. - develop.yml: build @docmost/prosemirror-markdown in the e2e-server job (after editor-ext, before migrations), like the test.yml job already does. Verified locally: an isolated spec importing the package fails with the exact SyntaxError under the old config and passes under the new one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -151,6 +151,12 @@ jobs:
|
||||
- name: Build editor-ext
|
||||
run: pnpm --filter @docmost/editor-ext build
|
||||
|
||||
# @docmost/prosemirror-markdown is an ESM workspace package the server
|
||||
# imports at runtime; its build/ is gitignored and test:e2e has no pretest
|
||||
# hook, so build it before the e2e run (mirrors the test.yml job).
|
||||
- name: Build prosemirror-markdown
|
||||
run: pnpm --filter @docmost/prosemirror-markdown build
|
||||
|
||||
- name: Run migrations
|
||||
run: pnpm --filter ./apps/server migration:latest
|
||||
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
"testEnvironment": "node",
|
||||
"testRegex": ".e2e-spec.ts$",
|
||||
"transform": {
|
||||
"prosemirror-markdown/build/.+\\.js$": [
|
||||
"babel-jest",
|
||||
{ "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]] }
|
||||
],
|
||||
"^.+\\.(t|j)sx?$": ["ts-jest", { "tsconfig": { "allowJs": true } }]
|
||||
},
|
||||
"transformIgnorePatterns": [
|
||||
"/node_modules/(?!(\\.pnpm/)?(nanoid|uuid|image-dimensions|marked|happy-dom|lib0|@sindresorhus[+/][a-z0-9-]+|escape-string-regexp|p-limit|yocto-queue)(@|/))"
|
||||
"/node_modules/(?!(\\.pnpm/)?(nanoid|uuid|image-dimensions|marked|happy-dom|lib0|@sindresorhus[+/][a-z0-9-]+|escape-string-regexp|p-limit|yocto-queue|@docmost/prosemirror-markdown)(@|/))"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"^@docmost/db/(.*)$": "<rootDir>/../src/database/$1",
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
"testRegex": ".*\\.int-spec\\.ts$",
|
||||
"testPathIgnorePatterns": ["/node_modules/"],
|
||||
"transform": {
|
||||
"prosemirror-markdown/build/.+\\.js$": [
|
||||
"babel-jest",
|
||||
{ "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]] }
|
||||
],
|
||||
"^.+\\.(t|j)sx?$": "ts-jest"
|
||||
},
|
||||
"transformIgnorePatterns": [
|
||||
"/node_modules/(?!(\\.pnpm/)?(nanoid|uuid|image-dimensions|marked|happy-dom|lib0)(@|/))"
|
||||
"/node_modules/(?!(\\.pnpm/)?(nanoid|uuid|image-dimensions|marked|happy-dom|lib0|@docmost/prosemirror-markdown)(@|/))"
|
||||
],
|
||||
"testEnvironment": "node",
|
||||
"testTimeout": 60000,
|
||||
|
||||
Reference in New Issue
Block a user