Skip to content
Open
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
2 changes: 1 addition & 1 deletion .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Project

React hooks/components library. Monorepo: `packages/core` + `packages/mobile`.
React hooks/components library. Monorepo: `packages/react-simplikit` + `packages/mobile`.

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Quick Reference

- Monorepo: `packages/core` (react-simplikit) + `packages/mobile` (@react-simplikit/mobile)
- Monorepo: `packages/react-simplikit` (react-simplikit) + `packages/mobile` (@react-simplikit/mobile)
- Architecture: `components → hooks → utils → _internal` (unidirectional, no circular imports)
- Core and mobile are independent packages — no cross-package dependencies

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./packages/core/coverage/coverage-final.json,./packages/mobile/coverage/coverage-final.json
files: ./packages/react-simplikit/coverage/coverage-final.json,./packages/mobile/coverage/coverage-final.json

spec-compiled:
name: spec (react compiler compiled)
Expand Down Expand Up @@ -474,7 +474,7 @@ jobs:
shell: bash
run: |
yarn workspaces foreach -Apt --include 'packages/*' run build
CORE_TGZ=$(cd packages/core && npm pack --pack-destination "$RUNNER_TEMP" | tail -1)
CORE_TGZ=$(cd packages/react-simplikit && npm pack --pack-destination "$RUNNER_TEMP" | tail -1)
MOBILE_TGZ=$(cd packages/mobile && npm pack --pack-destination "$RUNNER_TEMP" | tail -1)
echo "CORE_TGZ=$RUNNER_TEMP/$CORE_TGZ" >> "$GITHUB_ENV"
echo "MOBILE_TGZ=$RUNNER_TEMP/$MOBILE_TGZ" >> "$GITHUB_ENV"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ generated-locales/

# transient fixtures written by `yarn test:docs`, which a killed run cannot clean up
docs/core/untranslated-fallback-fixture.md
packages/core/src/hooks/useUntranslatedFallbackFixture/
packages/react-simplikit/src/hooks/useUntranslatedFallbackFixture/

