A SvelteKit application for processing and analyzing water temperature data from CSV files.
Here's a short video of the component working.
git clone <repository-url>
cd datastream-svelte-csv
If using nvm, the correct Node.js version will be set automatically:
nvm use
Or manually install Node.js v22 if not using nvm.
npm install
This will automatically:
prepare script)Playwright requires browser binaries to be installed separately:
npx playwright install chromium
If you encounter system dependency issues on Linux, use:
npx playwright install chromium --with-deps
npm run dev
The application will be available at http://localhost:5173
npm run build
Static files will be generated in the build/ directory.
npm run preview
Serves the production build locally at http://localhost:4173
Format all files with Prettier:
npm run format
Note: Prettier runs automatically on staged files when you commit (via pre-commit hook).
npm run check
Run type checking in watch mode:
npm run check:watch
npm test
This runs both unit tests (Jest) and browser tests (Playwright) sequentially.
Run unit tests only:
npm run test:unit
Unit tests are located in src/ with the pattern *.test.ts.
Run browser tests only:
npm run test:browser
Browser tests are located in tests/ with the pattern *.spec.ts.
Note: Browser tests require the application to be built first. The test script automatically builds and starts a preview server.
npm run test:ci
This is the same as npm test and is used in the GitHub Actions workflow.
This project uses Husky for git hooks:
lint-staged which formats staged files with PrettierThe hooks are automatically installed when you run npm install. If you need to reinstall them manually:
npx husky install
This project uses GitHub Actions for continuous integration. The workflow is defined in .github/workflows/ci.yml.
The CI pipeline runs on:
main branchmain branchnpm ci for clean dependency installationnpm run test:ci (unit + integration tests)If the pre-commit hook isn't working:
npx husky install
Ensure Playwright browsers are installed:
npx playwright install chromium
Regenerate SvelteKit types:
npx svelte-kit sync