Skip to content

Commit 2b19b44

Browse files
committed
Initialize runtime agnostic react-descendant library
0 parents  commit 2b19b44

20 files changed

Lines changed: 1376 additions & 0 deletions

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
6+
[*.{ts,tsx,js,json}]
7+
indent_style = space
8+
indent_size = 4

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.github adam@attio.com braden@attio.com @attio/sip
2+
/bun.lock adam@attio.com braden@attio.com @attio/sip
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Setup CI
2+
description: Sets up the CI environment with things we always need
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Bun package manager
8+
uses: oven-sh/setup-bun@v1
9+
with:
10+
bun-version: 1.2.21
11+
12+
- name: Install dependencies
13+
run: |
14+
if ! bun install --frozen-lockfile 2>&1 | tee output.txt; then
15+
if grep -q "error: lockfile had changes, but lockfile is frozen" output.txt; then
16+
echo "::group::Lockfile diff"
17+
git diff bun.lock
18+
echo "::endgroup::"
19+
fi
20+
rm output.txt
21+
exit 1
22+
fi
23+
rm output.txt
24+
shell: bash
25+
26+
- name: Check for bun.lock changes
27+
run: git diff --exit-code -- bun.lock
28+
shell: bash

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize]
9+
10+
env:
11+
DO_NOT_TRACK: 1
12+
13+
jobs:
14+
build:
15+
name: Build and Test
16+
timeout-minutes: 15
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest]
21+
22+
steps:
23+
- name: Check out code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup CI
27+
uses: ./.github/actions/ci-setup
28+
29+
- name: Check TypeScript
30+
run: bun run check-typescript
31+
32+
- name: Check Biome
33+
run: bun run check-biome
34+
35+
- name: Check Syncpack
36+
run: bun run check-syncpack
37+
38+
- name: Check CSpell
39+
run: bun run check-cspell
40+

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
env:
11+
DO_NOT_TRACK: 1
12+
13+
jobs:
14+
release:
15+
name: Release
16+
if: github.repository == 'attio/react-native-bottom-sheet-toolbox'
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 20
19+
permissions:
20+
contents: write
21+
issues: write
22+
pull-requests: write
23+
steps:
24+
- name: Check out code (full history)
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 22.16.0
33+
34+
- name: Setup CI
35+
uses: ./.github/actions/ci-setup
36+
37+
- name: Create Release Pull Request or Publish to npm
38+
uses: changesets/action@v1
39+
with:
40+
publish: bun run changeset-publish
41+
version: bun run changeset-version
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
lib
3+
out-tsc

.syncpackrc.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "node_modules/syncpack/schema.json",
3+
"indent": " ",
4+
"sortAz": [
5+
"bin",
6+
"contributors",
7+
"scripts",
8+
"keywords",
9+
"dependencies",
10+
"peerDependencies",
11+
"resolutions"
12+
],
13+
"sortFirst": [
14+
"private",
15+
"name",
16+
"description",
17+
"version",
18+
"author",
19+
"license",
20+
"keywords",
21+
"bugs",
22+
"homepage",
23+
"repository",
24+
"type",
25+
"main",
26+
"source",
27+
"react-native",
28+
"types",
29+
"files",
30+
"module",
31+
"exports",
32+
"imports",
33+
"engines",
34+
"packageManager",
35+
"scripts",
36+
"dependencies",
37+
"devDependencies",
38+
"peerDependencies",
39+
"trustedDependencies",
40+
"resolutions",
41+
"workspaces"
42+
],
43+
"sortPackages": true,
44+
"source": ["package.json"],
45+
"versionGroups": [
46+
{
47+
"dependencies": ["$LOCAL"],
48+
"dependencyTypes": ["dev"],
49+
"pinVersion": "workspace:^"
50+
}
51+
]
52+
}

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["streetsidesoftware.code-spell-checker", "biomejs.biome"]
3+
}

.vscode/settings.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"typescript.enablePromptUseWorkspaceTsdk": true,
4+
"typescript.tsserver.maxTsServerMemory": 4096,
5+
"[json]": {
6+
"editor.defaultFormatter": "biomejs.biome"
7+
},
8+
"[jsonc]": {
9+
"editor.defaultFormatter": "biomejs.biome"
10+
},
11+
"[javascript]": {
12+
"editor.defaultFormatter": "biomejs.biome"
13+
},
14+
"[typescript]": {
15+
"editor.defaultFormatter": "biomejs.biome"
16+
},
17+
"[typescriptreact]": {
18+
"editor.defaultFormatter": "biomejs.biome"
19+
},
20+
"editor.codeActionsOnSave": {
21+
"source.organizeImports.biome": "explicit",
22+
"source.fixAll.biome": "explicit"
23+
},
24+
"biome.suggestInstallingGlobally": false,
25+
"biome.requireConfiguration": true,
26+
"files.eol": "\n"
27+
}

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# React Descendants
2+
3+
A small runtime agnostic library for tracking descendants within a React application.
4+
Heavily inspired by [@reach/descendants](https://www.npmjs.com/package/@reach/descendants) and [pacocoursey/use-descendants](https://github.com/pacocoursey/use-descendants).
5+
6+
## Release Process
7+
8+
This repo uses **Changesets** for versioning and **GitHub Actions** for automated publishing.
9+
10+
### 1. Create Changesets for Changes
11+
12+
```bash
13+
# Generate a changeset for your changes
14+
bunx changeset
15+
```
16+
17+
- Select which packages are affected by your changes
18+
- Choose the appropriate semantic version bump (patch, minor, major)
19+
- Write a descriptive summary of the changes
20+
- Commit the generated changeset file in `.changeset/`
21+
22+
### 2. Automated Version Management
23+
24+
When you push to the `master` branch, the GitHub Action will:
25+
26+
- **Create a Release PR**: If there are pending changesets, it creates a "Version Packages" PR with updated version numbers, CHANGELOGs, and consumed changeset files
27+
28+
### 3. Release Publication
29+
30+
When the "Version Packages" PR is merged:
31+
32+
- **Automated Build**: Builds only packages using `bun run build-release`
33+
- **Automated Publishing**: Publishes updated packages to NPM via `changeset publish`
34+
- **Git Tagging**: Creates appropriate git tags for the released versions
35+
36+
### Manual Release (if needed)
37+
38+
```bash
39+
# 1. Create changesets for changes
40+
bunx changeset
41+
42+
# 2. Version packages (updates versions + CHANGELOGs)
43+
bun run changeset-version
44+
45+
# 3. Build and publish
46+
bun run changeset-publish
47+
```

0 commit comments

Comments
 (0)