rescript-association / genType

Auto generation of idiomatic bindings between Reason and JavaScript: either vanilla or typed with TypeScript/FlowType.
https://rescript-lang.org/docs/gentype/latest/introduction
MIT License
758 stars 44 forks source link

Shims in sub-folder #587

Closed dmtrKovalenko closed 10 months ago

dmtrKovalenko commented 2 years ago

When shims are used in the subfolder types are importing with ./shims/{Module}.shim without any ability to configure the behavior

My tree

├── bsconfig.json
├── src
│   ├── services
│   │   ├── mediaLoader.bs.js
│   │   ├── mediaLoader.gen.tsx
│   │   └── mediaLoader.res
│   ├── shims
│   │   └── Js.shim.ts

And inside services folder I get

import type {Js_ArrayBuffer_t as ReScriptJs_Js_ArrayBuffer_t} from './shims/Js.shim';

instead of

import type {Js_ArrayBuffer_t as ReScriptJs_Js_ArrayBuffer_t} from '../shims/Js.shim';

bsconfig.json

"gentypeconfig": {
    "language": "typescript",
    "module": "es6",
    "importPath": "relative",
    "exportInterfaces": false,
    "shims": {
      "Js": "Js",
      "ReScriptJs": "shims/Js"
    },
    "debug": {
      "all": false,
      "basic": false
    }
  }

It looks like it is not possible not but required so much

ryyppy commented 10 months ago

This repository is being archived. If you feel like the issue still relevant, please re-create it in the compiler repo. Thanks!