Modified the start script to run the built JavaScript file.
Updated the dev script to use tsx in watch mode.
Added a build script to compile TypeScript files.
Added typescript as a dependency and organized dependencies for ts-node and tsx.
tsconfig.json updates:
Changed the module option to esnext to enable import.meta.
Set noEmit to false to output compiled files.
Configured outDir to dist to output compiled files to the dist directory.
src/index.ts updates:
Added logic to check if the script is run directly using import.meta.
These changes establish a workflow where TypeScript files are built and then executed, and during development, tsx can be used in watch mode.
To verify that this PR works correctly, run the following commands:
Additionally, during development, you can use the following command to run in watch mode:
package.json updates:
Modified the start script to run the built JavaScript file. Updated the dev script to use tsx in watch mode. Added a build script to compile TypeScript files. Added typescript as a dependency and organized dependencies for ts-node and tsx. tsconfig.json updates:
Changed the module option to esnext to enable import.meta. Set noEmit to false to output compiled files. Configured outDir to dist to output compiled files to the dist directory. src/index.ts updates:
Added logic to check if the script is run directly using import.meta. These changes establish a workflow where TypeScript files are built and then executed, and during development, tsx can be used in watch mode.
To verify that this PR works correctly, run the following commands:
Additionally, during development, you can use the following command to run in watch mode: