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

Add support for export keyword #150

Open
jkone27 opened this issue Nov 15, 2024 · 3 comments
Open

Add support for export keyword #150

jkone27 opened this issue Nov 15, 2024 · 3 comments

Comments

@jkone27
Copy link
Contributor

jkone27 commented Nov 15, 2024

was trying to see what glutinum generates for react ts,

"typegen": "glutinum ./node_modules/@ACMELIB/Components/Button/index.d.ts --out-file ./src/Button.fs"

i tried this npm run typegen

but got an empty Button.fs only containing open declarations
am i doing smt wrong?

// Button  index.d.ts contains this
export { ChatbotButton } from './ChatbotButton';
export { default as PrimaryButton } from './PrimaryButton';
export { default as SecondaryButton } from './SecondaryButton';
export { default as TertiaryButton } from './TertiaryButton';
export { QuaternaryButton } from './QuaternaryButton';
export { QuinaryButton } from './QuinaryButton';
export { SeatInteractionButton } from './SeatInteractionButton';

but glutinum generated this (success) Button.fs

module rec Glutinum


open Fable.Core
open Fable.Core.JsInterop
open System
@jkone27
Copy link
Contributor Author

jkone27 commented Nov 15, 2024

i see i have the same happening

am i missing some module resolution flag? or config in package.json ?

{
  "private": true,
  "name": "test-fable",
  "version": "1.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "start": "dotnet tool restore && dotnet fable watch src --runFast vite",
    "build": "dotnet tool restore && dotnet fable src  --sourceMaps --run vite build",
    "clean": "dotnet fable clean src --yes",
    "typegen": "glutinum ./node_modules/ACMELIB/Components/Button/index.d.ts --out-file ./src/Button.fs"
  },
  "dependencies": {
    "ACMELIB": "^20.3.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-error-boundary": "^4.1.2"
  },
  "devDependencies": {
    "@glutinum/cli": "^0.11.0",
    "@types/react": "^18.2.15",
    "@types/react-dom": "^18.2.7",
    "@vitejs/plugin-react": "4.2.0",
    "rollup": "^4.26.0",
    "rollup-plugin-dts": "^6.1.1",
    "vite": "^5.1.1",
    "vite-plugin-fable": "^0.0.31"
  },
  "engines": {
    "node": ">=18"
  }
}

@jkone27
Copy link
Contributor Author

jkone27 commented Nov 15, 2024

maybe i will give in the meantime the "older" ts2fable a try as i see it has this --export option
image

@jkone27
Copy link
Contributor Author

jkone27 commented Nov 15, 2024

got some errors but this ts2Fable option for exporting all --export|-e gave better results (non empty file)
ts2Fable ./node_modules/ACMELIB/Components/Button/index.d.ts ./src/Button.fs -e ACMELIB

@MangelMaxime MangelMaxime changed the title Empty .fs converted file generated by glutinum Add support for export keyword Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants