Skip to content

Commit

Permalink
Remove webpack and babel in favor of TS
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkustra committed Jan 19, 2024
1 parent 8c22897 commit af75bd6
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 127 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
env: {
jest: true,
},
ignorePatterns: 'dist',
overrides: [
{
files: ['*.js', '*.jsx'],
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist/**/*.js
dist
package.json
package-lock.json
*.html
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,7 @@ The action logs use this naming convention:
`react-native` bundles source using the `metro` bundler. `metro` does not follow symlinks, so we can't use `npm link` to
link a local version of Onyx during development
To quickly test small changes you can directly go to `node_modules/react-native-onyx` in the parent project and:
- tweak original source if you're testing over a react-native project
- tweak `dist/web.development.js` for non react-native-projects
To quickly test small changes you can directly go to `node_modules/react-native-onyx` in the parent project and tweak original source code.
To continuously work on Onyx we have to set up a task that copies content to parent project's `node_modules/react-native-onyx`:
1. Work on Onyx feature or a fix
Expand Down
15 changes: 0 additions & 15 deletions babel.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Onyx, {OnyxUpdate, ConnectOptions} from './Onyx';
import OnyxUtils from './OnyxUtils';
import {CustomTypeOptions, OnyxCollection, OnyxEntry, NullishDeep, KeyValueMapping} from './types';
import withOnyx from './withOnyx';

export default Onyx;
export {OnyxUtils, CustomTypeOptions, OnyxCollection, OnyxEntry, OnyxUpdate, withOnyx, ConnectOptions, NullishDeep, KeyValueMapping};
export {CustomTypeOptions, OnyxCollection, OnyxEntry, OnyxUpdate, withOnyx, ConnectOptions, NullishDeep, KeyValueMapping};
11 changes: 0 additions & 11 deletions native.js

This file was deleted.

16 changes: 4 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,18 @@
},
"files": [
"dist/**/*",
"lib/**/*",
"native.js",
"web.js",
"API.md",
"README.md",
"LICENSE.md"
],
"react-native": "native.js",
"main": "native.js",
"browser": "web.js",
"types": "lib/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"lint-tests": "eslint tests/**",
"test": "jest",
"build": "webpack --config webpack.config.js && tsc",
"build": "tsc && cp ./lib/*.d.ts ./dist",
"build:docs": "node buildDocs.js",
"e2e": "playwright test",
"e2e-ui": "playwright test --ui",
Expand Down Expand Up @@ -89,10 +84,7 @@
"react-native-quick-sqlite": "^8.0.6",
"react-test-renderer": "18.1.0",
"type-fest": "^3.12.0",
"typescript": "^5.3.3",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"webpack-merge": "^5.8.0"
"typescript": "^5.3.3"
},
"peerDependencies": {
"idb-keyval": "^6.2.1",
Expand Down
7 changes: 3 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "esnext",
"target": "es2015",
"module": "esnext",
"types": ["react-native", "jest"],
"lib": ["esnext"],
Expand All @@ -11,14 +11,13 @@
"jsx": "react-native",
"isolatedModules": true,
"strict": true,
"emitDeclarationOnly": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"declaration": true,
"rootDir": "./lib",
"outDir": "./dist",
},
"include": ["."],
"include": ["./lib"],
"exclude": ["**/node_modules/**/*", "**/dist/**/*", "*.config.js"]
}
12 changes: 0 additions & 12 deletions web.js

This file was deleted.

66 changes: 0 additions & 66 deletions webpack.config.js

This file was deleted.

0 comments on commit af75bd6

Please sign in to comment.