Skip to content

Commit 1555d89

Browse files
committed
bring config packages back into monorepo
1 parent 3024bf1 commit 1555d89

40 files changed

+632
-17
lines changed

.gitmodules

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
[submodule "apps/electron"]
22
path = apps/electron
33
url = https://github.com/wcpos/electron
4-
[submodule "packages/hello-world"]
5-
path = packages/hello-world
6-
url = https://github.com/wcpos/hello-world
7-
[submodule "packages/tsconfig"]
8-
path = packages/tsconfig
9-
url = https://github.com/wcpos/tsconfig
10-
[submodule "packages/babel"]
11-
path = packages/babel
12-
url = https://github.com/wcpos/babel
13-
[submodule "packages/eslint"]
14-
path = packages/eslint
15-
url = https://github.com/wcpos/eslint
164
[submodule "packages/components"]
175
path = packages/components
186
url = https://github.com/wcpos/components

packages/babel

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on: push
2+
3+
jobs:
4+
publish:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/[email protected]
9+
with:
10+
node-version: 16.x
11+
- run: npm install
12+
- run: npm test
13+
- uses: JS-DevTools/npm-publish@v1
14+
with:
15+
token: ${{ secrets.NPM_TOKEN }}

packages/babel/.npmignore

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

packages/babel/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 WooCommerce POS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/babel/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# babel
2+
Babel configuration for WooCommerce POS React Native app

packages/babel/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const path = require('path');
2+
3+
module.exports = function () {
4+
return {
5+
presets: [['babel-preset-expo', { jsxRuntime: 'automatic' }], '@babel/preset-typescript'],
6+
plugins: ['react-native-reanimated/plugin'],
7+
};
8+
};

packages/babel/package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@wcpos/babel-preset-expo",
3+
"version": "1.0.2",
4+
"description": "Babel configuration for React Native with Expo",
5+
"author": "kilbot <[email protected]>",
6+
"license": "MIT",
7+
"main": "index.js",
8+
"scripts": {
9+
"build": "echo 'Nothing to build'",
10+
"test": "echo 'Nothing to test'"
11+
},
12+
"dependencies": {
13+
"@babel/core": "7.17.9",
14+
"@babel/preset-typescript": "^7.16.7",
15+
"babel-jest": "^27.5.1",
16+
"babel-preset-expo": "9.1.0"
17+
}
18+
}

packages/eslint

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on: push
2+
3+
jobs:
4+
publish:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/[email protected]
9+
with:
10+
node-version: 16.x
11+
- run: npm install
12+
- run: npm test
13+
- uses: JS-DevTools/npm-publish@v1
14+
with:
15+
token: ${{ secrets.NPM_TOKEN }}

packages/eslint/.npmignore

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

packages/eslint/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 WooCommerce POS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/eslint/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# eslint
2+
Eslint configuration for WooCommerce POS React Native app

packages/eslint/index.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
require('@rushstack/eslint-patch/modern-module-resolution');
2+
3+
module.exports = {
4+
root: true,
5+
env: {
6+
'react-native/react-native': true,
7+
'jest/globals': true,
8+
},
9+
extends: [
10+
'airbnb',
11+
'plugin:@typescript-eslint/recommended',
12+
'plugin:prettier/recommended',
13+
// 'prettier',
14+
],
15+
parser: '@typescript-eslint/parser',
16+
parserOptions: {
17+
project: './tsconfig.json',
18+
sourceType: 'module',
19+
},
20+
plugins: [
21+
'@typescript-eslint',
22+
'jest',
23+
'react-native',
24+
'react-hooks',
25+
// 'prettier'
26+
],
27+
rules: {
28+
'prettier/prettier': [
29+
'error',
30+
{
31+
useTabs: true,
32+
singleQuote: true,
33+
trailingComma: 'es5',
34+
printWidth: 100,
35+
},
36+
],
37+
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
38+
'react/function-component-definition': 0,
39+
'import/extensions': ['error', 'never'],
40+
'spaced-comment': ['error', 'always', { markers: ['/'] }],
41+
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
42+
'react/prop-types': 'off',
43+
'react/destructuring-assignment': 'off',
44+
'react/jsx-props-no-spreading': 'off',
45+
'react/static-property-placement': 'off',
46+
'react/jsx-indent': [2, 'tab'],
47+
'react/jsx-indent-props': [2, 'tab'],
48+
'react/jsx-wrap-multilines': [
49+
'error',
50+
{
51+
declaration: 'parens',
52+
assignment: 'parens',
53+
return: 'parens',
54+
arrow: 'parens',
55+
condition: 'ignore',
56+
logical: 'ignore',
57+
prop: 'ignore',
58+
},
59+
],
60+
'react-hooks/rules-of-hooks': 'warn',
61+
'react-hooks/exhaustive-deps': 'warn',
62+
// 'prettier/prettier': 'error',
63+
camelcase: 'off',
64+
'@typescript-eslint/explicit-module-boundary-types': 'off',
65+
'no-use-before-define': 'off',
66+
'@typescript-eslint/no-use-before-define': 'warn',
67+
'import/prefer-default-export': 'off',
68+
'react/require-default-props': 0,
69+
// 'no-underscore-dangle': ['error', { allowAfterThis: true }],
70+
'no-underscore-dangle': 0,
71+
'no-nested-ternary': 0,
72+
// @TODO - fix this when updated https://github.com/benmosher/eslint-plugin-import/issues/1174
73+
'import/no-extraneous-dependencies': 0,
74+
'no-restricted-exports': 'warn',
75+
// @TODO - fix this when updated - eslint has a bug with this rule
76+
'@typescript-eslint/no-explicit-any': 'off',
77+
},
78+
settings: {
79+
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
80+
'import/parsers': {
81+
'@typescript-eslint/parser': ['.ts', '.tsx'],
82+
},
83+
'import/resolver': {
84+
node: {
85+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
86+
},
87+
},
88+
react: {
89+
version: 'detect',
90+
},
91+
},
92+
};

