File tree 5 files changed +20
-21
lines changed
sandpack-client/src/clients/node
5 files changed +20
-21
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"packages" : [" sandpack-client" , " sandpack-react" ],
3
- "sandboxes" : [" sowx8r" , " 909l3f " ],
3
+ "sandboxes" : [" sowx8r" ],
4
4
"node" : " 16"
5
5
}
Original file line number Diff line number Diff line change @@ -366,7 +366,10 @@ export class SandpackNode extends SandpackClient {
366
366
*/
367
367
if ( this . emulatorShellProcess ?. state === "running" ) {
368
368
Object . entries ( modules ) . forEach ( ( [ key , value ] ) => {
369
- if ( Buffer . compare ( value , this . _modulesCache . get ( key ) ) !== 0 ) {
369
+ if (
370
+ ! this . _modulesCache . get ( key ) ||
371
+ Buffer . compare ( value , this . _modulesCache . get ( key ) ) !== 0
372
+ ) {
370
373
this . emulator . fs . writeFile ( key , value ) ;
371
374
}
372
375
} ) ;
Original file line number Diff line number Diff line change 20
20
"prebuild" : " yarn run clean" ,
21
21
"test" : " TEST_ENV=true jest . --transformIgnorePatterns \" node_modules/(?!@codemirror)/\" --modulePathIgnorePatterns \" e2e\" " ,
22
22
"lint" : " eslint '**/*.ts?(x)' --fix" ,
23
- "build" : " rollup -c" ,
23
+ "build" : " rollup -c && yarn build:types" ,
24
+ "build:types" : " tsc -p tsconfig.json" ,
24
25
"build:publish" : " yarn build" ,
25
26
"start" : " tsc -p tsconfig.esm.json --watch" ,
26
27
"dev" : " start-storybook -p 6006 --quiet" ,
Original file line number Diff line number Diff line change 1
1
/* eslint-disable @typescript-eslint/no-explicit-any */
2
2
import * as themes from "@codesandbox/sandpack-themes" ;
3
3
import React from "react" ;
4
-
5
- import { Sandpack } from "./presets" ;
4
+ import { SandpackProvider } from "." ;
5
+ import {
6
+ SandpackCodeEditor ,
7
+ SandpackFileExplorer ,
8
+ SandpackPreview ,
9
+ } from "./components" ;
6
10
7
11
export default {
8
12
title : "Intro/Playground" ,
9
13
} ;
10
14
11
15
export const Basic : React . FC = ( ) => {
12
- const [ text , setText ] = React . useState ( "world" ) ;
13
16
return (
14
17
< >
15
- < input
16
- defaultValue = { text }
17
- onChange = { ( { target } ) => setText ( target . value ) }
18
- />
19
- < Sandpack
20
- files = { {
21
- "App.js" : `export default function App() {
22
- return <h1>Hello ${ text } </h1>
23
- }
24
- ` ,
25
- } }
26
- template = "react"
27
- theme = { themes . sandpackDark }
28
- />
18
+ < SandpackProvider template = "nextjs" theme = { themes . sandpackDark } >
19
+ < SandpackFileExplorer />
20
+ < SandpackCodeEditor />
21
+ < SandpackPreview />
22
+ </ SandpackProvider >
29
23
</ >
30
24
) ;
31
25
} ;
Original file line number Diff line number Diff line change 16
16
"scripts" : {
17
17
"clean" : " rm -rf dist" ,
18
18
"prebuild" : " yarn run clean" ,
19
- "build" : " rollup -c" ,
19
+ "build" : " rollup -c && yarn build:types" ,
20
+ "build:types" : " tsc -p tsconfig.json" ,
20
21
"build:publish" : " yarn build" ,
21
22
"typecheck" : " tsc"
22
23
},
You can’t perform that action at this time.
1 commit comments
vercel[bot] commentedon Feb 28, 2023
Successfully deployed to the following URLs:
sandpack-docs – ./website/docs
sandpack.vercel.app
sandpack-docs-git-main-codesandbox1.vercel.app
sandpack-docs-codesandbox1.vercel.app