Skip to content
Merged
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
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(/(?<!:)\/\/+/g, '/') + store.serialize(), '_blank')
}
})
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"version": "0.1.0",
"scripts": {
"dev": "cross-env VP_MODE=development vitepress dev",
"prebuild": "pnpm -F @opentiny/genui-sdk-core build && pnpm -F @opentiny/genui-sdk-angular build:element",
"prebuild": "pnpm -F @opentiny/genui-sdk-core build && pnpm -F @opentiny/genui-sdk-angular build:element && pnpm build:playground",
"build": "cross-env VP_MODE=production NODE_OPTIONS=\"--max-old-space-size=8192\" vitepress build",
"build:playground": "cross-env PLAYGROUND_BASE=\"/tiny-robot/playground\" VITE_PLAYGROUND_SHARE_PATH=\"/tiny-robot/playground/\" pnpm -F robot-root build:playground",
"postbuild": "node scripts/copy-playground.js tiny-robot/packages/playground/dist dist/tiny-robot/playground",
"preview": "vitepress preview",
"postinstall": "pnpm -F robot-root build"
},
Expand Down
39 changes: 39 additions & 0 deletions scripts/copy-playground.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { cpSync, existsSync } from 'node:fs'
import { resolve, dirname } from 'node:path'

// Get command line arguments
const args = process.argv.slice(2)

if (args.length < 2) {
console.error('Usage: node copy-playground.js <source> <dest>')
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)
}
2 changes: 1 addition & 1 deletion tiny-robot
Submodule tiny-robot updated 176 files
Loading