{"id":17490766,"url":"https://github.com/val-town/deno-ata","last_synced_at":"2025-04-14T14:14:59.804Z","repository":{"id":244137736,"uuid":"814339454","full_name":"val-town/deno-ata","owner":"val-town","description":"support for type acquisition with url imports, npm, jsr prefixes","archived":false,"fork":false,"pushed_at":"2024-06-13T15:22:25.000Z","size":63,"stargazers_count":16,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T14:14:55.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://val-town.github.io/deno-ata/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/val-town.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-12T20:16:47.000Z","updated_at":"2025-03-29T16:37:59.000Z","dependencies_parsed_at":"2024-06-13T04:12:17.922Z","dependency_job_id":null,"html_url":"https://github.com/val-town/deno-ata","commit_stats":null,"previous_names":["val-town/deno-ata"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-ata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-ata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-ata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/val-town%2Fdeno-ata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/val-town","download_url":"https://codeload.github.com/val-town/deno-ata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894943,"owners_count":21179153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-19T07:01:09.157Z","updated_at":"2025-04-14T14:14:59.780Z","avatar_url":"https://github.com/val-town.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# ATA\n\nThis was originally based on [Automatic Type Acquisition](https://github.com/microsoft/TypeScript-Website/tree/v2/packages/ata), a subproject\nof TypeScript-Website, which powers the TypeScript Playground. What ATA\ndoes is it loads TypeScript types from jsDelivr and figures out `@types/` packages\nfor imported NPM modules.\n\nWhen someone types\n\n```ts\nimport chalk from \"npm:chalk\";\n```\n\nWe want to provide them with nice types. That's the intent here.\n\n## Differences from ATA\n\nThis is now dramatically different from ATA because Deno is dramatically\ndifferent from Node. Here are some of the differences:\n\n- Deno relies heavily on URL (HTTP) imports. TypeScript does not support them at all:\n  \u003chttps://github.com/microsoft/TypeScript/issues/35749\u003e\n- Deno references NPM modules using a `npm:` prefix. TypeScript does not support\n  that at all. It also supports a `jsr:` prefix for JSR imports. TypeScript does not\n  support that at all.\n- Deno requires Node modules be imported using the `node:` prefix. TypeScript does\n  not make it easy to add that requirement.\n\nSupporting URL imports, the `npm:` and `jsr:` prefixes, the required `node:` prefix,\nis very difficult.\n\n## Alternative paths\n\nDeno has a [Deno Language Server](https://github.com/denoland/deno/tree/main/cli/lsp)\nwhich implements all of its workarounds. Unfortunately, it's both written in Rust\nand relies on Deno itself. Using it on the frontend would be a total nonstarter - even\nif we were to compile it to WASM, it would be tens of megabytes.\n\nWe could run the Deno LSP on a server. This would require us to manage a lot of\nextra, sandboxed servers.\n\n## Workflow\n\nReflects reality on June 13, 2024.\n\n```mermaid\nflowchart TD\n    RECEIVED_FILE\n    ANALYZE_IMPORTS\n    RECEIVED_FILE --\u003e ANALYZE_IMPORTS\n    ANALYZE_IMPORTS --\u003e HAS_NODE_PREFIX\n    HAS_NODE_PREFIX{\"has node: prefix\"} --\u003e TRIGGER_LOADING_NPM_TYPES\n    TRIGGER_LOADING_NPM_TYPES --\u003e FETCH_URL[loadDependency]\n    ANALYZE_IMPORTS --\u003e HAS_NPM_PREFIX{\"has npm: prefix\"}\n    ANALYZE_IMPORTS --\u003e HAS_JSR_PREFIX{\"has jsr: prefix\"}\n    ANALYZE_IMPORTS --\u003e IS_ABSOLUTE_HTTPS_URL{\"is absolute url\"}\n    ANALYZE_IMPORTS --\u003e IS_RELATIVE_URL{\"is relative url\"}\n    IS_RELATIVE_URL{\"is relative url\"} --\u003e RESOLVE_TO_ABSOLUTE_URL\n    RESOLVE_TO_ABSOLUTE_URL --\u003e FETCH_URL\n    HAS_NPM_PREFIX --\u003e REWRITE_TO_ESM\n    HAS_JSR_PREFIX --\u003e REWRITE_TO_ESM\n    IS_ABSOLUTE_HTTPS_URL{\"is absolute https url\"} --\u003e FETCH_URL\n    REWRITE_TO_ESM --\u003e FETCH_URL\n    FETCH_URL --\u003e IS_VAL_URL\n    IS_VAL_URL{\"is val url\"} --\u003e FETCH_WITH_BEARER_TOKEN\n    FETCH_URL --\u003e IS_SKYPACK_URL\n    IS_SKYPACK_URL{\"is skypack url\"} --\u003e ADD_DTS_SUFFIX\n    FETCH_URL --\u003e FETCH\n    ADD_DTS_SUFFIX --\u003e FETCH\n    FETCH --\u003e HAS_X_TYPESCRIPT_TYPES_HEADER{\"has x-typescript-types header\"}\n    HAS_X_TYPESCRIPT_TYPES_HEADER --\u003e|Fetch types| FETCH\n    FETCH --\u003e IS_TYPES_NODE\n    IS_TYPES_NODE{\"is types node\"} --\u003e FIX_PROCESS_AND_BUFFER_GLOBALS\n    FIX_PROCESS_AND_BUFFER_GLOBALS --\u003e CREATE_FILE_WITH_FINAL_PATH\n    FETCH --\u003e CREATE_FILE_WITH_FINAL_PATH\n    CREATE_FILE_WITH_FINAL_PATH --\u003e WAS_REDIRECTED{\"was redirected\"}\n    WAS_REDIRECTED --\u003e CREATE_REDIRECT_FILE\n    CREATE_REDIRECT_FILE --\u003e DONE\n    CREATE_FILE_WITH_FINAL_PATH --\u003e DONE\n    DONE --\u003e RECEIVED_FILE\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fval-town%2Fdeno-ata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fval-town%2Fdeno-ata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fval-town%2Fdeno-ata/lists"}