Skip to content

Build and release node-sdk from a build directory #969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MasterOdin opened this issue Sep 25, 2019 · 1 comment · Fixed by #990
Closed

Build and release node-sdk from a build directory #969

MasterOdin opened this issue Sep 25, 2019 · 1 comment · Fixed by #990
Labels

Comments

@MasterOdin
Copy link
Contributor

Currently, when you run tsc, the artifacts from it are placed side-by-side with the *.ts files. This is nice from a release standpoint as it allows for a very clean API usage for loading the various services/versions/etc such as:

const TextToSpeechV1 = require('text-to-speech/v1');
const AssistantV1 = require('assistant/v1');
const AssistantV2 = require('assistant/v2');
// others

However, it does make going through the build tree more annoying due to the additional clutter of build artifacts. I talked to @dpopp07 and he is suggesting in doing something similar to how rxjs publishes which is that they build their files to a build directory, move some amount of necessary additional files (e.g. package.json, README.md, etc.) and then publishes out of that subdirectory. This keeps the nice import directory structure, but separates out the build artifacts from the source tree.

To accomplish this, the necessary changes would be:

  1. update tsconfig.json to have an outDir
  2. tool/process to move any additional non-build files into the outDir (e.g. README.md, LICENSE, etc.)
  3. modify @semantic-release/npm to have a pkgRoot property that points to the build directory.

None of these changes would have any affect on the installation package from NPM from an end-users perspective, so this can be accomplished anytime before or after v5 is published.

Per my discussion with @dpopp07 via slack, I am currently working on making a proof of concept for the repo and will be making a PR sometime in next week or so.

@watson-github-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants