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

Package Config, ts 5.3, & fixes #138

Merged
merged 14 commits into from
Dec 5, 2023
Merged

Package Config, ts 5.3, & fixes #138

merged 14 commits into from
Dec 5, 2023

Conversation

nonara
Copy link
Owner

@nonara nonara commented Dec 4, 2023

We covered a number of issues in this PR.

Mainly, we added the ability to allow plugin packages to have special config defined within their package.json file under a tsp section. This allows us to tell TSP that our plugin requires full JSDoc parsing to handle the changes made in the recent 5.3 JSDoc parsing changes).

We also fixed several various bugs and added support for chained transformers.

@nonara
Copy link
Owner Author

nonara commented Dec 5, 2023

@samchon Should be all set!

You can have a look at the README for how to implement: https://github.com/nonara/ts-patch/blob/24798a5cd5bf4b511e114d622968d22e72259bc4/README.md#plugin-package-configuration

I'll hold off on a release until you try it out. Seems to be working well in tests.

@samchon
Copy link
Sponsor Contributor

samchon commented Dec 5, 2023

Thanks for development. Which version should I use?

@nonara
Copy link
Owner Author

nonara commented Dec 5, 2023

@samchon It isn't released yet, so for now to test it you can just clone this branch into a new branch on your typia dev dir.

Steps:

  1. Clone the package-config branch of tsp
  2. Run cd ts-patch && yarn install && yarn build
  3. In the package,json that specifies ts-patch — use "ts-patch": "link:<path-to-tsp>/dist"
    • Note: the dist dir is the complete distributable package
  4. In your transformer's package,json — add the tsp clause w/ "parseAllJsDoc": true

You'll probably also want to run ts-patch clear-cache before you try using it. The tsp version number is not incremented yet, so if you have any cache files from the former version, it will use those.

Please let me know when you've confirmed it works!

@nonara
Copy link
Owner Author

nonara commented Dec 5, 2023

This is what you'd add to typia's main package.json

  "tsp": {
    "tscOptions": {
      "parseAllJsDoc": true
    }
  }

To see an example project, have a look at test/assets/projects/package-config

If you get stuck, feel free to share your working branch, and I'll take a look

@nonara nonara changed the title Add PackageConfig + enable overriding tscOptions Package Config, ts 5.3, & fixes Dec 5, 2023
samchon added a commit to samchon/typia that referenced this pull request Dec 5, 2023
@nonara As the `link:<path>` does not work and I do not know how to fix the problem, I just published temporary npm package, and proceed the testing.

You can reproduce it by running the `npm run package:tgz` command, and it is not working as you can see.
@samchon
Copy link
Sponsor Contributor

samchon commented Dec 5, 2023

Not working like above referenced commit.

@nonara
Copy link
Owner Author

nonara commented Dec 5, 2023

Thanks for checking it out.

Protocol for yarn is file I believe, so that should work instead of link.

I'll take a look with your branch tomorrow. What am I looking for? How will I know if it succeeds or fails?

@samchon
Copy link
Sponsor Contributor

samchon commented Dec 5, 2023

You can check it just by running the npm run package:tgz command.

By the way, you should edit packages/test/package.json file for updating.

https://github.com/samchon/typia/blob/68e6be767ae6303674d0cb02dd63664b7d653dfb/packages/test/package.json#L31

@samchon
Copy link
Sponsor Contributor

samchon commented Dec 5, 2023

https://github.com/samchon/ts-patch-typescript-v5.3-test

Here is easier repo for testing.

When testing, just run below command please, with the ts-patch updates.

git clone https://github.com/samchon/ts-patch-typescript-v5.3-test
cd ts-patch-typescript-v5.3-test
npm install
npm start

@nonara nonara merged commit 339768f into master Dec 5, 2023
3 checks passed
@nonara nonara deleted the package-config branch December 5, 2023 18:39
@nonara
Copy link
Owner Author

nonara commented Dec 5, 2023

@samchon Thanks! It needed a minor adjustment for package location logic, but it's working now.

@samchon
Copy link
Sponsor Contributor

samchon commented Dec 6, 2023

Thanks for development. I'll adjust it ASAP.

samchon added a commit to samchon/typia that referenced this pull request Dec 6, 2023
Since TypeScript v5.3 update, `tsc` no more parses `JSDocComment`s. Therefore, `typia` also cannot utilize those `JSDocComment` related features too, especially "Comment Tags" and "JSON schema generator".

To reflect such TypeScript v5.3 update, `typia` has newly added a  temporary CLI command `npx typia patch` that is hacking the TypeScript module to turning on the `JSDocComment` parsing.

  - #883

In today, `ts-patch` has started supporting the TypeScript v5.3 update by reading `package.json` of transformer libraries. Therefore, the temporary CLI command no more required. Following the `ts-patch` guide, this PR has configured the `package.json` file for `ts-patch`, and `JSDocComment` parsing would be turned on by the `ts-patch`.

For reference, the temporary CLI command `npx typia patch` would be kept for a while, due to there can be some users using previous version of `ts-patch`. It would be deprecated after the next major update.
samchon added a commit to samchon/typia that referenced this pull request Dec 6, 2023
samchon added a commit to samchon/nestia that referenced this pull request Dec 6, 2023
Since TypeScript v5.3 update, `tsc` no more parses `JSDocComment`s. Therefore, `typia` also cannot utilize those `JSDocComment` related features too, especially "Comment Tags" and "JSON schema generator".

To reflect such TypeScript v5.3 update, `typia` has newly added a  temporary CLI command `npx typia patch` that is hacking the TypeScript module to turning on the `JSDocComment` parsing. Also, `nestia` has adopted the CLI when running the `npx nestia setup` command.

  - samchon/typia#883
  - #696

In today, `ts-patch` has started supporting the TypeScript v5.3 update by reading `package.json` of transformer libraries. Therefore, the temporary CLI command no more required. Following the `ts-patch` guide, this PR has configured the `package.json` file for `ts-patch`, and `JSDocComment` parsing would be turned on by the `ts-patch`.

For reference, the temporary CLI command `npx typia patch` would be kept for a while, due to there can be some users using previous version of `ts-patch`. It would be deprecated after the next major update.
samchon added a commit to samchon/nestia that referenced this pull request Dec 6, 2023
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

2 participants