Skip to content

fix(mobile, core): fix failed ci tasks#305

Closed
zztnrudzz13 wants to merge 71 commits intomainfrom
fix/ci
Closed

fix(mobile, core): fix failed ci tasks#305
zztnrudzz13 wants to merge 71 commits intomainfrom
fix/ci

Conversation

@zztnrudzz13
Copy link
Collaborator

Overview

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

kimyouknow and others added 30 commits January 8, 2026 22:57
* feat: mobile scaffolding

* fix: root setting

* chore: pnp 제거

* chore: git ignore

* Revert "chore: pnp 제거"

This reverts commit 05136ba.

* chore: update react peer dependency to allow any version from 18.0.0

* chore: remove baseUrl from tsconfig.json

* chore: add mobile package to PnP configuration and update yarn settings

* chore: update Node.js version in .nvmrc to v22.18.0
Add SSR environment detection utility.

- isServer(): Check if code is running on the server
- Includes client and SSR environment tests
* feat(mobile): add isServer utility

Add SSR environment detection utility.

- isServer(): Check if code is running on the server
- Includes client and SSR environment tests

* feat(mobile): add bodyScrollLock utility and useBodyScrollLock hook

Add body scroll lock functionality for modals and overlays.

Utils:
- enableBodyScrollLock(): Lock body scroll with position preservation
- disableBodyScrollLock(): Unlock and restore scroll position

Hook:
- useBodyScrollLock(): Auto lock on mount, unlock on unmount

Includes comprehensive tests with edge cases and SSR tests.
feat: implement function for detecting device
feat: implement getKeyboard function
* feat(mobile): add isServer utility

Add SSR environment detection utility.

- isServer(): Check if code is running on the server
- Includes client and SSR environment tests

* feat(mobile): add useVisualViewport hook

Add hook to track Visual Viewport changes in mobile WebView.

Returns:
- width, height: Viewport dimensions
- offsetLeft, offsetTop: Viewport offset from layout viewport
- scale: Pinch-zoom scaling factor

Use cases:
- Detect keyboard appearance (iOS: negative offsetTop)
- Handle pinch-zoom interactions
- Responsive layout adjustments

Includes comprehensive tests with edge cases and SSR tests.

* feat(mobile): enhance useVisualViewport hook to handle null viewport

- Updated the useVisualViewport hook to return an object containing the viewport state or null if not supported.
- Modified example usage to check for null before accessing viewport properties.
- Improved getVisualViewportState function to return null when visualViewport is not available, ensuring safer access to viewport properties.

* feat: test

* fix(mobile): improve null handling in useVisualViewport hook

- Updated useVisualViewport to ensure it returns null when visualViewport is not available, enhancing safety.
- Refactored getVisualViewportState to always expect a valid visualViewport, removing unnecessary null checks.
- Improved state management for viewport updates to handle null cases more gracefully.
* feat(examples): add example applications with root tsconfig settings

Add two example projects to demonstrate @react-simplikit/mobile usage:

- with-vite: Vite + React CSR example
- with-nextjs: Next.js App Router SSR example

Both examples use the same tsconfig settings as the root project.

* chore(examples): customize tsconfig for each example

- with-vite: add isolatedModules for HMR support
- with-nextjs: add Next.js specific settings
  - jsx: preserve (required for Next.js)
  - incremental, isolatedModules
  - Next.js plugin
  - include next-env.d.ts and .next/types

* refactor(examples): use named import for ReactNode instead of React.*

* chore(examples): update vite to v7

* chore(examples): apply Next.js required tsconfig settings

* refactor(examples): remove DEMOS constant, define demos inline

* chore: lint
* feat(mobile): add isServer utility

Add SSR environment detection utility.

- isServer(): Check if code is running on the server
- Includes client and SSR environment tests

* feat(mobile): add useScrollDirection hook

Add hook to detect scroll direction with throttling support.

Returns:
- direction: 'up' | 'down' | null
- position: Current scroll Y position

Options:
- throttleMs: Throttle interval (default: 50ms)

Use cases:
- Hide/show header on scroll
- Infinite scroll implementations
- Scroll-based animations

