Skip to content

Commit

Permalink
chore: rename swr folder to core
Browse files Browse the repository at this point in the history
  • Loading branch information
promer94 committed May 13, 2022
1 parent fc88552 commit f23117b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
modulePathIgnorePatterns: ['<rootDir>/examples/'],
setupFilesAfterEnv: ['<rootDir>/test/jest-setup.ts'],
moduleNameMapper: {
'^swr$': '<rootDir>/swr/index.ts',
'^swr$': '<rootDir>/core/index.ts',
'^swr/infinite$': '<rootDir>/infinite/index.ts',
'^swr/immutable$': '<rootDir>/immutable/index.ts',
'^swr/mutation$': '<rootDir>/mutation/index.ts',
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"cache",
"fetch"
],
"main": "./swr/dist/index.js",
"module": "./swr/dist/index.esm.js",
"types": "./swr/dist/swr/index.d.ts",
"main": "./core/dist/index.js",
"module": "./core/dist/index.esm.js",
"types": "./core/dist/core/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./swr/dist/index.mjs",
"module": "./swr/dist/index.esm.js",
"require": "./swr/dist/index.js",
"types": "./swr/dist/swr/index.d.ts"
"import": "./core/dist/index.mjs",
"module": "./core/dist/index.esm.js",
"require": "./core/dist/index.js",
"types": "./core/dist/core/index.d.ts"
},
"./infinite": {
"import": "./infinite/dist/index.mjs",
Expand Down Expand Up @@ -47,12 +47,12 @@
}
},
"files": [
"swr/dist/**",
"core/dist/**",
"infinite/dist/**",
"immutable/dist/**",
"mutation/dist/**",
"_internal/dist/**",
"swr/dist/package.json",
"core/dist/package.json",
"infinite/package.json",
"immutable/package.json",
"mutation/package.json",
Expand All @@ -63,14 +63,14 @@
"homepage": "https://swr.vercel.app",
"license": "MIT",
"scripts": {
"clean": "rimraf dist infinite/dist immutable/dist mutation/dist",
"clean": "rimraf core/dist infinite/dist immutable/dist mutation/dist",
"build": "yarn build:internal && yarn build:core && yarn build:infinite && yarn build:immutable && yarn build:mutation",
"watch": "npm-run-all -p watch:core watch:infinite watch:immutable watch:mutation",
"watch:core": "yarn build:core -w",
"watch:infinite": "yarn build:infinite -w",
"watch:immutable": "yarn build:immutable -w",
"watch:mutation": "yarn build:mutation -w",
"build:core": "bunchee index.ts --cwd swr --no-sourcemap",
"build:core": "bunchee index.ts --cwd core --no-sourcemap",
"build:infinite": "bunchee index.ts --cwd infinite --no-sourcemap",
"build:immutable": "bunchee index.ts --cwd immutable --no-sourcemap",
"build:mutation": "bunchee index.ts --cwd mutation --no-sourcemap",
Expand Down
2 changes: 1 addition & 1 deletion test/use-swr-node-env.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react'
import { renderToString } from 'react-dom/server'
import useSWR from '../swr'
import useSWR from '../core'
import useSWRImmutable from '../immutable'
import { createKey } from './utils'
import { IS_SERVER } from '../_internal/utils/env'
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"baseUrl": ".",
"noEmitOnError": true,
"paths": {
"swr": ["./swr/index.ts"],
"swr": ["./core/index.ts"],
"swr/infinite": ["./infinite/index.ts"],
"swr/immutable": ["./immutable/index.ts"],
"swr/mutation": ["./mutation/index.ts"]
},
"typeRoots": ["swr/types", "./node_modules/@types"]
"typeRoots": ["./node_modules/@types"]
},
"include": ["swr"],
"include": ["core"],
"exclude": ["./**/dist", "node_modules", "jest.config.js"],
"watchOptions": {
"watchFile": "useFsEvents",
Expand Down

0 comments on commit f23117b

Please sign in to comment.