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

feat: Improve performance of running TypeScript files #261

Closed
psychobolt opened this issue Dec 25, 2023 · 4 comments
Closed

feat: Improve performance of running TypeScript files #261

psychobolt opened this issue Dec 25, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@psychobolt
Copy link
Owner

psychobolt commented Dec 25, 2023

Since we already run TypeScript lint, we can disable type checking. Look into the possibility of using SWC instead.

We also need to turn on type checking for all TS files including config files such as vite.config.ts...

@psychobolt psychobolt added the enhancement New feature or request label Dec 25, 2023
@psychobolt psychobolt self-assigned this Jan 5, 2024
@psychobolt psychobolt pinned this issue Jan 5, 2024
@psychobolt
Copy link
Owner Author

Updated project to support SWC, but still relies on ts-node until we can switch to swc-node . Tracking swc-project/swc-node#744

@yeliex
Copy link

yeliex commented Jan 12, 2024

@psychobolt try use @swc-node/register@1.6.7, it works well

@psychobolt
Copy link
Owner Author

psychobolt commented Jan 17, 2024

@yeliex I managed to get my workspace scripts working with the register. The only problem remains is when running ESLint bin in workspace and in VSCode:

ESLint bin fails:
https://github.com/psychobolt/vite-storybook-boilerplate/actions/runs/7559793715/job/20584394774?pr=340#step:5:20

ESLint server log:

[Info  - 9:47:01 AM] ESLint server is starting.
[Info  - 9:47:08 AM] ESLint server running in node v20.10.0
[Info  - 9:47:08 AM] ESLint server is running.
[Info  - 9:47:11 AM] ESLint library loaded from: /Users/mitran/Projects/vite-storybook-boilerplate/.yarn/sdks/eslint/lib/unsupported-api.js
2024-01-17T17:47:11.038Z eslint:flat-eslint Override config file path is ./eslint.config.ts
2024-01-17T17:47:11.040Z eslint:flat-eslint Loading config from /Users/mitran/Projects/vite-storybook-boilerplate/eslint.config.ts
2024-01-17T17:47:11.040Z eslint:flat-eslint Config file URL is file:///Users/mitran/Projects/vite-storybook-boilerplate/eslint.config.ts
[Error - 9:47:11 AM] An unexpected error occurred:
[Error - 9:47:11 AM] TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/mitran/Projects/vite-storybook-boilerplate/eslint.config.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
    at defaultLoad (node:internal/modules/esm/load:141:22)
    at async nextLoad (node:internal/modules/esm/hooks:865:22)
    at async nextLoad (node:internal/modules/esm/hooks:865:22)
    at async nextLoad (node:internal/modules/esm/hooks:865:22)
    at async Hooks.load (node:internal/modules/esm/hooks:448:20)
    at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18)

I am hoping the PR you made will resolve this issue.

@psychobolt
Copy link
Owner Author

psychobolt commented Feb 9, 2024

Update: My proposed patch resolves the issue above and includes fix swc-project/swc-node#754

@psychobolt psychobolt unpinned this issue Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants