Aylur / ags

Scaffolding CLI for Astal+TypeScript
https://aylur.github.io/ags/
GNU General Public License v3.0
2.28k stars 124 forks source link

how to use npm with ags ? #639

Closed vafu closed 3 hours ago

vafu commented 3 hours ago

node_modules is not bundled when running the app.

tsconfig.json

{
    "compilerOptions": {
        "baseUrl": ".",
        "experimentalDecorators": true,
        "jsx": "react-jsx",
        "jsxImportSource": "/usr/share/astal/gjs/gtk4",
        "module": "ES2022",
        "moduleResolution": "Bundler",
        "paths": {
            "astal": [
                "/usr/share/astal/gjs"
            ],
            "astal/*": [
                "/usr/share/astal/gjs/*"
            ]
        },
        "target": "ES2022",
        "typeRoots": [
            "./node_modules/@types"
        ]
    }
}

package.json

{
  "dependencies": {
    "@types/rx": "^4.1.4"
  }
}

results in

✘ [ERROR] Could not resolve "rx"

    app.ts:5:27:
      5 │ import { Observable } from "rx"
        ╵                            ~~~~

  You can mark the path "rx" as external to exclude it from the bundle, which will remove this error
  and leave the unresolved path in the bundle.
vafu commented 3 hours ago

I'm being an idiot by installing just types, it all works no problem if I actually install the library :)