Skip to content

Commit e607f64

Browse files
committed
chore: initial commit
1 parent cdf4548 commit e607f64

20 files changed

+770
-104
lines changed

.editorconfig

+68-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,75 @@
1-
# EditorConfig helps developers define and maintain consistent
2-
# coding styles between different editors and IDEs
3-
# editorconfig.org
4-
51
root = true
62

73
[*]
4+
charset = utf-8
5+
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
89

910
indent_style = space
11+
indent_size = 4
12+
13+
[Makefile]
14+
indent_style = tab
15+
16+
[*.go]
17+
indent_style = tab
18+
19+
[*.proto]
1020
indent_size = 2
1121

12-
end_of_line = lf
13-
charset = utf-8
14-
trim_trailing_whitespace = true
15-
insert_final_newline = true
22+
[*.swift]
23+
indent_size = 4
24+
25+
[*.tmpl]
26+
indent_size = 2
27+
28+
[*.{js,jsx,ts,tsx}]
29+
indent_size = 2
30+
indent_style = tab
31+
block_comment_start = /*
32+
block_comment_end = */
33+
34+
[*.hbs]
35+
indent_size = 4
36+
indent_style = tab
37+
block_comment_start = {{!
38+
block_comment_end = }}
39+
40+
[*.html]
41+
indent_size = 2
42+
43+
[*.bat]
44+
end_of_line = crlf
45+
46+
[*.{json,yml,yaml}]
47+
indent_size = 2
48+
indent_style = space
49+
50+
[.{babelrc,eslintrc}]
51+
indent_size = 2
52+
53+
[{Fastfile,.buckconfig,BUCK}]
54+
indent_size = 2
55+
56+
[*.diff]
57+
indent_size = 1
58+
59+
[*.m]
60+
indent_size = 1
61+
indent_style = space
62+
block_comment_start = /**
63+
block_comment = *
64+
block_comment_end = */
65+
66+
[*.java]
67+
indent_size = 4
68+
indent_style = space
69+
block_comment_start = /**
70+
block_comment = *
71+
block_comment_end = */
72+
73+
[js/packages/i18n/locale/**/*.{json,yml}]
74+
indent_size = 2
75+
indent_style = tab

.eslintignore

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# junk files
4+
#
5+
*~
6+
*#
7+
.#*
8+
.DS_Store
9+
gin-bin
10+
11+
# OSX
12+
#
13+
.DS_Store
14+
15+
# Xcode
16+
#
17+
build/
18+
*.pbxuser
19+
!default.pbxuser
20+
*.mode1v3
21+
!default.mode1v3
22+
*.mode2v3
23+
!default.mode2v3
24+
*.perspectivev3
25+
!default.perspectivev3
26+
xcuserdata
27+
*.xccheckout
28+
*.moved-aside
29+
DerivedData
30+
*.hmap
31+
*.ipa
32+
*.ipa.meta
33+
*.xcuserstate
34+
project.xcworkspace
35+
*.dSYM.zip
36+
ios/tmp.xcconfig
37+
ios-sourcemap.*
38+
ios/main.jsbundle
39+
40+
# Android/IntelliJ
41+
#
42+
build/
43+
.idea
44+
.gradle
45+
.settings/
46+
.project
47+
*.classpath
48+
local.properties
49+
*.iml
50+
android-sourcemap.*
51+
*.hprof
52+
android/main.jsbundle
53+
54+
# node.js
55+
#
56+
node_modules/
57+
npm-debug.log
58+
yarn-error.log
59+
lerna-debug.log
60+
/coverage/
61+
62+
# BUCK
63+
buck-out/
64+
\.buckd/
65+
*.keystore
66+
!debug.keystore
67+
68+
# gradle
69+
android/app/build/
70+
android/app/libs/
71+
android/app/gradle/
72+
android/app/gradlew
73+
android/app/gradlew.bat
74+
75+
lib/
76+
.eslintrc.js
77+
babel.config.js
78+
example/
79+
80+
# mobile
81+
shim.js
82+
83+
# GoGrpc framework
84+
ios/core.framework
85+
android/ble/libs/jars/ble.jar
86+
android/core/core.aar
87+
88+
# Go template
89+
.tmp/
90+
91+
# Optional eslint cache
92+
.eslintcache
93+
94+
# xcodegen cache
95+
.xcodegen
96+
97+
# VScode
98+
jsconfig.json
99+
100+
# Cocoapods
101+
/ios/Pods/
102+
103+
# bundler
104+
bundler
105+
106+
# certificates
107+
*.ud.wulo.ios.p12
108+
109+
# package-lock.json files
110+
111+
# Environment
112+
.env.*
113+
!.env.development
114+
115+
# Fix code factor __generated__ exclude patterns
116+
__generated__/
117+
118+
# osx
119+
dist/
120+
osx/Berty.app
121+
122+
# watchman
123+
.watchman-cookie*
124+
*.pb.*
125+
*.gen.*

