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 64 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c3315d4
Initial conversion to monorepo
aryaemami59 Feb 18, 2024
b7d9b61
Rename `.prettierrc` to `.prettierrc.json`
aryaemami59 Feb 18, 2024
d7adabf
Rename `.eslintrc` to `.eslintrc.json`
aryaemami59 Feb 18, 2024
2d526e8
Add NPM scripts
aryaemami59 Feb 18, 2024
da44935
Upgrade to Yarn 4
aryaemami59 Feb 18, 2024
78a6042
Format all files
aryaemami59 Feb 18, 2024
20ff885
Add dev deps to the root `package.json`
aryaemami59 Feb 18, 2024
7806a05
Remove extraneous lockfiles
aryaemami59 Feb 18, 2024
112c82a
Make all the Prettier configs across all templates consistent with RTK
aryaemami59 Feb 18, 2024
3b51871
Bump Prettier
aryaemami59 Feb 18, 2024
bac04fb
CI initial implementation
aryaemami59 Feb 18, 2024
4154402
Fix CI
aryaemami59 Feb 18, 2024
2d30883
Fix indentation
aryaemami59 Feb 19, 2024
f5c2257
Only run tests and build for now
aryaemami59 Feb 20, 2024
d27f3f8
Add missing install dependencies step
aryaemami59 Feb 20, 2024
40e9a46
Workaround new Vitest API
aryaemami59 Feb 29, 2024
6debb65
Fix `build` command for Expo template
aryaemami59 Feb 29, 2024
3f7b7ad
Fix environments for ESLint
aryaemami59 Feb 29, 2024
c44fc36
Add `mockTemplates.mjs` script file
aryaemami59 Feb 29, 2024
8de25f5
Update workspaces
aryaemami59 Mar 2, 2024
375d116
Fix `mockTemplates.mjs` script
aryaemami59 Mar 16, 2024
be0b68b
Fix root dependencies
aryaemami59 Mar 16, 2024
8602812
Fix CI
aryaemami59 Mar 16, 2024
f8fedcc
Add `create-expo` to dev dependencies
aryaemami59 Feb 29, 2024
15c425d
Add `cra-js-app` to `.gitignore` file
aryaemami59 Mar 2, 2024
8934889
Update workspaces
aryaemami59 Mar 2, 2024
c21f053
Fix root dependencies
aryaemami59 Mar 16, 2024
07d1623
Fix lockfile
aryaemami59 Mar 16, 2024
6beb81c
Format all files
aryaemami59 Mar 16, 2024
0881f35
Bump Yarn to 4.1.1
aryaemami59 Mar 16, 2024
38e6f57
Add JSDocs to functions in `mockTemplates.mjs`
aryaemami59 Mar 16, 2024
c5ad403
Add linting to CI
aryaemami59 Mar 16, 2024
bc8c499
Add `tsx` to `devDependencies`
aryaemami59 Mar 18, 2024
a3d0c4e
Rename `mockTemplates.mjs` to `mockTemplates.mts`
aryaemami59 Mar 18, 2024
5e6911e
Make `mockTemplates.mts` executable
aryaemami59 Mar 18, 2024
e289c5a
Fix shebang to use `tsx`
aryaemami59 Mar 18, 2024
98140e6
Update `process.argv` usage in `mockTemplate` function
aryaemami59 Mar 18, 2024
e385198
Update `mockTemplates` script to use TypeScript during CI
aryaemami59 Mar 18, 2024
11dfcb7
Fix build scripts for React Native and Expo templates
aryaemami59 Mar 18, 2024
ea8c699
Add build step to CI
aryaemami59 Mar 18, 2024
e049b5f
Remove unnecessary comment in `mockTemplates.mts`
aryaemami59 Mar 19, 2024
39c66f2
Remove unnecessary optional chaining
aryaemami59 Mar 19, 2024
d491f2b
Disable cache when using `tiged`
aryaemami59 Mar 19, 2024
6d50d83
Remove types from JSDocs in `mockTemplates.mts`
aryaemami59 Mar 19, 2024
d3d040c
Slightly modify names of steps in CI
aryaemami59 Mar 19, 2024
ea8f854
Clear cache before using `tiged`
aryaemami59 Mar 19, 2024
3562314
Remove cache folder for `tiged`
aryaemami59 Mar 21, 2024
c4e2e0f
Checkout forked repository during CI
aryaemami59 Mar 22, 2024
20f4818
Refactor GitHub URL construction in `mockTemplates.mts`
aryaemami59 Mar 22, 2024
cf3e9d0
Do not install dependencies during CI
aryaemami59 Mar 22, 2024
4b62c34
Add `matrix.os` per github actions documentation
aryaemami59 Mar 22, 2024
93c2afe
Cache setting up JDK step
aryaemami59 Mar 22, 2024
66078ab
Update `commitHash` to use short format
aryaemami59 Mar 22, 2024
e57a24c
Bump `tsx` to version 4.7.2
aryaemami59 Apr 6, 2024
b989658
Remove cache for `actions/setup-node`
aryaemami59 Apr 6, 2024
a3ce48d
Bump `tsx` to version 4.8.2
aryaemami59 May 2, 2024
74e3b42
Manually run `npm install` for expo template
aryaemami59 May 3, 2024
0270074
Run `npm install --force`
aryaemami59 May 3, 2024
a8afef9
Bump `tsx` to version 4.9.3
aryaemami59 May 6, 2024
53e0009
Fix `workspaces`
aryaemami59 May 16, 2024
ed3a475
Bump `tsx` to version 4.10.3
aryaemami59 May 16, 2024
b55a3d7
Upgrade Yarn to version 4.2.2
aryaemami59 May 16, 2024
917fabb
Fix `NPM` peer dependency issue
aryaemami59 May 16, 2024
acbcc08
Revert "Run `npm install --force`"
aryaemami59 May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintrc

This file was deleted.

33 changes: 33 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": ["eslint:recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"env": { "browser": true, "node": true, "es2024": true },
"parserOptions": {
// "project": ["./tsconfig.json"],
"ecmaVersion": "latest",
"projectFolderIgnoreList": ["dist"]
},
"plugins": ["@typescript-eslint"],
"reportUnusedDisableDirectives": true,
"root": true,
"overrides": [
{
"files": ["**/*.m{t,j}s"],
"parserOptions": {
// "project": ["./tsconfig.json"],
"ecmaVersion": "latest",
"projectFolderIgnoreList": ["dist"],
"sourceType": "module"
}
},
{
"files": ["**/*.c{t,j}s"],
"parserOptions": {
// "project": ["./tsconfig.json"],
"ecmaVersion": "latest",
"projectFolderIgnoreList": ["dist"],
"sourceType": "script"
}
}
]
}
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
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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

- 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 scripts/mockTemplates.mts ${{ matrix.packages }}

- 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
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
.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
cra-js-app
2 changes: 1 addition & 1 deletion .prettierrc → .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"trailingComma": "es5",
"semi": false,
"singleQuote": true
}
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

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

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.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.

35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "redux-templates",
"private": true,
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/reduxjs/redux-templates"
},
"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": {
"@reduxjs/toolkit": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"eslint-config-prettier": "latest",
"eslint-plugin-prettier": "latest",
"prettier": "latest",
"react-redux": "latest",
"tsx": "^4.10.3"
},
"packageManager": "yarn@4.2.2"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default {};
export default {}