Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(record): Update dependencies and build dual esm/cjs #11300

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/record/.babelrc.js

This file was deleted.

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

// ESM build
await build({
buildOptions: {
...defaultBuildOptions,
format: 'esm',
},
})

// CJS build
await build({
buildOptions: {
...defaultBuildOptions,
outdir: 'dist/cjs',
},
})
await insertCommonJsPackageJson({
buildFileUrl: import.meta.url,
})
25 changes: 16 additions & 9 deletions packages/record/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,39 @@
"directory": "packages/record"
},
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"default": "./dist/cjs/index.js"
}
},
"main": "./dist/cjs/index.js",
"module": "./dist/index.js",
"files": [
"dist"
],
"scripts": {
"build": "yarn build:js",
"build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"",
"build": "tsx ./build.mts",
"build:pack": "yarn pack -o redwoodjs-record.tgz",
"build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"",
"datamodel:parse": "node src/scripts/parse.js",
"check:package": "yarn publint",
"prepublishOnly": "NODE_ENV=production yarn build",
"test": "vitest run",
"test:watch": "vitest watch"
},
"dependencies": {
"@babel/runtime-corejs3": "7.25.0",
"@prisma/client": "5.18.0",
"@redwoodjs/api": "workspace:*",
"@redwoodjs/project-config": "workspace:*",
"core-js": "3.38.0"
"camelcase": "6.3.0"
},
"devDependencies": {
"@babel/cli": "7.24.8",
"@babel/core": "^7.22.20",
"@prisma/internals": "5.18.0",
"@redwoodjs/framework-tools": "workspace:*",
"esbuild": "0.23.0",
"publint": "0.2.10",
"tsx": "4.17.0",
"vitest": "2.0.5"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
Expand Down
9 changes: 5 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8516,14 +8516,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "@redwoodjs/record@workspace:packages/record"
dependencies:
"@babel/cli": "npm:7.24.8"
"@babel/core": "npm:^7.22.20"
"@babel/runtime-corejs3": "npm:7.25.0"
"@prisma/client": "npm:5.18.0"
"@prisma/internals": "npm:5.18.0"
"@redwoodjs/api": "workspace:*"
"@redwoodjs/framework-tools": "workspace:*"
"@redwoodjs/project-config": "workspace:*"
core-js: "npm:3.38.0"
camelcase: "npm:6.3.0"
esbuild: "npm:0.23.0"
publint: "npm:0.2.10"
tsx: "npm:4.17.0"
vitest: "npm:2.0.5"
languageName: unknown
linkType: soft
Expand Down
Loading