Skip to content

Conversation

@wch
Copy link
Collaborator

@wch wch commented Sep 3, 2025

This PR updates package.json for publishing to npmjs.com.

@wch
Copy link
Collaborator Author

wch commented Sep 3, 2025

I've updated it so that:

  • It publishes to @posit/shiny
  • It only publishes types

The current build system puts the .d.ts files into srcts/types/, and the built JS files into inst/www/shared. There is also a lot of other stuff in the latter directory.

In the future, I think we'll want to publish the JS and types together in a single package. To do that, I think we should:

  • Separate Shiny's JS code from the R code, into a separate repository (or a monorepo with R, Python, and JS subdirs).
  • Put all the built JS and .d.ts files into a directory like dist/
  • Have the R and Python packages copy the built JS files, or bundle these JS files with their own JS code.

"coverage": "type-coverage -p tsconfig.json --at-least 90",
"circular": "npx --yes dpdm --transform ./srcts/src/index.ts"
"circular": "npx --yes dpdm --transform ./srcts/src/index.ts",
"prepack": "cp README.md README-orig.md && cp npm-README.md README.md",
Copy link
Collaborator Author

@wch wch Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: It looks like yarn pack does not ignore README-orig.md (so it gets included in the package), but npm pack does ignore the file, which is the behavior that we want.

From what I can find, it's going to require awkward stuff to make yarn pack ignore that file, like moving the temporary file to /tmp. Since we're planning on switching to npm anyway, I suggest we just leave this as it is. We can publish it with npm publish just fine, even if we're using yarn for other steps.

@wch wch merged commit b6e9e9d into main Sep 9, 2025
21 of 23 checks passed
@wch wch deleted the publish-npm branch September 9, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants