mirror of
https://github.com/ZSeven-W/openpencil.git
synced 2026-06-01 03:14:29 +07:00
* fix(docker): support multi-platform builds and fix monorepo paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf(renderer): cache pre-rasterized paragraph images to avoid per-frame glyph rasterization (#76) * fix(canvas): stabilize frame label size during zoom Draw frame labels in screen-space after the viewport transform restore, converting scene coords manually. Previously fontSize=12/zoom fed into Math.ceil caused integer-boundary jumps that made labels flicker during zoom. Also skip shadow rendering while actively zooming for smoother performance. * perf(renderer): cache pre-rasterized paragraph images to avoid per-frame glyph rasterization - Add paraImageCache (SkImage, 128 MB LRU limit) keyed on the same key as paraCache - Use drawImageRect instead of drawParagraph on cache hit, skipping per-frame glyph shaping and rasterization - Fall back to direct drawParagraph only when off-screen surface creation (MakeSurface) fails - Extract _dpr getter to deduplicate device-pixel-ratio resolution logic across draw paths - Evict oldest entries when cache exceeds byte limit; delete SkImage on eviction and dispose() * feat(cli): introduce OpenPencil CLI for terminal control of the design tool - Added a new CLI application under `apps/cli` to manage OpenPencil from the terminal. - Implemented commands for app control (`start`, `stop`, `status`), document operations (`open`, `save`, `get`, `selection`), and design manipulation (`design`, `import`). - Enhanced documentation with usage instructions and platform support details. - Updated build scripts to include CLI compilation and publishing processes. - Introduced a new GitHub Actions workflow for publishing the CLI to npm. - Updated existing workflows to integrate CLI build steps and ensure proper versioning across packages. * docs: update README files to include CLI tool details and multi-platform code export - Added CLI section to README files in multiple languages, detailing commands for terminal control of the design tool. - Included instructions for global installation and usage examples for the CLI. - Expanded documentation on multi-platform code export capabilities from a single `.op` file to various frameworks. - Updated CLAUDE.md to reference the new CLI documentation and its integration with the design tool. * chore(bun.lock): update package dependencies to specific versions - Removed workspace references for several packages in the bun.lock file. - Updated dependencies for `@zseven-w/pen-core`, `@zseven-w/pen-types`, `@zseven-w/pen-codegen`, `@zseven-w/pen-figma`, and `@zseven-w/pen-renderer` to version `0.5.1-beta.1`. - Ensured consistency in dependency management across the project. * fix(docker): add missing CLI package.json to build context The Dockerfile was missing COPY for apps/cli/package.json, causing bun install --frozen-lockfile to fail because the CLI workspace dependency could not be resolved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add unpublish script and enhance CLI publish workflow - Introduced a new `unpublish` script to manage unpublishing of all @zseven-w packages from npm, with options for specific versions, all versions, or deprecation. - Updated the GitHub Actions workflow to check if a version is already published before proceeding with the publish step, ensuring better error handling and preventing conflicts. - Removed the fallback for npm publish commands to fail fast on errors, improving the reliability of the publishing process. * chore(bun.lock): update package versions and configuration - Bumped the configVersion from 0 to 1 in bun.lock. - Updated several package dependencies to their latest versions, including: - @anthropic-ai/claude-agent-sdk to 0.2.81 - @babel/helpers to 7.29.2 - @babel/parser to 7.29.2 - @babel/runtime to 7.29.2 - @csstools/color-helpers to 6.0.2 - @csstools/css-color-parser to 4.0.2 - Ensured consistency in dependency management across the project. * docs: restore Feishu group QR code in Chinese README * chore: update dependencies and add workspace references - Added "h3" package with version "^2.0.1-rc.18" to bun.lock, package.json, and apps/web/package.json. - Updated dependencies in multiple packages to use "workspace:*" for better management and consistency across the project. - Ensured all relevant packages are aligned with the latest workspace structure. * chore: update package versions in bun.lock and package.json - Updated several @tanstack packages to their latest versions, including: - @tanstack/react-devtools to 0.10.0 - @tanstack/react-router to 1.168.1 - @tanstack/react-router-devtools to 1.166.11 - @tanstack/react-router-ssr-query to 1.166.10 - @tanstack/react-start to 1.167.2 - @tanstack/router-plugin to 1.167.1 - Bumped @tanstack/devtools-vite to 0.6.0 in devDependencies. - Mocked 'paper' module in security tests to prevent crashes in jsdom environment. * chore: update CLI and MCP compile scripts to include package aliases - Enhanced the `mcp:compile` and `cli:compile` scripts in `package.json` and `apps/cli/package.json` to include additional package aliases for better module resolution. - This change improves the build process by ensuring that the correct paths are used for various dependencies. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: leinaldo <60176594+leinaldo@users.noreply.github.com> Co-authored-by: Fini <fini.yang@gmail.com>
117 lines
6.4 KiB
JSON
117 lines
6.4 KiB
JSON
{
|
|
"name": "openpencil",
|
|
"version": "0.5.1",
|
|
"description": "The world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.",
|
|
"author": {
|
|
"name": "ZSeven-W",
|
|
"email": "xkayshen@gmail.com"
|
|
},
|
|
"private": true,
|
|
"type": "module",
|
|
"workspaces": [
|
|
"packages/*",
|
|
"apps/*"
|
|
],
|
|
"main": "out/desktop/main.cjs",
|
|
"bin": {
|
|
"openpencil-mcp": "out/mcp-server.cjs"
|
|
},
|
|
"scripts": {
|
|
"dev": "cd apps/web && bun --bun vite dev --port 3000",
|
|
"build": "cd apps/web && bun --bun vite build",
|
|
"preview": "cd apps/web && bun --bun vite preview",
|
|
"test": "cd apps/web && bun --bun vitest run --passWithNoTests",
|
|
"mcp:compile": "cd apps/web && esbuild src/mcp/server.ts --bundle --platform=node --target=node20 --outfile=../../out/mcp-server.cjs --format=cjs --sourcemap --alias:@=src --alias:@zseven-w/pen-types=../../packages/pen-types/src --alias:@zseven-w/pen-core=../../packages/pen-core/src --alias:@zseven-w/pen-codegen=../../packages/pen-codegen/src --alias:@zseven-w/pen-figma=../../packages/pen-figma/src --alias:@zseven-w/pen-renderer=../../packages/pen-renderer/src --alias:@zseven-w/pen-sdk=../../packages/pen-sdk/src --define:import.meta.env={} --external:canvas --external:paper",
|
|
"mcp:dev": "bun run apps/web/src/mcp/server.ts",
|
|
"electron:dev": "bun run apps/desktop/dev.ts",
|
|
"electron:compile": "esbuild apps/desktop/main.ts apps/desktop/preload.ts --bundle --platform=node --target=node20 --outdir=out/desktop --external:electron --format=cjs --out-extension:.js=.cjs --sourcemap",
|
|
"electron:build": "BUILD_TARGET=electron bun --bun run build && bun run electron:compile && bun run mcp:compile && bun run cli:compile && npx electron-builder --config apps/desktop/electron-builder.yml",
|
|
"electron:build:mac-arm64": "BUILD_TARGET=electron bun --bun run build && bun run electron:compile && bun run mcp:compile && bun run cli:compile && npx electron-builder --config apps/desktop/electron-builder.yml --mac --arm64 && if [ -f out/release/latest-mac.yml ]; then mv out/release/latest-mac.yml out/release/latest-mac-arm64.yml; fi",
|
|
"electron:build:mac-x64": "BUILD_TARGET=electron bun --bun run build && bun run electron:compile && bun run mcp:compile && bun run cli:compile && npx electron-builder --config apps/desktop/electron-builder.yml --mac --x64",
|
|
"electron:build:mac-universal": "BUILD_TARGET=electron bun --bun run build && bun run electron:compile && bun run mcp:compile && bun run cli:compile && npx electron-builder --config apps/desktop/electron-builder.yml --mac --arm64 --x64",
|
|
"electron:build:mac-both": "bun run electron:build:mac-arm64 && bun run electron:build:mac-x64",
|
|
"cli:compile": "cd apps/web && esbuild ../cli/src/index.ts --bundle --platform=node --target=node20 --outfile=../cli/dist/openpencil-cli.cjs --format=cjs --sourcemap --alias:@=src --alias:@zseven-w/pen-types=../../packages/pen-types/src --alias:@zseven-w/pen-core=../../packages/pen-core/src --alias:@zseven-w/pen-codegen=../../packages/pen-codegen/src --alias:@zseven-w/pen-figma=../../packages/pen-figma/src --alias:@zseven-w/pen-renderer=../../packages/pen-renderer/src --alias:@zseven-w/pen-sdk=../../packages/pen-sdk/src --define:import.meta.env={} --external:canvas --external:paper",
|
|
"cli:dev": "bun run apps/cli/src/index.ts",
|
|
"publish:beta": "bash scripts/publish-beta.sh",
|
|
"unpublish": "bash scripts/unpublish.sh",
|
|
"bump": "sh -c 'V=$0; [ -z \"$V\" ] && echo \"Usage: bun run bump <version>\" && exit 1; for f in package.json apps/*/package.json packages/*/package.json; do [ -f \"$f\" ] && jq --arg v \"$V\" \".version=\\$v\" \"$f\" > \"$f.tmp\" && mv \"$f.tmp\" \"$f\" && echo \"$f → $V\"; done'"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/claude-agent-sdk": "^0.2.47",
|
|
"@anthropic-ai/sdk": "^0.77.0",
|
|
"h3": "^2.0.1-rc.18",
|
|
"@fontsource-variable/inter": "^5.2.8",
|
|
"@fontsource/dm-sans": "^5.2.8",
|
|
"@fontsource/inter": "^5.2.8",
|
|
"@fontsource/lato": "^5.2.7",
|
|
"@fontsource/montserrat": "^5.2.8",
|
|
"@fontsource/nunito": "^5.2.7",
|
|
"@fontsource/open-sans": "^5.2.7",
|
|
"@fontsource/playfair-display": "^5.2.8",
|
|
"@fontsource/poppins": "^5.2.7",
|
|
"@fontsource/raleway": "^5.2.8",
|
|
"@fontsource/roboto": "^5.2.10",
|
|
"@fontsource/source-sans-3": "^5.2.9",
|
|
"@github/copilot-sdk": "^0.1.32",
|
|
"@iconify-json/feather": "^1.2.1",
|
|
"@iconify-json/lucide": "^1.2.93",
|
|
"@iconify-json/simple-icons": "^1.2.71",
|
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
"@opencode-ai/sdk": "1.2.6",
|
|
"@radix-ui/react-popover": "^1.1.15",
|
|
"@radix-ui/react-select": "^2.2.6",
|
|
"@radix-ui/react-separator": "^1.1.8",
|
|
"@radix-ui/react-slider": "^1.3.6",
|
|
"@radix-ui/react-switch": "^1.2.6",
|
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
"@tailwindcss/vite": "^4.1.18",
|
|
"@tanstack/react-devtools": "0.10.0",
|
|
"@tanstack/react-router": "1.168.1",
|
|
"@tanstack/react-router-devtools": "1.166.11",
|
|
"@tanstack/react-router-ssr-query": "1.166.10",
|
|
"@tanstack/react-start": "1.167.2",
|
|
"@tanstack/router-plugin": "1.167.1",
|
|
"canvaskit-wasm": "^0.40.0",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"electron-updater": "^6.6.2",
|
|
"fzstd": "^0.1.1",
|
|
"html2canvas": "^1.4.1",
|
|
"i18next": "^25.8.14",
|
|
"i18next-browser-languagedetector": "^8.2.1",
|
|
"kiwi-schema": "^0.5.0",
|
|
"lucide-react": "^0.545.0",
|
|
"nanoid": "^5.1.6",
|
|
"nitro": "npm:nitro-nightly@latest",
|
|
"paper": "^0.12.18",
|
|
"rbush": "^4.0.1",
|
|
"react": "^19.2.0",
|
|
"react-dom": "^19.2.0",
|
|
"react-i18next": "^16.5.4",
|
|
"tailwind-merge": "^3.4.1",
|
|
"tailwindcss": "^4.1.18",
|
|
"uzip": "^0.20201231.0",
|
|
"vite-tsconfig-paths": "^5.1.4",
|
|
"zustand": "^5.0.11"
|
|
},
|
|
"devDependencies": {
|
|
"@tanstack/devtools-vite": "0.6.0",
|
|
"@testing-library/dom": "^10.4.0",
|
|
"@testing-library/react": "^16.2.0",
|
|
"@types/node": "^22.10.2",
|
|
"@types/rbush": "^4.0.0",
|
|
"@types/react": "^19.2.0",
|
|
"@types/react-dom": "^19.2.0",
|
|
"@types/uzip": "^0.20201231.2",
|
|
"@vitejs/plugin-react": "^5.0.4",
|
|
"electron": "^35.0.0",
|
|
"electron-builder": "^26.0.0",
|
|
"esbuild": "^0.25.0",
|
|
"graceful-fs": "^4.2.11",
|
|
"jsdom": "^27.0.0",
|
|
"typescript": "^5.7.2",
|
|
"vite": "^7.1.7",
|
|
"vitest": "^3.0.5"
|
|
}
|
|
}
|