Skip to content

Commit b9ea117

Browse files
committed
fix: resolve workspace dependency resolution issues in tests
- Add @jest/test-sequencer to root devDependencies to fix Jest test sequencer resolution errors - Convert internal package dependencies to workspace:^ protocol: - @launchql/server-utils: workspace:^ in server, core, explorer - pg-cache: workspace:^ in server, explorer, core - @launchql/logger: workspace:^ in server-utils - Add re-export files (index.js, index.d.ts) to pg-cache package for proper module resolution in workspace context - Update init.install test snapshot to match pnpm-based template output (license field and pnpm scripts) This ensures Jest and TypeScript can correctly resolve internal packages when running tests in the monorepo workspace, fixing MODULE_NOT_FOUND errors that were preventing tests from passing.
1 parent cf7c350 commit b9ea117

9 files changed

Lines changed: 234 additions & 42 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"lint": "pnpm -r run lint"
2626
},
2727
"devDependencies": {
28+
"@jest/test-sequencer": "^30.2.0",
2829
"@types/jest": "^29.5.11",
2930
"@types/jest-in-case": "^1.0.9",
3031
"@types/node": "^20.12.7",

packages/cli/__tests__/__snapshots__/init.install.test.ts.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`cmds:install - with initialized workspace and module installs a module
1212
"description": "undefined",
1313
"homepage": "https://github.com/undefined/undefined",
1414
"keywords": [],
15-
"license": "MIT",
15+
"license": "SEE LICENSE IN LICENSE",
1616
"main": "index.js",
1717
"module": "esm/index.js",
1818
"name": "undefined",
@@ -25,12 +25,12 @@ exports[`cmds:install - with initialized workspace and module installs a module
2525
"url": "https://github.com/undefined/undefined",
2626
},
2727
"scripts": {
28-
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
29-
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
28+
"build": "pnpm run clean; tsc -p tsconfig.json; tsc -p tsconfig.esm.json; pnpm run copy",
29+
"build:dev": "pnpm run clean; tsc -p tsconfig.json --declarationMap; tsc -p tsconfig.esm.json; pnpm run copy",
3030
"clean": "rimraf dist/**",
3131
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
3232
"lint": "eslint . --fix",
33-
"prepare": "npm run build",
33+
"prepare": "pnpm run build",
3434
"test": "jest",
3535
"test:watch": "jest --watch",
3636
},
@@ -93,7 +93,7 @@ exports[`cmds:install - with initialized workspace and module installs two modul
9393
"description": "undefined",
9494
"homepage": "https://github.com/undefined/undefined",
9595
"keywords": [],
96-
"license": "MIT",
96+
"license": "SEE LICENSE IN LICENSE",
9797
"main": "index.js",
9898
"module": "esm/index.js",
9999
"name": "undefined",
@@ -106,12 +106,12 @@ exports[`cmds:install - with initialized workspace and module installs two modul
106106
"url": "https://github.com/undefined/undefined",
107107
},
108108
"scripts": {
109-
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
110-
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
109+
"build": "pnpm run clean; tsc -p tsconfig.json; tsc -p tsconfig.esm.json; pnpm run copy",
110+
"build:dev": "pnpm run clean; tsc -p tsconfig.json --declarationMap; tsc -p tsconfig.esm.json; pnpm run copy",
111111
"clean": "rimraf dist/**",
112112
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
113113
"lint": "eslint . --fix",
114-
"prepare": "npm run build",
114+
"prepare": "pnpm run build",
115115
"test": "jest",
116116
"test:watch": "jest --watch",
117117
},

packages/core/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646
},
4747
"dependencies": {
4848
"@launchql/env": "^2.4.3",
49-
"@launchql/logger": "^1.1.0",
50-
"@launchql/server-utils": "^2.4.3",
49+
"@launchql/explorer": "workspace:^",
50+
"@launchql/logger": "workspace:^",
51+
"@launchql/server-utils": "workspace:^",
5152
"@launchql/templatizer": "workspace:^",
5253
"@launchql/types": "^2.6.2",
5354
"@pgsql/types": "^17.6.1",
@@ -57,7 +58,7 @@
5758
"glob": "^11.0.2",
5859
"parse-package-name": "^1.0.0",
5960
"pg": "^8.16.0",
60-
"pg-cache": "^1.3.4",
61+
"pg-cache": "workspace:^",
6162
"pg-env": "^1.1.0",
6263
"pgsql-deparser": "^17.11.1",
6364
"pgsql-parser": "^17.8.2",

packages/explorer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"dependencies": {
3838
"@launchql/env": "^2.4.3",
3939
"@launchql/s3-streamer": "^2.5.3",
40-
"@launchql/server-utils": "^2.4.3",
40+
"@launchql/server-utils": "workspace:^",
4141
"@launchql/types": "^2.6.2",
4242
"@launchql/upload-names": "^2.2.1",
4343
"@launchql/url-domains": "^2.2.1",
@@ -46,7 +46,7 @@
4646
"graphile-cache": "^1.3.4",
4747
"graphile-settings": "^2.5.3",
4848
"graphql-upload": "^13.0.0",
49-
"pg-cache": "^1.3.4",
49+
"pg-cache": "workspace:^",
5050
"pg-env": "workspace:^",
5151
"postgraphile": "^4.14.1"
5252
},

packages/pg-cache/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dist';

packages/pg-cache/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./dist');

packages/server-utils/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
},
3232
"dependencies": {
3333
"@launchql/types": "^2.6.2",
34+
"@launchql/logger": "workspace:^",
3435
"cors": "^2.8.5",
3536
"express": "^5.1.0",
3637
"lru-cache": "^11.1.0"

packages/server/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@launchql/env": "^2.4.3",
4545
"@launchql/logger": "workspace:^",
4646
"@launchql/s3-utils": "^2.2.1",
47-
"@launchql/server-utils": "^2.4.3",
47+
"@launchql/server-utils": "workspace:^",
4848
"@launchql/types": "^2.6.2",
4949
"@launchql/upload-names": "^2.2.1",
5050
"@launchql/url-domains": "^2.2.1",
@@ -61,6 +61,7 @@
6161
"graphile-search-plugin": "^0.1.2",
6262
"graphile-settings": "^2.5.3",
6363
"graphile-simple-inflector": "^0.1.1",
64+
"pg-cache": "workspace:^",
6465
"graphql-tag": "2.12.6",
6566
"graphql-upload": "^13.0.0",
6667
"lru-cache": "^11.1.0",

0 commit comments

Comments
 (0)