typescript-runtime-type-benchmarks icon indicating copy to clipboard operation
typescript-runtime-type-benchmarks copied to clipboard

Add `to-typed`

Open moltar opened this issue 2 years ago • 4 comments

https://github.com/jsoldi/to-typed

@jsoldi? 😁

moltar avatar Jun 30 '22 03:06 moltar

Happy to help with this but I haven't figured out how to work with this library. I downloaded the package and tried to add a dummy case in the cases folder by cloning one of the existing ones. I also added it to cases/index.ts and did npm run test, npm run docs:build and npm run docs:start but keep seeing the old cases only. Did I miss any step?

jsoldi avatar Jul 06 '22 23:07 jsoldi

@jsoldi looks like you forgot to run the actual benchmarks with npm run start? That will run all cases, write the results to docs/results, which is then shown in the docs ui.

For development, you can also choose which cases are benchmarked by using npm run start run <your-package-name> <another-package-name>.

Also, for your cases to be picked up by the tests you'll need to manually import it here: https://github.com/moltar/typescript-runtime-type-benchmarks/blob/master/test/benchmarks.test.ts

hoeck avatar Jul 07 '22 06:07 hoeck

So it seems that the problem was that I'm on Windows, which doesn't support the shebang code on top of ts-node's bin.js file. I guess this also explains why this file was randomly opening up on my text editor. The way I solved it was by changing this line to this:

const cmd = ['node', ...process.argv.slice(0, 2), 'run-internal', c];

But I'm not sure if that'll work the same on Linux although I think it should.

Anyway, I just sent pull request https://github.com/moltar/typescript-runtime-type-benchmarks/pull/902 with the new to-typed case. I didn't include the change above since that's a separate issue, but feel free to use that code if it work's on Linux too.

jsoldi avatar Jul 09 '22 01:07 jsoldi

@jsoldi ah, thanks for that. Good to know! Will move that into an issue.

moltar avatar Jul 09 '22 09:07 moltar