Includes comprehensive tests with edge cases and SSR tests.
feat: implement subscribeKeyboardHeight and useKeyboardHeight function
sukyeong and others added 28 commits January 27, 2026 08:28
Add package configuration files for the new packages/core location:
- package.json with workspace setup (name: react-simplikit)
  - Matches original root exports (dist for CJS, esm for ESM)
- tsconfig.json for TypeScript compilation
- tsup.config.ts for build configuration (identical to root)
- vitest.config.ts and vitest.setup.ts for testing (identical to root)

This prepares the monorepo structure where react-simplikit will be
managed as a workspace package alongside @react-simplikit/mobile.
* feat(core): add packages/core structure

Add package configuration files for the new packages/core location:
- package.json with workspace setup (name: react-simplikit)
  - Matches original root exports (dist for CJS, esm for ESM)
- tsconfig.json for TypeScript compilation
- tsup.config.ts for build configuration (identical to root)
- vitest.config.ts and vitest.setup.ts for testing (identical to root)

This prepares the monorepo structure where react-simplikit will be
managed as a workspace package alongside @react-simplikit/mobile.

* feat(core): add packages/core structure

Add package configuration files for the new packages/core location:
- package.json with workspace setup (name: react-simplikit)
- tsconfig.json for TypeScript compilation
- tsup.config.ts for build configuration
- vitest.config.ts and vitest.setup.ts for testing

This prepares the monorepo structure where react-simplikit will be
managed as a workspace package alongside @react-simplikit/mobile.

* refactor(core): move src to packages/core/src

Move all source files from root src/ to packages/core/src/:
- hooks/ (28 hooks)
- components/ (3 components)
- utils/ (3 utilities)
- docs/ and public/ assets
- _internal/ test utilities

Remove root-level build/test config files (now in packages/core):
- tsup.config.ts
- vitest.config.ts
- vitest.setup.ts

No functional changes - pure file relocation for monorepo structure.
* feat(core): add packages/core structure

Add package configuration files for the new packages/core location:
- package.json with workspace setup (name: react-simplikit)
  - Matches original root exports (dist for CJS, esm for ESM)
- tsconfig.json for TypeScript compilation
- tsup.config.ts for build configuration (identical to root)
- vitest.config.ts and vitest.setup.ts for testing (identical to root)

This prepares the monorepo structure where react-simplikit will be
managed as a workspace package alongside @react-simplikit/mobile.

* feat(core): add packages/core structure

Add package configuration files for the new packages/core location:
- package.json with workspace setup (name: react-simplikit)
- tsconfig.json for TypeScript compilation
- tsup.config.ts for build configuration
- vitest.config.ts and vitest.setup.ts for testing

This prepares the monorepo structure where react-simplikit will be
managed as a workspace package alongside @react-simplikit/mobile.

* refactor(core): move src to packages/core/src

Move all source files from root src/ to packages/core/src/:
- hooks/ (28 hooks)
- components/ (3 components)
- utils/ (3 utilities)
- docs/ and public/ assets
- _internal/ test utilities

Remove root-level build/test config files (now in packages/core):
- tsup.config.ts
- vitest.config.ts
- vitest.setup.ts

No functional changes - pure file relocation for monorepo structure.

* chore: update root config for workspace-only setup

Update root package.json:
- Change name to @react-simplikit (scoped workspace root)
- Update scripts to use workspace commands
- Remove publishConfig (moved to packages/core)
- Add prepack script for CI/CD

Update tsconfig.json:
- Remove root src from include
- Keep packages/**/src for workspace packages

