#Replacing @types/screeps with npm link to its upstream package

1 messages · Page 1 of 1 (latest)

trim crypt
#

This is a followup to https://discord.com/channels/508357248330760243/1439616726139670528

It turns out that @types/screeps from DefinitelyTyped is developed in https://github.com/screepers/typed-screeps. I am trying to get a npm link version of that repo to work.

I've cloned the typed-screeps repo, done npm link there to link it to my global node_modules, then done npm rm @types/screeps && npm link typed-screeps in the project where I'm using screeps types.

That project has a node_modules/typed-screeps/dist/index.d.ts containing the types I need.

However, those types aren't being picked up by TS in the project in the way that @types/screeps types were.

I feel like I've missed just one last step in getting this sort of development environment set up.

#

Perhaps TS wants node_modules/typed-screeps to contain an index.d.ts instead of it being nested one level deeper in that module's dist directory?

rough cave
trim crypt
#

is there a correct way to get from where I am now to that working? renaming the package directory doesn't seem right.

chrome trench
#

as mentionned by ckohen, just add "node-modules/typed-screeps" to your tsconfig.json typeRoots

trim crypt
#

I'm hoping there's a way that doesn't require me to jump through more hoops to gitignore/etc those changes

trim crypt
#

aha! I need to npm link from the dist directory, which has its own package.json!