Skip to content

Commit bd81431

Browse files
committed
chore: improve project structure
1 parent 16c6609 commit bd81431

File tree

13 files changed

+104
-60
lines changed

13 files changed

+104
-60
lines changed

bun.lockb

-2.17 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.

example/.prettierrc.js

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

example/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
[
88
'module-resolver',
99
{
10+
extensions: ['.tsx', '.ts', '.js', '.json'],
1011
alias: {
1112
[pak.name]: path.join(__dirname, '../package', pak.source),
1213
stream: 'stream-browserify',

example/package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
"version": "8.2.3",
44
"private": true,
55
"scripts": {
6-
"bundle-install": "bundle install",
7-
"pods": "cd ios && bundle exec pod install",
6+
"postinstall": "patch-package",
7+
"start": "react-native start",
88
"android": "react-native run-android",
99
"ios": "react-native run-ios",
10-
"start": "react-native start",
11-
"postinstall": "patch-package",
12-
"codegen": "bun react-native codegen",
10+
"bundle-install": "bundle install",
11+
"pods": "cd ios && bundle exec pod install",
1312
"typescript": "tsc --noEmit",
14-
"lint": "eslint \"**/*.{js,ts,tsx}\" --fix"
13+
"lint": "eslint \"**/*.{js,ts,tsx}\" --fix",
14+
"lint-ci": "eslint \"**/*.{js,ts,tsx}\" -f @jamesacarr/github-actions",
15+
"codegen": "bun react-native codegen"
1516
},
1617
"dependencies": {
1718
"@craftzdog/react-native-buffer": "^6.0.5",
@@ -33,25 +34,23 @@
3334
"util": "^0.12.5"
3435
},
3536
"devDependencies": {
36-
"@babel/core": "^7.25.2",
37-
"@babel/plugin-proposal-decorators": "^7.20.5",
38-
"@babel/preset-env": "^7.25.3",
39-
"@babel/runtime": "^7.25.0",
40-
"@react-native-community/cli": "15.0.0",
41-
"@react-native-community/cli-platform-android": "15.0.0",
42-
"@react-native-community/cli-platform-ios": "15.0.0",
43-
"@react-native/babel-preset": "0.76.1",
37+
"@babel/core": "*",
38+
"@babel/plugin-proposal-decorators": "*",
39+
"@babel/preset-env": "*",
40+
"@babel/runtime": "*",
41+
"@react-native-community/cli": "15.1.2",
42+
"@react-native-community/cli-platform-android": "15.1.2",
43+
"@react-native-community/cli-platform-ios": "15.1.2",
44+
"@react-native/babel-preset": "*",
4445
"@react-native/eslint-config": "*",
45-
"@react-native/metro-config": "0.76.1",
46+
"@react-native/metro-config": "*",
4647
"@react-native/typescript-config": "*",
4748
"@types/chai": "^4.3.4",
4849
"@types/chance": "^1.1.3",
4950
"@types/mocha": "^10.0.1",
5051
"@types/node": "^22.7.4",
5152
"@types/react": "*",
5253
"@types/react-test-renderer": "^18.0.0",
53-
"babel-plugin-module-resolver": "^4.1.0",
54-
"babel-plugin-transform-typescript-metadata": "*",
5554
"mocha": "^10.1.0",
5655
"postinstall-postinstall": "^2.1.0",
5756
"react-test-renderer": "18.3.1",

package.json

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
},
1919
"homepage": "https://github.com/margelo/react-native-quick-sqlite#readme",
2020
"scripts": {
21-
"bootstrap": "bun install && bun package prepare && bun example pods",
2221
"postinstall": "patch-package",
23-
"format-cpp": "./scripts/clang-format.sh",
2422
"typescript": "bun --filter=\"**\" typescript",
2523
"lint": "bun package lint && bun example lint",
26-
"release": "release-it",
24+
"lint-cpp": "./scripts/clang-format.sh",
2725
"clean": "rm -rf **/tsconfig.tsbuildinfo node_modules package/node_module package/lib",
26+
"release": "./scripts/release.sh",
2827
"package": "bun --cwd package",
2928
"example": "bun --cwd example"
3029
},
@@ -34,25 +33,32 @@
3433
"react-native": "0.76.1"
3534
},
3635
"devDependencies": {
36+
"@babel/core": "^7.25.2",
37+
"@babel/plugin-proposal-decorators": "^7.20.5",
38+
"@babel/preset-env": "^7.25.4",
39+
"@babel/runtime": "^7.25.4",
3740
"@eslint/js": "^9.10.0",
3841
"@jamesacarr/eslint-formatter-github-actions": "^0.2.0",
42+
"@react-native/babel-preset": "0.76.1",
3943
"@react-native/eslint-config": "0.76.1",
44+
"@react-native/metro-config": "0.76.1",
4045
"@react-native/typescript-config": "0.76.1",
41-
"@release-it-plugins/workspaces": "^4.2.0",
4246
"@release-it/bumper": "^6.0.1",
4347
"@release-it/conventional-changelog": "^8.0.2",
4448
"@tsconfig/react-native": "^2.0.2",
45-
"@types/react": "^18.2.6",
4649
"@types/eslint__js": "^8.42.3",
47-
"@types/jest": "^29.5.5",
50+
"@types/jest": "^29.5.13",
51+
"@types/react": "^18.3.4",
4852
"babel-jest": "^29.6.3",
53+
"babel-plugin-module-resolver": "^5.0.2",
4954
"babel-plugin-transform-typescript-metadata": "^0.3.2",
5055
"eslint": "8.57.0",
5156
"eslint-plugin-prettier": "^5.2.1",
5257
"jest": "^29.7.0",
5358
"prettier": "^3.3.3",
5459
"release-it": "^17.10.0",
55-
"typescript-eslint": "^8.6.0"
60+
"typescript": "~5.5.4",
61+
"typescript-eslint": "^8.13.0"
5662
},
5763
"release-it": {
5864
"npm": false,
@@ -65,12 +71,21 @@
6571
"release": true
6672
},
6773
"hooks": {
68-
"before:init": "bun typescript && bun lint",
69-
"before:bump": "bun example pods",
70-
"after:bump": "bun package prepare"
74+
"before:release": "bun example bundle-install && bun example pods && git add example/ios/Podfile.lock"
7175
},
7276
"plugins": {
73-
"@release-it-plugins/workspaces": true,
77+
"@release-it/bumper": {
78+
"out": [
79+
{
80+
"file": "example/package.json",
81+
"path": "version"
82+
},
83+
{
84+
"file": "example/package.json",
85+
"path": "dependencies.react-native-quick-sqlite"
86+
}
87+
]
88+
},
7489
"@release-it/conventional-changelog": {
7590
"preset": {
7691
"name": "conventionalcommits",
@@ -97,18 +112,6 @@
97112
}
98113
]
99114
}
100-
},
101-
"@release-it/bumper": {
102-
"out": [
103-
{
104-
"file": "example/package.json",
105-
"path": "version"
106-
},
107-
{
108-
"file": "example/package.json",
109-
"path": "dependencies.react-native-quick-sqlite"
110-
}
111-
]
112115
}
113116
}
114117
}

