Skip to content

Read deno.jsonc, not only deno.json #109

Open

Description

@TomChv

Follow-up from #106, which derives a module's sources from what its code imports.

A Deno module's import map is the only alias mechanism it has — no package.json, no tsconfig — and the derivation reads it from deno.json only. A module using deno.jsonc gets nothing derived from its map, so an import through an alias fails in the container with Module not found.

Two parts to it:

  • The filename. Deno accepts either; the SDK should look for deno.jsonc when deno.json is absent. This also affects ModConfig, which detects the runtime from deno.json alone — a deno.jsonc-only module is currently detected as Node.
  • The parser. .jsonc allows comments and trailing commas, which JSON.parse rejects. helpers/config-updater already strips comments (removeJSONComments) for exactly this reason; the scanner would need the same, or a real JSONC parse.

Every Deno module in this repo uses deno.json, which is why this is a follow-up rather than part of #106.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions