Skip to content

Commit

Permalink
feat: progress
Browse files Browse the repository at this point in the history
  • Loading branch information
birkir committed May 25, 2023
1 parent 655b2e5 commit 779d1fe
Show file tree
Hide file tree
Showing 362 changed files with 27,581 additions and 37,060 deletions.
9 changes: 0 additions & 9 deletions .buckconfig

This file was deleted.

170 changes: 170 additions & 0 deletions .eslintrc.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
module.exports = {
root: true,
env: {
node: true,
es6: true,
},
ignorePatterns: ['**/node_modules', '**/dist', '**/build', '**/lib'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
globalReturn: false,
},
ecmaVersion: 2020,
project: ['tsconfig.json'],
sourceType: 'module',
extraFileExtensions: ".mjs"
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {},
},
},
plugins: ['sonarjs'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:regexp/recommended',
'plugin:prettier/recommended',
],
globals: {
context: 'readonly',
cy: 'readonly',
assert: 'readonly',
Cypress: 'readonly',
},
rules: {
'regexp/no-unused-capturing-group': 'off',
'linebreak-style': ['error', 'unix'],
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': [
'error',
{ allow: ['private-constructors'] },
],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'import/default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-named-as-default': 'off',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
],
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'forbid',
},
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
{
selector: ['function'],
format: ['camelCase', 'PascalCase'],
},
{
selector: 'parameter',
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{
selector: 'class',
format: ['PascalCase'],
},
{
selector: 'classProperty',
format: ['camelCase'],
},
{
selector: 'objectLiteralProperty',
format: [
'camelCase',
// Some external libraries use snake_case for params
'snake_case',
// Env variables are generally uppercase
'UPPER_CASE',
'PascalCase'
],
leadingUnderscore: 'allowSingleOrDouble',
},
{
selector: ['typeAlias', 'interface'],
format: ['PascalCase'],
},
{
selector: ['typeProperty'],
format: ['camelCase', 'UPPER_CASE', 'snake_case'],
leadingUnderscore: 'allow',
},
{
selector: ['typeParameter'],
format: ['PascalCase'],
},
{
selector: ['enumMember'],
format: ['PascalCase', 'camelCase'],
},
{
selector: ['enum'],
format: ['PascalCase'],
},
],
},
overrides: [
{
// For performance run sonarjs/recommended on regular code, not test files.
files: ['**/*.{js,jsx,ts,tsx}'],
excludedFiles: ['**/__tests__/**/*.{js,jsx,ts,tsx}', '**/*.{spec,stories,res}.{js,jsx,ts,tsx}'],
extends: ['plugin:sonarjs/recommended'],
rules: {
'sonarjs/no-nested-template-literals': 'off',
'sonarjs/cognitive-complexity': 'warn',
'sonarjs/no-small-switch': 'warn',
'sonarjs/no-identical-expressions': 'off',
'sonarjs/no-identical-functions': 'warn',
'sonarjs/no-duplicate-string': ["error", 5]
},
},
{
files: ['*.js', '*.mjs'],
parser: 'espree',
parserOptions: {
ecmaVersion: 2020,
},
rules: {
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'sonarjs/no-duplicate-string': 'off',
'sonarjs/no-all-duplicated-branches': 'off',
'@typescript-eslint/consistent-type-exports': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'import/order': 'off',
},
},
],
};
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
File renamed without changes
File renamed without changes
File renamed without changes
60 changes: 60 additions & 0 deletions .github/workflows/ci-monorepo-integrity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: ci/monorepo-integrity

on:
push:
branches:
- dev
- main
paths:
- 'yarn.lock'
- '.yarnrc.yml'
- '.github/workflows/ci-monorepo-integrity.yml'

pull_request:
types:
- opened
- synchronize
- reopened
paths:
- 'yarn.lock'
- '.yarnrc.yml'
- '.github/workflows/ci-monorepo-integrity.yml'

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Install dependencies
run: |
yarn install --immutable
- name: Check for duplicate dependencies in lock file
run: |
yarn dedupe --check
- name: Check for yarn constraints.pro
run: |
yarn constraints
- name: Check monorepo dependency graph
run: |
yarn check:install
80 changes: 80 additions & 0 deletions .github/workflows/ci-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: ci/packages

on:
push:
branches:
- dev
- main
paths:
- 'packages/**'
- '.yarnrc.yml'
- 'yarn.lock'
- '.prettier*'
- 'tsconfig.base.json'
- '.prettier*'
- '.github/workflows/ci-packages.yml'

pull_request:
types:
- opened
- synchronize
- reopened
paths:
- 'packages/**'
- '.yarnrc.yml'
- 'yarn.lock'
- '.prettier*'
- 'tsconfig.base.json'
- '.prettier*'
- '.github/workflows/ci-packages.yml'

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Restore packages cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
${{ github.workspace }}/**/.eslintcache
key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }}
restore-keys: |
${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-
- name: Install dependencies
run: |
yarn install --immutable
- name: Typecheck
run: |
yarn workspaces foreach -tv --from 'react-native-carplay' --since=origin/main --recursive run typecheck
- name: Linter
run: |
yarn workspaces foreach -tv --include 'react-native-carplay' --since=origin/main --recursive run lint --cache
- name: Run build for changed packages
run: |
yarn workspaces foreach -tv --include 'react-native-carplay' --since=origin/main run build
10 changes: 6 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package.json
node_modules
lib/**/*
example
.yarn
**/.next/**
**/dist/**
**/lib/**
**/build/**
**/tmp/**
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"tabWidth": 2,
"printWidth": 100
}
52 changes: 52 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

Large diffs are not rendered by default.

Loading

0 comments on commit 779d1fe

Please sign in to comment.