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
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[*]
indent_style = tab
indent_size = 8
tab_width = 8
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- run: npm ci

- run: npm run typecheck

- run: npm run lint

- run: npm run format:check

- run: npm test

- run: npm run build

# dist/ is committed and installed straight from git — fail if the
# committed build doesn't match what src/ actually produces.
- name: Check dist is up to date
run: git diff --exit-code dist/

# Validate the published package shape (exports map, dual CJS/ESM types).
- run: npm run check:package
8 changes: 8 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Fast checks on staged files, then the full gate CI runs.
npx lint-staged
npm run typecheck
npm test
# dist/ is committed and consumed straight from git — rebuild and stage it so
# a commit can never ship src changes with a stale build (CI verifies too).
npm run build
git add dist
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist/
example/dist/
package-lock.json
src/skins/iosNinePatch.ts
src/skins/androidNinePatch.ts
src/skins/pixel9.ts
src/skins/bootAssets.ts
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DeviceView } from '@mobile-next/device-view';
onConnected={() => console.log('connected')}
onDisconnected={() => console.log('disconnected')}
onError={(err) => console.error(err)}
/>
/>;
```

The component fills its container, so give the parent element a size.
Expand Down
4 changes: 2 additions & 2 deletions dist/index.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface DeviceDescriptor {
platform: DevicePlatform;
type: DeviceType;
version?: string;
state?: "online" | "offline";
state?: 'online' | 'offline';
}
interface ScreenSize {
width: number;
Expand Down Expand Up @@ -266,7 +266,7 @@ declare class DeviceClient implements DeviceClientApi {
declare function createNoOpDeviceClient(): DeviceClientApi;

interface NinePatchSkin {
platform: 'ios' | 'android';
platform?: 'ios' | 'android';
image: string;
imageWidth: number;
imageHeight: number;
Expand Down
4 changes: 2 additions & 2 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface DeviceDescriptor {
platform: DevicePlatform;
type: DeviceType;
version?: string;
state?: "online" | "offline";
state?: 'online' | 'offline';
}
interface ScreenSize {
width: number;
Expand Down Expand Up @@ -266,7 +266,7 @@ declare class DeviceClient implements DeviceClientApi {
declare function createNoOpDeviceClient(): DeviceClientApi;

interface NinePatchSkin {
platform: 'ios' | 'android';
platform?: 'ios' | 'android';
image: string;
imageWidth: number;
imageHeight: number;
Expand Down
Loading
Loading