Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import_map.json doesn't work (but if i use deno.json all works fine) #503

Open
kravetsone opened this issue May 11, 2024 · 2 comments
Open

Comments

@kravetsone
Copy link

kravetsone commented May 11, 2024

i use jsr.json and import_map.json in my library

jsr.json -

{
    "$schema": "https://jsr.io/schema/config-file.v1.json",
    "name": "@gramio/keyboards",
    "version": "0.3.1",
    "exports": "./src/index.ts",
    "publish": {
        "include": [
            "jsr.json",
            "import_map.json",
            "src",
            "README.md",
            "tsconfig.json"
        ]
    }
}

import_map.json (about it) -

image

{
    "imports": {
        "@gramio/types": "jsr:@gramio/types@^7.3.4"
    }
}

but my dependency is recognized as npm and not jsr

image

I try to use deno.json and all works fine with it

{
    "name": "@gramio/keyboards",
    "version": "0.3.1",
    "exports": "./src/index.ts",
    "publish": {
        "include": [
            "deno.json",
            "import_map.json",
            "src",
            "README.md",
            "tsconfig.json"
        ]
    },
    "imports": {
        "@gramio/types": "jsr:@gramio/types@^7.3.4"
    }
}

for publish i use bunx jsr publish

kravetsone added a commit to gramiojs/keyboards that referenced this issue May 11, 2024
kravetsone added a commit to gramiojs/keyboards that referenced this issue May 11, 2024
@dsherret
Copy link
Contributor

The documentation is not clear, but only deno.json and jsr.json are autodiscovered. You'll need to specify the import map within the jsr.json file (similar to deno.json) or add an "importMap" key like so:

{
    "$schema": "https://jsr.io/schema/config-file.v1.json",
    "name": "@gramio/keyboards",
    "version": "0.3.1",
    "exports": "./src/index.ts",
    "importMap": "./import_map.json"
    "publish": {
        "include": [
            "jsr.json",
            "import_map.json",
            "src",
            "README.md",
            "tsconfig.json"
        ]
    }
}

@kravetsone
Copy link
Author

The documentation is not clear, but only deno.json and jsr.json are autodiscovered. You'll need to specify the import map within the jsr.json file (similar to deno.json) or add an "importMap" key like so:

{
    "$schema": "https://jsr.io/schema/config-file.v1.json",
    "name": "@gramio/keyboards",
    "version": "0.3.1",
    "exports": "./src/index.ts",
    "importMap": "./import_map.json"
    "publish": {
        "include": [
            "jsr.json",
            "import_map.json",
            "src",
            "README.md",
            "tsconfig.json"
        ]
    }
}

But in jsr.json schema neither imports nor importMap are described

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

No branches or pull requests

2 participants