Skip to content

Convert to monorepo with Yarn 4 #118

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

Merged
merged 61 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
65a73f4
Initial conversion to monorepo
aryaemami59 Feb 18, 2024
d20f674
Update Yarn to version 4.5.3
aryaemami59 Feb 18, 2024
98219fe
Add basic CI
aryaemami59 Feb 18, 2024
9aece26
Fix build scripts for React Native and Expo templates
aryaemami59 Feb 29, 2024
c82a6f2
Add `mockTemplates.mts` script file
aryaemami59 Feb 29, 2024
ec405d6
Make `mockTemplates.mts` executable
aryaemami59 Mar 18, 2024
27808ac
Fix `NPM` peer dependency issue
aryaemami59 May 16, 2024
a9957e2
Disable Lint during CI
aryaemami59 Aug 6, 2024
fad83e0
Fix `build` command to comply with `vite`'s new template
aryaemami59 Aug 6, 2024
bc9a0e4
Switch to `@react-native-community/cli`
aryaemami59 Nov 7, 2024
b12e95b
Resolve peer dependency issues
aryaemami59 Dec 25, 2024
ac09fc5
Update Yarn to version 4.6.0
aryaemami59 Dec 31, 2024
ddbfee9
Remove `echo` calls in CI
aryaemami59 Dec 31, 2024
8037b72
Update dependencies across templates to latest versions
aryaemami59 Dec 31, 2024
d7460f4
Fix React-Native template
aryaemami59 Dec 31, 2024
0d02947
Update JDK version for React Native build in CI workflow
aryaemami59 Dec 31, 2024
0bd1bbe
Rename `babel.config.cts` to `babel.config.js`
aryaemami59 Dec 31, 2024
c2deb3a
Fix `babel.config.js`
aryaemami59 Dec 31, 2024
a7f55f9
Fix Expo template
aryaemami59 Jan 1, 2025
f5327c9
Add `@react-native-community/cli`
aryaemami59 Jan 1, 2025
9bca870
Update tests workflow to use `-y` flag with `npx tsx`
aryaemami59 Jan 1, 2025
1f380f8
Add missing fields to all `package.json` files
aryaemami59 Jan 1, 2025
6415120
Update CI workflow to allow manual dispatch and add failure check
aryaemami59 Jan 1, 2025
bba93d7
Remove unnecessary `yarn rimraf` command
aryaemami59 Jan 1, 2025
3c46a0c
Update `.gitignore` for Expo template
aryaemami59 Jan 1, 2025
67c6490
Update metro config for Expo template
aryaemami59 Jan 1, 2025
b5f16d0
Add `eslint-plugin-jest` to resolve ESLint-related issues
aryaemami59 Jan 7, 2025
056980d
Format files in Expo template
aryaemami59 Jan 7, 2025
b6b067a
Rename `metro.config.ts` to `metro.base.config.ts`
aryaemami59 Jan 7, 2025
6d294d0
Bump `@types/node`
aryaemami59 Jan 7, 2025
489c84d
Format all files
aryaemami59 Jan 7, 2025
f72e5d2
Rename `.eslintrc.json` to `eslint.config.js`
aryaemami59 Jan 7, 2025
68cc56e
Migrate ESLint config of Vite template to flat config
aryaemami59 Jan 7, 2025
7efa011
Fix Vite template
aryaemami59 Jan 7, 2025
697c749
Fix dependencies
aryaemami59 Jan 7, 2025
d8d0c3e
Fix prettier configs and format all files
aryaemami59 Jan 7, 2025
dc2c21a
Fix Expo template
aryaemami59 Jan 7, 2025
50167f9
Rename `TypedColors.ts` to `Colors.ts`
aryaemami59 Jan 11, 2025
2f41cb4
Fix CI
aryaemami59 Jan 11, 2025
36b6467
Update dependencies
aryaemami59 Jan 11, 2025
b660f94
Update all templates
aryaemami59 Jan 17, 2025
0fba8a7
Fix `mockTemplates.mts` script
aryaemami59 Jan 21, 2025
838fce0
Fix `cra-template-redux`
aryaemami59 Jan 29, 2025
e8a291f
Fix `cra-template-redux-typescript`
aryaemami59 Jan 29, 2025
ff1e6a7
Fix `react-native-template-redux-typescript`
aryaemami59 Jan 29, 2025
bc6347a
Fix `rtk-app-structure-example`
aryaemami59 Jan 29, 2025
53028dc
Fix `vite-template-redux`
aryaemami59 Jan 29, 2025
bb5215a
Fix Expo template
aryaemami59 Feb 8, 2025
134d318
Update dependencies
aryaemami59 Feb 8, 2025
ad08369
Update Yarn to version 4.7.0
aryaemami59 Mar 10, 2025
053fc0a
Migrate Expo template to flat config
aryaemami59 Mar 10, 2025
dd834f0
Migrate React-Native template to flat config
aryaemami59 Mar 10, 2025
aed8722
Fix minor issues in ESLint configs
aryaemami59 Mar 10, 2025
325c050
Migrate root level ESLint config to flat config
aryaemami59 Mar 10, 2025
e9f6a0f
Update `.gitignore` files
aryaemami59 Mar 11, 2025
8245ce1
Update ESLint config
aryaemami59 Mar 11, 2025
d0f78c5
Update dependencies
aryaemami59 Mar 11, 2025
65e399e
Enable verbose logging in Jest configuration for better test output
aryaemami59 Apr 2, 2025
607a7a8
Utilize the `useAnimatedValue` hook
aryaemami59 Apr 3, 2025
9e6dc7c
Update dependencies
aryaemami59 Apr 3, 2025
4ff3f0f
Upgrade Yarn to version 4.8.1
aryaemami59 Apr 3, 2025
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
7 changes: 0 additions & 7 deletions .eslintrc

This file was deleted.

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
63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on: [push, pull_request, workflow_dispatch]

defaults:
run:
shell: bash

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: [22.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

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

- name: Set up environment variables for ${{ matrix.packages }} on ${{ matrix.node }} and ${{ matrix.os }}
if: ${{ matrix.os == 'windows-latest' }}
run: echo "TEMP=$USERPROFILE\AppData\Local\Temp" >> $GITHUB_ENV

- name: Set up JDK 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: "21.x"
distribution: "temurin"
cache: "gradle"

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

- name: Did we fail?
if: failure()
working-directory: packages/${{ matrix.packages }}
run: ls -R
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
.DS_Store
*.log
node_modules
dist*/
lib
es

.yalc/
yalc.lock

.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
4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

935 changes: 935 additions & 0 deletions .yarn/releases/yarn-4.8.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.8.1.cjs
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

61 changes: 61 additions & 0 deletions eslint.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import js from "@eslint/js"
import prettierConfig from "eslint-config-prettier/flat"
import type { ConfigArray } from "typescript-eslint"
import { config, configs } from "typescript-eslint"

const eslintConfig: ConfigArray = config(
{
name: "global-ignores",
ignores: [
"**/*.snap",
"**/dist/",
"**/.yalc/",
"**/build/",
"**/temp/",
"**/.temp/",
"**/.tmp/",
"**/.yarn/",
"**/coverage/",
"packages/rtk-app-structure-example",
"packages/vite-template-redux",
"packages/react-native-template-redux-typescript/template",
"packages/expo-template-redux-typescript",
"packages/cra-template-redux/template",
"packages/cra-template-redux-typescript/template",
],
},
{
name: `${js.meta.name}/recommended`,
...js.configs.recommended,
},
configs.strictTypeChecked,
configs.stylisticTypeChecked,
{
name: "main",
linterOptions: {
reportUnusedDisableDirectives: 2,
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"no-undef": [0],
"@typescript-eslint/consistent-type-definitions": [2, "type"],
"@typescript-eslint/consistent-type-imports": [
2,
{
prefer: "type-imports",
fixStyle: "separate-type-imports",
disallowTypeAnnotations: true,
},
],
},
},

prettierConfig,
)

export default eslintConfig
8 changes: 0 additions & 8 deletions jest.config.js

This file was deleted.

38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "redux-templates",
"version": "0.0.0",
"private": true,
"license": "MIT",
"homepage": "https://github.com/reduxjs/redux-templates#readme",
"bugs": {
"url": "https://github.com/reduxjs/redux-templates/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/reduxjs/redux-templates.git",
"directory": "."
},
"workspaces": [
"packages/*"
],
"scripts": {
"format": "prettier --config=$INIT_CWD/prettier.config.mjs --write $INIT_CWD",
"format-check": "prettier --config=$INIT_CWD/prettier.config.mjs --check $INIT_CWD",
"lint": "eslint --config=$INIT_CWD/eslint.config.mts $INIT_CWD",
"lint-fix": "eslint --config=$INIT_CWD/eslint.config.mts $INIT_CWD --fix",
"type-check": "tsc -p $INIT_CWD/tsconfig.json --noEmit"
},
"devDependencies": {
"@eslint/js": "^9.23.0",
"@types/node": "^22.14.0",
"eslint": "^9.23.0",
"eslint-config-prettier": "^10.1.1",
"jiti": "^2.4.2",
"prettier": "^3.5.3",
"rimraf": "^6.0.1",
"tsx": "^4.19.3",
"typescript": "^5.8.2",
"typescript-eslint": "^8.29.0"
},
"packageManager": "[email protected]"
}

This file was deleted.

Loading
Loading