Skip to content

Commit 7efd8d6

Browse files
committed
add empty sveltekit package ready for v2
1 parent 3d61c4e commit 7efd8d6

21 files changed

+937
-2072
lines changed

packages/imtala/.eslintignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

packages/imtala/.eslintrc.cjs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5+
plugins: ['svelte3', '@typescript-eslint'],
6+
ignorePatterns: ['*.cjs'],
7+
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
8+
settings: {
9+
'svelte3/typescript': () => require('typescript')
10+
},
11+
parserOptions: {
12+
sourceType: 'module',
13+
ecmaVersion: 2020
14+
},
15+
env: {
16+
browser: true,
17+
es2017: true,
18+
node: true
19+
}
20+
};

packages/imtala/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
*.tgz

packages/imtala/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src

packages/imtala/.npmrc

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

packages/imtala/.prettierignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

packages/imtala/.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"pluginSearchDirs": ["."],
8+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
9+
}

packages/imtala/README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# create-svelte
2+
3+
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4+
5+
## Creating a project
6+
7+
If you're seeing this, you've probably already done this step. Congrats!
8+
9+
```bash
10+
# create a new project in the current directory
11+
npm create svelte@latest
12+
13+
# create a new project in my-app
14+
npm create svelte@latest my-app
15+
```
16+
17+
## Developing
18+
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20+
21+
```bash
22+
npm run dev
23+
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
27+
28+
## Building
29+
30+
To create a production version of your app:
31+
32+
```bash
33+
npm run build
34+
```
35+
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

packages/imtala/bin/cli.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#! /usr/bin/env node
2+
import { Command } from 'commander'
3+
import {handler} from '../build/handler.js';
4+
const program = new Command();
5+
import http from 'http'
6+
7+
program
8+
.name('imtala')
9+
.description('Graphql powered automation tooling')
10+
.version('0.8.0');
11+
12+
program.command('serve')
13+
.description('Start the imtala server')
14+
.option('-p, --port <number>', 'port', 3000)
15+
.action((options) => {
16+
const port = options.port;
17+
18+
const server = http.createServer(handler);
19+
20+
server.listen(port, () => {
21+
console.log(`Imtala running at http://localhost:${port}/`);
22+
});
23+
});
24+
25+
program.parse();

packages/imtala/package.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "@imtala/imtala",
3+
"version": "0.0.1",
4+
"private": true,
5+
"devDependencies": {
6+
"@playwright/test": "^1.25.0",
7+
"@sveltejs/adapter-auto": "next",
8+
"@sveltejs/kit": "next",
9+
"@typescript-eslint/eslint-plugin": "^5.27.0",
10+
"@typescript-eslint/parser": "^5.27.0",
11+
"eslint": "^8.16.0",
12+
"eslint-config-prettier": "^8.3.0",
13+
"eslint-plugin-svelte3": "^4.0.0",
14+
"prettier": "^2.6.2",
15+
"prettier-plugin-svelte": "^2.7.0",
16+
"svelte": "^3.44.0",
17+
"svelte-check": "^2.7.1",
18+
"svelte-preprocess": "^4.10.6",
19+
"tslib": "^2.3.1",
20+
"typescript": "^4.7.4",
21+
"vite": "^3.1.0"
22+
},
23+
"type": "module",
24+
"dependencies": {
25+
"@sveltejs/adapter-node": "1.0.0-next.96",
26+
"commander": "^9.4.1"
27+
},
28+
"bin": {
29+
"imtala": "bin/cli.js"
30+
},
31+
"scripts": {
32+
"dev": "vite dev",
33+
"build": "vite build",
34+
"preview": "vite preview",
35+
"test": "playwright test",
36+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
37+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
38+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
39+
"format": "prettier --plugin-search-dir . --write .",
40+
"test:cli": "pnpm pack > filename.txt"
41+
}
42+
}

packages/imtala/playwright.config.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { PlaywrightTestConfig } from '@playwright/test';
2+
3+
const config: PlaywrightTestConfig = {
4+
webServer: {
5+
command: 'npm run build && npm run preview',
6+
port: 4173
7+
}
8+
};
9+
10+
export default config;

packages/imtala/src/app.d.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// See https://kit.svelte.dev/docs/types#app
2+
// for information about these interfaces
3+
// and what to do when importing types
4+
declare namespace App {
5+
// interface Locals {}
6+
// interface PageData {}
7+
// interface Error {}
8+
// interface Platform {}
9+
}

packages/imtala/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" />
7+
%sveltekit.head%
8+
</head>
9+
<body>
10+
<div>%sveltekit.body%</div>
11+
</body>
12+
</html>
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>Welcome to SvelteKit</h1>
2+
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

packages/imtala/static/favicon.png

1.53 KB
Loading

packages/imtala/svelte.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import adapter from '@sveltejs/adapter-node';
2+
import preprocess from 'svelte-preprocess';
3+
4+
/** @type {import('@sveltejs/kit').Config} */
5+
const config = {
6+
// Consult https://github.com/sveltejs/svelte-preprocess
7+
// for more information about preprocessors
8+
preprocess: preprocess(),
9+
10+
kit: {
11+
adapter: adapter()
12+
}
13+
};
14+
15+
export default config;

packages/imtala/tests/test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { expect, test } from '@playwright/test';
2+
3+
test('index page has expected h1', async ({ page }) => {
4+
await page.goto('/');
5+
expect(await page.textContent('h1')).toBe('Welcome to SvelteKit');
6+
});

packages/imtala/tsconfig.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "./.svelte-kit/tsconfig.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"checkJs": true,
6+
"esModuleInterop": true,
7+
"forceConsistentCasingInFileNames": true,
8+
"resolveJsonModule": true,
9+
"skipLibCheck": true,
10+
"sourceMap": true,
11+
"strict": true
12+
}
13+
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
14+
//
15+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
16+
// from the referenced tsconfig.json - TypeScript does not merge them in
17+
}

packages/imtala/vite.config.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { sveltekit } from '@sveltejs/kit/vite';
2+
import type { UserConfig } from 'vite';
3+
4+
const config: UserConfig = {
5+
plugins: [sveltekit()]
6+
};
7+
8+
export default config;

0 commit comments

Comments
 (0)