Skip to content

Commit 779d1fe

Browse files
committed
feat: progress
1 parent 655b2e5 commit 779d1fe

File tree

362 files changed

+27581
-37060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+27581
-37060
lines changed

.buckconfig

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

.eslintrc.base.js

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
es6: true,
6+
},
7+
ignorePatterns: ['**/node_modules', '**/dist', '**/build', '**/lib'],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
ecmaFeatures: {
11+
jsx: true,
12+
globalReturn: false,
13+
},
14+
ecmaVersion: 2020,
15+
project: ['tsconfig.json'],
16+
sourceType: 'module',
17+
extraFileExtensions: ".mjs"
18+
},
19+
settings: {
20+
react: {
21+
version: 'detect',
22+
},
23+
'import/resolver': {
24+
typescript: {},
25+
},
26+
},
27+
plugins: ['sonarjs'],
28+
extends: [
29+
'plugin:@typescript-eslint/recommended',
30+
'plugin:import/recommended',
31+
'plugin:import/typescript',
32+
'plugin:regexp/recommended',
33+
'plugin:prettier/recommended',
34+
],
35+
globals: {
36+
context: 'readonly',
37+
cy: 'readonly',
38+
assert: 'readonly',
39+
Cypress: 'readonly',
40+
},
41+
rules: {
42+
'regexp/no-unused-capturing-group': 'off',
43+
'linebreak-style': ['error', 'unix'],
44+
'no-empty-function': 'off',
45+
'@typescript-eslint/no-empty-function': [
46+
'error',
47+
{ allow: ['private-constructors'] },
48+
],
49+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
50+
'import/default': 'off',
51+
'import/no-named-as-default-member': 'off',
52+
'import/no-named-as-default': 'off',
53+
'import/order': [
54+
'error',
55+
{
56+
groups: [
57+
'builtin',
58+
'external',
59+
'internal',
60+
'parent',
61+
'sibling',
62+
'index',
63+
'object',
64+
],
65+
alphabetize: { order: 'asc', caseInsensitive: true },
66+
},
67+
],
68+
'@typescript-eslint/consistent-type-exports': 'error',
69+
'@typescript-eslint/consistent-type-imports': 'error',
70+
'@typescript-eslint/naming-convention': [
71+
'error',
72+
{
73+
selector: 'default',
74+
format: ['camelCase'],
75+
leadingUnderscore: 'allow',
76+
trailingUnderscore: 'forbid',
77+
},
78+
{
79+
selector: 'variable',
80+
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
81+
leadingUnderscore: 'allow',
82+
},
83+
{
84+
selector: ['function'],
85+
format: ['camelCase', 'PascalCase'],
86+
},
87+
{
88+
selector: 'parameter',
89+
format: ['camelCase'],
90+
leadingUnderscore: 'allow',
91+
},
92+
{
93+
selector: 'class',
94+
format: ['PascalCase'],
95+
},
96+
{
97+
selector: 'classProperty',
98+
format: ['camelCase'],
99+
},
100+
{
101+
selector: 'objectLiteralProperty',
102+
format: [
103+
'camelCase',
104+
// Some external libraries use snake_case for params
105+
'snake_case',
106+
// Env variables are generally uppercase
107+
'UPPER_CASE',
108+
'PascalCase'
109+
],
110+
leadingUnderscore: 'allowSingleOrDouble',
111+
},
112+
{
113+
selector: ['typeAlias', 'interface'],
114+
format: ['PascalCase'],
115+
},
116+
{
117+
selector: ['typeProperty'],
118+
format: ['camelCase', 'UPPER_CASE', 'snake_case'],
119+
leadingUnderscore: 'allow',
120+
},
121+
{
122+
selector: ['typeParameter'],
123+
format: ['PascalCase'],
124+
},
125+
{
126+
selector: ['enumMember'],
127+
format: ['PascalCase', 'camelCase'],
128+
},
129+
{
130+
selector: ['enum'],
131+
format: ['PascalCase'],
132+
},
133+
],
134+
},
135+
overrides: [
136+
{
137+
// For performance run sonarjs/recommended on regular code, not test files.
138+
files: ['**/*.{js,jsx,ts,tsx}'],
139+
excludedFiles: ['**/__tests__/**/*.{js,jsx,ts,tsx}', '**/*.{spec,stories,res}.{js,jsx,ts,tsx}'],
140+
extends: ['plugin:sonarjs/recommended'],
141+
rules: {
142+
'sonarjs/no-nested-template-literals': 'off',
143+
'sonarjs/cognitive-complexity': 'warn',
144+
'sonarjs/no-small-switch': 'warn',
145+
'sonarjs/no-identical-expressions': 'off',
146+
'sonarjs/no-identical-functions': 'warn',
147+
'sonarjs/no-duplicate-string': ["error", 5]
148+
},
149+
},
150+
{
151+
files: ['*.js', '*.mjs'],
152+
parser: 'espree',
153+
parserOptions: {
154+
ecmaVersion: 2020,
155+
},
156+
rules: {
157+
'@typescript-eslint/naming-convention': 'off',
158+
'@typescript-eslint/ban-ts-comment': 'off',
159+
'@typescript-eslint/no-explicit-any': 'off',
160+
'@typescript-eslint/no-var-requires': 'off',
161+
'@typescript-eslint/explicit-module-boundary-types': 'off',
162+
'sonarjs/no-duplicate-string': 'off',
163+
'sonarjs/no-all-duplicated-branches': 'off',
164+
'@typescript-eslint/consistent-type-exports': 'off',
165+
'@typescript-eslint/consistent-type-imports': 'off',
166+
'import/order': 'off',
167+
},
168+
},
169+
],
170+
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: ci/monorepo-integrity
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
paths:
9+
- 'yarn.lock'
10+
- '.yarnrc.yml'
11+
- '.github/workflows/ci-monorepo-integrity.yml'
12+
13+
pull_request:
14+
types:
15+
- opened
16+
- synchronize
17+
- reopened
18+
paths:
19+
- 'yarn.lock'
20+
- '.yarnrc.yml'
21+
- '.github/workflows/ci-monorepo-integrity.yml'
22+
23+
jobs:
24+
test:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
node-version: [16.x]
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Use Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
37+
- name: Get yarn cache directory path
38+
id: yarn-cache-dir-path
39+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
40+
41+
- name: Restore yarn cache
42+
uses: actions/cache@v3
43+
id: yarn-cache
44+
with:
45+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
46+
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
47+
restore-keys: |
48+
yarn-cache-folder-
49+
- name: Install dependencies
50+
run: |
51+
yarn install --immutable
52+
- name: Check for duplicate dependencies in lock file
53+
run: |
54+
yarn dedupe --check
55+
- name: Check for yarn constraints.pro
56+
run: |
57+
yarn constraints
58+
- name: Check monorepo dependency graph
59+
run: |
60+
yarn check:install

.github/workflows/ci-packages.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: ci/packages
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
paths:
9+
- 'packages/**'
10+
- '.yarnrc.yml'
11+
- 'yarn.lock'
12+
- '.prettier*'
13+
- 'tsconfig.base.json'
14+
- '.prettier*'
15+
- '.github/workflows/ci-packages.yml'
16+
17+
pull_request:
18+
types:
19+
- opened
20+
- synchronize
21+
- reopened
22+
paths:
23+
- 'packages/**'
24+
- '.yarnrc.yml'
25+
- 'yarn.lock'
26+
- '.prettier*'
27+
- 'tsconfig.base.json'
28+
- '.prettier*'
29+
- '.github/workflows/ci-packages.yml'
30+
31+
jobs:
32+
test:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
node-version: [14.x]
37+
steps:
38+
- uses: actions/checkout@v3
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Use Node.js ${{ matrix.node-version }}
43+
uses: actions/setup-node@v3
44+
with:
45+
node-version: ${{ matrix.node-version }}
46+
47+
- name: Get yarn cache directory path
48+
id: yarn-cache-dir-path
49+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
50+
51+
- name: Restore yarn cache
52+
uses: actions/cache@v3
53+
id: yarn-cache
54+
with:
55+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
56+
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
57+
restore-keys: |
58+
yarn-cache-folder-
59+
- name: Restore packages cache
60+
uses: actions/cache@v3
61+
with:
62+
path: |
63+
${{ github.workspace }}/.cache
64+
${{ github.workspace }}/**/tsconfig.tsbuildinfo
65+
${{ github.workspace }}/**/.eslintcache
66+
key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }}
67+
restore-keys: |
68+
${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-
69+
- name: Install dependencies
70+
run: |
71+
yarn install --immutable
72+
- name: Typecheck
73+
run: |
74+
yarn workspaces foreach -tv --from 'react-native-carplay' --since=origin/main --recursive run typecheck
75+
- name: Linter
76+
run: |
77+
yarn workspaces foreach -tv --include 'react-native-carplay' --since=origin/main --recursive run lint --cache
78+
- name: Run build for changed packages
79+
run: |
80+
yarn workspaces foreach -tv --include 'react-native-carplay' --since=origin/main run build

.prettierignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
package.json
2-
node_modules
3-
lib/**/*
4-
example
1+
.yarn
2+
**/.next/**
3+
**/dist/**
4+
**/lib/**
5+
**/build/**
6+
**/tmp/**

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"semi": true,
66
"singleQuote": true,
77
"bracketSpacing": true,
8-
"jsxBracketSameLine": false,
98
"tabWidth": 2,
109
"printWidth": 100
1110
}

.yarn/plugins/@yarnpkg/plugin-constraints.cjs

Lines changed: 52 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)