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

Defer to rollup TS plugin to build types #3564

Merged
merged 4 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dist
lib
es
coverage
types

website/translated_docs
website/build/
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,23 @@
"main": "lib/redux.js",
"unpkg": "dist/redux.js",
"module": "es/redux.js",
"types": "types/index.d.ts",
"types": "lib/redux.d.ts",
timdorr marked this conversation as resolved.
Show resolved Hide resolved
"files": [
"dist",
"lib",
"es",
"src",
"types"
"src"
],
"scripts": {
"clean": "rimraf lib dist es coverage types",
"clean": "rimraf lib dist es coverage",
"format": "prettier --write \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
"format:check": "prettier --list-different \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
"lint": "eslint --ext js,ts src test",
"pretest": "npm run build",
"test": "jest",
"test:watch": "npm test -- --watch",
"test:cov": "npm test -- --coverage",
"build": "npm run build-types && rollup -c",
"build": "rollup -c",
"prepare": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test",
"build-types": "tsc --emitDeclarationOnly",
"check-types": "tsc --noEmit",
Expand Down
10 changes: 5 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import pkg from './package.json'
export default [
// CommonJS
{
input: 'src/index.ts',
input: 'src/redux.ts',
output: { file: 'lib/redux.js', format: 'cjs', indent: false },
external: [
...Object.keys(pkg.dependencies || {}),
Expand All @@ -26,7 +26,7 @@ export default [

// ES
{
input: 'src/index.ts',
input: 'src/redux.ts',
output: { file: 'es/redux.js', format: 'es', indent: false },
external: [
...Object.keys(pkg.dependencies || {}),
Expand All @@ -43,7 +43,7 @@ export default [

// ES for Browsers
{
input: 'src/index.ts',
input: 'src/redux.ts',
output: { file: 'es/redux.mjs', format: 'es', indent: false },
plugins: [
nodeResolve({
Expand All @@ -69,7 +69,7 @@ export default [

// UMD Development
{
input: 'src/index.ts',
input: 'src/redux.ts',
output: {
file: 'dist/redux.js',
format: 'umd',
Expand All @@ -92,7 +92,7 @@ export default [

// UMD Production
{
input: 'src/index.ts',
input: 'src/redux.ts',
output: {
file: 'dist/redux.min.js',
format: 'umd',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/typescript.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { checkDirectory } from 'typings-tester'

describe('TypeScript definitions', function() {
it('should compile against index.d.ts', () => {
it('should compile against redux.d.ts', () => {
checkDirectory(__dirname + '/typescript')
})
})
2 changes: 1 addition & 1 deletion test/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"strict": true,
"baseUrl": "../..",
"paths": {
"redux": ["types/index.d.ts"]
"redux": ["lib/redux.d.ts"]
timdorr marked this conversation as resolved.
Show resolved Hide resolved
}
}
}