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

Better logging when using typia with yarn #744

Closed
enyineer opened this issue Aug 4, 2023 · 3 comments
Closed

Better logging when using typia with yarn #744

enyineer opened this issue Aug 4, 2023 · 3 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers wontfix This will not be worked on

Comments

@enyineer
Copy link

enyineer commented Aug 4, 2023

Feature Request

I just stumbled upon a problem while building my TypeScript project inside a Docker container. Locally everything worked fine, but after the docker build with Yarn Berry (v3) i received this error:

`Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,

The problem is, that after using npx typia setup, npm run prepare is called once. With npm this is fine as it is called after every install. However, with Yarn the prepare script is not triggered automatically. This is not a "Docker Container build" problem alone, as this would also hit users that cleanly checked out the project without running npx typia setup.

I'd like to suggest to improve this error message to make users aware that ts-patch has to be installed (or yarn prepare needs to be called manually) when using Yarn Berry as I struggled at first to understand what the problem was. All packages needed were installed and the transformer was configured inside the tsconfig.json - the error message was misleading in that case.

Thanks! Any ideas are welcome :-)

@samchon samchon self-assigned this Aug 7, 2023
@samchon samchon added documentation Improvements or additions to documentation good first issue Good for newcomers labels Aug 7, 2023
@samchon
Copy link
Owner

samchon commented Aug 7, 2023

Will construct another setup logic for yarn berry.

@samchon samchon added bug Something isn't working enhancement New feature or request labels Aug 7, 2023
@samchon
Copy link
Owner

samchon commented Aug 7, 2023

It was not possible to setup on yarn berry, as ts-patch does not support it.

Instead, I'll update the documents.

@samchon samchon added the wontfix This will not be worked on label Aug 7, 2023
@samchon samchon closed this as completed in f5a475d Aug 7, 2023
samchon added a commit that referenced this issue Aug 7, 2023
Fix #744 - change setup wizard to deprecate `yarn berry`.
@enyineer
Copy link
Author

enyineer commented Aug 7, 2023

Thanks for looking into it! Very appreciated.

samchon added a commit to samchon/nestia that referenced this issue Aug 7, 2023
  - Changed setup wizard
  - Introduce not to support `yarn berry`
  - Use `npm run postinstall` command instead

Unfortunately, `ts-patch` does not support `yarn berry`. Therefore, it is not possible to use transform mode of `typia` in the `yarn berry`. Therefore, to inform it and recommend not to use `yarn berry` in `typia`, I've changed setup wizard program. This change would be rolled back when `ts-patch` starts supporting the `yarn berry`.

Also, `yarn berry` does not support the `npm run prepare` command. I think this nonsensible story because the `npm run prepare` command is a standard feature of NPM, but this is the reality, so I can't help it. By the way, if `ts-patch` starts supporting `yarn berry`, configuring `npm run prepare` command by setup wizard can be a big problem. So, I've changed setup wizard to use `npm run postinstall` command instead of the previous `npm run prepare` command.
samchon added a commit to samchon/nestia that referenced this issue Aug 7, 2023
Fix samchon/typia#744 - change setup wizard to deprecate yarn berry
samchon added a commit that referenced this issue Aug 7, 2023
A tiny change does not affect on main setup logic.

So, this commit would be published with next patch.
samchon added a commit to samchon/nestia that referenced this issue Aug 7, 2023
samchon added a commit to samchon/nestia that referenced this issue Aug 7, 2023
Complement samchon/typia#744 - change setup document contents
samchon added a commit that referenced this issue Aug 8, 2023
Enhance #744 - silent setup and enhanced documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants