Skip to content

Commit

Permalink
fix(package.json): publint fixes so that package is correctly importe…
Browse files Browse the repository at this point in the history
…d in next.js (#36)
  • Loading branch information
daniele-pelagatti authored Apr 3, 2024
1 parent bcb42bd commit 490df10
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,36 @@
"path": "./node_modules/cz-conventional-changelog"
}
},
"main": "dist/decode.umd.js",
"main": "dist/decode.umd.cjs",
"module": "dist/decode.js",
"types": "dist/decode.d.ts",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/decode.d.ts",
"import": "./dist/decode.js",
"types": "./dist/decode.d.ts"
"default": "./dist/decode.umd.cjs"
},
"./encode": {
"types": "./dist/encode.d.ts",
"import": "./dist/encode.js",
"types": "./dist/encode.d.ts"
"default": "./dist/encode.umd.cjs"
},
"./libultrahdr": {
"types": "./dist/libultrahdr.d.ts",
"import": "./dist/libultrahdr.js",
"types": "./dist/libultrahdr.d.ts"
"default": "./dist/libultrahdr.umd.cjs"
},
"./worker": {
"types": "./dist/worker.d.ts",
"import": "./dist/worker.js",
"types": "./dist/worker.d.ts"
"default": "./dist/worker.umd.cjs"
},
"./worker-interface": {
"types": "./dist/worker-interface.d.ts",
"import": "./dist/worker-interface.js",
"types": "./dist/worker-interface.d.ts"
"default": "./dist/worker-interface.umd.cjs"
}
},
"typesVersions": {
Expand Down Expand Up @@ -80,7 +85,7 @@
"start": "concurrently -n rollup,servez -c magenta,green \"rollup -c -w\" \"servez\"",
"test": "nyc --reporter=text --reporter=lcov playwright test",
"test:startserver": "rollup -c && servez",
"test:docker": "docker run --rm --network host -v $(pwd):/work -w /work -it -u $(id -u ${USER}):$(id -g ${USER}) mcr.microsoft.com/playwright:v1.40.0-jammy /bin/bash",
"test:docker": "docker run --rm --network host -v $(pwd):/work -w /work -it -u $(id -u ${USER}):$(id -g ${USER}) mcr.microsoft.com/playwright:v1.42.1-jammy /bin/bash",
"test:codegen": "playwright codegen http://localhost:8080",
"prepack": "npm run build",
"check": "concurrently -c auto npm:check:*",
Expand Down
10 changes: 5 additions & 5 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let configs = [
output: {
format: 'umd',
name: 'worker',
file: 'dist/worker.umd.js',
file: 'dist/worker.umd.cjs',
...settings
},
plugins,
Expand All @@ -113,7 +113,7 @@ if (!process.env.PLAYWRIGHT_TESTING) {
output: {
format: 'umd',
name,
file: 'dist/decode.umd.js',
file: 'dist/decode.umd.cjs',
...settings
},
plugins,
Expand All @@ -126,7 +126,7 @@ if (!process.env.PLAYWRIGHT_TESTING) {
output: {
format: 'umd',
name: 'encode',
file: 'dist/encode.umd.js',
file: 'dist/encode.umd.cjs',
...settings
},
plugins,
Expand All @@ -139,7 +139,7 @@ if (!process.env.PLAYWRIGHT_TESTING) {
output: {
format: 'umd',
name: 'libultrahdr',
file: 'dist/libultrahdr.umd.js',
file: 'dist/libultrahdr.umd.cjs',
...settings
},
plugins,
Expand All @@ -152,7 +152,7 @@ if (!process.env.PLAYWRIGHT_TESTING) {
output: {
format: 'umd',
name: 'worker-interface',
file: 'dist/worker-interface.umd.js',
file: 'dist/worker-interface.umd.cjs',
...settings
},
plugins,
Expand Down
2 changes: 1 addition & 1 deletion tests/encode/encode-and-compress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const encodeAndCompressInBrowser = async (args: Omit<encode.EncodingParam
if (args.withWorker) {
withWorker = workerInterface.getWorkerInterface(
workerInterface.getPromiseWorker(
new Worker('../dist/worker.umd.js')
new Worker('../dist/worker.umd.cjs')
)
)
}
Expand Down

0 comments on commit 490df10

Please sign in to comment.