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

Migrate to Vite #476

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# dependencies
/node_modules

# production
public/build
# dist
/dist

# IDE - VSCode
.vscode/*
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ yarn start
# Running unit tests
yarn test

# build the project in production mode. The build artifacts will be stored in the `public/build/` directory
# build the project in production mode. The build artifacts will be stored in the `dist/` directory
yarn build

# extracts i18n messages from source code
Expand All @@ -39,8 +39,7 @@ yarn i18n:extract src/locales/zh-Hant.json
## Reference

- [Svelte API reference](https://svelte.dev/docs)
- [Svelte Webpack Template](https://github.com/sveltejs/template-webpack)
- [Svelte Preprocess](https://github.com/sveltejs/svelte-preprocess)
- [Svelte plugin for Vite](https://github.com/sveltejs/vite-plugin-svelte)
- [Svelte Routing](https://github.com/EmilTholin/svelte-routing)
- [Svelte i18n Library](https://github.com/kaisermann/svelte-i18n)
- [Svelte Forms Library](https://github.com/tjinauyeung/svelte-forms-lib)
Expand Down
22 changes: 0 additions & 22 deletions babel.config.json

This file was deleted.

14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Svelte Boilerplate</title>
<link rel="icon" type="image/png" href="/favicon.png" />
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
27 changes: 0 additions & 27 deletions jest.config.js

This file was deleted.

29 changes: 0 additions & 29 deletions jest.global-mocks.ts

This file was deleted.

48 changes: 19 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,47 @@
{
"name": "svelte-boilerplate",
"version": "0.0.0",
"type": "module",
"private": true,
"packageManager": "yarn@3.6.1",
"scripts": {
"build": "cross-env NODE_ENV=production webpack",
"start": "cross-env MOCK=true webpack serve --static-directory public",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"start": "vite",
"build": "tsc && vite build",
"serve": "vite preview",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"lint": "svelte-check",
"i18n:extract": "svelte-i18n extract 'src/**/*.svelte'"
},
"dependencies": {
"axios": "^1.4.0",
"rxjs": "^7.8.1",
"svelte-routing": "^1.10.0"
"svelte-routing": "^1.11.0"
},
"devDependencies": {
"@babel/plugin-transform-react-jsx": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@sveltejs/vite-plugin-svelte": "^2.4.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/svelte": "^3.2.2",
"@testing-library/svelte": "^4.0.3",
"@testing-library/user-event": "^14.4.3",
"@tsconfig/svelte": "^4.0.1",
"@tsconfig/svelte": "^5.0.0",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.2",
"babel-jest": "^29.5.0",
"@types/node": "^20.3.3",
"@vitest/coverage-v8": "^0.32.4",
"bootstrap": "^5.3.0",
"bootstrap-icons": "^1.10.5",
"cross-env": "^7.0.3",
"css-loader": "^6.8.1",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"mini-css-extract-plugin": "^2.7.6",
"jsdom": "^22.1.0",
"msw": "^1.2.2",
"sass": "^1.63.6",
"sass-loader": "^13.3.2",
"svelte": "^3.59.2",
"svelte": "^4.0.3",
"svelte-check": "^3.4.4",
"svelte-forms-lib": "^2.0.1",
"svelte-htm": "^1.2.0",
"svelte-i18n": "^3.6.0",
"svelte-jester": "^2.3.2",
"svelte-jsx": "^2.0.0",
"svelte-loader": "^3.1.9",
"svelte-preprocess": "^5.0.4",
"ts-loader": "^9.4.3",
"tslib": "^2.6.0",
"typescript": "~5.1.3",
"webpack": "^5.88.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
"typescript": "~5.1.6",
"vite": "^4.3.9",
"vitest": "^0.32.4"
},
"resolutions": {
"semver": "^7.5.3"
Expand Down
17 changes: 0 additions & 17 deletions public/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/actions/clickOutside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Action } from './types';

export function clickOutside(
node: HTMLElement,
params: { enabled: boolean; cb: Function }
params: { enabled: boolean; cb: () => void }
): ReturnType<Action> {
const { enabled: initialEnabled, cb } = params;

Expand Down
4 changes: 2 additions & 2 deletions src/actions/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type Action = (node: HTMLElement, parameters: any) => {
update?: (parameters: any) => void,
export type Action = (node: HTMLElement, parameters: unknown) => {
update?: (parameters: unknown) => void,
destroy?: () => void
}
Loading