.eslintrc.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@react-native', 'prettier'],
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint', 'import'],
6+
rules: {
7+
semi: [2, 'never'],
8+
'react-native/no-inline-styles': 0,
9+
'jsx-quotes': [2, 'prefer-single'],
10+
'no-shadow': 0,
11+
'no-catch-shadow': 0,
12+
'no-mixed-spaces-and-tabs': [2, 'smart-tabs'],
13+
// no-spaced-func breaks on typescript and already handled by prettier
14+
'no-spaced-func': 0,
15+
'react/react-in-jsx-scope': 2,
16+
'import/order': [
17+
2,
18+
{
19+
groups: [['builtin', 'external'], 'internal', ['sibling', 'parent', 'index'], 'object', 'type'],
20+
pathGroups: [
21+
{
22+
pattern: '@berty/**',
23+
group: 'internal',
24+
position: 'before',
25+
},
26+
],
27+
// https://github.com/import-js/eslint-plugin-import/issues/2291#issuecomment-1050199872
28+
pathGroupsExcludedImportTypes: [],
29+
'newlines-between': 'never',
30+
alphabetize: {
31+
order: 'asc',
32+
caseInsensitive: true,
33+
},
34+
},
35+
],
36+
},
37+
globals: {
38+
JSX: 'readonly',
39+
},
40+
}

.prettierrc.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
printWidth: 140,
3+
singleQuote: true,
4+
tabWidth: 2,
5+
useTabs: true,
6+
trailingComma: 'all',
7+
semi: false,
8+
arrowParens: 'avoid',
9+
jsxSingleQuote: true,
10+
bracketSpacing: true,
11+
jsxBracketSameLine: false,
12+
13+
importOrder: ['^react', '^react-native', '^[a-zA-Z]', '^@?\\w', '^[./]'],
14+
importOrderSeparation: false,
15+
importOrderSortSpecifiers: false,
16+
17+
plugins: ['@trivago/prettier-plugin-sort-imports'],
18+
}

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ npm install @berty/ui-components
1212

1313

1414
```js
15-
import { multiply } from '@berty/ui-components';
15+
import { Button, DefaultTheme, Text, ThemeProvider } from '@berty/ui-components'
1616

1717
// ...
1818

19-
const result = await multiply(3, 7);
19+
<ThemeProvider theme={theme}>
20+
<Button onPress={() => console.log('Button pressed')}>Press me</Button>
21+
<Text>Some text</Text>
22+
</ThemeProvider>
23+
2024
```
2125

2226

babel.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:react-native-builder-bob/babel-preset'],
3-
};
2+
presets: ['module:react-native-builder-bob/babel-preset'],
3+
}

example/babel.config.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const path = require('path');
2-
const { getConfig } = require('react-native-builder-bob/babel-config');
3-
const pkg = require('../package.json');
1+
const path = require('path')
2+
const { getConfig } = require('react-native-builder-bob/babel-config')
3+
const pkg = require('../package.json')
44

5-
const root = path.resolve(__dirname, '..');
5+
const root = path.resolve(__dirname, '..')
66

77
module.exports = function (api) {
8-
api.cache(true);
8+
api.cache(true)
99

10-
return getConfig(
11-
{
12-
presets: ['babel-preset-expo'],
13-
},
14-
{ root, pkg }
15-
);
16-
};
10+
return getConfig(
11+
{
12+
presets: ['babel-preset-expo'],
13+
},
14+
{ root, pkg },
15+
)
16+
}

example/index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { registerRootComponent } from 'expo';
2-
3-
import App from './src/App';
1+
import { registerRootComponent } from 'expo'
2+
import App from './src/App'
43

54
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
65
// It also ensures that whether you load the app in Expo Go or in a native build,
76
// the environment is set up appropriately
8-
registerRootComponent(App);
7+
registerRootComponent(App)

example/metro.config.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const path = require('path');
2-
const { getDefaultConfig } = require('@expo/metro-config');
3-
const { getConfig } = require('react-native-builder-bob/metro-config');
4-
const pkg = require('../package.json');
1+
const path = require('path')
2+
const { getDefaultConfig } = require('@expo/metro-config')
3+
const { getConfig } = require('react-native-builder-bob/metro-config')
4+
const pkg = require('../package.json')
55

6-
const root = path.resolve(__dirname, '..');
6+
const root = path.resolve(__dirname, '..')
77

88
/**
99
* Metro configuration
@@ -12,7 +12,7 @@ const root = path.resolve(__dirname, '..');
1212
* @type {import('metro-config').MetroConfig}
1313
*/
1414
module.exports = getConfig(getDefaultConfig(__dirname), {
15-
root,
16-
pkg,
17-
project: __dirname,
18-
});
15+
root,
16+
pkg,
17+
project: __dirname,
18+
})

example/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"web": "expo start --web"
1010
},
1111
"dependencies": {
12+
"@berty/ui-components": "workspace:*",
1213
"@expo/metro-runtime": "~4.0.1",
14+
"@expo/vector-icons": "^14.0.4",
1315
"expo": "~52.0.26",
1416
"expo-status-bar": "~2.0.1",
1517
"react": "18.3.1",

0 commit comments

Comments
 (0)