-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding option & lint * cleanup * add some docs ;)
- Loading branch information
Showing
31 changed files
with
460 additions
and
406 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,5 @@ | ||
--- | ||
'vite-plugin-kit-routes': patch | ||
--- | ||
|
||
remove a warning log that is internal |
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,5 @@ | ||
--- | ||
'@kitql/eslint-config': patch | ||
--- | ||
|
||
add option to format by file/dir/glob with arg `-g` |
16 changes: 0 additions & 16 deletions
16
packages/create-kitql/templates/sveltekit-remult/.eslintignore
This file was deleted.
Oops, something went wrong.
35 changes: 3 additions & 32 deletions
35
packages/create-kitql/templates/sveltekit-remult/.eslintrc.cjs
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,5 @@ | ||
/** @type { import("eslint").Linter.FlatConfig } */ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:svelte/recommended', | ||
'prettier' | ||
], | ||
rules: { | ||
// Some specific rules ? | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 2020, | ||
extraFileExtensions: ['.svelte'] | ||
}, | ||
env: { | ||
browser: true, | ||
es2017: true, | ||
node: true | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.svelte'], | ||
parser: 'svelte-eslint-parser', | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser' | ||
} | ||
} | ||
] | ||
}; | ||
extends: ['@kitql'], | ||
rules: {}, | ||
} |
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,5 +1,5 @@ | ||
{ | ||
"label": "SvelteKit Remult", | ||
"hint": "Minimul setup for SvelteKit & Remult", | ||
"order": 2 | ||
"label": "SvelteKit Remult", | ||
"hint": "Minimul setup for SvelteKit & Remult", | ||
"order": 2 | ||
} |
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 |
---|---|---|
|
@@ -13,4 +13,4 @@ package-lock.json | |
yarn.lock | ||
|
||
# Ignore files that are project specific | ||
/db | ||
/db |
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
packages/create-kitql/templates/sveltekit-remult/.prettierrc.cjs
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,6 @@ | ||
const config = require('@kitql/eslint-config/.prettierrc.cjs') | ||
|
||
module.exports = { | ||
...config, | ||
// Some custom things? | ||
} |
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
72 changes: 33 additions & 39 deletions
72
packages/create-kitql/templates/sveltekit-remult/package.json
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,41 +1,35 @@ | ||
{ | ||
"name": "create-kitql-sveltekit-remult", | ||
"version": "0.0.1", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:w": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"format": "prettier --write .", | ||
"lint": "prettier --check . && eslint .", | ||
"test": "vitest", | ||
"test:e2e": "playwright test", | ||
"test:ci": "npm run test:e2e && npm run test" | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "^1.28.1", | ||
"@sveltejs/adapter-auto": "^3.0.0", | ||
"@sveltejs/kit": "^2.0.0", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.0", | ||
"@typescript-eslint/eslint-plugin": "^6.0.0", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"eslint": "^8.28.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-svelte": "^2.30.0", | ||
"pg": "^8.11.3", | ||
"prettier": "^3.0.0", | ||
"prettier-plugin-svelte": "^3.0.0", | ||
"remult": "^0.24.1", | ||
"svelte": "^4.2.7", | ||
"svelte-check": "^3.6.0", | ||
"tslib": "^2.4.1", | ||
"typescript": "^5.0.0", | ||
"vite": "^5.0.0", | ||
"vite-plugin-kit-routes": "0.5.0", | ||
"vite-plugin-striper": "0.3.1", | ||
"vitest": "^1.0.0" | ||
} | ||
"name": "create-kitql-sveltekit-remult", | ||
"version": "0.0.1", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"build": "vite build", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check:w": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"dev": "vite dev", | ||
"format": "kitql-lint --format", | ||
"lint": "kitql-lint", | ||
"preview": "vite preview", | ||
"test": "vitest", | ||
"test:ci": "npm run test:e2e && npm run test", | ||
"test:e2e": "playwright test" | ||
}, | ||
"devDependencies": { | ||
"@kitql/eslint-config": "^0.1.0", | ||
"@playwright/test": "^1.28.1", | ||
"@sveltejs/adapter-auto": "^3.0.0", | ||
"@sveltejs/kit": "^2.0.0", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.0", | ||
"pg": "^8.11.3", | ||
"remult": "^0.24.1", | ||
"svelte": "^4.2.7", | ||
"svelte-check": "^3.6.0", | ||
"tslib": "^2.4.1", | ||
"typescript": "^5.0.0", | ||
"vite": "^5.0.0", | ||
"vite-plugin-kit-routes": "^0.5.0", | ||
"vite-plugin-stripper": "^0.3.2", | ||
"vitest": "^1.0.0" | ||
} | ||
} |
16 changes: 8 additions & 8 deletions
16
packages/create-kitql/templates/sveltekit-remult/playwright.config.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import type { PlaywrightTestConfig } from '@playwright/test'; | ||
import type { PlaywrightTestConfig } from '@playwright/test' | ||
|
||
const config: PlaywrightTestConfig = { | ||
webServer: { | ||
command: 'npm run build && npm run preview', | ||
port: 4173 | ||
}, | ||
testMatch: /(.+\.)?(e2e)\.[jt]s/ | ||
}; | ||
webServer: { | ||
command: 'npm run build && npm run preview', | ||
port: 4173, | ||
}, | ||
testMatch: /(.+\.)?(e2e)\.[jt]s/, | ||
} | ||
|
||
export default config; | ||
export default config |
14 changes: 7 additions & 7 deletions
14
packages/create-kitql/templates/sveltekit-remult/src/app.d.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// See https://kit.svelte.dev/docs/types#app | ||
// for information about these interfaces | ||
declare global { | ||
namespace App { | ||
// interface Error {} | ||
// interface Locals {} | ||
// interface PageData {} | ||
// interface Platform {} | ||
} | ||
namespace App { | ||
// interface Error {} | ||
// interface Locals {} | ||
// interface PageData {} | ||
// interface Platform {} | ||
} | ||
} | ||
|
||
export {}; | ||
export {} |
18 changes: 9 additions & 9 deletions
18
packages/create-kitql/templates/sveltekit-remult/src/app.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,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> |
7 changes: 4 additions & 3 deletions
7
packages/create-kitql/templates/sveltekit-remult/src/hooks.server.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { sequence } from '@sveltejs/kit/hooks'; | ||
import { handleRemult } from './hooks/handleRemult'; | ||
import { sequence } from '@sveltejs/kit/hooks' | ||
|
||
export const handle = sequence(handleRemult); | ||
import { handleRemult } from './hooks/handleRemult' | ||
|
||
export const handle = sequence(handleRemult) |
41 changes: 21 additions & 20 deletions
41
packages/create-kitql/templates/sveltekit-remult/src/hooks/handleRemult.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import { remultSveltekit } from 'remult/remult-sveltekit'; | ||
import { remult } from 'remult' | ||
import { remultSveltekit } from 'remult/remult-sveltekit' | ||
|
||
// import { createPostgresDataProvider } from 'remult/postgres'; | ||
// import { DATABASE_URL } from '$env/static/private'; | ||
import { entities, controllers } from '../shared'; | ||
import { remult } from 'remult'; | ||
import { Task } from '../shared'; | ||
import { entities, controllers } from '../shared' | ||
import { Task } from '../shared' | ||
|
||
export const handleRemult = remultSveltekit({ | ||
// dataProvider: createPostgresDataProvider({ connectionString: DATABASE_URL }) | ||
entities, | ||
controllers, | ||
initApi: async () => { | ||
try { | ||
if ((await remult.repo(Task).count()) === 0) { | ||
await remult.repo(Task).insert({ title: 'Well done!' }); | ||
await remult | ||
.repo(Task) | ||
.insert({ title: "You've successfully created a new KitQL remult project. 🚀" }); | ||
} | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
} | ||
}); | ||
// dataProvider: createPostgresDataProvider({ connectionString: DATABASE_URL }) | ||
entities, | ||
controllers, | ||
initApi: async () => { | ||
try { | ||
if ((await remult.repo(Task).count()) === 0) { | ||
await remult.repo(Task).insert({ title: 'Well done!' }) | ||
await remult | ||
.repo(Task) | ||
.insert({ title: "You've successfully created a new KitQL remult project. 🚀" }) | ||
} | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
}, | ||
}) |
13 changes: 7 additions & 6 deletions
13
packages/create-kitql/templates/sveltekit-remult/src/lib/ROUTES.spec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import { route } from './ROUTES'; | ||
import { describe, it, expect } from 'vitest' | ||
|
||
import { route } from './ROUTES' | ||
|
||
describe('ROUTES', () => { | ||
it('root path is /', () => { | ||
expect(route('/')).toBe('/'); | ||
}); | ||
}); | ||
it('root path is /', () => { | ||
expect(route('/')).toBe('/') | ||
}) | ||
}) |
Oops, something went wrong.