Skip to content

Commit ff1e62b

Browse files
committed
feature: compile with tsc, remove rollup & babel
1 parent 1d925b2 commit ff1e62b

File tree

6 files changed

+21
-73
lines changed

6 files changed

+21
-73
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

jest.config.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
// For a detailed explanation regarding each configuration property, visit:
2-
// https://jestjs.io/docs/en/configuration.html
3-
1+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
42
module.exports = {
5-
moduleFileExtensions: [
6-
"js",
7-
"ts",
8-
"jsx",
9-
"tsx"
10-
],
11-
testEnvironment: 'node',
12-
testMatch: ['**/*.test.[jt]s?(x)'],
3+
preset: 'ts-jest',
134
testEnvironment: 'jest-environment-jsdom',
14-
testPathIgnorePatterns: ['/node_modules/'],
15-
};
5+
testMatch: ['**/*.test.[jt]s?(x)']
6+
};

package.json

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@steviecs/react-fallback",
3-
"version": "1.0.1",
3+
"version": "1.0.3",
44
"author": "steviecs",
55
"description": "A POC component library for rendering adaptive skeletons that adjust to the shape of your UI's layout while data is being fetched",
66
"keywords": [
@@ -12,32 +12,22 @@
1212
"fallback"
1313
],
1414
"license": "MIT",
15-
"main": "dist/index.tsx",
15+
"main": "dist/index.js",
1616
"peerDependencies": {
17-
"react": "^17.0.2",
18-
"react-dom": "^17.0.2"
17+
"react": "^17.0.2"
1918
},
2019
"devDependencies": {
21-
"@emotion/react": "11.7.1",
22-
"@emotion/styled": "11.6.0",
23-
"@mui/icons-material": "5.2.5",
24-
"@mui/material": "5.2.8",
2520
"@testing-library/react": "^12.1.2",
2621
"@types/jest": "^27.5.1",
2722
"@types/react": "^17.0.37",
2823
"@types/react-dom": "17.0.0",
29-
"babel-core": "^6.26.3",
30-
"babel-runtime": "^6.26.0",
31-
"jest": "^27.5.1",
32-
"mui": "0.0.1",
33-
"react-scripts": "^5.0.1",
34-
"rollup": "^2.75.3",
35-
"rollup-plugin-typescript2": "^0.31.2",
24+
"jest-environment-jsdom": "^28.1.0",
25+
"react-dom": "^17.0.2",
26+
"ts-jest": "^28.0.3",
3627
"typescript": "^4.7.2"
3728
},
3829
"scripts": {
39-
"build": "rollup -c",
40-
"start": "rollup -c -w",
30+
"build": "tsc",
4131
"test": "jest"
4232
},
4333
"browserslist": {
@@ -52,7 +42,5 @@
5242
"last 1 safari version"
5343
]
5444
},
55-
"files": [
56-
"dist"
57-
]
45+
"files": ["dist", "src"]
5846
}

rollup.config.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ interface FallbackProps {
77
}
88

99
/**
10-
* A higher-order component that wraps your JSX to rendering adaptive
11-
* skeletons that adjust to the shape of layout while data is being fetched
10+
* A component that wraps your JSX to render adaptive skeletons
11+
* that adjust to the shape of layout while data is being fetched
1212
* @param isLoading a boolean flag representing if data has been fetched yet
1313
* @param children child nodes of the Fallback wrapper
1414
* @param fallbackOnStaticContent a flag that determines if you want to

tsconfig.json

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
{
22
"compilerOptions": {
3+
"target": "es2018",
34
"outDir": "dist",
4-
"module": "esnext",
5-
"target": "es5",
6-
"lib": ["es6", "dom", "es2016", "es2017", "esnext"],
7-
"sourceMap": true,
8-
"allowJs": false,
9-
"allowSyntheticDefaultImports": true,
10-
"jsx": "react-jsx",
5+
"lib": ["dom", "esnext"],
116
"declaration": true,
127
"moduleResolution": "node",
13-
"forceConsistentCasingInFileNames": true,
14-
"noImplicitReturns": true,
15-
"noImplicitThis": true,
16-
"noImplicitAny": true,
17-
"strictNullChecks": true,
18-
"suppressImplicitAnyIndexErrors": true,
19-
"noUnusedLocals": true,
20-
"noUnusedParameters": true
8+
"sourceMap": true,
9+
"strict": true,
10+
"esModuleInterop": true,
11+
"jsx": "react-jsx",
2112
},
2213
"include": ["src"],
23-
"exclude": ["node_modules", "dist", "rollup.config.js", ".codesandbox", ".vscode"]
14+
"exclude": ["node_modules", "dist", ".codesandbox", ".vscode"]
2415
}

0 commit comments

Comments
 (0)