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

Use standard package.json exports pattern #353

Open
wants to merge 2 commits into
base: alpha
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"redux": "^4.0.5",
"rimraf": "3.0.2",
"ts-loader": "^8.0.17",
"typescript": "^4.1.5",
"webpack": "5.23.0",
"typescript": "~4.7.4",
"webpack": "5.89.0",
"webpack-cli": "^4.5.0"
}
}
2 changes: 1 addition & 1 deletion examples/basic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compileOnSave": false,
"compilerOptions": {
"target": "es2015",
"moduleResolution": "node",
"moduleResolution": "Node16",
"pretty": true,
"allowSyntheticDefaultImports": true,
"strict": true,
Expand Down
483 changes: 267 additions & 216 deletions examples/basic/yarn.lock

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions main/package.json

This file was deleted.

31 changes: 25 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,34 @@
"license": "MIT",
"private": false,
"main": "lib/index.js",
"module": "es/index.js",
"types": "types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./types/index.d.ts",
"import": "./es/index.mjs",
"default": "./lib/index.js"
},
"./main": {
"types": "./types/main.d.ts",
"import": "./es/main.mjs",
"default": "./lib/main.js"
},
"./renderer": {
"types": "./types/renderer.d.ts",
"import": "./es/renderer.mjs",
"default": "./lib/renderer.js"
},
"./preload": {
"types": "./types/preload.d.ts",
"import": "./es/preload.mjs",
"default": "./lib/preload.js"
}
},
"files": [
"lib",
"es",
"types",
"main",
"renderer",
"preload"
"types"
],
"scripts": {
"clean": "rimraf lib es coverage types",
Expand Down Expand Up @@ -79,7 +98,7 @@
"rollup-plugin-typescript2": "^0.27.2",
"semantic-release": "^17.2.1",
"spectron": "^11.1.0",
"typescript": "^4.0.3",
"typescript": "~4.7.4",
"typings-tester": "^0.3.2"
},
"npmName": "electron-redux",
Expand Down
6 changes: 0 additions & 6 deletions preload/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions renderer/package.json

This file was deleted.

7 changes: 6 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ export default [
input: ['src/index.ts', 'src/main.ts', 'src/renderer.ts', 'src/preload.ts'],
output: [
{ dir: 'lib', format: 'cjs' },
{ dir: 'es', format: 'es' },
{
dir: 'es',
format: 'es',
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
},
],
},
]
2 changes: 1 addition & 1 deletion tests/typescript/composeWithStateSync.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { applyMiddleware, createStore } from 'redux'
import { reducer } from '../counter'
import { countMiddleware } from '../middleware'
import { composeWithStateSync } from '../../main'
import { composeWithStateSync } from 'electron-redux/main'

const middleware = [countMiddleware]

Expand Down
2 changes: 1 addition & 1 deletion tests/typescript/mainStateSyncEnhancer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { stateSyncEnhancer } from '../../main'
import { stateSyncEnhancer } from 'electron-redux/main'
import { createStore, Store } from 'redux'
import { reducer, CounterState, Actions } from '../counter'

Expand Down
2 changes: 1 addition & 1 deletion tests/typescript/rendererStateSyncEnhancer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { stateSyncEnhancer } from '../../renderer'
import { stateSyncEnhancer } from 'electron-redux/renderer'
import { createStore, Store } from 'redux'
import { reducer, CounterState, Actions } from '../counter'

Expand Down
1 change: 1 addition & 0 deletions tests/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"lib": ["es2017", "dom"],
"module": "Node16",
"strict": true,
"baseUrl": "../.."
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9815,10 +9815,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5"
integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==
typescript@~4.7.4:
version "4.7.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==

typings-tester@^0.3.2:
version "0.3.2"
Expand Down
Loading