Skip to content

Commit

Permalink
fix(pkg): Dependency fixes & optimizations
Browse files Browse the repository at this point in the history
Switched from tsdx to tsup, which relies on ESBuild rather than TSC for faster transpiling. It also outputs files separately which is useful for code splitting only the files that you need!

Also fixed a few other issues with adding react-native as a dev dependency.
  • Loading branch information
Pkmmte committed Sep 24, 2022
1 parent bb59f19 commit 787e128
Show file tree
Hide file tree
Showing 5 changed files with 474 additions and 6,030 deletions.
31 changes: 11 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/stashy.esm.js",
"module": "dist/index.mjs",
"release": {
"branches": [
"main",
Expand All @@ -34,37 +34,28 @@
"README.md"
],
"scripts": {
"build": "tsdx build",
"format": "tsdx lint src --fix",
"lint": "tsdx lint src",
"semantic-release": "semantic-release",
"start": "tsdx watch",
"test": "tsdx test"
},
"resolutions": {
"typescript": "4.6.2"
"build": "tsup src --dts --sourcemap --external react-native,react-native-mmkv --format esm,cjs --minify",
"semantic-release": "semantic-release"
},
"dependencies": {
"jotai": "1.8.3",
"nookies": "^2.5.2",
"pino": "^8.5.0",
"react-native-mmkv": "^2.4.3"
"jotai": "1.8.4",
"nookies": "2.5.2",
"pino": "8.5.0"
},
"peerDependencies": {
"next": ">=11.0.0",
"react-native": ">=0.64.1"
"react-native-mmkv": "2.4.3"
},
"devDependencies": {
"@types/next": "^9.0.0",
"@types/react": "^18.0.21",
"@types/react-native": "^0.70.3",
"@typescript-eslint/eslint-plugin": "5.6.0",
"@typescript-eslint/parser": "5.6.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "25.3.0",
"next": "^12.3.0",
"react-native": "0.69.5",
"semantic-release": "18.0.1",
"semantic-release-cli": "5.4.4",
"tsdx": "^0.14.1",
"tslib": "2.3.1",
"tsup": "^6.2.3",
"typescript": "4.6.2"
},
"eslint": {
Expand Down
1 change: 1 addition & 0 deletions src/backend/mmkv.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* © 2022 WavePlay <[email protected]>
*/
// @ts-ignore
import { MMKV } from 'react-native-mmkv';
import { StashyBackend, StashyBackendInitOptions } from './_base';

Expand Down
6 changes: 0 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import MmkvBackend from './backend/mmkv';
import pino from 'pino';
import { Platform } from 'react-native';

export * from './backend/_base';
export * from './backend/cookie';
export * from './backend/local-storage';
export * from './backend/mmkv';
export * from './jotai';

interface StashyConstructor {
backend?: StashyBackend | {
native?: StashyBackend
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"importHelpers": true,
"declaration": true,
"sourceMap": true,
"rootDir": ".",
"rootDir": "./src",
"noUnusedLocals": true,
"moduleResolution": "node",
"outDir": "dist"
Expand Down
Loading

0 comments on commit 787e128

Please sign in to comment.