-
Notifications
You must be signed in to change notification settings - Fork 786
Package now consists of ES2015 and commonjs #1576
Changes from 7 commits
3411ecf
85077d0
0ff67a1
2d89a1d
e1e86b7
0a1bb51
c34f7f2
3b5942a
25011ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,37 +5,40 @@ | |
"module": "src/index.ts", | ||
"scripts": { | ||
"danger": "danger run --verbose", | ||
"deploy": | ||
"./scripts/prepare-package.sh && cd npm && npm publish --tag=alpha", | ||
"predeploy": "npm run compile", | ||
"deploy": "cd lib && npm publish --tag=alpha", | ||
"test": "npm run lint && npm run type-check && npm run jest", | ||
"jest": "jest --maxWorkers=4 --coverage", | ||
"test-watch": "jest --watch", | ||
"test-preact": "jest --config ./jest.preact.config.json --no-cache", | ||
"filesize": "bundlesize", | ||
"type-check": "tsc --project tsconfig.json --noEmit && flow check", | ||
"precompile": "rimraf lib && rimraf npm", | ||
"compile": | ||
"tsc --project tsconfig.json && rimraf lib/test && mv lib/src/* lib/. && rimraf lib/src", | ||
"postcompile": | ||
"rollup -c rollup.config.js && rollup -c rollup.test-utils.config.js", | ||
"precompile": "rimraf lib", | ||
"compile": "npm run compile:esm && npm run compile:cjs", | ||
"compile:esm": "tsc --project tsconfig.json -d && rimraf lib/test && mv lib/src/* lib/. && rimraf lib/src && cd lib && rename js mjs", | ||
"compile:cjs": "tsc --project tsconfig.cjs.json && rimraf lib/test && mv lib/src/* lib/. && rimraf lib/src", | ||
"postcompile": "./scripts/prepare-package.sh", | ||
"watch": "tsc -w", | ||
"lint": "tslint --project tsconfig.json --config tslint.json", | ||
"lint:fix": | ||
"npm run prettier && tslint 'src/*.ts*' --project tsconfig.json --fix", | ||
"lint:fix": "npm run prettier && tslint 'src/*.ts*' --project tsconfig.json --fix", | ||
"lint-staged": "lint-staged", | ||
"prettier": | ||
"prettier --config .prettierrc --write \"{src,test}/**/*.{js,ts}*\"" | ||
"prettier": "prettier --write \"{,!(node_modules|lib)/**/}*.{ts*,js*,json,md}\"" | ||
}, | ||
"bundlesize": [ | ||
{ | ||
"path": "./lib/umd/react-apollo.js", | ||
"maxSize": "4.81 KB" | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
], | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts}*": ["prettier --single-quote --write", "git add"] | ||
"*.{ts*}": [ | ||
"prettier --write", | ||
"yarn lint", | ||
"git add" | ||
], | ||
"*.{js*,json,md}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
}, | ||
"pre-commit": "lint-staged", | ||
"repository": { | ||
"type": "git", | ||
"url": "apollostack/react-apollo" | ||
|
@@ -51,7 +54,9 @@ | |
], | ||
"author": "James Baxley <[email protected]>", | ||
"babel": { | ||
"presets": ["env"] | ||
"presets": [ | ||
"env" | ||
] | ||
}, | ||
"jest": { | ||
"testEnvironment": "jsdom", | ||
|
@@ -60,15 +65,24 @@ | |
"^.+\\.jsx?$": "babel-jest" | ||
}, | ||
"mapCoverage": true, | ||
"moduleFileExtensions": ["ts", "tsx", "js", "json"], | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"json" | ||
], | ||
"modulePathIgnorePatterns": [ | ||
"<rootDir>/examples", | ||
"<rootDir>/test/flow-usage.js", | ||
"<rootDir>/test/typescript-usage.tsx" | ||
], | ||
"projects": ["<rootDir>"], | ||
"projects": [ | ||
"<rootDir>" | ||
], | ||
"testRegex": "(/test/(?!test-utils\b)\b.*|\\.(test|spec))\\.(ts|tsx|js)$", | ||
"setupFiles": ["<rootDir>/test/test-utils/setup.ts"] | ||
"setupFiles": [ | ||
"<rootDir>/test/test-utils/setup.ts" | ||
] | ||
}, | ||
"license": "MIT", | ||
"peerDependencies": { | ||
|
@@ -90,28 +104,26 @@ | |
"babel-core": "6.26.0", | ||
"babel-jest": "22.1.0", | ||
"babel-preset-env": "1.6.1", | ||
"bundlesize": "0.15.3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rosskevin why are we removing bundlesize? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We aren't creating a UMD bundle anymore, not sure if we can size a non-compressed folder of files. I'll check. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added back to test rollup-produced CJS file |
||
"coveralls": "3.0.0", | ||
"danger": "3.0.5", | ||
"enzyme": "3.3.0", | ||
"enzyme-adapter-react-16": "1.1.1", | ||
"flow-bin": "0.63.1", | ||
"graphql": "0.11.7", | ||
"graphql-tag": "2.6.1", | ||
"husky": "^0.14.3", | ||
"jest": "22.1.1", | ||
"jsdom": "11.5.1", | ||
"lint-staged": "6.0.0", | ||
"pre-commit": "1.2.2", | ||
"preact": "^8.2.7", | ||
"preact-compat": "^3.17.0", | ||
"prettier": "1.10.2", | ||
"react": "16.2.0", | ||
"react-dom": "16.2.0", | ||
"react-test-renderer": "16.2.0", | ||
"recompose": "0.26.0", | ||
"recursive-rename": "^2.0.0", | ||
"rimraf": "2.6.2", | ||
"rollup": "0.54.1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we not need this anymore? Does typescript handle all of the bundling? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tsc does 100% of the transpilation - no more bundles (discussed with @jaydenseric in the thread) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rollup added back for bundlesize only |
||
"rollup-plugin-babel-minify": "3.1.2", | ||
"ts-jest": "22.0.1", | ||
"tslint": "5.9.1", | ||
"typescript": "2.6.2", | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es5", | ||
"lib": ["es2015", "dom"], | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"noImplicitAny": false, | ||
"outDir": "lib", | ||
"allowSyntheticDefaultImports": false, | ||
"experimentalDecorators": true, | ||
"pretty": true, | ||
"removeComments": true, | ||
"jsx": "react", | ||
"skipLibCheck": true, | ||
"noUnusedLocals": true | ||
}, | ||
"include": ["./typings/**/*", "./src/**/*", "./test/**/*"], | ||
"exclude": ["./node_modules", "./dist", "./lib"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work, does
main
andmodule
get added to the package.json that actually gets published?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, that's no good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, no, this is ok - it's there for codesandbox. Pay no attention to the /package.json, just to lib/package.json