frostney / frostney/GocciaScript

Resolve bundled text and byte ESM imports from .gcbundle assets

Open
#158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
Dominant language
Pascal
Stars
20
Forks
3
Avg merge
3d 4h
Merged PRs (30d)
45

Description

Summary

Make explicit assets stored in a .gcbundle resolve through the standard ESM import-attribute surface that GocciaScript already supports:

import sourceText from "./shader.wgsl" with { type: "text" };
import imageBytes from "./sprite.png" with { type: "bytes" };

Do not add a parallel GocciaScript.bundle runtime API.

Why

GocciaScript already supports text and byte ESM imports. Bundled assets should preserve that language-level contract so the same module source works from the filesystem and from a .gcbundle, without a bundle-specific global API.

Current behavior

Filesystem-backed module content can resolve text and byte imports, but the proposed bundle format and resolver do not yet store and serve explicit asset entries.

Expected behavior

  • BundleBuilder accepts explicit --asset and --asset-dir inputs.
  • The bundle manifest records stable normalized virtual paths and whether an entry is text or bytes.
  • The bundle-backed content provider resolves those entries through with { type: "text" } and with { type: "bytes" }.
  • Missing assets and mismatched import attributes raise deterministic module-resolution errors.
  • The same importing module runs unchanged against filesystem and bundle-backed providers.

Scope notes

  • Depends on #153, #154, #155, #156, and #157.
  • Keep asset inclusion explicit rather than scanning arbitrary project files.
  • Cover text, binary, directory inclusion, duplicate paths, missing entries, and mismatched attributes.
  • No GocciaScript.bundle global or other bundle-only JavaScript API.
  • Tracked by #161.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with BundleBuilder, the bundle manifest, and the bundle-backed content provider; review the existing filesystem text and byte ESM import path first. Add explicit asset and directory inclusion with normalized manifest entries, then cover text, binary, duplicates, missing entries, and mismatched attributes with deterministic resolution errors. Done means unchanged importing modules work from both filesystem and bundle providers without a bundle-specific runtime API.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.