-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d74b04f
commit 97c4974
Showing
11 changed files
with
192 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: fmt-check | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches-ignore: | ||
- 'develop' | ||
- 'develop*' | ||
- 'archive/**' | ||
- 'deploy/**' | ||
paths-ignore: | ||
- '.gitignore' | ||
- '**.png' | ||
- '**.jpg' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
fmt-check: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
strategy: | ||
fail-fast: true | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Node.js 20.x | ||
uses: actions/[email protected] | ||
id: setup_node_id | ||
with: | ||
node-version: 20 | ||
cache: 'yarn' | ||
cache-dependency-path: yarn.lock | ||
|
||
# - run: echo '${{ toJSON(steps.setup_node_id.outputs) }}' | ||
# - if: ${{ steps.setup_node_id.outputs.cache-hit != 'true' }} | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Setup | ||
run: yarn fmt | ||
|
||
- name: Check if there is no file diff | ||
run: yarn zz:check:no-diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import prettier from "eslint-config-prettier"; | ||
import js from '@eslint/js'; | ||
import { includeIgnoreFile } from '@eslint/compat'; | ||
import js from '@eslint/js'; | ||
import prettier from 'eslint-config-prettier'; | ||
import svelte from 'eslint-plugin-svelte'; | ||
import globals from 'globals'; | ||
import { fileURLToPath } from 'node:url'; | ||
import ts from 'typescript-eslint'; | ||
const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url)); | ||
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); | ||
|
||
export default ts.config( | ||
includeIgnoreFile(gitignorePath), | ||
js.configs.recommended, | ||
...ts.configs.recommended, | ||
...svelte.configs["flat/recommended"], | ||
...svelte.configs['flat/recommended'], | ||
prettier, | ||
...svelte.configs['flat/prettier'], | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node | ||
} | ||
} | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.svelte"], | ||
files: ['**/*.svelte'], | ||
|
||
languageOptions: { | ||
parserOptions: { | ||
parser: ts.parser | ||
} | ||
} | ||
} | ||
parserOptions: { | ||
parser: ts.parser, | ||
}, | ||
}, | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
{ | ||
"name": "my-svelte-app", | ||
"private": true, | ||
"version": "0.0.1", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"prepare": "svelte-kit sync || echo ''", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"format": "prettier --write .", | ||
"lint": "prettier --check . && eslint .", | ||
"test:unit": "vitest", | ||
"test": "npm run test:unit -- --run" | ||
}, | ||
"devDependencies": { | ||
"@eslint/compat": "^1.2.5", | ||
"@eslint/js": "^9.18.0", | ||
"@sveltejs/adapter-auto": "^4.0.0", | ||
"@sveltejs/kit": "^2.16.0", | ||
"@sveltejs/vite-plugin-svelte": "^5.0.0", | ||
"@testing-library/jest-dom": "^6.6.3", | ||
"@testing-library/svelte": "^5.2.4", | ||
"eslint": "^9.18.0", | ||
"eslint-config-prettier": "^10.0.1", | ||
"eslint-plugin-svelte": "^2.46.1", | ||
"globals": "^15.14.0", | ||
"jsdom": "^25.0.1", | ||
"prettier": "^3.4.2", | ||
"prettier-plugin-svelte": "^3.3.3", | ||
"svelte": "^5.0.0", | ||
"svelte-check": "^4.0.0", | ||
"typescript": "^5.0.0", | ||
"typescript-eslint": "^8.20.0", | ||
"vite": "^6.0.0", | ||
"vitest": "^3.0.0" | ||
} | ||
"name": "my-svelte-app", | ||
"version": "0.0.1", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"build": "vite build", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"dev": "vite dev", | ||
"format": "prettier --write .", | ||
"lint": "prettier --check . && eslint .", | ||
"prepare": "svelte-kit sync || echo ''", | ||
"preview": "vite preview", | ||
"test": "npm run test:unit -- --run", | ||
"test:unit": "vitest" | ||
}, | ||
"devDependencies": { | ||
"@eslint/compat": "^1.2.5", | ||
"@eslint/js": "^9.18.0", | ||
"@sveltejs/adapter-auto": "^4.0.0", | ||
"@sveltejs/kit": "^2.16.0", | ||
"@sveltejs/vite-plugin-svelte": "^5.0.0", | ||
"@testing-library/jest-dom": "^6.6.3", | ||
"@testing-library/svelte": "^5.2.4", | ||
"eslint": "^9.18.0", | ||
"eslint-config-prettier": "^10.0.1", | ||
"eslint-plugin-svelte": "^2.46.1", | ||
"globals": "^15.14.0", | ||
"jsdom": "^25.0.1", | ||
"prettier": "^3.4.2", | ||
"prettier-plugin-svelte": "^3.3.3", | ||
"svelte": "^5.0.0", | ||
"svelte-check": "^4.0.0", | ||
"typescript": "^5.0.0", | ||
"typescript-eslint": "^8.20.0", | ||
"vite": "^6.0.0", | ||
"vitest": "^3.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// See https://svelte.dev/docs/kit/types#app.d.ts | ||
// for information about these interfaces | ||
declare global { | ||
namespace App { | ||
// interface Error {} | ||
// interface Locals {} | ||
// interface PageData {} | ||
// interface PageState {} | ||
// interface Platform {} | ||
} | ||
namespace App { | ||
// interface Error {} | ||
// interface Locals {} | ||
// interface PageData {} | ||
// interface PageState {} | ||
// interface Platform {} | ||
} | ||
} | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="%sveltekit.assets%/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
%sveltekit.head% | ||
</head> | ||
<body data-sveltekit-preload-data="hover"> | ||
<div style="display: contents">%sveltekit.body%</div> | ||
</body> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
%sveltekit.head% | ||
</head> | ||
<body data-sveltekit-preload-data="hover"> | ||
<div style="display: contents">%sveltekit.body%</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
describe('sum test', () => { | ||
it('adds 1 + 2 to equal 3', () => { | ||
expect(1 + 2).toBe(3); | ||
}); | ||
it('adds 1 + 2 to equal 3', () => { | ||
expect(1 + 2).toBe(3); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"extends": "./.svelte-kit/tsconfig.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"checkJs": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"moduleResolution": "bundler" | ||
} | ||
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias | ||
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files | ||
// | ||
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes | ||
// from the referenced tsconfig.json - TypeScript does not merge them in | ||
"extends": "./.svelte-kit/tsconfig.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"checkJs": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"moduleResolution": "bundler" | ||
} | ||
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias | ||
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files | ||
// | ||
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes | ||
// from the referenced tsconfig.json - TypeScript does not merge them in | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
import { svelteTesting } from "@testing-library/svelte/vite"; | ||
import { sveltekit } from '@sveltejs/kit/vite'; | ||
import { svelteTesting } from '@testing-library/svelte/vite'; | ||
import { defineConfig } from 'vite'; | ||
|
||
export default defineConfig({ | ||
plugins: [sveltekit()], | ||
plugins: [sveltekit()], | ||
|
||
test: { | ||
workspace: [{ | ||
extends: "./vite.config.ts", | ||
plugins: [svelteTesting()], | ||
test: { | ||
workspace: [ | ||
{ | ||
extends: './vite.config.ts', | ||
plugins: [svelteTesting()], | ||
|
||
test: { | ||
name: "client", | ||
environment: "jsdom", | ||
clearMocks: true, | ||
include: ['src/**/*.svelte.{test,spec}.{js,ts}'], | ||
exclude: ['src/lib/server/**'], | ||
setupFiles: ['./vitest-setup-client.ts'] | ||
} | ||
}, { | ||
extends: "./vite.config.ts", | ||
test: { | ||
name: 'client', | ||
environment: 'jsdom', | ||
clearMocks: true, | ||
include: ['src/**/*.svelte.{test,spec}.{js,ts}'], | ||
exclude: ['src/lib/server/**'], | ||
setupFiles: ['./vitest-setup-client.ts'], | ||
}, | ||
}, | ||
{ | ||
extends: './vite.config.ts', | ||
|
||
test: { | ||
name: "server", | ||
environment: "node", | ||
include: ['src/**/*.{test,spec}.{js,ts}'], | ||
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}'] | ||
} | ||
}] | ||
} | ||
test: { | ||
name: 'server', | ||
environment: 'node', | ||
include: ['src/**/*.{test,spec}.{js,ts}'], | ||
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}'], | ||
}, | ||
}, | ||
], | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters