package.json 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {
  2. "name": "swr",
  3. "version": "1.2.1",
  4. "description": "React Hooks library for remote data fetching",
  5. "keywords": [
  6. "swr",
  7. "react",
  8. "hooks",
  9. "request",
  10. "cache",
  11. "fetch"
  12. ],
  13. "main": "./dist/index.js",
  14. "module": "./dist/index.esm.js",
  15. "exports": {
  16. "./package.json": "./package.json",
  17. ".": {
  18. "import": "./dist/index.mjs",
  19. "module": "./dist/index.esm.js",
  20. "require": "./dist/index.js",
  21. "types": "./dist/index.d.ts"
  22. },
  23. "./infinite": {
  24. "import": "./infinite/dist/index.mjs",
  25. "module": "./infinite/dist/index.esm.js",
  26. "require": "./infinite/dist/index.js",
  27. "types": "./infinite/dist/infinite/index.d.ts"
  28. },
  29. "./immutable": {
  30. "import": "./immutable/dist/index.mjs",
  31. "module": "./immutable/dist/index.esm.js",
  32. "require": "./immutable/dist/index.js",
  33. "types": "./immutable/dist/immutable/index.d.ts"
  34. }
  35. },
  36. "types": "./dist/index.d.ts",
  37. "files": [
  38. "dist/**",
  39. "infinite/dist/**",
  40. "immutable/dist/**",
  41. "infinite/package.json",
  42. "immutable/package.json"
  43. ],
  44. "repository": "github:vercel/swr",
  45. "homepage": "https://swr.vercel.app",
  46. "license": "MIT",
  47. "scripts": {
  48. "clean": "rimraf dist infinite/dist immutable/dist",
  49. "build": "yarn build:core && yarn build:infinite && yarn build:immutable",
  50. "watch": "npm-run-all -p watch:core watch:infinite watch:immutable",
  51. "watch:core": "yarn build:core -w",
  52. "watch:infinite": "yarn build:infinite -w",
  53. "watch:immutable": "yarn build:immutable -w",
  54. "build:core": "bunchee src/index.ts --no-sourcemap",
  55. "build:infinite": "bunchee index.ts --cwd infinite --no-sourcemap",
  56. "build:immutable": "bunchee index.ts --cwd immutable --no-sourcemap",
  57. "prepublishOnly": "yarn clean && yarn build",
  58. "publish-beta": "yarn publish --tag beta",
  59. "types:check": "tsc --noEmit --project tsconfig.check.json && tsc --noEmit -p test",
  60. "format": "prettier --write ./**/*.{ts,tsx}",
  61. "lint": "eslint . --ext .ts,.tsx --cache",
  62. "lint:fix": "yarn lint --fix",
  63. "test": "jest --coverage"
  64. },
  65. "husky": {
  66. "hooks": {
  67. "pre-commit": "lint-staged",
  68. "pre-push": "yarn types:check"
  69. }
  70. },
  71. "lint-staged": {
  72. "*.{ts,tsx}": [
  73. "eslint --fix --cache",
  74. "prettier --write",
  75. "git add"
  76. ]
  77. },
  78. "resolutions": {
  79. "tslib": "2.3.0"
  80. },
  81. "devDependencies": {
  82. "@swc/core": "1.2.129",
  83. "@swc/jest": "0.2.17",
  84. "@testing-library/jest-dom": "5.14.1",
  85. "@testing-library/react": "12.0.0",
  86. "@type-challenges/utils": "0.1.1",
  87. "@types/react": "17.0.20",
  88. "@typescript-eslint/eslint-plugin": "5.8.0",
  89. "@typescript-eslint/parser": "5.8.0",
  90. "bunchee": "1.8.2",
  91. "eslint": "8.3.0",
  92. "eslint-config-prettier": "8.3.0",
  93. "eslint-plugin-jest-dom": "3.9.2",
  94. "eslint-plugin-react": "7.27.1",
  95. "eslint-plugin-react-hooks": "4.3.0",
  96. "eslint-plugin-testing-library": "5.0.0",
  97. "husky": "2.4.1",
  98. "jest": "27.0.6",
  99. "lint-staged": "8.2.1",
  100. "next": "12.0.9",
  101. "npm-run-all": "4.1.5",
  102. "prettier": "2.5.0",
  103. "react": "17.0.1",
  104. "react-dom": "17.0.1",
  105. "react-dom-experimental": "npm:react-dom@alpha",
  106. "react-experimental": "npm:react@alpha",
  107. "rimraf": "3.0.2",
  108. "swr": "link:./",
  109. "typescript": "4.4.3"
  110. },
  111. "peerDependencies": {
  112. "react": "^16.11.0 || ^17.0.0 || ^18.0.0"
  113. },
  114. "prettier": {
  115. "semi": false,
  116. "singleQuote": true,
  117. "useTabs": false,
  118. "trailingComma": "none",
  119. "tabWidth": 2,
  120. "arrowParens": "avoid"
  121. }
  122. }