Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Walker-GM committed Aug 17, 2024
1 parent b86898a commit 4e1c3c5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 14 deletions.
1 change: 0 additions & 1 deletion packages/record/.babelrc.js

This file was deleted.

23 changes: 23 additions & 0 deletions packages/record/build.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { writeFileSync } from 'node:fs'

import { build, defaultBuildOptions } from '@redwoodjs/framework-tools'

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

// CJS build
await build({
buildOptions: {
...defaultBuildOptions,
outdir: 'dist/cjs',
},
})

// Place a package.json file with `type: commonjs` in the 'dist/cjs' folder so that
// all files are considered CommonJS modules.
writeFileSync('dist/cjs/package.json', JSON.stringify({ type: 'commonjs' }))
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 @@ -8441,14 +8441,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

0 comments on commit 4e1c3c5

Please sign in to comment.