@bovinphang/frontend-craft 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +34 -0
- package/CHANGELOG.zh-CN.md +34 -0
- package/README.md +1 -1
- package/README.openclaw.md +99 -43
- package/README.openclaw.zh-CN.md +99 -43
- package/README.zh-CN.md +1 -1
- package/agents/fec-architect.md +70 -70
- package/agents/fec-code-reviewer.md +82 -82
- package/agents/fec-debugger.md +20 -20
- package/agents/fec-design-token-mapper.md +36 -36
- package/agents/fec-doc-updater.md +13 -13
- package/agents/fec-e2e-runner.md +45 -45
- package/agents/fec-figma-implementer.md +59 -59
- package/agents/fec-performance-optimizer.md +128 -128
- package/agents/fec-refactor-cleaner.md +14 -14
- package/agents/fec-security-reviewer.md +66 -67
- package/agents/fec-test-planner.md +27 -27
- package/agents/fec-typescript-reviewer.md +87 -87
- package/agents/fec-ui-checker.md +74 -74
- package/commands/fec-debug.md +19 -19
- package/commands/fec-doc-sync.md +11 -11
- package/commands/fec-init.md +37 -38
- package/commands/fec-plan.md +58 -58
- package/commands/fec-refactor-clean.md +11 -11
- package/commands/fec-review.md +41 -41
- package/commands/fec-scaffold.md +41 -41
- package/commands/fec-tdd.md +13 -13
- package/dist/bin/frontend-craft.js +29 -27
- package/docs/example-prompts.md +3 -0
- package/docs/ja-JP/README.md +1 -1
- package/docs/ko-KR/README.md +1 -1
- package/docs/project-structure.md +13 -5
- package/docs/zh-CN/example-prompts.md +3 -0
- package/docs/zh-CN/project-structure.md +6 -1
- package/docs/zh-TW/README.md +1 -1
- package/localized/zh-CN/agents/fec-architect.md +125 -0
- package/localized/zh-CN/agents/fec-code-reviewer.md +152 -0
- package/localized/zh-CN/agents/fec-debugger.md +44 -0
- package/localized/zh-CN/agents/fec-design-token-mapper.md +75 -0
- package/localized/zh-CN/agents/fec-doc-updater.md +30 -0
- package/localized/zh-CN/agents/fec-e2e-runner.md +107 -0
- package/localized/zh-CN/agents/fec-figma-implementer.md +104 -0
- package/localized/zh-CN/agents/fec-performance-optimizer.md +293 -0
- package/localized/zh-CN/agents/fec-refactor-cleaner.md +32 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +116 -0
- package/localized/zh-CN/agents/fec-test-planner.md +50 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +142 -0
- package/localized/zh-CN/agents/fec-ui-checker.md +120 -0
- package/localized/zh-CN/commands/fec-debug.md +30 -0
- package/localized/zh-CN/commands/fec-doc-sync.md +19 -0
- package/localized/zh-CN/commands/fec-init.md +70 -0
- package/localized/zh-CN/commands/fec-plan.md +94 -0
- package/localized/zh-CN/commands/fec-refactor-clean.md +19 -0
- package/localized/zh-CN/commands/fec-review.md +66 -0
- package/localized/zh-CN/commands/fec-scaffold.md +205 -0
- package/localized/zh-CN/commands/fec-tdd.md +21 -0
- package/localized/zh-CN/skills/TEMPLATE.md +155 -0
- package/localized/zh-CN/skills/eval_queries.json +1013 -0
- package/localized/zh-CN/skills/fec-accessibility-check/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/report-template.md +23 -0
- package/localized/zh-CN/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
- package/localized/zh-CN/skills/fec-alchemy/SKILL.md +74 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/absorption-plan-template.md +47 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/intake-template.md +55 -0
- package/localized/zh-CN/skills/fec-alchemy/assets/review-checklist.md +31 -0
- package/localized/zh-CN/skills/fec-alchemy/references/methodology.md +94 -0
- package/localized/zh-CN/skills/fec-alchemy/references/originality-and-licensing.md +57 -0
- package/localized/zh-CN/skills/fec-api-integration/SKILL.md +78 -0
- package/localized/zh-CN/skills/fec-api-integration/references/integration-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-browser-storage/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-browser-storage/references/storage-patterns.md +65 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/SKILL.md +66 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +143 -0
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +29 -0
- package/localized/zh-CN/skills/fec-component-testing/SKILL.md +119 -0
- package/localized/zh-CN/skills/fec-data-fetching/SKILL.md +62 -0
- package/localized/zh-CN/skills/fec-data-fetching/references/query-patterns.md +103 -0
- package/localized/zh-CN/skills/fec-debug-framework/SKILL.md +157 -0
- package/localized/zh-CN/skills/fec-debug-framework/references/report-template.md +58 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
- package/localized/zh-CN/skills/fec-doc-sync/SKILL.md +39 -0
- package/localized/zh-CN/skills/fec-drawio-studio/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/brand-icons.json +878 -0
- package/localized/zh-CN/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/data-residency.md +27 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/diagram-patterns.md +60 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/layout-and-export.md +72 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
- package/localized/zh-CN/skills/fec-drawio-studio/references/xml-and-mermaid.md +58 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-lint.mjs +205 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/shape-query.mjs +121 -0
- package/localized/zh-CN/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
- package/localized/zh-CN/skills/fec-drawio-studio/styles/schema.json +112 -0
- package/localized/zh-CN/skills/fec-e2e-testing/SKILL.md +42 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
- package/localized/zh-CN/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
- package/localized/zh-CN/skills/fec-form-handling/SKILL.md +76 -0
- package/localized/zh-CN/skills/fec-form-handling/references/advanced-form-patterns.md +101 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +80 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/localized/zh-CN/skills/fec-image-generation/references/artifact-routing.md +80 -0
- package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +74 -0
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +431 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
- package/localized/zh-CN/skills/fec-implement-from-design/SKILL.md +129 -0
- package/localized/zh-CN/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/SKILL.md +46 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
- package/localized/zh-CN/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
- package/localized/zh-CN/skills/fec-list-virtualization/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-list-virtualization/references/virtualization-patterns.md +80 -0
- package/localized/zh-CN/skills/fec-monorepo-project-standard/SKILL.md +142 -0
- package/localized/zh-CN/skills/fec-motion-interaction/SKILL.md +73 -0
- package/localized/zh-CN/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
- package/localized/zh-CN/skills/fec-nextjs-project-standard/SKILL.md +123 -0
- package/localized/zh-CN/skills/fec-nuxt-project-standard/SKILL.md +122 -0
- package/localized/zh-CN/skills/fec-performance-optimization/SKILL.md +80 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
- package/localized/zh-CN/skills/fec-performance-optimization/references/report-template.md +59 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
- package/localized/zh-CN/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
- package/localized/zh-CN/skills/fec-react-project-standard/SKILL.md +91 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
- package/localized/zh-CN/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
- package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +51 -0
- package/localized/zh-CN/skills/fec-refactor-clean/references/report-template.md +42 -0
- package/localized/zh-CN/skills/fec-responsive-layout/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-responsive-layout/references/responsive-layout-patterns.md +70 -0
- package/localized/zh-CN/skills/fec-route-protection/SKILL.md +135 -0
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +38 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +27 -0
- package/localized/zh-CN/skills/fec-security-review/references/security-checklist.md +64 -0
- package/localized/zh-CN/skills/fec-source-driven-development/SKILL.md +87 -0
- package/localized/zh-CN/skills/fec-state-management/SKILL.md +140 -0
- package/localized/zh-CN/skills/fec-state-management/references/state-patterns.md +109 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/SKILL.md +37 -0
- package/localized/zh-CN/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
- package/localized/zh-CN/skills/fec-svg-animation/SKILL.md +148 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/SKILL.md +34 -0
- package/localized/zh-CN/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +59 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-testing-strategy/SKILL.md +45 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/SKILL.md +54 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety-patterns.md +102 -0
- package/localized/zh-CN/skills/fec-typescript-project-standard/references/type-safety.md +148 -0
- package/localized/zh-CN/skills/fec-ui-design/SKILL.md +108 -0
- package/localized/zh-CN/skills/fec-ui-design/data/product-rules.json +231 -0
- package/localized/zh-CN/skills/fec-ui-design/data/stack-ui-rules.json +146 -0
- package/localized/zh-CN/skills/fec-ui-design/data/style-archetypes.json +373 -0
- package/localized/zh-CN/skills/fec-ui-design/data/ux-quality-rules.json +203 -0
- package/localized/zh-CN/skills/fec-ui-design/references/design-intelligence.md +97 -0
- package/localized/zh-CN/skills/fec-ui-design/references/master-page-overrides.md +30 -0
- package/localized/zh-CN/skills/fec-ui-design/references/pre-delivery-checklist.md +39 -0
- package/localized/zh-CN/skills/fec-ui-design/scripts/design-system.mjs +648 -0
- package/localized/zh-CN/skills/fec-validation-fix/SKILL.md +51 -0
- package/localized/zh-CN/skills/fec-validation-fix/references/report-template.md +43 -0
- package/localized/zh-CN/skills/fec-vite-project-standard/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/SKILL.md +58 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +162 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-project-structure.md +176 -0
- package/localized/zh-CN/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/SKILL.md +61 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/content-plan.md +38 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/references/theme-system.md +36 -0
- package/localized/zh-CN/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
- package/localized/zh-CN/skills/fec-web-workers/SKILL.md +35 -0
- package/localized/zh-CN/skills/fec-web-workers/references/advanced-workers.md +54 -0
- package/localized/zh-CN/skills/fec-web-workers/references/basic-worker.md +67 -0
- package/localized/zh-CN/skills/metadata.json +1646 -0
- package/localized/zh-CN/skills/relations.json +755 -0
- package/localized/zh-CN/templates/claude/CLAUDE.md +106 -0
- package/localized/zh-CN/templates/claude/settings.json +62 -0
- package/localized/zh-CN/templates/codex/AGENTS.md +105 -0
- package/localized/zh-CN/templates/codex/config.toml +32 -0
- package/localized/zh-CN/templates/openclaw/AGENTS.md +101 -0
- package/localized/zh-CN/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
- package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +54 -0
- package/localized/zh-CN/templates/shared/rules/fec-api-layer.md +99 -0
- package/localized/zh-CN/templates/shared/rules/fec-ci-cd.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-code-comments.md +33 -0
- package/localized/zh-CN/templates/shared/rules/fec-design-system.md +72 -0
- package/localized/zh-CN/templates/shared/rules/fec-error-handling.md +56 -0
- package/localized/zh-CN/templates/shared/rules/fec-git-conventions.md +73 -0
- package/localized/zh-CN/templates/shared/rules/fec-i18n.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-naming-conventions.md +120 -0
- package/localized/zh-CN/templates/shared/rules/fec-performance.md +101 -0
- package/localized/zh-CN/templates/shared/rules/fec-react.md +82 -0
- package/localized/zh-CN/templates/shared/rules/fec-refactoring.md +47 -0
- package/localized/zh-CN/templates/shared/rules/fec-rendering-patterns.md +40 -0
- package/localized/zh-CN/templates/shared/rules/fec-responsive-design.md +50 -0
- package/localized/zh-CN/templates/shared/rules/fec-source-driven-development.md +31 -0
- package/localized/zh-CN/templates/shared/rules/fec-state-management.md +60 -0
- package/localized/zh-CN/templates/shared/rules/fec-testing.md +98 -0
- package/localized/zh-CN/templates/shared/rules/fec-typescript.md +112 -0
- package/localized/zh-CN/templates/shared/rules/fec-vue.md +64 -0
- package/localized/zh-CN/templates/shared/rules/fec-working-modes.md +50 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -2
- package/skills/TEMPLATE.md +74 -74
- package/skills/eval_queries.json +678 -678
- package/skills/fec-accessibility-check/SKILL.md +21 -21
- package/skills/fec-accessibility-check/references/report-template.md +12 -12
- package/skills/fec-accessibility-check/references/screen-reader-testing.md +24 -24
- package/skills/fec-alchemy/SKILL.md +50 -50
- package/skills/fec-alchemy/assets/absorption-plan-template.md +32 -32
- package/skills/fec-alchemy/assets/intake-template.md +55 -55
- package/skills/fec-alchemy/assets/review-checklist.md +23 -23
- package/skills/fec-alchemy/references/methodology.md +66 -66
- package/skills/fec-alchemy/references/originality-and-licensing.md +42 -42
- package/skills/fec-api-integration/SKILL.md +61 -61
- package/skills/fec-api-integration/references/integration-patterns.md +30 -30
- package/skills/fec-backend-requirements-handoff/SKILL.md +25 -25
- package/skills/fec-browser-storage/SKILL.md +16 -16
- package/skills/fec-browser-storage/references/storage-patterns.md +16 -16
- package/skills/fec-canvas-threejs/SKILL.md +21 -21
- package/skills/fec-canvas-threejs/references/rendering-patterns.md +10 -10
- package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +37 -37
- package/skills/fec-code-review/SKILL.md +94 -94
- package/skills/fec-code-review/references/report-template.md +13 -13
- package/skills/fec-component-testing/SKILL.md +39 -39
- package/skills/fec-data-fetching/SKILL.md +16 -16
- package/skills/fec-data-fetching/references/query-patterns.md +27 -27
- package/skills/fec-debug-framework/SKILL.md +95 -95
- package/skills/fec-debug-framework/references/report-template.md +34 -34
- package/skills/fec-dependency-upgrade/SKILL.md +17 -17
- package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +31 -31
- package/skills/fec-doc-sync/SKILL.md +23 -23
- package/skills/fec-drawio-studio/SKILL.md +42 -38
- package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +1 -1
- package/skills/fec-drawio-studio/data/shape-index.json +83570 -0
- package/skills/fec-drawio-studio/references/diagram-patterns.md +19 -0
- package/skills/fec-drawio-studio/references/flowchart-quality.md +49 -0
- package/skills/fec-drawio-studio/references/layout-and-export.md +18 -3
- package/skills/fec-drawio-studio/references/xml-and-mermaid.md +5 -1
- package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +62 -0
- package/skills/fec-drawio-studio/scripts/drawio-export.mjs +134 -0
- package/skills/fec-drawio-studio/scripts/shape-query.mjs +55 -15
- package/skills/fec-e2e-testing/SKILL.md +24 -24
- package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +20 -20
- package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +10 -10
- package/skills/fec-e2e-testing/references/e2e-visual-regression.md +17 -17
- package/skills/fec-e2e-testing/references/playwright-patterns.md +6 -6
- package/skills/fec-form-handling/SKILL.md +21 -21
- package/skills/fec-form-handling/references/advanced-form-patterns.md +41 -41
- package/skills/fec-image-generation/SKILL.md +54 -29
- package/skills/fec-image-generation/assets/interactive-diagram.html +371 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +33 -2
- package/skills/fec-image-generation/references/html-technical-diagrams.md +236 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +364 -0
- package/skills/fec-image-generation/scripts/interactive-diagram-server.mjs +654 -0
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +1397 -0
- package/skills/fec-implement-from-design/SKILL.md +81 -81
- package/skills/fec-implement-from-design/references/design-plan-template.md +16 -16
- package/skills/fec-legacy-to-modern-migration/SKILL.md +29 -29
- package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +81 -81
- package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +37 -37
- package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +31 -31
- package/skills/fec-legacy-web-standard/SKILL.md +17 -17
- package/skills/fec-legacy-web-standard/references/legacy-patterns.md +16 -16
- package/skills/fec-list-virtualization/SKILL.md +16 -16
- package/skills/fec-list-virtualization/references/virtualization-patterns.md +31 -31
- package/skills/fec-monorepo-project-standard/SKILL.md +52 -52
- package/skills/fec-motion-interaction/SKILL.md +51 -51
- package/skills/fec-motion-interaction/references/motion-patterns.md +11 -11
- package/skills/fec-nextjs-project-standard/SKILL.md +64 -64
- package/skills/fec-nuxt-project-standard/SKILL.md +57 -57
- package/skills/fec-performance-optimization/SKILL.md +54 -54
- package/skills/fec-performance-optimization/references/framework-performance-patterns.md +23 -23
- package/skills/fec-performance-optimization/references/report-template.md +31 -31
- package/skills/fec-pwa-implementation/SKILL.md +17 -17
- package/skills/fec-pwa-implementation/references/manifest-and-icons.md +12 -12
- package/skills/fec-pwa-implementation/references/service-worker-workbox.md +13 -13
- package/skills/fec-react-project-standard/SKILL.md +72 -72
- package/skills/fec-react-project-standard/references/react-performance-patterns.md +28 -28
- package/skills/fec-react-project-standard/references/react-project-structure.md +112 -112
- package/skills/fec-react-project-standard/references/react-quality-patterns.md +72 -72
- package/skills/fec-react-project-standard/references/react-runtime-patterns.md +94 -94
- package/skills/fec-refactor-clean/SKILL.md +30 -30
- package/skills/fec-refactor-clean/references/report-template.md +23 -23
- package/skills/fec-responsive-layout/SKILL.md +17 -17
- package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +37 -37
- package/skills/fec-route-protection/SKILL.md +26 -26
- package/skills/fec-security-review/SKILL.md +20 -20
- package/skills/fec-security-review/references/report-template.md +12 -12
- package/skills/fec-security-review/references/security-checklist.md +27 -27
- package/skills/fec-source-driven-development/SKILL.md +59 -59
- package/skills/fec-state-management/SKILL.md +34 -34
- package/skills/fec-state-management/references/state-patterns.md +19 -19
- package/skills/fec-storybook-component-doc/SKILL.md +19 -19
- package/skills/fec-storybook-component-doc/references/story-patterns.md +12 -12
- package/skills/fec-svg-animation/SKILL.md +32 -32
- package/skills/fec-tailwind-design-system/SKILL.md +17 -17
- package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +36 -36
- package/skills/fec-tdd-workflow/SKILL.md +28 -28
- package/skills/fec-testing-strategy/SKILL.md +29 -29
- package/skills/fec-typescript-project-standard/SKILL.md +38 -38
- package/skills/fec-typescript-project-standard/references/type-safety-patterns.md +20 -20
- package/skills/fec-typescript-project-standard/references/type-safety.md +18 -18
- package/skills/fec-ui-design/SKILL.md +90 -90
- package/skills/fec-ui-design/references/design-intelligence.md +61 -61
- package/skills/fec-ui-design/references/master-page-overrides.md +15 -15
- package/skills/fec-ui-design/references/pre-delivery-checklist.md +38 -38
- package/skills/fec-validation-fix/SKILL.md +26 -26
- package/skills/fec-validation-fix/references/report-template.md +25 -25
- package/skills/fec-vite-project-standard/SKILL.md +39 -39
- package/skills/fec-vue3-project-standard/SKILL.md +38 -38
- package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +36 -36
- package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +8 -8
- package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +112 -112
- package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +74 -74
- package/skills/fec-web-video-presentation/SKILL.md +33 -33
- package/skills/fec-web-workers/SKILL.md +16 -16
- package/skills/fec-web-workers/references/advanced-workers.md +13 -13
- package/skills/fec-web-workers/references/basic-worker.md +8 -8
- package/skills/metadata.json +121 -115
- package/skills/relations.json +4 -0
- package/templates/claude/CLAUDE.md +60 -60
- package/templates/codex/AGENTS.md +76 -76
- package/templates/codex/config.toml +4 -4
- package/templates/openclaw/AGENTS.md +68 -68
- package/templates/openclaw/OPENCLAW-CONFIG.md +8 -8
- package/templates/shared/rules/fec-agent-workflow.md +40 -40
- package/templates/shared/rules/fec-api-layer.md +52 -52
- package/templates/shared/rules/fec-ci-cd.md +29 -29
- package/templates/shared/rules/fec-code-comments.md +22 -22
- package/templates/shared/rules/fec-design-system.md +53 -53
- package/templates/shared/rules/fec-error-handling.md +40 -40
- package/templates/shared/rules/fec-git-conventions.md +42 -42
- package/templates/shared/rules/fec-i18n.md +48 -48
- package/templates/shared/rules/fec-naming-conventions.md +91 -91
- package/templates/shared/rules/fec-performance.md +78 -78
- package/templates/shared/rules/fec-react.md +58 -58
- package/templates/shared/rules/fec-refactoring.md +34 -34
- package/templates/shared/rules/fec-rendering-patterns.md +36 -36
- package/templates/shared/rules/fec-responsive-design.md +37 -37
- package/templates/shared/rules/fec-source-driven-development.md +22 -22
- package/templates/shared/rules/fec-state-management.md +56 -56
- package/templates/shared/rules/fec-testing.md +64 -64
- package/templates/shared/rules/fec-typescript.md +75 -75
- package/templates/shared/rules/fec-vue.md +42 -42
- package/templates/shared/rules/fec-working-modes.md +34 -34
- package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// @ts-check
|
|
3
|
+
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { pathToFileURL } from "node:url";
|
|
9
|
+
|
|
10
|
+
const SUPPORTED_FORMATS = new Set(["svg", "png", "jpg", "jpeg"]);
|
|
11
|
+
const JPEG_FORMATS = new Set(["jpg", "jpeg"]);
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const args = parseArgs(process.argv.slice(2));
|
|
15
|
+
const inputPath = path.resolve(requireArg(args, "input"));
|
|
16
|
+
const format = requireArg(args, "format").toLowerCase();
|
|
17
|
+
const scale = args.scale === undefined ? 2 : parseScale(args.scale);
|
|
18
|
+
const background = args.background ?? "#0f172a";
|
|
19
|
+
|
|
20
|
+
if (!SUPPORTED_FORMATS.has(format)) {
|
|
21
|
+
throw usageError(`Unsupported --format "${format}". Expected svg, png, jpg, or jpeg.`);
|
|
22
|
+
}
|
|
23
|
+
if (!fs.existsSync(inputPath)) {
|
|
24
|
+
throw usageError(`Input file does not exist: ${inputPath}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const svg = extractSvg(inputPath);
|
|
28
|
+
const outputPath = path.resolve(resolveOutputPath(inputPath, format, args.output));
|
|
29
|
+
|
|
30
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
31
|
+
if (format === "svg") {
|
|
32
|
+
fs.writeFileSync(outputPath, `${svg.trim()}\n`, "utf8");
|
|
33
|
+
} else {
|
|
34
|
+
exportRaster(svg, outputPath, format, scale, background);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
console.log(`Exported ${format.toUpperCase()} diagram: ${outputPath}`);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
40
|
+
process.exitCode = 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param {string[]} argv
|
|
45
|
+
* @returns {Record<string, string | undefined>}
|
|
46
|
+
*/
|
|
47
|
+
function parseArgs(argv) {
|
|
48
|
+
/** @type {Record<string, string | undefined>} */
|
|
49
|
+
const parsed = {};
|
|
50
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
51
|
+
const token = argv[index];
|
|
52
|
+
if (!token.startsWith("--")) {
|
|
53
|
+
throw usageError(`Unexpected positional argument "${token}".`);
|
|
54
|
+
}
|
|
55
|
+
const key = token.slice(2);
|
|
56
|
+
const value = argv[index + 1];
|
|
57
|
+
if (!value || value.startsWith("--")) {
|
|
58
|
+
throw usageError(`Missing value for --${key}.`);
|
|
59
|
+
}
|
|
60
|
+
parsed[key] = value;
|
|
61
|
+
index += 1;
|
|
62
|
+
}
|
|
63
|
+
return parsed;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @param {Record<string, string | undefined>} args
|
|
68
|
+
* @param {string} key
|
|
69
|
+
*/
|
|
70
|
+
function requireArg(args, key) {
|
|
71
|
+
const value = args[key];
|
|
72
|
+
if (!value) throw usageError(`Missing required --${key}.`);
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @param {string} value
|
|
78
|
+
*/
|
|
79
|
+
function parseScale(value) {
|
|
80
|
+
const scale = Number(value);
|
|
81
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
82
|
+
throw usageError("--scale must be a positive number.");
|
|
83
|
+
}
|
|
84
|
+
return scale;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @param {string} inputPath
|
|
89
|
+
* @param {string} format
|
|
90
|
+
* @param {string | undefined} output
|
|
91
|
+
*/
|
|
92
|
+
function resolveOutputPath(inputPath, format, output) {
|
|
93
|
+
if (output) return output;
|
|
94
|
+
const extension = JPEG_FORMATS.has(format) ? ".jpg" : `.${format}`;
|
|
95
|
+
return inputPath.replace(/\.[^.\\/]+$/, "") + extension;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @param {string} inputPath
|
|
100
|
+
*/
|
|
101
|
+
function extractSvg(inputPath) {
|
|
102
|
+
const content = fs.readFileSync(inputPath, "utf8");
|
|
103
|
+
if (inputPath.toLowerCase().endsWith(".svg")) {
|
|
104
|
+
if (!/<svg[\s>]/i.test(content)) {
|
|
105
|
+
throw usageError("SVG input does not contain an <svg> root.");
|
|
106
|
+
}
|
|
107
|
+
return content;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const svgStart = content.search(/<svg[\s>]/i);
|
|
111
|
+
if (svgStart === -1) {
|
|
112
|
+
throw usageError("HTML input does not contain an inline <svg> element.");
|
|
113
|
+
}
|
|
114
|
+
const afterStart = content.slice(svgStart);
|
|
115
|
+
const svgEnd = afterStart.search(/<\/svg>/i);
|
|
116
|
+
if (svgEnd === -1) {
|
|
117
|
+
throw usageError("HTML input contains an <svg> start tag without a closing </svg>.");
|
|
118
|
+
}
|
|
119
|
+
return afterStart.slice(0, svgEnd + "</svg>".length);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @param {string} svg
|
|
124
|
+
* @param {string} outputPath
|
|
125
|
+
* @param {string} format
|
|
126
|
+
* @param {number} scale
|
|
127
|
+
* @param {string} background
|
|
128
|
+
*/
|
|
129
|
+
function exportRaster(svg, outputPath, format, scale, background) {
|
|
130
|
+
const browser = findBrowser();
|
|
131
|
+
if (!browser) {
|
|
132
|
+
throw usageError(
|
|
133
|
+
"PNG/JPG export requires a local Chromium browser (Chrome, Edge, Chromium, Brave, or Vivaldi) because Node.js has no built-in SVG rasterizer. Export SVG instead, or install a Chromium browser and rerun this command.",
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "fec-diagram-export-"));
|
|
138
|
+
const htmlPath = path.join(tempDir, "diagram.html");
|
|
139
|
+
const screenshotPath = path.join(tempDir, "diagram.png");
|
|
140
|
+
const { width, height } = measureSvg(svg);
|
|
141
|
+
const viewportWidth = Math.ceil(width * scale);
|
|
142
|
+
const viewportHeight = Math.ceil(height * scale);
|
|
143
|
+
|
|
144
|
+
try {
|
|
145
|
+
fs.writeFileSync(htmlPath, renderScreenshotHtml(svg, width, height, scale, background), "utf8");
|
|
146
|
+
|
|
147
|
+
const result = spawnSync(browser, [
|
|
148
|
+
"--headless=new",
|
|
149
|
+
"--disable-gpu",
|
|
150
|
+
"--hide-scrollbars",
|
|
151
|
+
`--window-size=${viewportWidth},${viewportHeight}`,
|
|
152
|
+
`--screenshot=${screenshotPath}`,
|
|
153
|
+
pathToFileURL(htmlPath).href,
|
|
154
|
+
], {
|
|
155
|
+
encoding: "utf8",
|
|
156
|
+
timeout: 30000,
|
|
157
|
+
windowsHide: true,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
if (result.status !== 0 || !fs.existsSync(screenshotPath)) {
|
|
161
|
+
throw usageError(`Browser raster export failed: ${result.stderr || result.stdout || `exit code ${result.status}`}`.trim());
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (JPEG_FORMATS.has(format)) {
|
|
165
|
+
convertPngToJpeg(screenshotPath, outputPath);
|
|
166
|
+
} else {
|
|
167
|
+
fs.copyFileSync(screenshotPath, outputPath);
|
|
168
|
+
}
|
|
169
|
+
} finally {
|
|
170
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @param {string} pngPath
|
|
176
|
+
* @param {string} outputPath
|
|
177
|
+
*/
|
|
178
|
+
function convertPngToJpeg(pngPath, outputPath) {
|
|
179
|
+
const converters = [
|
|
180
|
+
() => convertWithMagick(pngPath, outputPath),
|
|
181
|
+
() => convertWithFfmpeg(pngPath, outputPath),
|
|
182
|
+
() => process.platform === "win32" ? convertWithPowerShell(pngPath, outputPath) : false,
|
|
183
|
+
() => process.platform === "darwin" ? convertWithSips(pngPath, outputPath) : false,
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
for (const convert of converters) {
|
|
187
|
+
try {
|
|
188
|
+
if (convert() && fs.existsSync(outputPath) && fs.statSync(outputPath).size > 0) return;
|
|
189
|
+
} catch {
|
|
190
|
+
// Try the next system converter.
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
throw usageError("JPG/JPEG export needs a local image converter after Chromium captures the SVG. Install ImageMagick, FFmpeg, macOS sips, or use SVG/PNG output.");
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @param {string} pngPath
|
|
199
|
+
* @param {string} outputPath
|
|
200
|
+
*/
|
|
201
|
+
function convertWithMagick(pngPath, outputPath) {
|
|
202
|
+
for (const command of ["magick", "convert"]) {
|
|
203
|
+
const result = spawnSync(command, [pngPath, "-background", "white", "-alpha", "remove", "-quality", "95", outputPath], {
|
|
204
|
+
encoding: "utf8",
|
|
205
|
+
timeout: 15000,
|
|
206
|
+
windowsHide: true,
|
|
207
|
+
});
|
|
208
|
+
if (result.status === 0) return true;
|
|
209
|
+
}
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @param {string} pngPath
|
|
215
|
+
* @param {string} outputPath
|
|
216
|
+
*/
|
|
217
|
+
function convertWithFfmpeg(pngPath, outputPath) {
|
|
218
|
+
const result = spawnSync("ffmpeg", ["-y", "-i", pngPath, "-q:v", "2", outputPath], {
|
|
219
|
+
encoding: "utf8",
|
|
220
|
+
timeout: 15000,
|
|
221
|
+
windowsHide: true,
|
|
222
|
+
});
|
|
223
|
+
return result.status === 0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @param {string} pngPath
|
|
228
|
+
* @param {string} outputPath
|
|
229
|
+
*/
|
|
230
|
+
function convertWithPowerShell(pngPath, outputPath) {
|
|
231
|
+
const script = [
|
|
232
|
+
"Add-Type -AssemblyName System.Drawing",
|
|
233
|
+
`$img = [System.Drawing.Image]::FromFile(${quotePowerShell(pngPath)})`,
|
|
234
|
+
"$bmp = New-Object System.Drawing.Bitmap $img.Width, $img.Height",
|
|
235
|
+
"$graphics = [System.Drawing.Graphics]::FromImage($bmp)",
|
|
236
|
+
"$graphics.Clear([System.Drawing.Color]::White)",
|
|
237
|
+
"$graphics.DrawImage($img, 0, 0, $img.Width, $img.Height)",
|
|
238
|
+
`$bmp.Save(${quotePowerShell(outputPath)}, [System.Drawing.Imaging.ImageFormat]::Jpeg)`,
|
|
239
|
+
"$graphics.Dispose(); $bmp.Dispose(); $img.Dispose()",
|
|
240
|
+
].join("; ");
|
|
241
|
+
const result = spawnSync("powershell", ["-NoProfile", "-Command", script], {
|
|
242
|
+
encoding: "utf8",
|
|
243
|
+
timeout: 15000,
|
|
244
|
+
windowsHide: true,
|
|
245
|
+
});
|
|
246
|
+
return result.status === 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @param {string} pngPath
|
|
251
|
+
* @param {string} outputPath
|
|
252
|
+
*/
|
|
253
|
+
function convertWithSips(pngPath, outputPath) {
|
|
254
|
+
fs.copyFileSync(pngPath, outputPath);
|
|
255
|
+
const result = spawnSync("sips", ["-s", "format", "jpeg", outputPath, "--out", outputPath], {
|
|
256
|
+
encoding: "utf8",
|
|
257
|
+
timeout: 15000,
|
|
258
|
+
});
|
|
259
|
+
return result.status === 0;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function findBrowser() {
|
|
263
|
+
const envBrowser = process.env.CHROME_PATH || process.env.EDGE_PATH || process.env.BROWSER;
|
|
264
|
+
const candidates = [
|
|
265
|
+
envBrowser,
|
|
266
|
+
process.platform === "win32" ? "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" : undefined,
|
|
267
|
+
process.platform === "win32" ? "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" : undefined,
|
|
268
|
+
process.platform === "win32" ? "C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe" : undefined,
|
|
269
|
+
process.platform === "win32" ? "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" : undefined,
|
|
270
|
+
process.platform === "darwin" ? "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" : undefined,
|
|
271
|
+
process.platform === "darwin" ? "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" : undefined,
|
|
272
|
+
"google-chrome",
|
|
273
|
+
"google-chrome-stable",
|
|
274
|
+
"chromium",
|
|
275
|
+
"chromium-browser",
|
|
276
|
+
"microsoft-edge",
|
|
277
|
+
"msedge",
|
|
278
|
+
"brave-browser",
|
|
279
|
+
"vivaldi",
|
|
280
|
+
].filter(Boolean);
|
|
281
|
+
|
|
282
|
+
for (const candidate of candidates) {
|
|
283
|
+
if (typeof candidate !== "string") continue;
|
|
284
|
+
if (path.isAbsolute(candidate) && fs.existsSync(candidate)) return candidate;
|
|
285
|
+
if (!path.isAbsolute(candidate)) {
|
|
286
|
+
const result = spawnSync(candidate, ["--version"], { encoding: "utf8", timeout: 5000, windowsHide: true });
|
|
287
|
+
if (result.status === 0) return candidate;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* @param {string} value
|
|
295
|
+
*/
|
|
296
|
+
function quotePowerShell(value) {
|
|
297
|
+
return `'${value.replace(/'/g, "''")}'`;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* @param {string} svg
|
|
302
|
+
*/
|
|
303
|
+
function measureSvg(svg) {
|
|
304
|
+
const openTag = svg.match(/<svg\b[^>]*>/i)?.[0] ?? "";
|
|
305
|
+
const width = numberAttr(openTag, "width");
|
|
306
|
+
const height = numberAttr(openTag, "height");
|
|
307
|
+
if (width && height) return { width, height };
|
|
308
|
+
|
|
309
|
+
const viewBox = openTag.match(/\bviewBox=(["'])(.*?)\1/i)?.[2]?.trim().split(/\s+/).map(Number);
|
|
310
|
+
if (viewBox && viewBox.length === 4 && viewBox.every(Number.isFinite)) {
|
|
311
|
+
return { width: viewBox[2], height: viewBox[3] };
|
|
312
|
+
}
|
|
313
|
+
return { width: 1280, height: 720 };
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* @param {string} tag
|
|
318
|
+
* @param {string} name
|
|
319
|
+
*/
|
|
320
|
+
function numberAttr(tag, name) {
|
|
321
|
+
const value = tag.match(new RegExp(`\\b${name}=(["'])(.*?)\\1`, "i"))?.[2];
|
|
322
|
+
if (!value) return null;
|
|
323
|
+
const number = Number.parseFloat(value);
|
|
324
|
+
return Number.isFinite(number) && number > 0 ? number : null;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @param {string} svg
|
|
329
|
+
* @param {number} width
|
|
330
|
+
* @param {number} height
|
|
331
|
+
* @param {number} scale
|
|
332
|
+
* @param {string} background
|
|
333
|
+
*/
|
|
334
|
+
function renderScreenshotHtml(svg, width, height, scale, background) {
|
|
335
|
+
return `<!doctype html>
|
|
336
|
+
<html lang="en">
|
|
337
|
+
<head>
|
|
338
|
+
<meta charset="utf-8">
|
|
339
|
+
<style>
|
|
340
|
+
html, body {
|
|
341
|
+
margin: 0;
|
|
342
|
+
width: ${Math.ceil(width * scale)}px;
|
|
343
|
+
height: ${Math.ceil(height * scale)}px;
|
|
344
|
+
overflow: hidden;
|
|
345
|
+
background: ${background};
|
|
346
|
+
}
|
|
347
|
+
svg {
|
|
348
|
+
display: block;
|
|
349
|
+
width: ${Math.ceil(width * scale)}px;
|
|
350
|
+
height: ${Math.ceil(height * scale)}px;
|
|
351
|
+
}
|
|
352
|
+
</style>
|
|
353
|
+
</head>
|
|
354
|
+
<body>${svg}</body>
|
|
355
|
+
</html>
|
|
356
|
+
`;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @param {string} message
|
|
361
|
+
*/
|
|
362
|
+
function usageError(message) {
|
|
363
|
+
return new Error(message);
|
|
364
|
+
}
|