@playcraft/cli 0.1.51 → 0.1.53-beta
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/README.md +62 -3
- package/SKILLS_REGISTRY.md +149 -0
- package/dist/agent/local-backend.js +1 -1
- package/dist/auth/account-activation.js +157 -0
- package/dist/auth/messages.js +30 -0
- package/dist/cli-root-help.js +2 -0
- package/dist/commands/build-all.js +5 -19
- package/dist/commands/build-temp.js +26 -0
- package/dist/commands/build.js +15 -28
- package/dist/commands/create.js +26 -33
- package/dist/commands/login.js +84 -42
- package/dist/commands/platform-skills.generated.js +19 -0
- package/dist/commands/playable.js +53 -0
- package/dist/commands/preview-runtime.js +21 -0
- package/dist/commands/skills.js +4 -0
- package/dist/commands/tools-3d.js +11 -0
- package/dist/commands/tools-batch.js +113 -0
- package/dist/commands/tools-generation.js +6 -0
- package/dist/commands/tools.js +2 -0
- package/dist/commands/video.js +122 -0
- package/dist/commands/workspace-runtime.js +54 -0
- package/dist/commands/workspace.js +40 -0
- package/dist/config.js +59 -4
- package/dist/index.js +42 -3
- package/dist/preview-runtime/distribution.js +77 -0
- package/dist/project-skills/builtin-import.js +225 -0
- package/dist/project-skills/commands.js +77 -0
- package/dist/project-skills/lifecycle.js +28 -0
- package/dist/project-skills/local-run.js +112 -0
- package/dist/project-skills/local-store.js +221 -0
- package/dist/project-skills/messages.js +80 -0
- package/dist/project-skills/reconcile.js +62 -0
- package/dist/project-skills/remote-cache.js +51 -0
- package/dist/project-skills/validation.js +19 -0
- package/dist/recording/messages.js +40 -0
- package/dist/recording/project-digest.js +85 -0
- package/dist/recording/recorder.js +293 -0
- package/dist/recording/scenario.js +50 -0
- package/dist/remix/clone.js +2 -0
- package/dist/remix/init-template.js +2 -0
- package/dist/remix/pull.js +2 -0
- package/dist/remix/push.js +21 -1
- package/dist/skill-registry/client.js +345 -0
- package/dist/skill-registry/commands.js +180 -0
- package/dist/skill-registry/evaluation-client.js +156 -0
- package/dist/skill-registry/evaluation-commands.js +174 -0
- package/dist/skill-registry/messages.js +177 -0
- package/dist/skill-registry/package.js +275 -0
- package/dist/skill-registry/platform-package.js +100 -0
- package/dist/utils/agent-api-client.js +210 -30
- package/dist/utils/environment-endpoints.js +17 -0
- package/dist/utils/error-diagnostics.js +20 -0
- package/dist/utils/playcraft-http-client.js +6 -4
- package/dist/utils/tool-operation-journal.js +124 -0
- package/dist/utils/video-evidence-git.js +81 -0
- package/dist/video-replication/client.js +234 -0
- package/dist/video-replication/comparison-evidence.js +149 -0
- package/dist/video-replication/comparison-files.js +57 -0
- package/dist/video-replication/comparison-log.js +72 -0
- package/dist/video-replication/comparison-messages.js +104 -0
- package/dist/video-replication/comparison-output.js +63 -0
- package/dist/video-replication/comparison-preflight.js +66 -0
- package/dist/video-replication/comparison.js +230 -0
- package/dist/video-replication/diagnostics.js +41 -0
- package/dist/video-replication/evidence.js +165 -0
- package/dist/video-replication/media.js +112 -0
- package/dist/video-replication/messages.js +97 -0
- package/dist/workspace/messages.js +67 -0
- package/dist/workspace/transfer-client.js +237 -0
- package/dist/workspace/transfer-errors.js +48 -0
- package/dist/workspace-runtime/batch/content-changes.js +30 -0
- package/dist/workspace-runtime/batch/control.js +86 -0
- package/dist/workspace-runtime/batch/deliver.js +173 -0
- package/dist/workspace-runtime/batch/freeze.js +101 -0
- package/dist/workspace-runtime/batch/generate.js +249 -0
- package/dist/workspace-runtime/batch/git.js +40 -0
- package/dist/workspace-runtime/batch/occupancy.js +8 -0
- package/dist/workspace-runtime/batch/policy.js +70 -0
- package/dist/workspace-runtime/batch/prepare.js +317 -0
- package/dist/workspace-runtime/batch/processes.js +72 -0
- package/dist/workspace-runtime/batch/records.js +113 -0
- package/dist/workspace-runtime/batch/routes.js +61 -0
- package/dist/workspace-runtime/batch/source-candidate.js +86 -0
- package/dist/workspace-runtime/batch/source-capture.js +146 -0
- package/dist/workspace-runtime/batch/source-failure.js +43 -0
- package/dist/workspace-runtime/batch/source-publish.js +130 -0
- package/dist/workspace-runtime/codex/app-server.js +1065 -0
- package/dist/workspace-runtime/codex/compact.js +46 -0
- package/dist/workspace-runtime/codex/config-toml.js +107 -0
- package/dist/workspace-runtime/codex/delivery-tools.js +144 -0
- package/dist/workspace-runtime/codex/jsonrpc-stdio.js +145 -0
- package/dist/workspace-runtime/codex/launcher-client.js +177 -0
- package/dist/workspace-runtime/codex/loopback.js +146 -0
- package/dist/workspace-runtime/codex/mcp-config.js +39 -0
- package/dist/workspace-runtime/codex/model-broker.js +263 -0
- package/dist/workspace-runtime/codex/native-adapter.js +9 -0
- package/dist/workspace-runtime/codex/permissions.js +79 -0
- package/dist/workspace-runtime/codex/thread-image.js +38 -0
- package/dist/workspace-runtime/codex/tool-response.js +10 -0
- package/dist/workspace-runtime/codex/ui-instructions.js +4 -0
- package/dist/workspace-runtime/codex/ui-tools.js +203 -0
- package/dist/workspace-runtime/codex/work-mode.js +15 -0
- package/dist/workspace-runtime/main.js +10 -0
- package/dist/workspace-runtime/persistence/journal.js +365 -0
- package/dist/workspace-runtime/persistence/native-subagents.js +162 -0
- package/dist/workspace-runtime/persistence/sqlite-client.js +77 -0
- package/dist/workspace-runtime/persistence/sqlite-worker.js +1161 -0
- package/dist/workspace-runtime/persistence/stopped-execution.js +77 -0
- package/dist/workspace-runtime/previews/diagnostics.js +44 -0
- package/dist/workspace-runtime/previews/output.js +36 -0
- package/dist/workspace-runtime/previews/publish.js +283 -0
- package/dist/workspace-runtime/previews/runtime-preview.js +251 -0
- package/dist/workspace-runtime/previews/single-file.js +43 -0
- package/dist/workspace-runtime/processes/managed-writes.js +69 -0
- package/dist/workspace-runtime/serve.js +441 -0
- package/dist/workspace-runtime/server/accept-operation.js +61 -0
- package/dist/workspace-runtime/server/asset-transfers.js +63 -0
- package/dist/workspace-runtime/server/auth.js +21 -0
- package/dist/workspace-runtime/server/connectivity.js +211 -0
- package/dist/workspace-runtime/server/desktop-host.js +429 -0
- package/dist/workspace-runtime/server/desktop-preview-config.js +81 -0
- package/dist/workspace-runtime/server/desktop-preview-service.js +157 -0
- package/dist/workspace-runtime/server/desktop-preview-static.js +53 -0
- package/dist/workspace-runtime/server/desktop-preview.js +189 -0
- package/dist/workspace-runtime/server/dispatch.js +1655 -0
- package/dist/workspace-runtime/server/endpoints.js +21 -0
- package/dist/workspace-runtime/server/execution-group.js +90 -0
- package/dist/workspace-runtime/server/http.js +1339 -0
- package/dist/workspace-runtime/server/lock.js +53 -0
- package/dist/workspace-runtime/server/operation-record.js +33 -0
- package/dist/workspace-runtime/server/rfb-watch-gate.js +168 -0
- package/dist/workspace-runtime/server/session-restore.js +84 -0
- package/dist/workspace-runtime/server/source-uploader.js +138 -0
- package/dist/workspace-runtime/server/submit-operation.js +41 -0
- package/dist/workspace-runtime/server/terminal-host.js +366 -0
- package/dist/workspace-runtime/server/types.js +1 -0
- package/dist/workspace-runtime/server/workspace-transfer.js +168 -0
- package/dist/workspace-runtime/verify-artifact.js +59 -0
- package/dist/workspace-runtime/workspaces/append-only-log.js +62 -0
- package/dist/workspace-runtime/workspaces/archive.js +207 -0
- package/dist/workspace-runtime/workspaces/artifact-events.js +55 -0
- package/dist/workspace-runtime/workspaces/artifact-files.js +199 -0
- package/dist/workspace-runtime/workspaces/artifact-receipts.js +89 -0
- package/dist/workspace-runtime/workspaces/artifacts.js +282 -0
- package/dist/workspace-runtime/workspaces/asset-library-import.js +387 -0
- package/dist/workspace-runtime/workspaces/asset-publication-access.js +25 -0
- package/dist/workspace-runtime/workspaces/asset-transfer-dependencies.js +81 -0
- package/dist/workspace-runtime/workspaces/asset-transfer-publish.js +438 -0
- package/dist/workspace-runtime/workspaces/asset-transfer-storage.js +389 -0
- package/dist/workspace-runtime/workspaces/attachment-content.js +73 -0
- package/dist/workspace-runtime/workspaces/attachments.js +185 -0
- package/dist/workspace-runtime/workspaces/batch-commit.js +142 -0
- package/dist/workspace-runtime/workspaces/binary-content.js +65 -0
- package/dist/workspace-runtime/workspaces/binary-write.js +117 -0
- package/dist/workspace-runtime/workspaces/cli-context.js +23 -0
- package/dist/workspace-runtime/workspaces/cli-credentials.js +115 -0
- package/dist/workspace-runtime/workspaces/composer-context.js +147 -0
- package/dist/workspace-runtime/workspaces/context-error.js +2 -0
- package/dist/workspace-runtime/workspaces/delivery-build.js +331 -0
- package/dist/workspace-runtime/workspaces/delivery-store.js +168 -0
- package/dist/workspace-runtime/workspaces/delivery.js +64 -0
- package/dist/workspace-runtime/workspaces/dependencies.js +279 -0
- package/dist/workspace-runtime/workspaces/developer-command.js +98 -0
- package/dist/workspace-runtime/workspaces/directories.js +132 -0
- package/dist/workspace-runtime/workspaces/directory-access.js +37 -0
- package/dist/workspace-runtime/workspaces/directory-attachments.js +245 -0
- package/dist/workspace-runtime/workspaces/directory-create.js +57 -0
- package/dist/workspace-runtime/workspaces/directory-maintenance.js +111 -0
- package/dist/workspace-runtime/workspaces/directory-mutations.js +238 -0
- package/dist/workspace-runtime/workspaces/directory-revisions.js +56 -0
- package/dist/workspace-runtime/workspaces/directory-stats.js +49 -0
- package/dist/workspace-runtime/workspaces/disk-snapshot.js +31 -0
- package/dist/workspace-runtime/workspaces/empty-template.js +42 -0
- package/dist/workspace-runtime/workspaces/file-content.js +48 -0
- package/dist/workspace-runtime/workspaces/files-search.js +116 -0
- package/dist/workspace-runtime/workspaces/files.js +150 -0
- package/dist/workspace-runtime/workspaces/git-credential-broker.js +312 -0
- package/dist/workspace-runtime/workspaces/git-credential-helper.js +68 -0
- package/dist/workspace-runtime/workspaces/git-direct-store.js +155 -0
- package/dist/workspace-runtime/workspaces/git.js +670 -0
- package/dist/workspace-runtime/workspaces/instructions.js +56 -0
- package/dist/workspace-runtime/workspaces/json5-edit.js +313 -0
- package/dist/workspace-runtime/workspaces/library-attachments.js +268 -0
- package/dist/workspace-runtime/workspaces/operation-log.js +23 -0
- package/dist/workspace-runtime/workspaces/optional-platform-skills.js +14 -0
- package/dist/workspace-runtime/workspaces/parameter-agent-inputs.js +97 -0
- package/dist/workspace-runtime/workspaces/parameter-agent-protocol.js +40 -0
- package/dist/workspace-runtime/workspaces/parameter-agent-store.js +58 -0
- package/dist/workspace-runtime/workspaces/parameter-agent.js +284 -0
- package/dist/workspace-runtime/workspaces/parameter-assets.js +189 -0
- package/dist/workspace-runtime/workspaces/parameters.js +329 -0
- package/dist/workspace-runtime/workspaces/prepare.js +278 -0
- package/dist/workspace-runtime/workspaces/registry.js +251 -0
- package/dist/workspace-runtime/workspaces/remix-references.js +301 -0
- package/dist/workspace-runtime/workspaces/revisions.js +31 -0
- package/dist/workspace-runtime/workspaces/session-image.js +104 -0
- package/dist/workspace-runtime/workspaces/shared-git.js +40 -0
- package/dist/workspace-runtime/workspaces/skill-artifact-loader.js +95 -0
- package/dist/workspace-runtime/workspaces/skills.js +191 -0
- package/dist/workspace-runtime/workspaces/theme-asset-index.js +157 -0
- package/dist/workspace-runtime/workspaces/transfer-quota.js +69 -0
- package/dist/workspace-runtime/workspaces/transfer.js +471 -0
- package/dist/workspace-runtime/workspaces/turn-changes.js +75 -0
- package/dist/workspace-runtime/workspaces/video-attachments.js +49 -0
- package/package.json +15 -5
- package/project-template/.claude/skills/playcraft-replica-validation/SKILL.md +25 -0
- package/project-template/.claude/skills/playcraft-replica-validation/references/contracts.md +79 -0
- package/project-template/.claude/skills/playcraft-video-understanding/SKILL.md +29 -0
- package/project-template/.claude/skills/playcraft-video-understanding/references/contracts.md +37 -0
- package/project-template-v2/.claude/agents/artist.md +82 -0
- package/project-template-v2/.claude/agents/developer.md +153 -0
- package/project-template-v2/.claude/agents/game-designer.md +264 -0
- package/project-template-v2/.claude/agents/refs/artist-art-style-catalog.md +533 -0
- package/project-template-v2/.claude/agents/refs/artist-color-audio-recipes.md +153 -0
- package/project-template-v2/.claude/agents/refs/artist-dimension-axis.md +27 -0
- package/project-template-v2/.claude/agents/refs/artist-master-composite-recipes.md +208 -0
- package/project-template-v2/.claude/agents/refs/atom-skill-library.md +81 -0
- package/project-template-v2/.claude/agents/refs/developer-impl-cookbook.md +432 -0
- package/project-template-v2/.claude/agents/refs/framework-5-component-filter.md +252 -0
- package/project-template-v2/.claude/agents/refs/framework-game-feel-juice.md +266 -0
- package/project-template-v2/.claude/agents/refs/framework-mda.md +147 -0
- package/project-template-v2/.claude/agents/refs/game-designer-gameplay-sufficiency.md +123 -0
- package/project-template-v2/.claude/agents/refs/ta-3d-flip-recipe.md +88 -0
- package/project-template-v2/.claude/agents/refs/ta-atlas-deliverable-standard.md +67 -0
- package/project-template-v2/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
- package/project-template-v2/.claude/agents/refs/ta-image-generation-detail.md +300 -0
- package/project-template-v2/.claude/agents/refs/ta-image-ops-reference.md +495 -0
- package/project-template-v2/.claude/agents/refs/ta-pipeline-cookbook.md +1141 -0
- package/project-template-v2/.claude/agents/refs/ta-tools-reference.md +111 -0
- package/project-template-v2/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
- package/project-template-v2/.claude/agents/refs/threejs-cannon-pitfalls.md +412 -0
- package/project-template-v2/.claude/agents/reviewer.md +75 -0
- package/project-template-v2/.claude/agents/technical-artist.md +86 -0
- package/project-template-v2/.claude/hooks/snapshot-milestone.mjs +243 -0
- package/project-template-v2/.claude/hooks/user-prompt.mjs +133 -0
- package/project-template-v2/.claude/settings.json +33 -0
- package/project-template-v2/.claude/skills/brainstorming/SKILL.md +161 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/frame-template.html +270 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/helper.js +177 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/server.cjs +354 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/start-server.sh +148 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/project-template-v2/.claude/skills/brainstorming/scripts/wait-for-selection.sh +62 -0
- package/project-template-v2/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/project-template-v2/.claude/skills/brainstorming/visual-companion.md +309 -0
- package/project-template-v2/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
- package/project-template-v2/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
- package/project-template-v2/.claude/skills/playcraft-asset-state-sheet/SKILL.md +205 -0
- package/project-template-v2/.claude/skills/playcraft-audio-generation/SKILL.md +280 -0
- package/project-template-v2/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
- package/project-template-v2/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/SKILL.md +370 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +333 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +95 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +136 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
- package/project-template-v2/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
- package/project-template-v2/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
- package/project-template-v2/.claude/skills/playcraft-image-processing/SKILL.md +219 -0
- package/project-template-v2/.claude/skills/playcraft-masking/SKILL.md +373 -0
- package/project-template-v2/.claude/skills/playcraft-playable-optimization/SKILL.md +161 -0
- package/project-template-v2/.claude/skills/playcraft-research/SKILL.md +215 -0
- package/project-template-v2/.claude/skills/playcraft-skill-recommender/SKILL.md +382 -0
- package/project-template-v2/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
- package/project-template-v2/.claude/skills/playcraft-sprite-remix/SKILL.md +158 -0
- package/project-template-v2/.claude/skills/playcraft-sprite-sheet/SKILL.md +100 -0
- package/project-template-v2/.claude/skills/playcraft-storyboard/SKILL.md +167 -0
- package/project-template-v2/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
- package/project-template-v2/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
- package/project-template-v2/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
- package/project-template-v2/.claude/skills/playwright-cli/SKILL.md +390 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/running-code.md +240 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/session-management.md +226 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/spec-driven-testing.md +308 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/storage-state.md +275 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/test-generation.md +134 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/tracing.md +142 -0
- package/project-template-v2/.claude/skills/playwright-cli/references/video-recording.md +153 -0
- package/project-template-v2/.claude/skills/session-analyzer/SKILL.md +386 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +182 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/find-turns.mjs +72 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/heavy-output.mjs +121 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/resolve-session.mjs +102 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +127 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +106 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/time-gaps.mjs +128 -0
- package/project-template-v2/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +67 -0
- package/project-template-v2/.claude/snapshot.mjs +263 -0
- package/project-template-v2/.playcraft/skills.lock.json +152 -0
- package/project-template-v2/CLAUDE.md +146 -0
- package/project-template-v2/assets/audio/bgm/.gitkeep +0 -0
- package/project-template-v2/assets/audio/sfx/.gitkeep +0 -0
- package/project-template-v2/assets/bundles/.gitkeep +0 -0
- package/project-template-v2/assets/images/bg/.gitkeep +0 -0
- package/project-template-v2/assets/images/reference/.gitkeep +0 -0
- package/project-template-v2/assets/images/storyboard/.gitkeep +0 -0
- package/project-template-v2/assets/images/tiles/.gitkeep +0 -0
- package/project-template-v2/assets/images/ui/.gitkeep +0 -0
- package/project-template-v2/assets/images/vfx/.gitkeep +0 -0
- package/project-template-v2/assets/models/.gitkeep +0 -0
- package/project-template-v2/docs/harness/iteration-1/context-flow.md +254 -0
- package/project-template-v2/docs/harness/iteration-1/generate-flow.md +91 -0
- package/project-template-v2/docs/harness/iteration-1/ideate-flow.md +214 -0
- package/project-template-v2/docs/harness/iteration-1/optimize-flow.md +75 -0
- package/project-template-v2/docs/harness/iteration-1/wrapup-flow.md +63 -0
- package/project-template-v2/docs/harness/iteration-2/context-flow.md +223 -0
- package/project-template-v2/docs/harness/iteration-2/generate-flow.md +129 -0
- package/project-template-v2/docs/harness/iteration-2/ideate-flow.md +267 -0
- package/project-template-v2/docs/harness/iteration-2/optimize-flow.md +164 -0
- package/project-template-v2/docs/harness/iteration-2/wrapup-flow.md +115 -0
- package/project-template-v2/docs/harness/orchestrator-flow.md +364 -0
- package/project-template-v2/docs/project-state.json +60 -0
- package/project-template-v2/docs/project-state.md +72 -0
- package/project-template-v2/docs/standards/README.md +225 -0
- package/project-template-v2/docs/standards/agent-behavior-standards.md +174 -0
- package/project-template-v2/docs/standards/artifacts/design-brief.md +19 -0
- package/project-template-v2/docs/standards/artifacts/design.md +22 -0
- package/project-template-v2/docs/standards/artifacts/game-code.md +41 -0
- package/project-template-v2/docs/standards/artifacts/todo-list.md +41 -0
- package/project-template-v2/docs/standards/iter1-agent-behavior-standards.md +343 -0
- package/project-template-v2/game/index.ts +18 -0
- package/project-template-v2/globals.d.ts +51 -0
- package/project-template-v2/index.css +34 -0
- package/project-template-v2/index.html +18 -0
- package/project-template-v2/main.ts +9 -0
- package/project-template-v2/package.json +46 -0
- package/project-template-v2/skills/_shared/scripts/dispatch-clear.mjs +31 -0
- package/project-template-v2/skills/_shared/scripts/dispatch-set.mjs +86 -0
- package/project-template-v2/skills/_shared/scripts/dod-check.mjs +153 -0
- package/project-template-v2/skills/_shared/scripts/handoff-append.mjs +70 -0
- package/project-template-v2/skills/_shared/scripts/lib/validator-artifacts.mjs +91 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/dod-config.mjs +131 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/index.mjs +80 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/iteration-1-core.mjs +90 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/iteration-2-wrap.mjs +93 -0
- package/project-template-v2/skills/_shared/scripts/pipeline/iteration-3-visual.mjs +23 -0
- package/project-template-v2/skills/_shared/scripts/render-project-state.mjs +230 -0
- package/project-template-v2/skills/_shared/scripts/state-advance-stage.mjs +58 -0
- package/project-template-v2/skills/_shared/scripts/state-get.mjs +339 -0
- package/project-template-v2/skills/_shared/scripts/state-handoff.mjs +39 -0
- package/project-template-v2/skills/_shared/scripts/state-set.mjs +94 -0
- package/project-template-v2/skills/_shared/scripts/state-store.mjs +783 -0
- package/project-template-v2/skills/_shared/scripts/todo-add.mjs +88 -0
- package/project-template-v2/skills/_shared/scripts/todo-get.mjs +130 -0
- package/project-template-v2/skills/_shared/scripts/todo-remove.mjs +33 -0
- package/project-template-v2/skills/_shared/scripts/todo-set.mjs +47 -0
- package/project-template-v2/skills/_shared/scripts/verify-asset-code-sync.mjs +268 -0
- package/project-template-v2/skills/_shared/scripts/verify-env.mjs +285 -0
- package/project-template-v2/skills/_shared/scripts/verify-placeholders.mjs +161 -0
- package/project-template-v2/skills/playable-autoplay/SKILL.md +176 -0
- package/project-template-v2/skills/playable-autoplay/agents/openai.yaml +4 -0
- package/project-template-v2/skills/playable-debug/SKILL.md +116 -0
- package/project-template-v2/skills/playable-debug/agents/openai.yaml +4 -0
- package/project-template-v2/skills/playable-debug/references/debug-config.md +40 -0
- package/project-template-v2/skills/playable-record/SKILL.md +140 -0
- package/project-template-v2/skills/playable-record/scripts/lib/dev-server.mjs +104 -0
- package/project-template-v2/skills/playable-record/scripts/lib/record-audio-bridge.js +141 -0
- package/project-template-v2/skills/playable-record/scripts/record-playable.mjs +425 -0
- package/project-template-v2/skills/playable-record/scripts/verify-contract.mjs +261 -0
- package/project-template-v2/skills/playable-record/scripts/verify-firstwin.mjs +398 -0
- package/project-template-v2/skills/playable-record/scripts/verify-fusion.mjs +322 -0
- package/project-template-v2/skills/playable-record/scripts/verify-lifecycle.mjs +105 -0
- package/project-template-v2/skills/playable-record/scripts/verify-vlm-video.mjs +230 -0
- package/project-template-v2/skills/playable-validate/SKILL.md +61 -0
- package/project-template-v2/skills/playable-validate/validation-rules.md +14 -0
- package/project-template-v2/skills/playable-verify-ui/SKILL.md +63 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/__init__.py +1 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/config_expr.js +218 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/node_utils.js +51 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/profile_loader.py +59 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/report.py +106 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/lib/runtime_contract.js +116 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +59 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +64 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/verify_runtime_contract.js +58 -0
- package/project-template-v2/skills/playable-verify-ui/scripts/verify_text_overlap.py +333 -0
- package/project-template-v2/ta-workspace/scripts/.gitkeep +0 -0
- package/project-template-v2/tsconfig.json +20 -0
- package/project-template-v2/vite.config.ts +27 -0
- package/project-templates/batch-locks/phaser.yaml +922 -0
- package/project-templates/batch-locks/threejs.yaml +978 -0
- package/project-templates/empty/AGENTS.md +41 -0
- package/project-templates/empty/gitignore +33 -0
- package/templates/preview-runtime/v1/README.md +71 -0
- package/templates/preview-runtime/v1/build-preview.mjs +1324 -0
- package/templates/preview-runtime/v1/manifest.json +17 -0
- package/templates/preview-runtime/v1/release-guard.mjs +87 -0
- package/templates/preview-runtime/v1/runtime.d.mts +3 -0
- package/templates/preview-runtime/v1/runtime.d.ts +3 -0
- package/templates/preview-runtime/v1/runtime.mjs +1121 -0
- package/templates/preview-runtime/v1/types/adapters.d.ts +26 -0
- package/templates/preview-runtime/v1/types/preview.d.ts +23 -0
- package/templates/preview-runtime/v1/types/protocol.d.ts +94 -0
- package/templates/preview-runtime/v1/types/runtime.d.ts +14 -0
|
@@ -0,0 +1,1324 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
try {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw mod = 0, e;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
|
|
31
|
+
// ../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/unicode.js
|
|
32
|
+
var require_unicode = __commonJS({
|
|
33
|
+
"../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/unicode.js"(exports, module) {
|
|
34
|
+
module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
35
|
+
module.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
|
36
|
+
module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// ../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/util.js
|
|
41
|
+
var require_util = __commonJS({
|
|
42
|
+
"../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/util.js"(exports, module) {
|
|
43
|
+
var unicode = require_unicode();
|
|
44
|
+
module.exports = {
|
|
45
|
+
isSpaceSeparator(c) {
|
|
46
|
+
return typeof c === "string" && unicode.Space_Separator.test(c);
|
|
47
|
+
},
|
|
48
|
+
isIdStartChar(c) {
|
|
49
|
+
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
|
|
50
|
+
},
|
|
51
|
+
isIdContinueChar(c) {
|
|
52
|
+
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
|
|
53
|
+
},
|
|
54
|
+
isDigit(c) {
|
|
55
|
+
return typeof c === "string" && /[0-9]/.test(c);
|
|
56
|
+
},
|
|
57
|
+
isHexDigit(c) {
|
|
58
|
+
return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/parse.js
|
|
65
|
+
var require_parse = __commonJS({
|
|
66
|
+
"../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/parse.js"(exports, module) {
|
|
67
|
+
var util = require_util();
|
|
68
|
+
var source;
|
|
69
|
+
var parseState;
|
|
70
|
+
var stack;
|
|
71
|
+
var pos;
|
|
72
|
+
var line;
|
|
73
|
+
var column;
|
|
74
|
+
var token;
|
|
75
|
+
var key;
|
|
76
|
+
var root;
|
|
77
|
+
module.exports = function parse(text, reviver) {
|
|
78
|
+
source = String(text);
|
|
79
|
+
parseState = "start";
|
|
80
|
+
stack = [];
|
|
81
|
+
pos = 0;
|
|
82
|
+
line = 1;
|
|
83
|
+
column = 0;
|
|
84
|
+
token = void 0;
|
|
85
|
+
key = void 0;
|
|
86
|
+
root = void 0;
|
|
87
|
+
do {
|
|
88
|
+
token = lex();
|
|
89
|
+
parseStates[parseState]();
|
|
90
|
+
} while (token.type !== "eof");
|
|
91
|
+
if (typeof reviver === "function") {
|
|
92
|
+
return internalize({ "": root }, "", reviver);
|
|
93
|
+
}
|
|
94
|
+
return root;
|
|
95
|
+
};
|
|
96
|
+
function internalize(holder, name, reviver) {
|
|
97
|
+
const value = holder[name];
|
|
98
|
+
if (value != null && typeof value === "object") {
|
|
99
|
+
if (Array.isArray(value)) {
|
|
100
|
+
for (let i = 0; i < value.length; i++) {
|
|
101
|
+
const key2 = String(i);
|
|
102
|
+
const replacement = internalize(value, key2, reviver);
|
|
103
|
+
if (replacement === void 0) {
|
|
104
|
+
delete value[key2];
|
|
105
|
+
} else {
|
|
106
|
+
Object.defineProperty(value, key2, {
|
|
107
|
+
value: replacement,
|
|
108
|
+
writable: true,
|
|
109
|
+
enumerable: true,
|
|
110
|
+
configurable: true
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
for (const key2 in value) {
|
|
116
|
+
const replacement = internalize(value, key2, reviver);
|
|
117
|
+
if (replacement === void 0) {
|
|
118
|
+
delete value[key2];
|
|
119
|
+
} else {
|
|
120
|
+
Object.defineProperty(value, key2, {
|
|
121
|
+
value: replacement,
|
|
122
|
+
writable: true,
|
|
123
|
+
enumerable: true,
|
|
124
|
+
configurable: true
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return reviver.call(holder, name, value);
|
|
131
|
+
}
|
|
132
|
+
var lexState;
|
|
133
|
+
var buffer;
|
|
134
|
+
var doubleQuote;
|
|
135
|
+
var sign;
|
|
136
|
+
var c;
|
|
137
|
+
function lex() {
|
|
138
|
+
lexState = "default";
|
|
139
|
+
buffer = "";
|
|
140
|
+
doubleQuote = false;
|
|
141
|
+
sign = 1;
|
|
142
|
+
for (; ; ) {
|
|
143
|
+
c = peek();
|
|
144
|
+
const token2 = lexStates[lexState]();
|
|
145
|
+
if (token2) {
|
|
146
|
+
return token2;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function peek() {
|
|
151
|
+
if (source[pos]) {
|
|
152
|
+
return String.fromCodePoint(source.codePointAt(pos));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function read() {
|
|
156
|
+
const c2 = peek();
|
|
157
|
+
if (c2 === "\n") {
|
|
158
|
+
line++;
|
|
159
|
+
column = 0;
|
|
160
|
+
} else if (c2) {
|
|
161
|
+
column += c2.length;
|
|
162
|
+
} else {
|
|
163
|
+
column++;
|
|
164
|
+
}
|
|
165
|
+
if (c2) {
|
|
166
|
+
pos += c2.length;
|
|
167
|
+
}
|
|
168
|
+
return c2;
|
|
169
|
+
}
|
|
170
|
+
var lexStates = {
|
|
171
|
+
default() {
|
|
172
|
+
switch (c) {
|
|
173
|
+
case " ":
|
|
174
|
+
case "\v":
|
|
175
|
+
case "\f":
|
|
176
|
+
case " ":
|
|
177
|
+
case "\xA0":
|
|
178
|
+
case "\uFEFF":
|
|
179
|
+
case "\n":
|
|
180
|
+
case "\r":
|
|
181
|
+
case "\u2028":
|
|
182
|
+
case "\u2029":
|
|
183
|
+
read();
|
|
184
|
+
return;
|
|
185
|
+
case "/":
|
|
186
|
+
read();
|
|
187
|
+
lexState = "comment";
|
|
188
|
+
return;
|
|
189
|
+
case void 0:
|
|
190
|
+
read();
|
|
191
|
+
return newToken("eof");
|
|
192
|
+
}
|
|
193
|
+
if (util.isSpaceSeparator(c)) {
|
|
194
|
+
read();
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
return lexStates[parseState]();
|
|
198
|
+
},
|
|
199
|
+
comment() {
|
|
200
|
+
switch (c) {
|
|
201
|
+
case "*":
|
|
202
|
+
read();
|
|
203
|
+
lexState = "multiLineComment";
|
|
204
|
+
return;
|
|
205
|
+
case "/":
|
|
206
|
+
read();
|
|
207
|
+
lexState = "singleLineComment";
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
throw invalidChar(read());
|
|
211
|
+
},
|
|
212
|
+
multiLineComment() {
|
|
213
|
+
switch (c) {
|
|
214
|
+
case "*":
|
|
215
|
+
read();
|
|
216
|
+
lexState = "multiLineCommentAsterisk";
|
|
217
|
+
return;
|
|
218
|
+
case void 0:
|
|
219
|
+
throw invalidChar(read());
|
|
220
|
+
}
|
|
221
|
+
read();
|
|
222
|
+
},
|
|
223
|
+
multiLineCommentAsterisk() {
|
|
224
|
+
switch (c) {
|
|
225
|
+
case "*":
|
|
226
|
+
read();
|
|
227
|
+
return;
|
|
228
|
+
case "/":
|
|
229
|
+
read();
|
|
230
|
+
lexState = "default";
|
|
231
|
+
return;
|
|
232
|
+
case void 0:
|
|
233
|
+
throw invalidChar(read());
|
|
234
|
+
}
|
|
235
|
+
read();
|
|
236
|
+
lexState = "multiLineComment";
|
|
237
|
+
},
|
|
238
|
+
singleLineComment() {
|
|
239
|
+
switch (c) {
|
|
240
|
+
case "\n":
|
|
241
|
+
case "\r":
|
|
242
|
+
case "\u2028":
|
|
243
|
+
case "\u2029":
|
|
244
|
+
read();
|
|
245
|
+
lexState = "default";
|
|
246
|
+
return;
|
|
247
|
+
case void 0:
|
|
248
|
+
read();
|
|
249
|
+
return newToken("eof");
|
|
250
|
+
}
|
|
251
|
+
read();
|
|
252
|
+
},
|
|
253
|
+
value() {
|
|
254
|
+
switch (c) {
|
|
255
|
+
case "{":
|
|
256
|
+
case "[":
|
|
257
|
+
return newToken("punctuator", read());
|
|
258
|
+
case "n":
|
|
259
|
+
read();
|
|
260
|
+
literal("ull");
|
|
261
|
+
return newToken("null", null);
|
|
262
|
+
case "t":
|
|
263
|
+
read();
|
|
264
|
+
literal("rue");
|
|
265
|
+
return newToken("boolean", true);
|
|
266
|
+
case "f":
|
|
267
|
+
read();
|
|
268
|
+
literal("alse");
|
|
269
|
+
return newToken("boolean", false);
|
|
270
|
+
case "-":
|
|
271
|
+
case "+":
|
|
272
|
+
if (read() === "-") {
|
|
273
|
+
sign = -1;
|
|
274
|
+
}
|
|
275
|
+
lexState = "sign";
|
|
276
|
+
return;
|
|
277
|
+
case ".":
|
|
278
|
+
buffer = read();
|
|
279
|
+
lexState = "decimalPointLeading";
|
|
280
|
+
return;
|
|
281
|
+
case "0":
|
|
282
|
+
buffer = read();
|
|
283
|
+
lexState = "zero";
|
|
284
|
+
return;
|
|
285
|
+
case "1":
|
|
286
|
+
case "2":
|
|
287
|
+
case "3":
|
|
288
|
+
case "4":
|
|
289
|
+
case "5":
|
|
290
|
+
case "6":
|
|
291
|
+
case "7":
|
|
292
|
+
case "8":
|
|
293
|
+
case "9":
|
|
294
|
+
buffer = read();
|
|
295
|
+
lexState = "decimalInteger";
|
|
296
|
+
return;
|
|
297
|
+
case "I":
|
|
298
|
+
read();
|
|
299
|
+
literal("nfinity");
|
|
300
|
+
return newToken("numeric", Infinity);
|
|
301
|
+
case "N":
|
|
302
|
+
read();
|
|
303
|
+
literal("aN");
|
|
304
|
+
return newToken("numeric", NaN);
|
|
305
|
+
case '"':
|
|
306
|
+
case "'":
|
|
307
|
+
doubleQuote = read() === '"';
|
|
308
|
+
buffer = "";
|
|
309
|
+
lexState = "string";
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
throw invalidChar(read());
|
|
313
|
+
},
|
|
314
|
+
identifierNameStartEscape() {
|
|
315
|
+
if (c !== "u") {
|
|
316
|
+
throw invalidChar(read());
|
|
317
|
+
}
|
|
318
|
+
read();
|
|
319
|
+
const u = unicodeEscape();
|
|
320
|
+
switch (u) {
|
|
321
|
+
case "$":
|
|
322
|
+
case "_":
|
|
323
|
+
break;
|
|
324
|
+
default:
|
|
325
|
+
if (!util.isIdStartChar(u)) {
|
|
326
|
+
throw invalidIdentifier();
|
|
327
|
+
}
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
buffer += u;
|
|
331
|
+
lexState = "identifierName";
|
|
332
|
+
},
|
|
333
|
+
identifierName() {
|
|
334
|
+
switch (c) {
|
|
335
|
+
case "$":
|
|
336
|
+
case "_":
|
|
337
|
+
case "\u200C":
|
|
338
|
+
case "\u200D":
|
|
339
|
+
buffer += read();
|
|
340
|
+
return;
|
|
341
|
+
case "\\":
|
|
342
|
+
read();
|
|
343
|
+
lexState = "identifierNameEscape";
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (util.isIdContinueChar(c)) {
|
|
347
|
+
buffer += read();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
return newToken("identifier", buffer);
|
|
351
|
+
},
|
|
352
|
+
identifierNameEscape() {
|
|
353
|
+
if (c !== "u") {
|
|
354
|
+
throw invalidChar(read());
|
|
355
|
+
}
|
|
356
|
+
read();
|
|
357
|
+
const u = unicodeEscape();
|
|
358
|
+
switch (u) {
|
|
359
|
+
case "$":
|
|
360
|
+
case "_":
|
|
361
|
+
case "\u200C":
|
|
362
|
+
case "\u200D":
|
|
363
|
+
break;
|
|
364
|
+
default:
|
|
365
|
+
if (!util.isIdContinueChar(u)) {
|
|
366
|
+
throw invalidIdentifier();
|
|
367
|
+
}
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
buffer += u;
|
|
371
|
+
lexState = "identifierName";
|
|
372
|
+
},
|
|
373
|
+
sign() {
|
|
374
|
+
switch (c) {
|
|
375
|
+
case ".":
|
|
376
|
+
buffer = read();
|
|
377
|
+
lexState = "decimalPointLeading";
|
|
378
|
+
return;
|
|
379
|
+
case "0":
|
|
380
|
+
buffer = read();
|
|
381
|
+
lexState = "zero";
|
|
382
|
+
return;
|
|
383
|
+
case "1":
|
|
384
|
+
case "2":
|
|
385
|
+
case "3":
|
|
386
|
+
case "4":
|
|
387
|
+
case "5":
|
|
388
|
+
case "6":
|
|
389
|
+
case "7":
|
|
390
|
+
case "8":
|
|
391
|
+
case "9":
|
|
392
|
+
buffer = read();
|
|
393
|
+
lexState = "decimalInteger";
|
|
394
|
+
return;
|
|
395
|
+
case "I":
|
|
396
|
+
read();
|
|
397
|
+
literal("nfinity");
|
|
398
|
+
return newToken("numeric", sign * Infinity);
|
|
399
|
+
case "N":
|
|
400
|
+
read();
|
|
401
|
+
literal("aN");
|
|
402
|
+
return newToken("numeric", NaN);
|
|
403
|
+
}
|
|
404
|
+
throw invalidChar(read());
|
|
405
|
+
},
|
|
406
|
+
zero() {
|
|
407
|
+
switch (c) {
|
|
408
|
+
case ".":
|
|
409
|
+
buffer += read();
|
|
410
|
+
lexState = "decimalPoint";
|
|
411
|
+
return;
|
|
412
|
+
case "e":
|
|
413
|
+
case "E":
|
|
414
|
+
buffer += read();
|
|
415
|
+
lexState = "decimalExponent";
|
|
416
|
+
return;
|
|
417
|
+
case "x":
|
|
418
|
+
case "X":
|
|
419
|
+
buffer += read();
|
|
420
|
+
lexState = "hexadecimal";
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
return newToken("numeric", sign * 0);
|
|
424
|
+
},
|
|
425
|
+
decimalInteger() {
|
|
426
|
+
switch (c) {
|
|
427
|
+
case ".":
|
|
428
|
+
buffer += read();
|
|
429
|
+
lexState = "decimalPoint";
|
|
430
|
+
return;
|
|
431
|
+
case "e":
|
|
432
|
+
case "E":
|
|
433
|
+
buffer += read();
|
|
434
|
+
lexState = "decimalExponent";
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
if (util.isDigit(c)) {
|
|
438
|
+
buffer += read();
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
return newToken("numeric", sign * Number(buffer));
|
|
442
|
+
},
|
|
443
|
+
decimalPointLeading() {
|
|
444
|
+
if (util.isDigit(c)) {
|
|
445
|
+
buffer += read();
|
|
446
|
+
lexState = "decimalFraction";
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
throw invalidChar(read());
|
|
450
|
+
},
|
|
451
|
+
decimalPoint() {
|
|
452
|
+
switch (c) {
|
|
453
|
+
case "e":
|
|
454
|
+
case "E":
|
|
455
|
+
buffer += read();
|
|
456
|
+
lexState = "decimalExponent";
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
if (util.isDigit(c)) {
|
|
460
|
+
buffer += read();
|
|
461
|
+
lexState = "decimalFraction";
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
return newToken("numeric", sign * Number(buffer));
|
|
465
|
+
},
|
|
466
|
+
decimalFraction() {
|
|
467
|
+
switch (c) {
|
|
468
|
+
case "e":
|
|
469
|
+
case "E":
|
|
470
|
+
buffer += read();
|
|
471
|
+
lexState = "decimalExponent";
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (util.isDigit(c)) {
|
|
475
|
+
buffer += read();
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
return newToken("numeric", sign * Number(buffer));
|
|
479
|
+
},
|
|
480
|
+
decimalExponent() {
|
|
481
|
+
switch (c) {
|
|
482
|
+
case "+":
|
|
483
|
+
case "-":
|
|
484
|
+
buffer += read();
|
|
485
|
+
lexState = "decimalExponentSign";
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
if (util.isDigit(c)) {
|
|
489
|
+
buffer += read();
|
|
490
|
+
lexState = "decimalExponentInteger";
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
throw invalidChar(read());
|
|
494
|
+
},
|
|
495
|
+
decimalExponentSign() {
|
|
496
|
+
if (util.isDigit(c)) {
|
|
497
|
+
buffer += read();
|
|
498
|
+
lexState = "decimalExponentInteger";
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
throw invalidChar(read());
|
|
502
|
+
},
|
|
503
|
+
decimalExponentInteger() {
|
|
504
|
+
if (util.isDigit(c)) {
|
|
505
|
+
buffer += read();
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
return newToken("numeric", sign * Number(buffer));
|
|
509
|
+
},
|
|
510
|
+
hexadecimal() {
|
|
511
|
+
if (util.isHexDigit(c)) {
|
|
512
|
+
buffer += read();
|
|
513
|
+
lexState = "hexadecimalInteger";
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
throw invalidChar(read());
|
|
517
|
+
},
|
|
518
|
+
hexadecimalInteger() {
|
|
519
|
+
if (util.isHexDigit(c)) {
|
|
520
|
+
buffer += read();
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
return newToken("numeric", sign * Number(buffer));
|
|
524
|
+
},
|
|
525
|
+
string() {
|
|
526
|
+
switch (c) {
|
|
527
|
+
case "\\":
|
|
528
|
+
read();
|
|
529
|
+
buffer += escape();
|
|
530
|
+
return;
|
|
531
|
+
case '"':
|
|
532
|
+
if (doubleQuote) {
|
|
533
|
+
read();
|
|
534
|
+
return newToken("string", buffer);
|
|
535
|
+
}
|
|
536
|
+
buffer += read();
|
|
537
|
+
return;
|
|
538
|
+
case "'":
|
|
539
|
+
if (!doubleQuote) {
|
|
540
|
+
read();
|
|
541
|
+
return newToken("string", buffer);
|
|
542
|
+
}
|
|
543
|
+
buffer += read();
|
|
544
|
+
return;
|
|
545
|
+
case "\n":
|
|
546
|
+
case "\r":
|
|
547
|
+
throw invalidChar(read());
|
|
548
|
+
case "\u2028":
|
|
549
|
+
case "\u2029":
|
|
550
|
+
separatorChar(c);
|
|
551
|
+
break;
|
|
552
|
+
case void 0:
|
|
553
|
+
throw invalidChar(read());
|
|
554
|
+
}
|
|
555
|
+
buffer += read();
|
|
556
|
+
},
|
|
557
|
+
start() {
|
|
558
|
+
switch (c) {
|
|
559
|
+
case "{":
|
|
560
|
+
case "[":
|
|
561
|
+
return newToken("punctuator", read());
|
|
562
|
+
}
|
|
563
|
+
lexState = "value";
|
|
564
|
+
},
|
|
565
|
+
beforePropertyName() {
|
|
566
|
+
switch (c) {
|
|
567
|
+
case "$":
|
|
568
|
+
case "_":
|
|
569
|
+
buffer = read();
|
|
570
|
+
lexState = "identifierName";
|
|
571
|
+
return;
|
|
572
|
+
case "\\":
|
|
573
|
+
read();
|
|
574
|
+
lexState = "identifierNameStartEscape";
|
|
575
|
+
return;
|
|
576
|
+
case "}":
|
|
577
|
+
return newToken("punctuator", read());
|
|
578
|
+
case '"':
|
|
579
|
+
case "'":
|
|
580
|
+
doubleQuote = read() === '"';
|
|
581
|
+
lexState = "string";
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
if (util.isIdStartChar(c)) {
|
|
585
|
+
buffer += read();
|
|
586
|
+
lexState = "identifierName";
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
throw invalidChar(read());
|
|
590
|
+
},
|
|
591
|
+
afterPropertyName() {
|
|
592
|
+
if (c === ":") {
|
|
593
|
+
return newToken("punctuator", read());
|
|
594
|
+
}
|
|
595
|
+
throw invalidChar(read());
|
|
596
|
+
},
|
|
597
|
+
beforePropertyValue() {
|
|
598
|
+
lexState = "value";
|
|
599
|
+
},
|
|
600
|
+
afterPropertyValue() {
|
|
601
|
+
switch (c) {
|
|
602
|
+
case ",":
|
|
603
|
+
case "}":
|
|
604
|
+
return newToken("punctuator", read());
|
|
605
|
+
}
|
|
606
|
+
throw invalidChar(read());
|
|
607
|
+
},
|
|
608
|
+
beforeArrayValue() {
|
|
609
|
+
if (c === "]") {
|
|
610
|
+
return newToken("punctuator", read());
|
|
611
|
+
}
|
|
612
|
+
lexState = "value";
|
|
613
|
+
},
|
|
614
|
+
afterArrayValue() {
|
|
615
|
+
switch (c) {
|
|
616
|
+
case ",":
|
|
617
|
+
case "]":
|
|
618
|
+
return newToken("punctuator", read());
|
|
619
|
+
}
|
|
620
|
+
throw invalidChar(read());
|
|
621
|
+
},
|
|
622
|
+
end() {
|
|
623
|
+
throw invalidChar(read());
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
function newToken(type, value) {
|
|
627
|
+
return {
|
|
628
|
+
type,
|
|
629
|
+
value,
|
|
630
|
+
line,
|
|
631
|
+
column
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
function literal(s) {
|
|
635
|
+
for (const c2 of s) {
|
|
636
|
+
const p = peek();
|
|
637
|
+
if (p !== c2) {
|
|
638
|
+
throw invalidChar(read());
|
|
639
|
+
}
|
|
640
|
+
read();
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function escape() {
|
|
644
|
+
const c2 = peek();
|
|
645
|
+
switch (c2) {
|
|
646
|
+
case "b":
|
|
647
|
+
read();
|
|
648
|
+
return "\b";
|
|
649
|
+
case "f":
|
|
650
|
+
read();
|
|
651
|
+
return "\f";
|
|
652
|
+
case "n":
|
|
653
|
+
read();
|
|
654
|
+
return "\n";
|
|
655
|
+
case "r":
|
|
656
|
+
read();
|
|
657
|
+
return "\r";
|
|
658
|
+
case "t":
|
|
659
|
+
read();
|
|
660
|
+
return " ";
|
|
661
|
+
case "v":
|
|
662
|
+
read();
|
|
663
|
+
return "\v";
|
|
664
|
+
case "0":
|
|
665
|
+
read();
|
|
666
|
+
if (util.isDigit(peek())) {
|
|
667
|
+
throw invalidChar(read());
|
|
668
|
+
}
|
|
669
|
+
return "\0";
|
|
670
|
+
case "x":
|
|
671
|
+
read();
|
|
672
|
+
return hexEscape();
|
|
673
|
+
case "u":
|
|
674
|
+
read();
|
|
675
|
+
return unicodeEscape();
|
|
676
|
+
case "\n":
|
|
677
|
+
case "\u2028":
|
|
678
|
+
case "\u2029":
|
|
679
|
+
read();
|
|
680
|
+
return "";
|
|
681
|
+
case "\r":
|
|
682
|
+
read();
|
|
683
|
+
if (peek() === "\n") {
|
|
684
|
+
read();
|
|
685
|
+
}
|
|
686
|
+
return "";
|
|
687
|
+
case "1":
|
|
688
|
+
case "2":
|
|
689
|
+
case "3":
|
|
690
|
+
case "4":
|
|
691
|
+
case "5":
|
|
692
|
+
case "6":
|
|
693
|
+
case "7":
|
|
694
|
+
case "8":
|
|
695
|
+
case "9":
|
|
696
|
+
throw invalidChar(read());
|
|
697
|
+
case void 0:
|
|
698
|
+
throw invalidChar(read());
|
|
699
|
+
}
|
|
700
|
+
return read();
|
|
701
|
+
}
|
|
702
|
+
function hexEscape() {
|
|
703
|
+
let buffer2 = "";
|
|
704
|
+
let c2 = peek();
|
|
705
|
+
if (!util.isHexDigit(c2)) {
|
|
706
|
+
throw invalidChar(read());
|
|
707
|
+
}
|
|
708
|
+
buffer2 += read();
|
|
709
|
+
c2 = peek();
|
|
710
|
+
if (!util.isHexDigit(c2)) {
|
|
711
|
+
throw invalidChar(read());
|
|
712
|
+
}
|
|
713
|
+
buffer2 += read();
|
|
714
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
715
|
+
}
|
|
716
|
+
function unicodeEscape() {
|
|
717
|
+
let buffer2 = "";
|
|
718
|
+
let count = 4;
|
|
719
|
+
while (count-- > 0) {
|
|
720
|
+
const c2 = peek();
|
|
721
|
+
if (!util.isHexDigit(c2)) {
|
|
722
|
+
throw invalidChar(read());
|
|
723
|
+
}
|
|
724
|
+
buffer2 += read();
|
|
725
|
+
}
|
|
726
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
727
|
+
}
|
|
728
|
+
var parseStates = {
|
|
729
|
+
start() {
|
|
730
|
+
if (token.type === "eof") {
|
|
731
|
+
throw invalidEOF();
|
|
732
|
+
}
|
|
733
|
+
push();
|
|
734
|
+
},
|
|
735
|
+
beforePropertyName() {
|
|
736
|
+
switch (token.type) {
|
|
737
|
+
case "identifier":
|
|
738
|
+
case "string":
|
|
739
|
+
key = token.value;
|
|
740
|
+
parseState = "afterPropertyName";
|
|
741
|
+
return;
|
|
742
|
+
case "punctuator":
|
|
743
|
+
pop();
|
|
744
|
+
return;
|
|
745
|
+
case "eof":
|
|
746
|
+
throw invalidEOF();
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
afterPropertyName() {
|
|
750
|
+
if (token.type === "eof") {
|
|
751
|
+
throw invalidEOF();
|
|
752
|
+
}
|
|
753
|
+
parseState = "beforePropertyValue";
|
|
754
|
+
},
|
|
755
|
+
beforePropertyValue() {
|
|
756
|
+
if (token.type === "eof") {
|
|
757
|
+
throw invalidEOF();
|
|
758
|
+
}
|
|
759
|
+
push();
|
|
760
|
+
},
|
|
761
|
+
beforeArrayValue() {
|
|
762
|
+
if (token.type === "eof") {
|
|
763
|
+
throw invalidEOF();
|
|
764
|
+
}
|
|
765
|
+
if (token.type === "punctuator" && token.value === "]") {
|
|
766
|
+
pop();
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
push();
|
|
770
|
+
},
|
|
771
|
+
afterPropertyValue() {
|
|
772
|
+
if (token.type === "eof") {
|
|
773
|
+
throw invalidEOF();
|
|
774
|
+
}
|
|
775
|
+
switch (token.value) {
|
|
776
|
+
case ",":
|
|
777
|
+
parseState = "beforePropertyName";
|
|
778
|
+
return;
|
|
779
|
+
case "}":
|
|
780
|
+
pop();
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
afterArrayValue() {
|
|
784
|
+
if (token.type === "eof") {
|
|
785
|
+
throw invalidEOF();
|
|
786
|
+
}
|
|
787
|
+
switch (token.value) {
|
|
788
|
+
case ",":
|
|
789
|
+
parseState = "beforeArrayValue";
|
|
790
|
+
return;
|
|
791
|
+
case "]":
|
|
792
|
+
pop();
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
end() {
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
function push() {
|
|
799
|
+
let value;
|
|
800
|
+
switch (token.type) {
|
|
801
|
+
case "punctuator":
|
|
802
|
+
switch (token.value) {
|
|
803
|
+
case "{":
|
|
804
|
+
value = {};
|
|
805
|
+
break;
|
|
806
|
+
case "[":
|
|
807
|
+
value = [];
|
|
808
|
+
break;
|
|
809
|
+
}
|
|
810
|
+
break;
|
|
811
|
+
case "null":
|
|
812
|
+
case "boolean":
|
|
813
|
+
case "numeric":
|
|
814
|
+
case "string":
|
|
815
|
+
value = token.value;
|
|
816
|
+
break;
|
|
817
|
+
}
|
|
818
|
+
if (root === void 0) {
|
|
819
|
+
root = value;
|
|
820
|
+
} else {
|
|
821
|
+
const parent = stack[stack.length - 1];
|
|
822
|
+
if (Array.isArray(parent)) {
|
|
823
|
+
parent.push(value);
|
|
824
|
+
} else {
|
|
825
|
+
Object.defineProperty(parent, key, {
|
|
826
|
+
value,
|
|
827
|
+
writable: true,
|
|
828
|
+
enumerable: true,
|
|
829
|
+
configurable: true
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
if (value !== null && typeof value === "object") {
|
|
834
|
+
stack.push(value);
|
|
835
|
+
if (Array.isArray(value)) {
|
|
836
|
+
parseState = "beforeArrayValue";
|
|
837
|
+
} else {
|
|
838
|
+
parseState = "beforePropertyName";
|
|
839
|
+
}
|
|
840
|
+
} else {
|
|
841
|
+
const current = stack[stack.length - 1];
|
|
842
|
+
if (current == null) {
|
|
843
|
+
parseState = "end";
|
|
844
|
+
} else if (Array.isArray(current)) {
|
|
845
|
+
parseState = "afterArrayValue";
|
|
846
|
+
} else {
|
|
847
|
+
parseState = "afterPropertyValue";
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
function pop() {
|
|
852
|
+
stack.pop();
|
|
853
|
+
const current = stack[stack.length - 1];
|
|
854
|
+
if (current == null) {
|
|
855
|
+
parseState = "end";
|
|
856
|
+
} else if (Array.isArray(current)) {
|
|
857
|
+
parseState = "afterArrayValue";
|
|
858
|
+
} else {
|
|
859
|
+
parseState = "afterPropertyValue";
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
function invalidChar(c2) {
|
|
863
|
+
if (c2 === void 0) {
|
|
864
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
865
|
+
}
|
|
866
|
+
return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
|
|
867
|
+
}
|
|
868
|
+
function invalidEOF() {
|
|
869
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
870
|
+
}
|
|
871
|
+
function invalidIdentifier() {
|
|
872
|
+
column -= 5;
|
|
873
|
+
return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
|
|
874
|
+
}
|
|
875
|
+
function separatorChar(c2) {
|
|
876
|
+
console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
|
|
877
|
+
}
|
|
878
|
+
function formatChar(c2) {
|
|
879
|
+
const replacements = {
|
|
880
|
+
"'": "\\'",
|
|
881
|
+
'"': '\\"',
|
|
882
|
+
"\\": "\\\\",
|
|
883
|
+
"\b": "\\b",
|
|
884
|
+
"\f": "\\f",
|
|
885
|
+
"\n": "\\n",
|
|
886
|
+
"\r": "\\r",
|
|
887
|
+
" ": "\\t",
|
|
888
|
+
"\v": "\\v",
|
|
889
|
+
"\0": "\\0",
|
|
890
|
+
"\u2028": "\\u2028",
|
|
891
|
+
"\u2029": "\\u2029"
|
|
892
|
+
};
|
|
893
|
+
if (replacements[c2]) {
|
|
894
|
+
return replacements[c2];
|
|
895
|
+
}
|
|
896
|
+
if (c2 < " ") {
|
|
897
|
+
const hexString = c2.charCodeAt(0).toString(16);
|
|
898
|
+
return "\\x" + ("00" + hexString).substring(hexString.length);
|
|
899
|
+
}
|
|
900
|
+
return c2;
|
|
901
|
+
}
|
|
902
|
+
function syntaxError(message) {
|
|
903
|
+
const err = new SyntaxError(message);
|
|
904
|
+
err.lineNumber = line;
|
|
905
|
+
err.columnNumber = column;
|
|
906
|
+
return err;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
|
|
911
|
+
// ../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/stringify.js
|
|
912
|
+
var require_stringify = __commonJS({
|
|
913
|
+
"../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/stringify.js"(exports, module) {
|
|
914
|
+
var util = require_util();
|
|
915
|
+
module.exports = function stringify(value, replacer, space) {
|
|
916
|
+
const stack = [];
|
|
917
|
+
let indent = "";
|
|
918
|
+
let propertyList;
|
|
919
|
+
let replacerFunc;
|
|
920
|
+
let gap = "";
|
|
921
|
+
let quote;
|
|
922
|
+
if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
|
|
923
|
+
space = replacer.space;
|
|
924
|
+
quote = replacer.quote;
|
|
925
|
+
replacer = replacer.replacer;
|
|
926
|
+
}
|
|
927
|
+
if (typeof replacer === "function") {
|
|
928
|
+
replacerFunc = replacer;
|
|
929
|
+
} else if (Array.isArray(replacer)) {
|
|
930
|
+
propertyList = [];
|
|
931
|
+
for (const v of replacer) {
|
|
932
|
+
let item;
|
|
933
|
+
if (typeof v === "string") {
|
|
934
|
+
item = v;
|
|
935
|
+
} else if (typeof v === "number" || v instanceof String || v instanceof Number) {
|
|
936
|
+
item = String(v);
|
|
937
|
+
}
|
|
938
|
+
if (item !== void 0 && propertyList.indexOf(item) < 0) {
|
|
939
|
+
propertyList.push(item);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
if (space instanceof Number) {
|
|
944
|
+
space = Number(space);
|
|
945
|
+
} else if (space instanceof String) {
|
|
946
|
+
space = String(space);
|
|
947
|
+
}
|
|
948
|
+
if (typeof space === "number") {
|
|
949
|
+
if (space > 0) {
|
|
950
|
+
space = Math.min(10, Math.floor(space));
|
|
951
|
+
gap = " ".substr(0, space);
|
|
952
|
+
}
|
|
953
|
+
} else if (typeof space === "string") {
|
|
954
|
+
gap = space.substr(0, 10);
|
|
955
|
+
}
|
|
956
|
+
return serializeProperty("", { "": value });
|
|
957
|
+
function serializeProperty(key, holder) {
|
|
958
|
+
let value2 = holder[key];
|
|
959
|
+
if (value2 != null) {
|
|
960
|
+
if (typeof value2.toJSON5 === "function") {
|
|
961
|
+
value2 = value2.toJSON5(key);
|
|
962
|
+
} else if (typeof value2.toJSON === "function") {
|
|
963
|
+
value2 = value2.toJSON(key);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (replacerFunc) {
|
|
967
|
+
value2 = replacerFunc.call(holder, key, value2);
|
|
968
|
+
}
|
|
969
|
+
if (value2 instanceof Number) {
|
|
970
|
+
value2 = Number(value2);
|
|
971
|
+
} else if (value2 instanceof String) {
|
|
972
|
+
value2 = String(value2);
|
|
973
|
+
} else if (value2 instanceof Boolean) {
|
|
974
|
+
value2 = value2.valueOf();
|
|
975
|
+
}
|
|
976
|
+
switch (value2) {
|
|
977
|
+
case null:
|
|
978
|
+
return "null";
|
|
979
|
+
case true:
|
|
980
|
+
return "true";
|
|
981
|
+
case false:
|
|
982
|
+
return "false";
|
|
983
|
+
}
|
|
984
|
+
if (typeof value2 === "string") {
|
|
985
|
+
return quoteString(value2, false);
|
|
986
|
+
}
|
|
987
|
+
if (typeof value2 === "number") {
|
|
988
|
+
return String(value2);
|
|
989
|
+
}
|
|
990
|
+
if (typeof value2 === "object") {
|
|
991
|
+
return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
|
|
992
|
+
}
|
|
993
|
+
return void 0;
|
|
994
|
+
}
|
|
995
|
+
function quoteString(value2) {
|
|
996
|
+
const quotes = {
|
|
997
|
+
"'": 0.1,
|
|
998
|
+
'"': 0.2
|
|
999
|
+
};
|
|
1000
|
+
const replacements = {
|
|
1001
|
+
"'": "\\'",
|
|
1002
|
+
'"': '\\"',
|
|
1003
|
+
"\\": "\\\\",
|
|
1004
|
+
"\b": "\\b",
|
|
1005
|
+
"\f": "\\f",
|
|
1006
|
+
"\n": "\\n",
|
|
1007
|
+
"\r": "\\r",
|
|
1008
|
+
" ": "\\t",
|
|
1009
|
+
"\v": "\\v",
|
|
1010
|
+
"\0": "\\0",
|
|
1011
|
+
"\u2028": "\\u2028",
|
|
1012
|
+
"\u2029": "\\u2029"
|
|
1013
|
+
};
|
|
1014
|
+
let product = "";
|
|
1015
|
+
for (let i = 0; i < value2.length; i++) {
|
|
1016
|
+
const c = value2[i];
|
|
1017
|
+
switch (c) {
|
|
1018
|
+
case "'":
|
|
1019
|
+
case '"':
|
|
1020
|
+
quotes[c]++;
|
|
1021
|
+
product += c;
|
|
1022
|
+
continue;
|
|
1023
|
+
case "\0":
|
|
1024
|
+
if (util.isDigit(value2[i + 1])) {
|
|
1025
|
+
product += "\\x00";
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
if (replacements[c]) {
|
|
1030
|
+
product += replacements[c];
|
|
1031
|
+
continue;
|
|
1032
|
+
}
|
|
1033
|
+
if (c < " ") {
|
|
1034
|
+
let hexString = c.charCodeAt(0).toString(16);
|
|
1035
|
+
product += "\\x" + ("00" + hexString).substring(hexString.length);
|
|
1036
|
+
continue;
|
|
1037
|
+
}
|
|
1038
|
+
product += c;
|
|
1039
|
+
}
|
|
1040
|
+
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
|
|
1041
|
+
product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
|
|
1042
|
+
return quoteChar + product + quoteChar;
|
|
1043
|
+
}
|
|
1044
|
+
function serializeObject(value2) {
|
|
1045
|
+
if (stack.indexOf(value2) >= 0) {
|
|
1046
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
1047
|
+
}
|
|
1048
|
+
stack.push(value2);
|
|
1049
|
+
let stepback = indent;
|
|
1050
|
+
indent = indent + gap;
|
|
1051
|
+
let keys = propertyList || Object.keys(value2);
|
|
1052
|
+
let partial = [];
|
|
1053
|
+
for (const key of keys) {
|
|
1054
|
+
const propertyString = serializeProperty(key, value2);
|
|
1055
|
+
if (propertyString !== void 0) {
|
|
1056
|
+
let member = serializeKey(key) + ":";
|
|
1057
|
+
if (gap !== "") {
|
|
1058
|
+
member += " ";
|
|
1059
|
+
}
|
|
1060
|
+
member += propertyString;
|
|
1061
|
+
partial.push(member);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
let final;
|
|
1065
|
+
if (partial.length === 0) {
|
|
1066
|
+
final = "{}";
|
|
1067
|
+
} else {
|
|
1068
|
+
let properties;
|
|
1069
|
+
if (gap === "") {
|
|
1070
|
+
properties = partial.join(",");
|
|
1071
|
+
final = "{" + properties + "}";
|
|
1072
|
+
} else {
|
|
1073
|
+
let separator = ",\n" + indent;
|
|
1074
|
+
properties = partial.join(separator);
|
|
1075
|
+
final = "{\n" + indent + properties + ",\n" + stepback + "}";
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
stack.pop();
|
|
1079
|
+
indent = stepback;
|
|
1080
|
+
return final;
|
|
1081
|
+
}
|
|
1082
|
+
function serializeKey(key) {
|
|
1083
|
+
if (key.length === 0) {
|
|
1084
|
+
return quoteString(key, true);
|
|
1085
|
+
}
|
|
1086
|
+
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
|
1087
|
+
if (!util.isIdStartChar(firstChar)) {
|
|
1088
|
+
return quoteString(key, true);
|
|
1089
|
+
}
|
|
1090
|
+
for (let i = firstChar.length; i < key.length; i++) {
|
|
1091
|
+
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
|
1092
|
+
return quoteString(key, true);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
return key;
|
|
1096
|
+
}
|
|
1097
|
+
function serializeArray(value2) {
|
|
1098
|
+
if (stack.indexOf(value2) >= 0) {
|
|
1099
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
1100
|
+
}
|
|
1101
|
+
stack.push(value2);
|
|
1102
|
+
let stepback = indent;
|
|
1103
|
+
indent = indent + gap;
|
|
1104
|
+
let partial = [];
|
|
1105
|
+
for (let i = 0; i < value2.length; i++) {
|
|
1106
|
+
const propertyString = serializeProperty(String(i), value2);
|
|
1107
|
+
partial.push(propertyString !== void 0 ? propertyString : "null");
|
|
1108
|
+
}
|
|
1109
|
+
let final;
|
|
1110
|
+
if (partial.length === 0) {
|
|
1111
|
+
final = "[]";
|
|
1112
|
+
} else {
|
|
1113
|
+
if (gap === "") {
|
|
1114
|
+
let properties = partial.join(",");
|
|
1115
|
+
final = "[" + properties + "]";
|
|
1116
|
+
} else {
|
|
1117
|
+
let separator = ",\n" + indent;
|
|
1118
|
+
let properties = partial.join(separator);
|
|
1119
|
+
final = "[\n" + indent + properties + ",\n" + stepback + "]";
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
stack.pop();
|
|
1123
|
+
indent = stepback;
|
|
1124
|
+
return final;
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
|
|
1130
|
+
// ../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/index.js
|
|
1131
|
+
var require_lib = __commonJS({
|
|
1132
|
+
"../../node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/index.js"(exports, module) {
|
|
1133
|
+
var parse = require_parse();
|
|
1134
|
+
var stringify = require_stringify();
|
|
1135
|
+
var JSON52 = {
|
|
1136
|
+
parse,
|
|
1137
|
+
stringify
|
|
1138
|
+
};
|
|
1139
|
+
module.exports = JSON52;
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
|
|
1143
|
+
// preview-runtime-resources/build-preview.mjs
|
|
1144
|
+
var import_json5 = __toESM(require_lib(), 1);
|
|
1145
|
+
import { createHash } from "node:crypto";
|
|
1146
|
+
import { lstat, mkdir, readFile, realpath, rm, writeFile } from "node:fs/promises";
|
|
1147
|
+
import { createRequire } from "node:module";
|
|
1148
|
+
import path from "node:path";
|
|
1149
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
1150
|
+
var hash = (value) => createHash("sha256").update(value).digest("hex");
|
|
1151
|
+
var slash = (value) => value.replaceAll("\\", "/");
|
|
1152
|
+
function relativePath(value) {
|
|
1153
|
+
if (typeof value !== "string" || !value || path.isAbsolute(value) || value.includes("\\") || value.split("/").some((part) => !part || part === "." || part === "..")) throw new Error("preview_runtime_path_invalid");
|
|
1154
|
+
return value;
|
|
1155
|
+
}
|
|
1156
|
+
async function inside(root, value, required = true) {
|
|
1157
|
+
const rel = relativePath(value);
|
|
1158
|
+
let current = root;
|
|
1159
|
+
for (const part of rel.split("/")) {
|
|
1160
|
+
current = path.join(current, part);
|
|
1161
|
+
const stat = await lstat(current).catch((error) => {
|
|
1162
|
+
if (error.code === "ENOENT") return void 0;
|
|
1163
|
+
throw error;
|
|
1164
|
+
});
|
|
1165
|
+
if (stat?.isSymbolicLink()) throw new Error("preview_runtime_path_invalid");
|
|
1166
|
+
if (!stat && required) throw new Error("preview_runtime_file_missing:" + rel);
|
|
1167
|
+
}
|
|
1168
|
+
return current;
|
|
1169
|
+
}
|
|
1170
|
+
async function buildWorkspacePreview({ entry, config, mountId = "game", root = process.cwd(), context } = {}) {
|
|
1171
|
+
root = await realpath(root);
|
|
1172
|
+
const sdkDirectory = path.join(root, ".playcraft/preview-runtime");
|
|
1173
|
+
if (!context || context.version !== 1 || context.protocolVersion !== 1 || context.target !== "editor-static" || typeof context.buildId !== "string" || !context.binding || !context.baseline)
|
|
1174
|
+
throw new Error("preview_runtime_context_missing");
|
|
1175
|
+
const manifestBytes = await readFile(await inside(root, ".playcraft/workspace.json"));
|
|
1176
|
+
const manifest = import_json5.default.parse(manifestBytes.toString());
|
|
1177
|
+
const preview = manifest.previewRuntime;
|
|
1178
|
+
if (preview?.version !== 1 || preview.configContractVersion !== context.binding.configContractVersion || !preview.outputPath?.startsWith(".playcraft-editor-preview/") || !preview.outputPath.endsWith(".html") || !preview.reportPath?.startsWith(".playcraft-editor-preview/") || !preview.reportPath.endsWith(".json"))
|
|
1179
|
+
throw new Error("preview_runtime_manifest_invalid");
|
|
1180
|
+
const outputPath = await inside(root, preview.outputPath, false);
|
|
1181
|
+
const reportPath = await inside(root, preview.reportPath, false);
|
|
1182
|
+
const entryPath = await inside(root, entry);
|
|
1183
|
+
const configPath = config ? await inside(root, config) : false;
|
|
1184
|
+
if (!/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(mountId)) throw new Error("preview_runtime_mount_invalid");
|
|
1185
|
+
const schemaPath = await inside(root, manifest.parameters?.schemaPath);
|
|
1186
|
+
const dataPath = await inside(root, manifest.parameters?.dataPath);
|
|
1187
|
+
const schema = await readFile(schemaPath);
|
|
1188
|
+
const data = await readFile(dataPath);
|
|
1189
|
+
if (hash(schema) !== context.binding.schemaVersion || hash(data) !== context.baseline.dataHash)
|
|
1190
|
+
throw new Error("preview_runtime_source_changed");
|
|
1191
|
+
const sdkPath = await realpath(path.join(sdkDirectory, "runtime.mjs"));
|
|
1192
|
+
const sdkRelativePath = slash(path.relative(root, sdkPath));
|
|
1193
|
+
relativePath(sdkRelativePath);
|
|
1194
|
+
const sdkManifest = JSON.parse(await readFile(path.join(sdkDirectory, "manifest.json"), "utf8"));
|
|
1195
|
+
const sdkBytes = await readFile(sdkPath);
|
|
1196
|
+
if (sdkManifest.protocolVersion !== 1 || sdkManifest.files?.["runtime.mjs"] !== hash(sdkBytes))
|
|
1197
|
+
throw new Error("preview_runtime_sdk_modified");
|
|
1198
|
+
await rm(outputPath, { force: true });
|
|
1199
|
+
await rm(reportPath, { force: true });
|
|
1200
|
+
const requireProject = createRequire(path.join(root, "package.json"));
|
|
1201
|
+
let vite;
|
|
1202
|
+
try {
|
|
1203
|
+
vite = await import(pathToFileURL(requireProject.resolve("vite")).href);
|
|
1204
|
+
} catch {
|
|
1205
|
+
throw new Error("preview_runtime_vite_missing");
|
|
1206
|
+
}
|
|
1207
|
+
let moduleIds = [];
|
|
1208
|
+
const inputHashes = /* @__PURE__ */ new Map();
|
|
1209
|
+
async function trackInput(id) {
|
|
1210
|
+
if (!id || id.startsWith("\0")) return;
|
|
1211
|
+
const file = id.split("?")[0];
|
|
1212
|
+
if (!path.isAbsolute(file)) return;
|
|
1213
|
+
const logical = slash(path.relative(root, file));
|
|
1214
|
+
const local = !logical.startsWith("../") && !path.isAbsolute(logical);
|
|
1215
|
+
if (local && logical.startsWith("node_modules/") || !local && slash(file).includes("/node_modules/")) return;
|
|
1216
|
+
const stat = await lstat(file).catch((error) => {
|
|
1217
|
+
if (error.code === "ENOENT") return void 0;
|
|
1218
|
+
throw error;
|
|
1219
|
+
});
|
|
1220
|
+
if (stat?.isSymbolicLink()) throw new Error("preview_runtime_path_invalid");
|
|
1221
|
+
if (!stat?.isFile()) return;
|
|
1222
|
+
if (local) await inside(root, logical);
|
|
1223
|
+
const physical = await realpath(file);
|
|
1224
|
+
const relative = slash(path.relative(root, physical));
|
|
1225
|
+
if (relative.startsWith("../") || path.isAbsolute(relative)) {
|
|
1226
|
+
if (slash(file).includes("/node_modules/") || slash(physical).includes("/node_modules/")) return;
|
|
1227
|
+
throw new Error("preview_runtime_input_outside_project");
|
|
1228
|
+
}
|
|
1229
|
+
if (relative.startsWith("node_modules/")) return;
|
|
1230
|
+
if (stat.isSymbolicLink()) throw new Error("preview_runtime_path_invalid");
|
|
1231
|
+
const digest = hash(await readFile(physical));
|
|
1232
|
+
if (inputHashes.has(relative) && inputHashes.get(relative) !== digest)
|
|
1233
|
+
throw new Error("preview_runtime_source_changed");
|
|
1234
|
+
inputHashes.set(relative, digest);
|
|
1235
|
+
}
|
|
1236
|
+
for (const input of [
|
|
1237
|
+
entryPath,
|
|
1238
|
+
configPath,
|
|
1239
|
+
path.join(root, "package.json"),
|
|
1240
|
+
schemaPath,
|
|
1241
|
+
dataPath,
|
|
1242
|
+
path.join(root, ".playcraft/workspace.json"),
|
|
1243
|
+
...["pnpm-lock.yaml", "package-lock.json", "yarn.lock"].map((name) => path.join(root, name))
|
|
1244
|
+
])
|
|
1245
|
+
await trackInput(input);
|
|
1246
|
+
const result = await vite.build({
|
|
1247
|
+
root,
|
|
1248
|
+
configFile: configPath,
|
|
1249
|
+
base: "./",
|
|
1250
|
+
publicDir: false,
|
|
1251
|
+
plugins: [{
|
|
1252
|
+
name: "playcraft-workspace-preview-report",
|
|
1253
|
+
enforce: "pre",
|
|
1254
|
+
async configResolved(config2) {
|
|
1255
|
+
for (const file of config2.configFileDependencies ?? []) await trackInput(file);
|
|
1256
|
+
},
|
|
1257
|
+
async load(id) {
|
|
1258
|
+
await trackInput(id);
|
|
1259
|
+
return null;
|
|
1260
|
+
},
|
|
1261
|
+
async transform(_code, id) {
|
|
1262
|
+
await trackInput(id);
|
|
1263
|
+
return null;
|
|
1264
|
+
},
|
|
1265
|
+
async generateBundle(_options, bundle) {
|
|
1266
|
+
moduleIds = [...new Set(Object.values(bundle).filter((output) => output.type === "chunk").flatMap((output) => Object.keys(output.modules)))].sort();
|
|
1267
|
+
if ([...this.getModuleIds()].some((id) => this.getModuleInfo(id)?.isExternal))
|
|
1268
|
+
throw new Error("preview_runtime_external_module");
|
|
1269
|
+
for (const id of moduleIds) await trackInput(id);
|
|
1270
|
+
for (const relative of inputHashes.keys()) await trackInput(path.join(root, relative));
|
|
1271
|
+
}
|
|
1272
|
+
}],
|
|
1273
|
+
build: {
|
|
1274
|
+
write: false,
|
|
1275
|
+
copyPublicDir: false,
|
|
1276
|
+
cssCodeSplit: false,
|
|
1277
|
+
assetsInlineLimit: Infinity,
|
|
1278
|
+
sourcemap: false,
|
|
1279
|
+
target: "es2022",
|
|
1280
|
+
rollupOptions: { input: entryPath, output: { inlineDynamicImports: true } }
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
const sdkIncluded = moduleIds.some((id) => path.resolve(id.split("?")[0]) === sdkPath);
|
|
1284
|
+
if (!sdkIncluded) throw new Error("preview_runtime_sdk_missing");
|
|
1285
|
+
const outputs = (Array.isArray(result) ? result : [result]).flatMap((output) => output.output);
|
|
1286
|
+
const chunks = outputs.filter((output) => output.type === "chunk");
|
|
1287
|
+
if (chunks.length !== 1 || chunks[0].imports.length || chunks[0].dynamicImports.length)
|
|
1288
|
+
throw new Error("preview_runtime_split_output");
|
|
1289
|
+
if (outputs.some((output) => output.type === "asset" && !output.fileName.endsWith(".css")))
|
|
1290
|
+
throw new Error("preview_runtime_external_resource");
|
|
1291
|
+
const css = outputs.filter((output) => output.type === "asset").map((output) => typeof output.source === "string" ? output.source : Buffer.from(output.source).toString()).join("\n");
|
|
1292
|
+
const html = '<!doctype html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>PlayCraft preview</title><style>' + css.replace(/<\/style/gi, "<\\/style") + '</style></head><body><div id="' + mountId + '"></div><script type="module">' + chunks[0].code.replace(/<\/script/gi, "<\\/script") + "</script></body></html>";
|
|
1293
|
+
if (hash(await readFile(schemaPath)) !== hash(schema) || hash(await readFile(dataPath)) !== hash(data) || hash(await readFile(await inside(root, ".playcraft/workspace.json"))) !== hash(manifestBytes) || hash(await readFile(sdkPath)) !== hash(sdkBytes)) throw new Error("preview_runtime_source_changed");
|
|
1294
|
+
const report = {
|
|
1295
|
+
target: "editor-static",
|
|
1296
|
+
buildId: context.buildId,
|
|
1297
|
+
htmlDigest: hash(html),
|
|
1298
|
+
schemaDigest: hash(schema),
|
|
1299
|
+
sourceFingerprint: context.sourceFingerprint,
|
|
1300
|
+
dataHash: hash(data),
|
|
1301
|
+
dataRevision: context.baseline.dataRevision,
|
|
1302
|
+
schemaRevision: context.baseline.schemaRevision,
|
|
1303
|
+
moduleIds,
|
|
1304
|
+
moduleInputs: [...inputHashes].sort(([a], [b]) => a.localeCompare(b)).map(([path2, sha256]) => ({ path: path2, sha256 })),
|
|
1305
|
+
sdkArtifact: { path: sdkRelativePath, sdkVersion: sdkManifest.sdkVersion, protocolVersion: 1, sha256: hash(sdkBytes) }
|
|
1306
|
+
};
|
|
1307
|
+
await mkdir(path.dirname(outputPath), { recursive: true });
|
|
1308
|
+
await mkdir(path.dirname(reportPath), { recursive: true });
|
|
1309
|
+
await writeFile(outputPath, html);
|
|
1310
|
+
await writeFile(reportPath, JSON.stringify(report, null, 2) + "\n");
|
|
1311
|
+
return report;
|
|
1312
|
+
}
|
|
1313
|
+
if (process.argv[1] && await realpath(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
1314
|
+
const options = {};
|
|
1315
|
+
for (let index = 2; index < process.argv.length; index += 2) {
|
|
1316
|
+
const key = { "--entry": "entry", "--config": "config", "--mount-id": "mountId" }[process.argv[index]];
|
|
1317
|
+
if (!key || !process.argv[index + 1]) throw new Error("preview_runtime_arguments_invalid");
|
|
1318
|
+
options[key] = process.argv[index + 1];
|
|
1319
|
+
}
|
|
1320
|
+
await buildWorkspacePreview({ ...options, context: JSON.parse(process.env.PLAYCRAFT_RUNTIME_PREVIEW_CONTEXT ?? "null") });
|
|
1321
|
+
}
|
|
1322
|
+
export {
|
|
1323
|
+
buildWorkspacePreview
|
|
1324
|
+
};
|