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
7 changes: 7 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in the readme](https://github.com/changesets/changesets/blob/main/README.md)

To add a new changeset, run `npx changeset` in the root of the repository.
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "Semantu/linked-react" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/tough-tigers-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@_linked/react": major
---

update to major
43 changes: 43 additions & 0 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Changeset Check

on:
pull_request:
branches:
- main
- dev

jobs:
changeset-check:
name: Check for changeset
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for changeset files
uses: actions/github-script@v7
with:
script: |
const { data: files } = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});

const hasChangeset = files.some(f =>
f.filename.startsWith('.changeset/') &&
f.filename.endsWith('.md') &&
f.filename !== '.changeset/README.md'
);

if (!hasChangeset) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '⚠️ **No changeset found.** If this PR should trigger a release, run `npx changeset` and commit the generated file.\n\nIf this change doesn\'t need a release (docs, CI config, etc.), you can ignore this message.'
});
core.warning('No changeset file found in this PR.');
}
109 changes: 109 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Publish

on:
push:
branches:
- main
- dev

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Build
run: npm run build

- name: Test
run: npm test

release:
name: Publish Stable Release
needs: build-and-test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"

- name: Setup npm
run: npm install -g npm@^11.5.1

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Build
run: npm run build

- name: Create release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npx changeset publish
title: "chore: version package for release"
commit: "chore: version package for release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dev-release:
name: Publish Dev Release
needs: build-and-test
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"

- name: Setup npm
run: npm install -g npm@^11.5.1

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Build
run: npm run build

- name: Publish next release
run: |
# Apply pending changesets to get the next version (without committing)
npx changeset version
NEXT_VERSION=$(node -p "require('./package.json').version")
# Append dev prerelease identifier
DEV_VERSION="${NEXT_VERSION}-next.$(date +%Y%m%d%H%M%S)"
npm version "$DEV_VERSION" --no-git-tag-version
npm publish --tag next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Each package also has a `README.md` with API docs and a `## Changelog` at the bo

### When to plan

Any task that changes package code requires a plan. Simple checks, info gathering, and discussions do not.
Any task that requires significant code changes requires a plan. Simple checks, info gathering, and discussions do not. If it's not clear (small code changes), ask the user if he wants to plan first.

### Creating a plan

Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

### 1.0.0 (from LINCD.js)

Initial extraction from the LINCD monolith. Moves React-specific linked component wrappers into a standalone package.

- `linkedComponent(...)` and `linkedSetComponent(...)` extracted from `lincd`.
- `LinkedComponentClass` base class for class-based linked components.
- `useStyles(...)` hook for component styling.
- Pagination API (`nextPage`, `previousPage`, `setPage`, `setLimit`) on linked set components.
- `_refresh(updatedProps?)` for optimistic UI updates on linked components.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Semantu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,4 @@ npm test

## Changelog

### 1.0.0 (from LINCD.js)

Initial extraction from the LINCD monolith. Moves React-specific linked component wrappers into a standalone package.

- `linkedComponent(...)` and `linkedSetComponent(...)` extracted from `lincd`.
- `LinkedComponentClass` base class for class-based linked components.
- `useStyles(...)` hook for component styling.
- Pagination API (`nextPage`, `previousPage`, `setPage`, `setLimit`) on linked set components.
- `_refresh(updatedProps?)` for optimistic UI updates on linked components.
See [CHANGELOG.md](./CHANGELOG.md).
Loading