Skip to content

Commit 7af1927

Browse files
committed
Initial commit
0 parents  commit 7af1927

13 files changed

+124
-0
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/dist
5+
/.svelte-kit
6+
/package
7+
.env
8+
.env.*
9+
!.env.example
10+
vite.config.js.timestamp-*
11+
vite.config.ts.timestamp-*

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a reimplementation of https://github.com/kenoxa/svelte-hyperscript, but for Svelte 4.

jsconfig.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./.svelte-kit/tsconfig.json",
3+
"compilerOptions": {
4+
"esModuleInterop": true,
5+
"forceConsistentCasingInFileNames": true,
6+
"resolveJsonModule": true,
7+
"skipLibCheck": true,
8+
"sourceMap": true,
9+
"moduleResolution": "NodeNext"
10+
}
11+
}

package.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@mitcheljager/svelte-hyperscript",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"dev": "vite dev",
6+
"build": "vite build && npm run package",
7+
"preview": "vite preview",
8+
"package": "svelte-kit sync && svelte-package && publint",
9+
"prepublishOnly": "npm run package",
10+
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
11+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
12+
"test": "vitest"
13+
},
14+
"exports": {
15+
".": {
16+
"types": "./dist/index.d.ts",
17+
"svelte": "./dist/index.js"
18+
}
19+
},
20+
"files": [
21+
"dist",
22+
"!dist/**/*.test.*",
23+
"!dist/**/*.spec.*"
24+
],
25+
"peerDependencies": {
26+
"svelte": "^4.0.0"
27+
},
28+
"devDependencies": {
29+
"@sveltejs/adapter-auto": "^2.0.0",
30+
"@sveltejs/kit": "^1.20.4",
31+
"@sveltejs/package": "^2.0.0",
32+
"publint": "^0.1.9",
33+
"svelte": "^4.0.5",
34+
"svelte-check": "^3.4.3",
35+
"tslib": "^2.4.1",
36+
"typescript": "^5.0.0",
37+
"vite": "^4.4.2",
38+
"vitest": "^0.34.0"
39+
},
40+
"svelte": "./dist/index.js",
41+
"types": "./dist/index.d.ts",
42+
"type": "module"
43+
}

src/app.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// See https://kit.svelte.dev/docs/types#app
2+
// for information about these interfaces
3+
declare global {
4+
namespace App {
5+
// interface Error {}
6+
// interface Locals {}
7+
// interface PageData {}
8+
// interface Platform {}
9+
}
10+
}
11+
12+
export {};

src/app.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
%sveltekit.head%
8+
</head>
9+
<body data-sveltekit-preload-data="hover">
10+
<div>%sveltekit.body%</div>
11+
</body>
12+
</html>

src/index.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { describe, it, expect } from 'vitest';
2+
3+
describe('sum test', () => {
4+
it('adds 1 + 2 to equal 3', () => {
5+
expect(1 + 2).toBe(3);
6+
});
7+
});

src/lib/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Reexport your entry components here

src/routes/+page.svelte

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h1>Welcome to your library project</h1>
2+
<p>Create your package using @sveltejs/package and preview/showcase your work with SvelteKit</p>
3+
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

static/favicon.png

1.53 KB
Loading

svelte.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import adapter from '@sveltejs/adapter-auto';
2+
3+
/** @type {import('@sveltejs/kit').Config} */
4+
const config = {
5+
kit: {
6+
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
7+
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
8+
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
9+
adapter: adapter()
10+
}
11+
};
12+
13+
export default config;

vite.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { sveltekit } from '@sveltejs/kit/vite';
2+
import { defineConfig } from 'vitest/config';
3+
4+
export default defineConfig({
5+
plugins: [sveltekit()],
6+
test: {
7+
include: ['src/**/*.{test,spec}.{js,ts}']
8+
}
9+
});

0 commit comments

Comments
 (0)