Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to monorepo with Yarn 4 #118

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Use LF line endings for template files
**/template/** text=auto eol=lf
* text=auto eol=lf
67 changes: 67 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
name: Test and lint ${{ matrix.packages }} on Node.js ${{ matrix.node }} and ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [20.x]
os: [ubuntu-latest, windows-latest]
packages:
[
'cra-template-redux',
'cra-template-redux-typescript',
'expo-template-redux-typescript',
'react-native-template-redux-typescript',
'vite-template-redux',
]

steps:
- name: Checkout repository for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Checkout repository for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v4

- run: echo ${{ github.event.pull_request.head.sha }}
- run: echo ${{ github.head_ref }}

- name: Setup Node.js ${{ matrix.node }} for ${{ matrix.packages }} on ${{ matrix.os }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Mock the templates for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
run: npx tsx@latest scripts/mockTemplates.mts ${{ matrix.packages }}

- name: show folder
run: ls -R

- name: Run test for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
working-directory: example
run: npm run test

# - name: Run lint for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
# working-directory: example
# run: npm run lint

- name: Set up JDK 17 for React Native build for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
if: matrix.packages == 'react-native-template-redux-typescript' || matrix.packages == 'expo-template-redux-typescript'
uses: actions/setup-java@v4
with:
java-version: '17.x'
distribution: 'temurin'
cache: 'gradle'

- name: Build ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
working-directory: example
run: npm run build
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
.DS_Store
*.log
node_modules
dist*/
lib
es

.yalc
yalc.lock
yalc.sig

.idea/
.vscode/
temp/
.tmp-projections
build/
.rts2*
coverage/

typesversions
.cache
.yarnrc
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
*.tgz

tsconfig.vitest-temp.json

# Ignore template lock files
/packages/**/package-lock.json
/packages/**/yarn.lock

.eslintcache
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
compressionLevel: mixed

enableGlobalCache: false

enableTransparentWorkspaces: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.1.cjs
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

8 changes: 0 additions & 8 deletions jest.config.js

This file was deleted.

30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "redux-templates",
"private": true,
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/reduxjs/redux-templates.git"
},
"bugs": {
"url": "https://github.com/reduxjs/redux-templates/issues"
},
"workspaces": [
"packages/*"
],
"scripts": {
"format": "prettier --write . --cache --cache-strategy content",
"format:check": "prettier --check .",
"lint": "eslint . --cache --cache-strategy content",
"lint:fix": "eslint . --fix",
"build": "yarn workspaces foreach -A run build",
"test": "yarn workspaces foreach -A run test"
},
"devDependencies": {
"@types/node": "^22.9.0",
"rimraf": "^6.0.1",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
},
"packageManager": "[email protected]"
}
Loading
Loading