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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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 our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
123 changes: 123 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Contributing

Thanks for your interest in contributing to `@luk4x/list`.

This project is intentionally small and opinionated. Please read this document carefully before opening an issue or pull request.

---

## Project scope

This component exists to solve **one specific problem**:

> Rendering lists in React with correct, stable keys and minimal boilerplate, without hiding React’s behavior.

Because of that, this project values:

- **Correctness over convenience** (especially around stable keys)
- **failing loudly over silent fallbacks**
- **Minimal API surface**
- **Strong typing**
- **Clear docs**

If a proposed change compromises any of these principles, it’s unlikely to be accepted.

### Proposing changes

Please do **not** propose changes that:

- add styling, layout, or visual concerns
- introduce silent fallbacks as a workaround in case of failure
- attempt to “fix” unstable or poorly modeled data
- hide React’s behavior
- expand the API surface beyond its current scope

Contributions are very welcome when:

- fix bugs or edge cases related to key handling
- improve type safety without increasing API complexity
- improve documentation clarity or examples
- add tests that validate existing behavior
- clarify error messages or developer feedback

### Issues and feature requests

When opening an issue, please include:

- What you’re trying to do
- Expected behavior
- Actual behavior
- A minimal code example

---

## Project environment

The project is a **CLI** that prompts for a destination path and copies the `templates/list` component into a user’s codebase.

Therefore, the changes should be tested through the CLI itself as well, and not just through tests.

### Folder structure

```

├─ .github/ # GitHub metadata
├─ .husky/ # Git hooks
├─ dist/ # Build output (generated)
├─ src/ # CLI source
├─ templates # Component templates shipped by the CLI
├─ tests/ # Runtime and type tests
├─ index.d.ts # Root type exports for tsd
├─ tsup.config.ts # Build config
└─ vitest.config.ts # Test config

```

### Requirements

- Node.js >= 18 (recommended via NVM)
- pnpm

### Tooling and conventions

This project uses the following tools and conventions:

- [@changesets/cli](https://www.npmjs.com/package/@changesets/cli) for versioning and releases
- [Conventional Commits](https://www.conventionalcommits.org) for commit messages
- [Vitest](https://vitest.dev/) and [tsd](https://www.npmjs.com/package/tsd) for testing

### Main scripts

```bash

pnpm install # install dependencies
nvm install # install Node.js version from .nvmrc
pnpm run dev # build and run the CLI locally
pnpm run typecheck # run TypeScript checks (runs on every commit)
pnpm run lint # run ESLint (runs on every commit)
pnpm run test:all # run runtime and type tests (runs on every commit)
pnpm run build # build the CLI with tsup (runs on every push)

```

### Recommended CLI local testing workflow

Because this is a CLI that copies templates into real projects, the most reliable way to test changes is to run it against a fresh test project.

Create a temporary test project:

```bash

mkdir -p /tmp/list-test && cd /tmp/list-test && pnpm init

```

From inside that project, run the CLI directly from your local build (replace the path accordingly):

```bash

node /absolute/path/to/list-repo/dist/cli.mjs

```

This simulates how real users interact with the CLI and helps catch issues that unit tests alone may miss (path resolution, prompts, file output, etc.). Changes that affect the CLI or templates should always be tested this way before opening a pull request.
56 changes: 56 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## Summary

Briefly explain what this pull request does and why it exists.

Focus on:

- what problem is being addressed
- why this change is necessary
- how it aligns with the project’s goals

Avoid generic statements like “refactor” or “cleanup” without context.

---

## Type of change

- [ ] Bug fix (fixes incorrect or broken behavior)
- [ ] Type-safety improvement
- [ ] Documentation improvement
- [ ] Internal refactor (no behavior change)
- [ ] Test improvement
- [ ] Other

---

## Design alignment check

Please confirm the following:

- [ ] This change does **not** add styling or layout concerns
- [ ] This change does **not** expand the API surface beyond its current scope
- [ ] This change preserves the component’s correctness and fail-fast behavior
- [ ] This change does not hide or alter React’s list behavior
- [ ] CLI behavior remains predictable and non-invasive

If any of these are unchecked, explain why below.

---

## Details

Explain the change in more detail if needed.

Include:

- edge cases considered
- trade-offs made
- alternative approaches rejected

---

## Checklist

- [ ] No unnecessary complexity introduced
- [ ] Documentation was updated (if applicable)
- [ ] Tests added/updated (if applicable) and tests pass locally
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
push:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.28.2

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm

- name: Install
run: pnpm install --frozen-lockfile

- name: Typecheck
run: pnpm run typecheck

- name: Lint
run: pnpm run lint

- name: Tests
run: pnpm run test:all

- name: Build
run: pnpm run build
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm dlx commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm run typecheck && pnpm run lint && pnpm run test:all
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm run build
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict = true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"printWidth": 80
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"notebook.defaultFormatter": "esbenp.prettier-vscode",
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.fixAll": "explicit"
},
"eslint.format.enable": true,
"eslint.useESLintClass": true,
"files.eol": "\n"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @luk4x/list

## 0.1.0

### Minor Changes

- cli creation
Loading