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
756 stars 44 forks source link

genType started importing from `bs-platform` instead of from `rescript` #609

Closed vknez closed 2 years ago

vknez commented 2 years ago

Hi, I'm trying genType (4.4.0) with the latest rescript beta (10.0.0-beta.3), and genType (in .gen.tsx) started importing from bs-platform instead of rescript:

// now
import * as Curry__Es6Import from 'bs-platform/lib/es6/curry.js';
// before
import * as Curry__Es6Import from 'rescript/lib/es6/curry.js';

I'm using a monorepo, and this is the relevant extract from bsconfig:

{
  "refmt": 3,
  "reason": {
    "react-jsx": 3
  },
  "package-specs": {
    "module": "es6",
    "in-source": true
  },
  "gentypeconfig": {
    "language": "typescript",
    "shims": {
      "ReactNative": "ReactNative",
      "RescriptRelay": "RescriptRelay",
      "Js": "Js",
      "Belt": "Belt",
      "Promise": "Promise",
      "ReactNativeSvg": "ReactNativeSvg"
    },
    "importPath": "relative",
    "debug": {
      "all": false,
      "basic": false
    }
  },
  "bsc-flags": ["-open Belt"]
}
cristianoc commented 2 years ago

Thank you. Here's a PR that just tests on the latest compiler: https://github.com/rescript-association/genType/pull/610

And sure enough has the issue.

cristianoc commented 2 years ago

Simple not-forward-looking check:

      | None -> if v1 >= 9 && v2 >= 1 then "rescript" else "bs-platform"