Skip to content

Commit

Permalink
docs(project): update documentation and project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tobua committed Jun 12, 2024
1 parent 748379f commit e90879c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
4 changes: 2 additions & 2 deletions create-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cpSync('logo.png', 'app/logo.png')
rmSync(appTemp, { recursive: true })

// Run build to ensure distributed files for plugin exist.
execSync('npm run build', {
execSync('bun run build', {
stdio: 'inherit',
})

Expand All @@ -35,7 +35,7 @@ execSync('npm install $(npm pack .. | tail -1)', {
})

// Additional dependency.
execSync('npm install react-native-cols mobx', {
execSync('bun install react-native-cols mobx', {
cwd: join(process.cwd(), 'app'),
stdio: 'inherit',
})
Expand Down
18 changes: 4 additions & 14 deletions documentation/markup/Repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,15 @@ const SandpackInner = ({ phone, setPhone }) => {
const phone = deviceSizes[selected.value]

Object.values(sandpack.clients).forEach((client) => {
client.iframe.contentWindow.postMessage(
{ type: 'width', width: phone.width / phone.scale },
'*'
)
client.iframe.contentWindow.postMessage({ type: 'width', width: phone.width / phone.scale }, '*')
})

setPhone(phone)
})

useEffect(() => {
Object.values(sandpack.clients).forEach((client) => {
client.iframe.contentWindow.postMessage(
{ type: 'width', width: phone.width / phone.scale },
'*'
)
client.iframe.contentWindow.postMessage({ type: 'width', width: phone.width / phone.scale }, '*')
})
}, [sandpack])

Expand Down Expand Up @@ -141,11 +135,7 @@ const SandpackInner = ({ phone, setPhone }) => {
}),
option: (provided, state) => ({
...provided,
backgroundColor: state.isSelected
? '#82D9FF'
: state.isFocused
? '#FF85FA'
: 'transparent',
backgroundColor: state.isSelected ? '#82D9FF' : state.isFocused ? '#FF85FA' : 'transparent',
cursor: 'pointer',
':active': {
backgroundColor: '#FF85FA',
Expand Down Expand Up @@ -176,7 +166,7 @@ const SandpackInner = ({ phone, setPhone }) => {
}

export const Repl = () => {
const [phone, setPhone] = useState(deviceSizes['iphone14'])
const [phone, setPhone] = useState(deviceSizes['iphone15'])

return (
<ContentGrid size={phone.type === Type.Tablet ? 'ultrawide' : 'wide'}>
Expand Down
8 changes: 4 additions & 4 deletions documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"lint": "next lint"
},
"dependencies": {
"@codesandbox/sandpack-react": "^2.11.2",
"@codesandbox/sandpack-react": "^2.14.2",
"@stitches/react": "^1.2.8",
"device-sizes": "^1.2.3",
"indicate": "^6.2.0",
"device-sizes": "^1.2.4",
"indicate": "^6.3.0",
"next": "14.0.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-select": "^5.8.0",
"wasser": "^2.4.0"
"wasser": "^2.6.0"
},
"devDependencies": {
"eslint": "8.56.0",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"license": "MIT",
"author": "Matthias Giger",
"scripts": {
"app": "node create-app.js",
"app": "bun create-app.js",
"app:install": "npm i --no-save $(npm pack . | tail -1) --prefix app",
"build": "esbuild index.ts --outdir=dist --bundle --format=esm --platform=neutral --sourcemap --external:react-native --external:react --external:mobx && tsc",
"watch": "npm-run-all --parallel build:watch copy",
"copy": "cpx 'dist/**/*' app/node_modules/responsive-react-native/dist --watch",
"build:watch": "esbuild index.ts --watch --outdir=dist --bundle --format=esm --platform=neutral --sourcemap --external:react-native --external:react --external:mobx",
"test": "jest && npm run test:types",
"test": "jest && bun run test:types",
"test:types": "cd test && tsc && cd types && tsc",
"test:watch": "jest --watchAll",
"lint": "eslint . --fix --ext .js,.jsx,.ts,.tsx",
Expand Down

0 comments on commit e90879c

Please sign in to comment.