question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publish TypeScript declarations to NPM

See original GitHub issue

Now that 10.0 is released and the JavaScript docs are up-to-date, it would be great if the TypeScript declarations could be published to NPM. For now, in my own projects, I just copied said file into my project, but that’s a bit hard to update and maintain. If it were published on NPM, people could then just

  • npm install -D primefaces

and add

/// <reference types="primefaces" />

to the top of their file to (a) enjoy auto completion and (b) type checking.

  • There’s a script and maven profile for publishing to NPM, see the readme.
  • For now I set the package name primefaces. This does not exist yet on NPM, but we could also use another name.
  • @melloware I think you did ask PrimeTek about this? Did they say anthing about this?

Also note, the publish maven profile reads the version from the pom, which is now 11, so we need to specifiy the version explicitly:

mvn org.codehaus.mojo:build-helper-maven-plugin:parse-version \
  com.github.eirslett:frontend-maven-plugin:npm@publish-to-npm \
  "-Dnpm.token=token" \
  -DparsedVersion.majorVersion=10 \
  -DparsedVersion.minorVersion=0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, Mar 15, 2021

Yep I was in a cleaned directory. OK its published!

See: https://www.npmjs.com/package/primefaces

0reactions
blutorangecommented, Mar 15, 2021

Awesome, looks great. I’ll give it a try later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Publishing - TypeScript
There are two main ways you can publish your declaration files to npm: ... Both TypeScript and JavaScript projects can generate types via...
Read more >
The 30-second guide to publishing a TypeScript package to ...
The 30-second guide to publishing a TypeScript package to NPM · 1. Add "declaration": true to the compilerOptions of your tsconfig.json · 2....
Read more >
Build and publish an NPM Typescript package | Codementor
Use -y for default values. Add typescript dev dependency to your project. devDependencies will only be installed when you run npm install, but ......
Read more >
How to publish TypeScript package to NPM
How to publish TypeScript package to NPM · Write some code · tsconfig.json · Set up Rollup · Build code and publish package...
Read more >
Including declarations in your npm package - TypeScript
There are two main ways you can publish your declaration files to npm: ... If your package is written in TypeScript then the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found