roblox-ts / create-roblox-ts

MIT License
1 stars 6 forks source link

Install `typescript` version matching installed compiler version. #12

Open osyrisrblx opened 4 months ago

osyrisrblx commented 4 months ago

We can fetch + parse the package.json using jsdelivr.net

The end result should be like "typescript": "=5.3.3",

Dionysusnu commented 4 months ago

Supersedes roblox-ts/roblox-ts#2199

Is jsdelivr the preferred strategy? We could also install roblox-ts first, then parse the node_modules/roblox-ts/package.json.

osyrisrblx commented 4 months ago

Copying the body from https://github.com/roblox-ts/roblox-ts/issues/2199

Running rbxtsc init will make the package manager install the latest (stable) version of TypeScript, not the actual version that roblox-ts is meant to support. This causes version conflicts, where for example the user's editor might show support for a new feature, but the compiler wouldn't yet recognise it.

osyrisrblx commented 4 months ago

We could also install roblox-ts first, then parse the node_modules/roblox-ts/package.json. This is possible, but I am concerned about having to run npm install twice. It's not a very fast command. 😓

I realized jsdelivr might have caching issues with @latest.

Alternatively, we could do:

npm view roblox-ts@latest dependencies.typescript

(or swap @latest for a specific version)

Whatever caching issues this has would probably match npm install.