Skip to content

Commit a85f513

Browse files
committed
Merge branch 'main' into chore/update-rn-version-to-v82
2 parents 035b631 + e7a3ef9 commit a85f513

40 files changed

+246
-225
lines changed

.clang-format-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package/cpp/sqlite/*

.prettierignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
*.html
2+
*.yml
3+
*.yaml
4+
*.css
5+
*.scss
6+
*.md
7+
*.markdown
8+
9+
package/lib
10+
11+
.well-known
12+
android
13+
ios
14+
vendor
15+
package.json
16+
package-lock.json
17+
18+
# The GH actions don't seem to compile and verify themselves well when Prettier is applied to them
19+
.github/actions/javascript/**/index.js
20+

.prettierrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
quoteProps: 'consistent',
3+
singleQuote: true,
4+
tabWidth: 2,
5+
trailingComma: 'all',
6+
useTabs: false,
7+
singleAttributePerLine: true,
8+
semi: false,
9+
}

.watchmanconfig

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

config/.eslintrc.js

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
module.exports = {
22
root: true,
33
ignorePatterns: [
4-
"**/node_modules",
5-
"**/lib",
6-
"**/.eslintrc.js",
7-
"**/.prettierrc.js",
8-
"**/jest.config.js",
9-
"**/babel.config.js",
10-
"**/metro.config.js",
11-
"**/react-native.config.js",
12-
"**/tsconfig.json"
4+
'**/node_modules',
5+
'**/lib',
6+
'**/.eslintrc.js',
7+
'**/.prettierrc.js',
8+
'**/jest.config.js',
9+
'**/babel.config.js',
10+
'**/metro.config.js',
11+
'**/react-native.config.js',
12+
'**/tsconfig.json',
1313
],
14-
extends: ['@react-native','plugin:prettier/recommended'],
15-
plugins: ['@typescript-eslint', 'prettier'],
14+
extends: [
15+
'@react-native',
16+
'plugin:prettier/recommended',
17+
'plugin:@typescript-eslint/recommended',
18+
],
19+
plugins: ['@typescript-eslint', 'jest'],
1620
parser: '@typescript-eslint/parser',
1721
parserOptions: {
1822
project: true,
@@ -23,17 +27,4 @@ module.exports = {
2327
ecmaVersion: 2018,
2428
sourceType: 'module',
2529
},
26-
rules: {
27-
'prettier/prettier': [
28-
'warn',
29-
{
30-
quoteProps: 'consistent',
31-
singleQuote: true,
32-
tabWidth: 2,
33-
trailingComma: 'es5',
34-
useTabs: false,
35-
semi: false,
36-
},
37-
],
38-
},
3930
}

example/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ module.exports = {
55
project: true,
66
tsconfigRootDir: __dirname,
77
},
8-
};
8+
}

example/.watchmanconfig

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

example/babel.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const path = require('path');
2-
const pak = require('../package/package.json');
1+
const path = require('path')
2+
const pak = require('../package/package.json')
33

44
module.exports = {
55
presets: ['module:@react-native/babel-preset'],
@@ -10,12 +10,12 @@ module.exports = {
1010
extensions: ['.tsx', '.ts', '.js', '.json'],
1111
alias: {
1212
[pak.name]: path.join(__dirname, '../package', pak.source),
13-
stream: 'stream-browserify',
13+
'stream': 'stream-browserify',
1414
'react-native-sqlite-storage': 'react-native-nitro-sqlite',
1515
},
1616
},
1717
],
1818
'babel-plugin-transform-typescript-metadata',
19-
['@babel/plugin-proposal-decorators', {legacy: true}],
19+
['@babel/plugin-proposal-decorators', { legacy: true }],
2020
],
21-
};
21+
}

example/metro.config.js

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,46 @@
1-
const fs = require('fs');
2-
const path = require('path');
3-
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
4-
// const exclusionList = require('metro-config/src/defaults/exclusionList');
5-
// const escape = require('escape-string-regexp');
1+
const fs = require('fs')
2+
const path = require('path')
3+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
64
const pak = require('../package.json')
75

8-
const root = path.resolve(__dirname, '..');
9-
const rootNodeModulesPath = path.join(root, 'node_modules');
10-
const exampleNodeModulesPath = path.join(__dirname, 'node_modules');
11-
6+
const root = path.resolve(__dirname, '..')
127
const modules = Object.keys({ ...pak.peerDependencies })
138

149
function getPackageNames(nodeModulesPath) {
1510
if (!fs.existsSync(nodeModulesPath)) {
16-
return [];
11+
return []
1712
}
1813

19-
const allFiles = fs.readdirSync(nodeModulesPath);
14+
const allFiles = fs.readdirSync(nodeModulesPath)
2015

2116
// Filter out only directories (package names)
22-
const packageNames = allFiles.filter(file => {
23-
const filePath = path.join(nodeModulesPath, file);
24-
return fs.statSync(filePath).isDirectory();
25-
});
17+
const packageNames = allFiles.filter((file) => {
18+
const filePath = path.join(nodeModulesPath, file)
19+
return fs.statSync(filePath).isDirectory()
20+
})
2621

2722
// Handle scoped packages (e.g., @scope/package)
2823
const scopedPackages = packageNames
29-
.filter(pkg => pkg.startsWith('@'))
30-
.flatMap(scope => {
31-
const scopePath = path.join(nodeModulesPath, scope);
32-
const scopedFiles = fs.readdirSync(scopePath);
33-
return scopedFiles.map(scopedFile => `${scope}/${scopedFile}`);
34-
});
24+
.filter((pkg) => pkg.startsWith('@'))
25+
.flatMap((scope) => {
26+
const scopePath = path.join(nodeModulesPath, scope)
27+
const scopedFiles = fs.readdirSync(scopePath)
28+
return scopedFiles.map((scopedFile) => `${scope}/${scopedFile}`)
29+
})
3530

3631
// Return both regular and scoped package names
3732
return packageNames
38-
.filter(pkg => !pkg.startsWith('@'))
39-
.concat(scopedPackages);
33+
.filter((pkg) => !pkg.startsWith('@'))
34+
.concat(scopedPackages)
4035
}
4136

42-
const exampleNodeModules = getPackageNames(exampleNodeModulesPath);
43-
4437
const config = {
4538
projectRoot: __dirname,
4639
watchFolders: [root],
4740

4841
// We need to make sure that only one version is loaded for peerDependencies
4942
// So we blacklist them at the root, and alias them to the versions in example's node_modules
5043
resolver: {
51-
// unstable_enableSymlinks: true,
52-
// blockList: exclusionList(
53-
// exampleNodeModules.map(
54-
// m => new RegExp(`^${escape(path.join(rootNodeModulesPath, m))}\\/.*$`),
55-
// ),
56-
// ),
57-
5844
extraNodeModules: modules.reduce((acc, name) => {
5945
acc[name] = path.join(__dirname, 'node_modules', name)
6046
return acc
@@ -69,6 +55,6 @@ const config = {
6955
},
7056
}),
7157
},
72-
};
58+
}
7359

74-
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
60+
module.exports = mergeConfig(getDefaultConfig(__dirname), config)

example/react-native.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const path = require('path');
2-
const pak = require('../package/package.json');
1+
const path = require('path')
2+
const pak = require('../package/package.json')
33

44
module.exports = {
55
dependencies: {
66
[pak.name]: {
77
root: path.join(__dirname, '../package'),
88
},
99
},
10-
};
10+
}

0 commit comments

Comments
 (0)