package/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

package/package.json

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@
3333
"!**/__mocks__"
3434
],
3535
"scripts": {
36+
"postinstall": "bun build || exit 0;",
3637
"typescript": "tsc --noEmit",
3738
"lint": "eslint \"**/*.{js,ts,tsx}\" --fix",
38-
"prepare": "rm -rf lib && bun typescript && bob build"
39+
"lint-ci": "eslint \"**/*.{js,ts,tsx}\" -f @jamesacarr/github-actions",
40+
"prepare": "rm -rf lib && bun typescript && bob build",
41+
"test": "jest",
42+
"release": "release-it"
3943
},
4044
"keywords": [
4145
"react-native",
@@ -59,11 +63,10 @@
5963
"typeorm": "^0.3.20"
6064
},
6165
"devDependencies": {
62-
"@react-native/typescript-config": "*",
63-
"babel-plugin-transform-typescript-metadata": "*",
66+
"jest": "*",
6467
"react": "*",
6568
"react-native": "*",
66-
"react-native-builder-bob": "^0.18.2"
69+
"react-native-builder-bob": "^0.31.0"
6770
},
6871
"peerDependencies": {
6972
"react": ">=17.0.0",
@@ -79,6 +82,20 @@
7982
"<rootDir>/lib/"
8083
]
8184
},
85+
"release-it": {
86+
"npm": {
87+
"publish": true,
88+
"publishPackageManager": "bun"
89+
},
90+
"git": false,
91+
"github": {
92+
"release": false
93+
},
94+
"hooks": {
95+
"before:init": "bun typescript && bun lint",
96+
"after:bump": "bun run build"
97+
}
98+
},
8299
"react-native-builder-bob": {
83100
"source": "src",
84101
"output": "lib",
@@ -88,16 +105,10 @@
88105
[
89106
"typescript",
90107
{
91-
"tsc": "../node_modules/.bin/tsc"
108+
"tsc": "../node_modules/.bin/tsc",
109+
"project": "tsconfig.build.json"
92110
}
93111
]
94112
]
95-
},
96-
"release-it": {
97-
"npm": {
98-
"publish": true,
99-
"publishPackageManager": "bun"
100-
},
101-
"git": false
102113
}
103114
}

package/react-native.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// https://github.com/react-native-community/cli/blob/main/docs/dependencies.md
2+
3+
module.exports = {
4+
dependency: {
5+
platforms: {
6+
/**
7+
* @type {import('@react-native-community/cli-types').IOSDependencyParams}
8+
*/
9+
ios: {},
10+
/**
11+
* @type {import('@react-native-community/cli-types').AndroidDependencyParams}
12+
*/
13+
android: {},
14+
},
15+
},
16+
}

0 commit comments

Comments
 (0)