Skip to content
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
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
38 changes: 19 additions & 19 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript'),
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019,
},
env: {
browser: true,
es2017: true,
node: true,
},
}
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
};
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ node_modules
/build
/.svelte-kit
/package

.vercel
.vercel_build_output
.env
.env.*
!.env.example
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
15 changes: 13 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
*.md
yarn.lock
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
12 changes: 7 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"useTabs": false,
"singleQuote": true,
"semi": false,
"trailingComma": "all",
"printWidth": 100
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
2 changes: 1 addition & 1 deletion jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '@testing-library/jest-dom/extend-expect'
import 'jest-canvas-mock'

// Sveltekit Mocks
jest.mock('$app/env.js', () => ({
jest.mock('$app/environment.js', () => ({
amp: false,
browser: false,
dev: true,
Expand Down
121 changes: 61 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
{
"name": "learn-manoonchai",
"version": "1.2.1",
"license": "MIT",
"scripts": {
"dev": "svelte-kit dev",
"build": "svelte-kit build",
"preview": "svelte-kit preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .",
"test": "jest test --config jest.config.js",
"test:watch": "npm run test -- --watch",
"test:e2e": "playwright test ./e2e",
"semantic-release": "semantic-release"
},
"devDependencies": {
"@fortawesome/free-brands-svg-icons": "^5.15.4",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@playwright/test": "^1.16.2",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@sveltejs/adapter-vercel": "next",
"@sveltejs/kit": "next",
"@testing-library/jest-dom": "^5.14.0",
"@testing-library/svelte": "^3.0.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.0.0",
"@types/testing-library__jest-dom": "^5.14.0",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"autoprefixer": "^10.4.1",
"chart.js": "^3.7.0",
"cssnano": "^5.0.8",
"eslint": "^8.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^3.2.1",
"jest": "^27.3.1",
"jest-canvas-mock": "^2.3.1",
"postcss": "^8.4.5",
"postcss-load-config": "^3.1.0",
"prettier": "^2.4.1",
"prettier-plugin-svelte": "^2.4.0",
"semantic-release": "^18.0.0",
"svelte": "^3.44.0",
"svelte-check": "^2.2.6",
"svelte-fa": "^2.3.3",
"svelte-jester": "^2.0.1",
"svelte-preprocess": "^4.9.8",
"tailwindcss": "^3.0.11",
"ts-jest": "^27.0.7",
"tslib": "^2.3.1",
"typescript": "^4.4.3"
},
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/Manoonchai/learn.git"
},
"dependencies": {}
"name": "learn-manoonchai",
"version": "1.2.1",
"license": "MIT",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "jest test --config jest.config.js",
"test:watch": "npm run test -- --watch",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"test:e2e": "playwright test ./e2e",
"semantic-release": "semantic-release"
},
"devDependencies": {
"@fortawesome/free-brands-svg-icons": "^5.15.4",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@playwright/test": "1.25.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@sveltejs/adapter-auto": "next",
"@sveltejs/kit": "^1.0.0-next.535",
"@testing-library/jest-dom": "^5.14.0",
"@testing-library/svelte": "^3.0.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.0.0",
"@types/testing-library__jest-dom": "^5.14.0",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"autoprefixer": "^10.4.7",
"chart.js": "^3.7.0",
"cssnano": "^5.0.8",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^4.0.0",
"jest": "^27.3.1",
"jest-canvas-mock": "^2.3.1",
"postcss": "^8.4.14",
"postcss-load-config": "^4.0.1",
"prettier": "^2.6.2",
"prettier-plugin-svelte": "^2.7.0",
"semantic-release": "^18.0.0",
"svelte": "^3.44.0",
"svelte-check": "^2.7.1",
"svelte-fa": "^2.3.3",
"svelte-jester": "^2.0.1",
"svelte-preprocess": "^4.10.7",
"tailwindcss": "^3.1.5",
"ts-jest": "^27.0.7",
"tslib": "^2.3.1",
"typescript": "^4.7.4",
"vite": "^3.1.0"
},
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/Manoonchai/learn.git"
},
"dependencies": {}
}
10 changes: 10 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173
}
};

export default config;
27 changes: 10 additions & 17 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
const tailwindcss = require('tailwindcss')
const autoprefixer = require('autoprefixer')
const cssnano = require('cssnano')

const mode = process.env.NODE_ENV
const dev = mode === 'development'
const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');

const config = {
plugins: [
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
tailwindcss(), //Some plugins, like tailwindcss/nesting, need to run before Tailwind, tailwindcss(), //But others, like autoprefixer, need to run after, //But others, like autoprefixer, need to run after,
autoprefixer(),
!dev &&
cssnano({
preset: 'default',
}),
],
}
plugins: [
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
tailwindcss(),
//But others, like autoprefixer, need to run after,
autoprefixer
]
};

module.exports = config
module.exports = config;
28 changes: 0 additions & 28 deletions src/app.css

This file was deleted.

13 changes: 13 additions & 0 deletions src/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
// and what to do when importing types
declare namespace App {
// interface Locals {}
// interface PageData {}
// interface Error {}
// interface Platform {}
}

interface Window {
kofiWidgetOverlay: any;
}
18 changes: 9 additions & 9 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%svelte.head%
</head>
<body>
<div id="svelte">%svelte.body%</div>
</body>
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body>
<div>%sveltekit.body%</div>
</body>
</html>
36 changes: 36 additions & 0 deletions src/app.postcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* Write your global styles here, in PostCSS syntax */

/* Write your global styles here, in PostCSS syntax */

@import url('https://fonts.googleapis.com/css2?family=Sarabun&display=swap');

@tailwind base;

.font-sarabun {
font-family: 'Sarabun', sans-serif;
}

.input:focus {
outline: none;
}

.dark .shadow-white {
box-shadow: 0px 10px 20px #fcfcfc5d;
}

html .dark {
background-color: black;
}

::-webkit-scrollbar {
width: 0px;
}

::selection {
background-color: #05d616;
color: #fff;
}

@tailwind components;

@tailwind utilities;
5 changes: 0 additions & 5 deletions src/global.d.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/lib/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { writable } from 'svelte/store'
import { browser } from '$app/env'
import { browser } from '$app/environment'

interface ISetting {
showKeymap: boolean
Expand Down Expand Up @@ -92,4 +92,4 @@ export default {
DarkMode,
GlowKey,
currentLessonName,
}
}
Loading