-
Notifications
You must be signed in to change notification settings - Fork 3
refactor(all): initialize TypeScript environment #12
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
base: main
Are you sure you want to change the base?
Conversation
Why: for migrating the project from JavaScript to TypeScript. What: - Added `tsconfig.json` for the main application code and `tsconfig.node.json` for build-related files like the Vite config. - Converted `vite.config.js` to `vite.config.ts` to make the build configuration type-safe. - Created `src/vite-env.d.ts` to include Vite-specific client type definitions. - Migrated the main entry point from `src/main.jsx` to `src/main.tsx`. - Installed TypeScript, type definitions (`@types/*`), and ESLint plugins (`@typescript-eslint/*`) as dev dependencies. - Created a new `eslint.config.js` to support TypeScript and React linting rules. Changes to be committed: modified: eslint.config.js modified: package-lock.json modified: package.json deleted: src/main.jsx new file: src/main.tsx new file: src/vite-env.d.ts new file: tsconfig.json new file: tsconfig.node.json new file: vite.config.ts
Why: migration to TypeScript by converting the main `App` component. includes clean-up and fixes for the TypeScript and build configurations What: - Renamed `App.jsx` to `App.tsx` and updated its import in `main.tsx`. - Explicitly typed the `App` component with `React.FC` for better clarity and type safety. - Corrected issues in `tsconfig.json` and `tsconfig.node.json` related to project references and file emission, simplifying the setup. - Removed the old `vite.config.js` file, as it has been fully replaced by `vite.config.ts`. Changes to be committed: modified: package-lock.json modified: package.json renamed: src/App.jsx -> src/App.tsx modified: src/main.tsx modified: tsconfig.json modified: tsconfig.node.json deleted: vite.config.js modified: vite.config.ts
Why: Improves the organization of files and is easier to debug What: - The main `src/types/index.ts` acts as main source - Created individual type definition files for each synthesizer module (`envelope.ts`, `filter.ts`, `lfo.ts`, `oscillator.ts`, `effects.ts`, `sequencer.ts`). - Expanded the core `SynthState` interface to include modules mentioned in readme . - Added new interfaces for `Oscillator` and `SequencerStep`. - Converted the `path.js` constants file to `path.ts` to ensure type-safe handling of asset paths. Changes to be committed: new file: src/types/effects.ts new file: src/types/envelope.ts new file: src/types/eq.ts new file: src/types/filter.ts new file: src/types/index.ts new file: src/types/lfo.ts new file: src/types/oscillator.ts new file: src/types/path.ts new file: src/types/sequencer.ts new file: src/types/waveform.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Anurag, we are using Bun as the package manager cum runtime. You have tested this code out over node js. Kindly go through the project readme and documentation once. You should delete the package-lock.json file and built the app with vite.
As far as I do remember, when we are using bun as the runtime, we do not even require to explicitly create files like tsconfig etc. Although do confirm that once.
|
Hi @baync180705 unsure about this being mention in #7.
Regarding tsconfig.json (https://bun.com/docs/typescript) came across this and have proceeded with the same. |
Why:
for migrating the project from JavaScript to TypeScript.
What:
tsconfig.jsonfor the main application code andtsconfig.node.jsonfor build-related files like the Vite config.vite.config.jstovite.config.tsto make the build configuration type-safe.src/vite-env.d.tsto include Vite-specific client type definitions.src/main.jsxtosrc/main.tsx.@types/*), and ESLint plugins (@typescript-eslint/*) as dev dependencies.eslint.config.jsto support TypeScript and React linting rules.closes (#7)