Skip to content

Commit

Permalink
Merge pull request #133 from birkir/feat/monorepo2
Browse files Browse the repository at this point in the history
feat: monorepo
  • Loading branch information
birkir authored May 26, 2023
2 parents 33d7060 + d977788 commit 931d8d1
Show file tree
Hide file tree
Showing 370 changed files with 27,848 additions and 42,325 deletions.
9 changes: 0 additions & 9 deletions .buckconfig

This file was deleted.

23 changes: 23 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"settings": {
"react": {
"version": "18.x"
}
},
"ignorePatterns": ["node_modules", "dist", "build", ".eslintrc.js"],
"plugins": ["react", "@typescript-eslint"],
"rules": {
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "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
75 changes: 75 additions & 0 deletions .github/workflows/ci-codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'ci/codeql'

on:
push:
branches: ['master']
pull_request:
# The branches below must be a subset of the branches above
branches: ['master']
schedule:
- cron: '33 2 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['typescript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{matrix.language}}'
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
76 changes: 0 additions & 76 deletions .github/workflows/codeql.yml

This file was deleted.

12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ node_modules/
npm-debug.log
yarn-error.log

# Yarn
#
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Xcode
#
build/
Expand All @@ -28,7 +38,7 @@ DerivedData
*.ipa
*.xcuserstate
project.xcworkspace

Pods/

# Android/IntelliJ
#
Expand Down
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/**
3 changes: 1 addition & 2 deletions .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 931d8d1

Please sign in to comment.