diff --git a/.gitmodules b/.gitmodules index 45a0cce..4783dd9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,6 @@ [submodule "tiny-robot"] path = tiny-robot url = git@github.com:opentiny/tiny-robot.git - branch = release/v0.4.x [submodule "next-sdk"] path = next-sdk url = git@github.com:opentiny/next-sdk.git diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index a026131..f2a7c0c 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -142,8 +142,10 @@ function listenCodePlaygroundEvent() { files, extraImports, }) - if(route.path.includes('tiny-robot')){ - window.open(`https://playground.opentiny.design/tiny-robot.html` + store.serialize(), '_blank') + if (route.path.includes('tiny-robot')) { + const playgroundUrl = + import.meta.env.VITE_TINY_ROBOT_PLAYGROUND_URL || `${import.meta.env.BASE_URL}/tiny-robot/playground/` + window.open(playgroundUrl.replace(/(? ') + console.error('Example: node copy-playground.js packages/playground/dist docs/dist/playground') + process.exit(1) +} + +// Source and destination paths from arguments +// resolve() automatically handles both absolute and relative paths +const source = resolve(args[0]) +const dest = resolve(args[1]) + +try { + // Check if source exists + if (!existsSync(source)) { + console.error(`Error: Source directory not found: ${source}`) + process.exit(1) + } + + // Ensure parent directory exists + const destParent = dirname(dest) + if (!existsSync(destParent)) { + console.error(`Error: Destination parent directory not found: ${destParent}`) + process.exit(1) + } + + // Copy directory recursively + console.log('Copying playground dist to docs/dist/playground...') + cpSync(source, dest, { recursive: true, force: true }) + console.log('✓ Successfully copied playground to docs/dist/playground') +} catch (error) { + console.error('Error copying playground:', error.message) + process.exit(1) +} diff --git a/tiny-robot b/tiny-robot index 558095a..fcc7cd6 160000 --- a/tiny-robot +++ b/tiny-robot @@ -1 +1 @@ -Subproject commit 558095a424930d99e079e6e1cf4fe8929d48c7b2 +Subproject commit fcc7cd62468f73e4f19856c4bf65be82a62ab71e