packages/eslint/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "@wcpos/eslint-config",
3+
"version": "1.0.6",
4+
"description": "Eslint configuration for React Native",
5+
"author": "kilbot <[email protected]>",
6+
"license": "MIT",
7+
"main": "index.js",
8+
"scripts": {
9+
"lint": "node_modules/.bin/eslint .",
10+
"build": "echo 'Nothing to build'",
11+
"test": "echo 'Nothing to test'"
12+
},
13+
"dependencies": {
14+
"@rushstack/eslint-patch": "^1.1.3",
15+
"@typescript-eslint/eslint-plugin": "5.20.0",
16+
"@typescript-eslint/parser": "5.20.0",
17+
"@wcpos/tsconfig": "*",
18+
"eslint": "8.13.0",
19+
"eslint-config-airbnb": "19.0.4",
20+
"eslint-config-prettier": "8.5.0",
21+
"eslint-plugin-import": "2.26.0",
22+
"eslint-plugin-jest": "26.1.4",
23+
"eslint-plugin-jsx-a11y": "6.5.1",
24+
"eslint-plugin-prettier": "4.0.0",
25+
"eslint-plugin-react": "7.29.4",
26+
"eslint-plugin-react-hooks": "4.4.0",
27+
"eslint-plugin-react-native": "4.0.0",
28+
"prettier": "2.6.2",
29+
"typescript": "4.6.3"
30+
}
31+
}

packages/eslint/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@wcpos/tsconfig/base.json"
3+
}

packages/hello-world

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on: push
2+
3+
jobs:
4+
publish:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/[email protected]
9+
with:
10+
node-version: 16.x
11+
- run: npm install
12+
- run: npm run build
13+
- uses: JS-DevTools/npm-publish@v1
14+
with:
15+
token: ${{ secrets.NPM_TOKEN }}

packages/hello-world/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
/dist
14+
15+
# misc
16+
.DS_Store
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

packages/hello-world/.npmignore

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

packages/hello-world/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# hello-world
2+
Simple app for testing purposes

packages/hello-world/babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = function (api) {
2+
api.cache(true);
3+
return {
4+
presets: ['@wcpos/babel-preset-expo'],
5+
};
6+
};

packages/hello-world/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@wcpos/hello-world",
3+
"version": "1.0.0",
4+
"description": "Simple React Native app for testing",
5+
"author": "kilbot <[email protected]>",
6+
"license": "MIT",
7+
"main": "./src/index.ts",
8+
"files": [
9+
"src/**"
10+
],
11+
"scripts": {
12+
"build": "tsup",
13+
"dev": "tsup --watch",
14+
"test": "eslint --ext ts,tsx ./src"
15+
},
16+
"devDependencies": {
17+
"@wcpos/babel-preset-expo": "*",
18+
"@wcpos/eslint-config": "*",
19+
"@wcpos/tsconfig": "*",
20+
"react-native-builder-bob": "0.18.2",
21+
"tsup": "5.12.5",
22+
"typescript": "4.6.3"
23+
},
24+
"eslintConfig": {
25+
"extends": "@wcpos/eslint-config"
26+
}
27+
}

0 commit comments

Comments
 (0)