Skip to content
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

Remove yarn link:bin script #135

Closed
wants to merge 3 commits into from
Closed

Conversation

Frederick888
Copy link
Member

@Frederick888 Frederick888 commented Sep 8, 2022

Description

88e105a Remove yarn link:bin script

To adopt TypeScript, we previously used ts-node [1] in [2] as our
shebang. However this required user to install ts-node as a sibling
global dependency and effectively stopped using transpiled JavaScript
files.

So in [3] we reverted back to node to fix the issue in distribution.
However locally when using yarn/npm link, it still links that very
same script to global binary directory. Since locally we don't keep the
JavaScript files (we only transpile them when packaging/publishing), it
rendered the yarn link:bin setup broken.

As it stands now, it's easier and more straightforward to rely on yarn dev which feeds the run script into ts-node, overriding its shebang.

[1] https://github.com/TypeStrong/ts-node
[2] 2b799dc
[3] 0f59937

ce8e79a Pin TypeScript to <4.8 to avoid oclif/core error

See [1]. oclif/core doesn't transpile using TypeScript 4.8 at the
moment.

[1] oclif/core#482

Detail

Checklist

  • 💂‍♂️ includes new unit and functional tests

To adopt TypeScript, we previously used ts-node [1] in [2] as our
shebang. However this required user to install ts-node as a sibling
global dependency and effectively stopped using transpiled JavaScript
files.

So in [3] we reverted back to node to fix the issue in distribution.
However locally when using `yarn/npm link`, it still links that very
same script to global binary directory. Since locally we don't keep the
JavaScript files (we only transpile them when packaging/publishing), it
rendered the `yarn link:bin` setup broken.

As it stands now, it's easier and more straightforward to rely on `yarn
dev` which feeds the `run` script into ts-node, overriding its shebang.

[1] https://github.com/TypeStrong/ts-node
[2] 2b799dc
[3] 0f59937
See [1]. oclif/core doesn't transpile using TypeScript 4.8 at the
moment.

[1] oclif/core#482
@Frederick888 Frederick888 marked this pull request as ready for review September 8, 2022 05:45
@Frederick888 Frederick888 requested a review from a team September 8, 2022 05:45
# Local development

You can run `yarn --cwd /path/to/zcli dev` in a development environment without transpiling ZCLI into JavaScript.

Copy link
Contributor

Choose a reason for hiding this comment

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

could you leave an example here? I usually use something like yarn dev apps:server ./zcli-demo-4

Copy link
Member Author

Choose a reason for hiding this comment

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

I added an example in ee8dd0d. Does it work for you?

@Frederick888
Copy link
Member Author

I'm gonna close this for now since it doesn't work well with things like apps:new, which now creates the new folder in zcli/ instead of $PWD/

@Frederick888 Frederick888 deleted the fzhang/update-dev-docs branch September 13, 2022 06:40
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.

None yet

3 participants