Skip to content
Merged
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
48 changes: 14 additions & 34 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup
description: Setup Node.js and install dependencies
description: Setup Node.js, Yarn 4.9.1, and install dependencies

runs:
using: composite
Expand All @@ -9,46 +9,26 @@ runs:
with:
node-version-file: .nvmrc

# Create a minimal .yarnrc.yml without any plugin references
- name: Create minimal Yarn config
run: |
cat > .yarnrc.yml << EOF
nodeLinker: node-modules
nmHoistingLimits: workspaces
EOF
shell: bash

# Setup Corepack for proper Yarn version management
- name: Setup Corepack and Yarn
- name: Enable Corepack and Prepare Yarn 4.9.1
run: |
corepack enable
corepack prepare yarn@3.6.1 --activate
corepack prepare yarn@4.9.1 --activate
yarn --version
shell: bash

# Create required directory and install plugins
- name: Setup plugins
- name: Configure Yarn and Generate .yarnrc.yml
run: |
mkdir -p .yarn/plugins
yarn plugin import @yarnpkg/plugin-interactive-tools
yarn plugin import @yarnpkg/plugin-workspace-tools
yarn set version 4.9.1
yarn config set nodeLinker node-modules
yarn config set nmHoistingLimits workspaces
shell: bash

# Now update .yarnrc.yml to include the plugins
- name: Update Yarn config with plugins
- name: Verify .yarnrc.yml
run: |
cat > .yarnrc.yml << EOF
nodeLinker: node-modules
nmHoistingLimits: workspaces

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
EOF
cat .yarnrc.yml
shell: bash

- name: Restore cache
- name: Restore Yarn Cache
uses: actions/cache/restore@v4
id: yarn-cache
with:
Expand All @@ -62,11 +42,11 @@ runs:
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-yarn-

- name: Install dependencies
- name: Install Dependencies
run: yarn install
shell: bash

- name: Save cache
- name: Save Yarn Cache
uses: actions/cache/save@v4
if: steps.yarn-cache.outputs.cache-hit != 'true'
with:
Expand All @@ -75,4 +55,4 @@ runs:
.yarn/cache
.yarn/unplugged
.yarn/install-state.gz
key: ${{ steps.yarn-cache.outputs.cache-primary-key || format('{0}-yarn-{1}-{2}', runner.os, hashFiles('yarn.lock'), hashFiles('**/package.json', '!node_modules/**')) }}
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ android/keystores/debug.keystore
# Yarn
.yarn/
.pnp.*
.yarnrc.yml

# Expo
.expo/
Expand Down
10 changes: 0 additions & 10 deletions .yarnrc.yml

This file was deleted.

37 changes: 30 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,43 @@ Contributions are always welcome, no matter how large or small!

We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md).

## Development workflow
## Development Workflow

This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
This project is a monorepo managed using [Yarn Workspaces](https://yarnpkg.com/features/workspaces) with Yarn 4.9.1. It contains the following packages:

- The library package in the root directory.
- An example app in the `example/` directory.

To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
To get started with the project, follow these steps:

```sh
yarn
```
1. **Ensure Node.js is installed**: Use Node.js 22.12.0 or higher (as specified in `.nvmrc`). Install via [nvm](https://github.com/nvm-sh/nvm) if needed:

```sh
nvm install 22.12.0
nvm use 22.12.0

2. **Enable Corepack**: Yarn 4.9.1 is managed via Corepack, included with Node.js. Enable it to ensure the correct Yarn version:

```sh
corepack enable
corepack prepare yarn@4.9.1 --activate
```

3. Set up Yarn configuration: In the root directory, configure Yarn 4.9.1 and generate the .yarnrc.yml file:

```sh
yarn set version 4.9.1
yarn config set nodeLinker node-modules
yarn config set nmHoistingLimits workspaces
```

4. **Install dependencies**: Install dependencies for all packages:

```sh
yarn
```

> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
> Important: This project relies on Yarn Workspaces and Yarn 4.9.1. Do not use npm or other package managers for development, as they are not compatible with the monorepo setup.

The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "A papery checkbox for react native",
"main": "./lib/module/index.js",
"types": "./lib/typescript/src/index.d.ts",
"private": false,
"exports": {
".": {
"source": "./src/index.tsx",
Expand Down Expand Up @@ -120,7 +119,7 @@
"workspaces": [
"example"
],
"packageManager": "yarn@3.6.1",
"packageManager": "yarn@4.9.1",
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
Expand Down
Loading