# next
.next
Expand Down
172 changes: 86 additions & 86 deletions .pnp.cjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .scripts/commands/prepareLocalizedFallbacks/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ describe('prepareLocalizedFallbacks', () => {

it('does not create a fallback when a localized document exists', async () => {
const root = await createFixtureDirectory();
await writeFile(root, 'packages/core/src/hooks/useExample/useExample.md', '# useExample\n');
await writeFile(root, 'packages/core/src/hooks/useExample/ja/useExample.md', '# useExample Japanese\n');
await writeFile(root, 'packages/react-simplikit/src/hooks/useExample/useExample.md', '# useExample\n');
await writeFile(root, 'packages/react-simplikit/src/hooks/useExample/ja/useExample.md', '# useExample Japanese\n');

await prepareLocalizedFallbacks({ localeDirectories: ['ja'], root });

await assert.rejects(
fs.access(path.join(root, 'generated-locales/packages/core/src/hooks/useExample/ja/useExample.md'))
fs.access(path.join(root, 'generated-locales/packages/react-simplikit/src/hooks/useExample/ja/useExample.md'))
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion .scripts/commands/scaffold/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const prettierConfig: prettier.Options = {
};

export async function scaffold(name: string, type: 'hook' | 'component' | 'util') {
const directory = path.join(getRootPath(), `./packages/core/src/${type}s/${name}`);
const directory = path.join(getRootPath(), `./packages/react-simplikit/src/${type}s/${name}`);
const ext = type === 'component' ? 'tsx' : 'ts';

const tasks = new Listr(
Expand Down
2 changes: 1 addition & 1 deletion .scripts/verify-pack/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type TargetPackage = {
export const TARGET_PACKAGES: TargetPackage[] = [
{
name: 'react-simplikit',
dir: 'packages/core',
dir: 'packages/react-simplikit',
sizeEntry: `export { useToggle } from 'react-simplikit';`,
sizeLimitBytes: 256,
},
Expand Down
6 changes: 3 additions & 3 deletions .scripts/verifyDocsI18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ for (const requiredText of ['release:', 'changesets/action@', 'changeset:publish
assert.deepEqual(Object.keys(localeDefinitions), ['root', 'ko', 'ja']);
assert.equal(rewrites['docs/index.md'], 'index.md');
assert.equal(rewrites['docs/ko/index.md'], 'ko/index.md');
assert.equal(rewrites['packages/core/src/hooks/:hook/ko/:hook.md'], 'ko/core/hooks/:hook.md');
assert.equal(rewrites['packages/react-simplikit/src/hooks/:hook/ko/:hook.md'], 'ko/core/hooks/:hook.md');
assert.equal(rewrites['docs/ja/index.md'], 'ja/index.md');
assert.equal(rewrites['packages/core/src/hooks/:hook/ja/:hook.md'], 'ja/core/hooks/:hook.md');
assert.equal(rewrites['packages/react-simplikit/src/hooks/:hook/ja/:hook.md'], 'ja/core/hooks/:hook.md');
assert.equal(generatedRewrites['generated-locales/docs/ko/index.md'], 'ko/index.md');
assert.equal(generatedRewrites['generated-locales/docs/ja/index.md'], 'ja/index.md');
assert.equal(packageJson.scripts['docs:prepare'], 'tsx .scripts/index.ts prepare-localized-fallbacks');
Expand Down Expand Up @@ -65,7 +65,7 @@ try {
const guideFixtureTitle = 'Untranslated Fallback Fixture';
const guideFixturePath = path.join(root, 'docs/core/untranslated-fallback-fixture.md');
const hookFixtureName = 'useUntranslatedFallbackFixture';
const hookFixtureDirectory = path.join(root, 'packages/core/src/hooks', hookFixtureName);
const hookFixtureDirectory = path.join(root, 'packages/react-simplikit/src/hooks', hookFixtureName);
const buildOutputDirectory = await fs.mkdtemp(path.join(os.tmpdir(), 'react-simplikit-docs-'));

// Korean translates every routed English document, so its fallback path only has a route to
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/libs/getSidebarItems.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { projectRoot } from '../shared.mts';

/**
* Get sidebar items from a package's source directory
* @param packageRoot - Root directory of the package (e.g., packages/core/src)
* @param packageRoot - Root directory of the package (e.g., packages/react-simplikit/src)
* @param category - Category like 'hooks', 'components', 'utils'
* @param prefix - URL prefix like '/core' or '/mobile'
* @param locale - Optional locale like 'ko'
Expand Down
12 changes: 6 additions & 6 deletions .vitepress/locales.mts
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,21 @@ const routeDefinitions: RouteDefinition[] = [
localizedDestination: ':locale/mobile/:doc.md',
},
{
source: 'packages/core/src/hooks/:hook/:hook.md',
source: 'packages/react-simplikit/src/hooks/:hook/:hook.md',
destination: 'core/hooks/:hook.md',
localizedSource: 'packages/core/src/hooks/:hook/:locale/:hook.md',
localizedSource: 'packages/react-simplikit/src/hooks/:hook/:locale/:hook.md',
localizedDestination: ':locale/core/hooks/:hook.md',
},
{
source: 'packages/core/src/components/:component/:component.md',
source: 'packages/react-simplikit/src/components/:component/:component.md',
destination: 'core/components/:component.md',
localizedSource: 'packages/core/src/components/:component/:locale/:component.md',
localizedSource: 'packages/react-simplikit/src/components/:component/:locale/:component.md',
localizedDestination: ':locale/core/components/:component.md',
},
{
source: 'packages/core/src/utils/:util/:util.md',
source: 'packages/react-simplikit/src/utils/:util/:util.md',
destination: 'core/utils/:util.md',
localizedSource: 'packages/core/src/utils/:util/:locale/:util.md',
localizedSource: 'packages/react-simplikit/src/utils/:util/:locale/:util.md',
localizedDestination: ':locale/core/utils/:util.md',
},
{
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/shared.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

export const projectRoot = path.resolve(import.meta.dirname, '..');
export const corePackageRoot = path.join(projectRoot, 'packages/core/src');
export const corePackageRoot = path.join(projectRoot, 'packages/react-simplikit/src');
export const mobilePackageRoot = path.join(projectRoot, 'packages/mobile/src');
export const docsRoot = path.join(projectRoot, 'docs');
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

React utility hooks/components library. Monorepo with two packages:

- `react-simplikit` (`packages/core`) — Platform-independent React hooks & components
- `react-simplikit` (`packages/react-simplikit`) — Platform-independent React hooks & components
- `@react-simplikit/mobile` (`packages/mobile`) — Mobile web utilities (viewport, keyboard, layout)

## Architecture
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

React utility hooks/components library. Monorepo with two packages:

- `react-simplikit` (`packages/core`) — Platform-independent React hooks & components
- `react-simplikit` (`packages/react-simplikit`) — Platform-independent React hooks & components
- `@react-simplikit/mobile` (`packages/mobile`) — Mobile web utilities (viewport, keyboard, layout)

## Development Quick Start
Expand Down
10 changes: 5 additions & 5 deletions README-ja_jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

## パッケージ

| パッケージ | 説明 | バージョン |
| -------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [react-simplikit](./packages/core) | Universal hooks - 純粋な状態/ロジック用フック(プラットフォームに依存しない) | [![npm](https://img.shields.io/npm/v/react-simplikit.svg)](https://www.npmjs.com/package/react-simplikit) |
| [@react-simplikit/mobile](./packages/mobile) | モバイル Web ユーティリティ(viewport、keyboard、scroll) | [![npm](https://img.shields.io/npm/v/@react-simplikit/mobile.svg)](https://www.npmjs.com/package/@react-simplikit/mobile) |
| パッケージ | 説明 | バージョン |
| --------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [react-simplikit](./packages/react-simplikit) | Universal hooks - 純粋な状態/ロジック用フック(プラットフォームに依存しない) | [![npm](https://img.shields.io/npm/v/react-simplikit.svg)](https://www.npmjs.com/package/react-simplikit) |
| [@react-simplikit/mobile](./packages/mobile) | モバイル Web ユーティリティ(viewport、keyboard、scroll) | [![npm](https://img.shields.io/npm/v/@react-simplikit/mobile.svg)](https://www.npmjs.com/package/@react-simplikit/mobile) |

> **注記**: `react-simplikit` は現在、Web とモバイル(React Native)の両方で動作する純粋な状態/ロジック用フックのみを提供する Universal Hook Library として維持されています。ブラウザ/プラットフォームに依存するフックは非推奨です。詳しくは [packages/core/README-ja_jp.md](./packages/core/README-ja_jp.md) を参照してください。
> **注記**: `react-simplikit` は現在、Web とモバイル(React Native)の両方で動作する純粋な状態/ロジック用フックのみを提供する Universal Hook Library として維持されています。ブラウザ/プラットフォームに依存するフックは非推奨です。詳しくは [packages/react-simplikit/README-ja_jp.md](./packages/react-simplikit/README-ja_jp.md) を参照してください。

## 特長

Expand Down
10 changes: 5 additions & 5 deletions README-ko_kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

## 패키지

| 패키지 | 설명 | 버전 |
| -------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [react-simplikit](./packages/core) | Universal hooks - 순수 상태/로직 훅 (플랫폼 독립적) | [![npm](https://img.shields.io/npm/v/react-simplikit.svg)](https://www.npmjs.com/package/react-simplikit) |
| [@react-simplikit/mobile](./packages/mobile) | 모바일 웹 유틸리티 (viewport, keyboard, scroll) | [![npm](https://img.shields.io/npm/v/@react-simplikit/mobile.svg)](https://www.npmjs.com/package/@react-simplikit/mobile) |
| 패키지 | 설명 | 버전 |
| --------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [react-simplikit](./packages/react-simplikit) | Universal hooks - 순수 상태/로직 훅 (플랫폼 독립적) | [![npm](https://img.shields.io/npm/v/react-simplikit.svg)](https://www.npmjs.com/package/react-simplikit) |
| [@react-simplikit/mobile](./packages/mobile) | 모바일 웹 유틸리티 (viewport, keyboard, scroll) | [![npm](https://img.shields.io/npm/v/@react-simplikit/mobile.svg)](https://www.npmjs.com/package/@react-simplikit/mobile) |

> **참고**: `react-simplikit`은 이제 웹과 모바일(React Native)에서 모두 동작하는 순수 상태/로직 훅만을 제공하는 Universal Hook Library로 유지됩니다. 브라우저/플랫폼 종속 훅들은 Deprecated 처리됩니다. 자세한 내용은 [packages/core/README-ko_kr.md](./packages/core/README-ko_kr.md)를 참고하세요.
> **참고**: `react-simplikit`은 이제 웹과 모바일(React Native)에서 모두 동작하는 순수 상태/로직 훅만을 제공하는 Universal Hook Library로 유지됩니다. 브라우저/플랫폼 종속 훅들은 Deprecated 처리됩니다. 자세한 내용은 [packages/react-simplikit/README-ko_kr.md](./packages/react-simplikit/README-ko_kr.md)를 참고하세요.

## 특징

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ A collection of lightweight, zero-dependency React utilities for building robust

## Packages

| Package | Description | Version |
| -------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [react-simplikit](./packages/core) | Universal hooks - pure state/logic hooks (platform-independent) | [![npm](https://img.shields.io/npm/v/react-simplikit.svg)](https://www.npmjs.com/package/react-simplikit) |
| [@react-simplikit/mobile](./packages/mobile) | Mobile web utilities (viewport, keyboard, scroll) | [![npm](https://img.shields.io/npm/v/@react-simplikit/mobile.svg)](https://www.npmjs.com/package/@react-simplikit/mobile) |
| Package | Description | Version |
| --------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [react-simplikit](./packages/react-simplikit) | Universal hooks - pure state/logic hooks (platform-independent) | [![npm](https://img.shields.io/npm/v/react-simplikit.svg)](https://www.npmjs.com/package/react-simplikit) |
| [@react-simplikit/mobile](./packages/mobile) | Mobile web utilities (viewport, keyboard, scroll) | [![npm](https://img.shields.io/npm/v/@react-simplikit/mobile.svg)](https://www.npmjs.com/package/@react-simplikit/mobile) |

> **Note**: `react-simplikit` is now maintained as a Universal Hook Library providing only pure state/logic hooks that work across web and mobile (React Native). Browser/platform-dependent hooks are deprecated. See [packages/core/README.md](./packages/core/README.md) for details.
> **Note**: `react-simplikit` is now maintained as a Universal Hook Library providing only pure state/logic hooks that work across web and mobile (React Native). Browser/platform-dependent hooks are deprecated. See [packages/react-simplikit/README.md](./packages/react-simplikit/README.md) for details.

## Features

Expand Down
24 changes: 12 additions & 12 deletions docs/hook-design-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,21 +319,21 @@ packages/plugin/ (planned)

### Extraction Rules

| Extracted (Philosophy) | Left Behind (Implementation) |
| ------------------------------------------ | ------------------------------------ |
| "Always return objects" | `packages/core/src/hooks/` paths |
| "Named useEffect improves stack traces" | `yarn test`, `yarn fix` commands |
| "SSR-safe: fixed initial + useEffect sync" | `renderHookSSR.serverOnly()` utility |
| "4 JSDoc tags for AI doc generation" | `100%` coverage threshold |
| Extracted (Philosophy) | Left Behind (Implementation) |
| ------------------------------------------ | ------------------------------------------- |
| "Always return objects" | `packages/react-simplikit/src/hooks/` paths |
| "Named useEffect improves stack traces" | `yarn test`, `yarn fix` commands |
| "SSR-safe: fixed initial + useEffect sync" | `renderHookSSR.serverOnly()` utility |
| "4 JSDoc tags for AI doc generation" | `100%` coverage threshold |

### Generalization Transforms

| Before (Project-Specific) | After (Universal) |
| ---------------------------- | ------------------------------- |
| `renderHookSSR.serverOnly()` | Vitest + `delete global.window` |
| `yarn test` / `yarn fix` | "Run your test suite" |
| `packages/core/` paths | "your source directory" |
| `react-simplikit` references | Removed |
| Before (Project-Specific) | After (Universal) |
| --------------------------------- | ------------------------------- |
| `renderHookSSR.serverOnly()` | Vitest + `delete global.window` |
| `yarn test` / `yarn fix` | "Run your test suite" |
| `packages/react-simplikit/` paths | "your source directory" |
| `react-simplikit` references | Removed |

---

Expand Down
Loading