Skip to content

Commit

Permalink
refactor(testing): build 'testing' package with esbuild (#11342)
Browse files Browse the repository at this point in the history
Switches the testing package over to use esbuild over babel for building
the package. This PR doesn't introduce the conditional exports yet.
  • Loading branch information
Josh-Walker-GM authored Aug 22, 2024
1 parent dc8e847 commit b4541a2
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 17 deletions.
1 change: 0 additions & 1 deletion packages/testing/.babelrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions packages/testing/build.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { build } from '@redwoodjs/framework-tools'

await build()
18 changes: 9 additions & 9 deletions packages/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"directory": "packages/testing"
},
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "commonjs",
"files": [
"config",
"web",
Expand All @@ -18,17 +17,17 @@
"dist"
],
"scripts": {
"build": "yarn build:js && yarn build:types",
"build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"",
"build": "tsx ./build.mts && yarn build:types",
"build:pack": "yarn pack -o redwoodjs-testing.tgz",
"build:types": "tsc --build --verbose",
"build:types": "tsc --build --verbose ./tsconfig.build.json",
"build:watch": "nodemon --watch src --ext 'js,jsx,ts,tsx' --ignore dist --exec 'yarn build'",
"check:attw": "yarn rw-fwtools-attw",
"check:package": "concurrently npm:check:attw yarn:publint",
"prepublishOnly": "NODE_ENV=production yarn build",
"test": "vitest run",
"test:watch": "vitest watch"
},
"dependencies": {
"@babel/runtime-corejs3": "7.25.0",
"@redwoodjs/auth": "workspace:*",
"@redwoodjs/babel-config": "workspace:*",
"@redwoodjs/context": "workspace:*",
Expand All @@ -44,7 +43,6 @@
"@types/jest": "29.5.12",
"@types/node": "20.14.15",
"babel-jest": "^29.7.0",
"core-js": "3.38.0",
"fast-glob": "3.3.2",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
Expand All @@ -54,9 +52,11 @@
"whatwg-fetch": "3.6.20"
},
"devDependencies": {
"@babel/cli": "7.24.8",
"@babel/core": "^7.22.20",
"@redwoodjs/framework-tools": "workspace:*",
"concurrently": "8.2.2",
"jsdom": "24.1.1",
"publint": "0.2.10",
"tsx": "4.17.0",
"typescript": "5.5.4",
"vitest": "2.0.5"
},
Expand Down
20 changes: 20 additions & 0 deletions packages/testing/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "../../tsconfig.compilerOption.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"module": "Node16",
"moduleResolution": "Node16",
"tsBuildInfoFile": "./tsconfig.build.tsbuildinfo"
},
"include": ["src"],
"references": [
{ "path": "../router/tsconfig.build.json" },
{ "path": "../babel-config" },
{ "path": "../context/tsconfig.build.json" },
{ "path": "../project-config" },
{ "path": "../web/tsconfig.build.json" },
{ "path": "../auth/tsconfig.build.json" },
{ "path": "../graphql-server" }
]
}
6 changes: 3 additions & 3 deletions packages/testing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"extends": "../../tsconfig.compilerOption.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"module": "Node16",
"moduleResolution": "Node16"
},
"include": ["src"],
"include": ["."],
"exclude": ["dist", "node_modules", "**/__mocks__", "**/__fixtures__"],
"references": [
{ "path": "../framework-tools" },
{ "path": "../router/tsconfig.build.json" },
{ "path": "../babel-config" },
{ "path": "../context/tsconfig.build.json" },
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8661,12 +8661,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "@redwoodjs/testing@workspace:packages/testing"
dependencies:
"@babel/cli": "npm:7.24.8"
"@babel/core": "npm:^7.22.20"
"@babel/runtime-corejs3": "npm:7.25.0"
"@redwoodjs/auth": "workspace:*"
"@redwoodjs/babel-config": "workspace:*"
"@redwoodjs/context": "workspace:*"
"@redwoodjs/framework-tools": "workspace:*"
"@redwoodjs/graphql-server": "workspace:*"
"@redwoodjs/project-config": "workspace:*"
"@redwoodjs/router": "workspace:*"
Expand All @@ -8679,14 +8677,16 @@ __metadata:
"@types/jest": "npm:29.5.12"
"@types/node": "npm:20.14.15"
babel-jest: "npm:^29.7.0"
core-js: "npm:3.38.0"
concurrently: "npm:8.2.2"
fast-glob: "npm:3.3.2"
jest: "npm:29.7.0"
jest-environment-jsdom: "npm:29.7.0"
jest-watch-typeahead: "npm:2.2.2"
jsdom: "npm:24.1.1"
msw: "npm:1.3.3"
publint: "npm:0.2.10"
ts-toolbelt: "npm:9.6.0"
tsx: "npm:4.17.0"
typescript: "npm:5.5.4"
vitest: "npm:2.0.5"
whatwg-fetch: "npm:3.6.20"
Expand Down

0 comments on commit b4541a2

Please sign in to comment.