Update eslint.config.js:
- Add packages/**/*.{ts,tsx} file pattern
- Add parserOptions for packages/*/tsconfig.json

Update yarn.lock and .pnp.cjs for workspace changes.

* chore: rename root package to @react-simplikit/root and improve scripts

- Rename root package from @react-simplikit to @react-simplikit/root
- Use workspaces foreach for all lint/test/build commands
- Add parallel (-p) and topological (-t) flags for better DX
- Remove redundant individual package scripts (build:mobile, test:all, etc.)

* chore :y lock

* feat: add build
feat(mobile): implement getSafeAreaInset function and demo
* test(mobile): add renderHookSSR utility for SSR testing

Add SSR testing utilities to support server-side rendering tests:
- renderHookSSR.serverOnly: Render hook in server environment only
- renderHookSSR.fullCycle: Test full SSR hydration cycle

* feat(mobile): add useNetworkStatus hook

Add hook to access Network Information API for adaptive content loading.
Provides raw network data without opinionated abstractions.

Features:
- Returns effectiveType, type, downlink, rtt, saveData
- SSR safe (returns empty object on server)
- Subscribes to connection change events
- All fields optional (undefined if API not supported)

* docs(examples): add useNetworkStatus demo

Add interactive demo showing:
- Real-time network status display
- Online/offline detection with navigator.onLine
- Effective connection type explanation
- Chrome DevTools throttling testing guide
* test(mobile): add renderHookSSR utility for SSR testing

Add SSR testing utilities to support server-side rendering tests:
- renderHookSSR.serverOnly: Render hook in server environment only
- renderHookSSR.fullCycle: Test full SSR hydration cycle

* feat(mobile): add usePageVisibility hook

Add hook to detect page visibility changes using Page Visibility API.
Useful for webview environments to detect app background/foreground state.

Features:
- Returns { isVisible, visibilityState }
- SSR safe (returns visible state on server)
- Automatically subscribes/unsubscribes to visibilitychange event

* docs(examples): add usePageVisibility demo

Add interactive demo page showing:
- Real-time visibility state display
- Tab switch detection
- Usage examples for video pause and analytics

* fix: lint error in IsServerDemo

* refactor(examples): simplify UseBodyScrollLockDemo and enhance modal functionality

- Removed unnecessary BodyScrollLock wrapper and modal examples.
- Updated state management for modal visibility and scroll position.
- Improved demo layout and status display for body scroll lock.
- Added a new ModalContent component to demonstrate body scroll locking.
* chore(mobile): use source entry for development

- Change main to ./src/index.ts for direct source reference during development
- Move dist exports to publishConfig for npm publish only
- Enables HMR without build step in examples

* chore: add vercel build configuration

- Add private: true to root package.json (required for yarn workspaces)
- Add vercel.json for with-vite example with corepack support

* fix: run corepack from monorepo root

* chore: examples/with-vite -> workspace^

* chore: bundle yarn binary for platform independence

- Add .yarn/releases/yarn-4.10.2.cjs for consistent yarn version
- Update .yarnrc.yml with yarnPath
- Simplify vercel.json (corepack no longer needed)

* fix: add outputDirectory to vercel.json
* fix(scaffold): update scaffold directory path to reflect new monorepo structure

* fix(eslint): update project path in parserOptions to support nested tsconfig files

* chore(core): update package.json and tsconfig.json for improved script organization and TypeScript configuration

- Added directory path to repository URL in package.json.
- Simplified scripts in package.json by removing redundant commands and introducing new ones for linting and testing.
- Updated TypeScript configuration to include all files in the src directory.

* chore(mobile): enhance package.json and tsconfig.json with new scripts and type definitions

- Added linting and type checking scripts to package.json for improved code quality.
- Introduced a test coverage script to facilitate better testing practices.
- Updated tsconfig.json to include type definitions for testing library.
* docs: update README for monorepo structure and add package READMEs

- Update root README with packages table and installation guide
- Add react-simplikit (core) package README (EN/KO)
- Add @react-simplikit/mobile package README (EN/KO)
- Fix image path for monorepo structure

* docs: setup VitePress for monorepo documentation

- Add docs/ folder with core and mobile package documentation
- Configure VitePress to support both react-simplikit and @react-simplikit/mobile
- Create landing page with package selection (mobile prioritized)
- Copy core docs from upstream react-simplikit
- Add placeholder docs for mobile hooks
- Restructure mobile hooks to folder-based organization
- Update .gitignore to use context/ instead of docs/

* Revert "docs: setup VitePress for monorepo documentation"

This reverts commit 0a0e46e.
* refactor(mobile): restructure hooks to folder-based organization

* docs(mobile): add hook documentation

* chore(vitepress): configure monorepo documentation structure

* docs: add landing page, guides and assets
feat(mobile): implement useSafeAreaInset function, test codes, and an example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants