svelte-common 4.6.3 → 4.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +15 -14
- package/src/components/DataGrid.svelte +8 -14
- package/src/components/DataGridColumn.svelte +6 -5
- package/src/components/ServerDetails.svelte +16 -31
- package/src/data-grid.mjs +10 -0
- package/vite.config.js +0 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-common",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,38 +21,38 @@
|
|
|
21
21
|
"license": "BSD-2-Clause",
|
|
22
22
|
"scripts": {
|
|
23
23
|
"prepare": "vite build",
|
|
24
|
-
"start": "vite
|
|
24
|
+
"start": "vite",
|
|
25
25
|
"test": "npm run test:ava && npm run test:cafe",
|
|
26
|
-
"test:cafe": "testcafe $BROWSER:headless tests/cafe/*.js -s build/test --page-request-timeout 9000 --app-init-delay 3000 --app
|
|
26
|
+
"test:cafe": "testcafe $BROWSER:headless tests/cafe/*.js -s build/test --page-request-timeout 9000 --app-init-delay 3000 --app vite",
|
|
27
27
|
"test:ava": "ava --timeout 2m tests/*.mjs",
|
|
28
28
|
"docs": "documentation readme --section=API ./src/**/*.mjs",
|
|
29
|
-
"lint": "npm run lint:css && npm run lint:docs
|
|
29
|
+
"lint": "npm run lint:css && npm run lint:docs",
|
|
30
30
|
"lint:docs": "documentation lint ./src/**/*.mjs",
|
|
31
31
|
"lint:css": "stylelint ./src/*.css",
|
|
32
32
|
"preview": "vite preview"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"svelte-command": "^1.1.
|
|
36
|
-
"svelte-entitlement": "^1.2.
|
|
35
|
+
"svelte-command": "^1.1.18",
|
|
36
|
+
"svelte-entitlement": "^1.2.25"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
40
40
|
"@semantic-release/exec": "^6.0.3",
|
|
41
41
|
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
42
|
-
"@sveltejs/vite-plugin-svelte": "^1.0.
|
|
43
|
-
"ava": "^4.3.
|
|
42
|
+
"@sveltejs/vite-plugin-svelte": "^1.0.1",
|
|
43
|
+
"ava": "^4.3.1",
|
|
44
44
|
"documentation": "^13.2.5",
|
|
45
|
-
"mf-styling": "^1.2.
|
|
46
|
-
"npm-pkgbuild": "^10.
|
|
45
|
+
"mf-styling": "^1.2.26",
|
|
46
|
+
"npm-pkgbuild": "^10.11.3",
|
|
47
47
|
"semantic-release": "^19.0.3",
|
|
48
48
|
"stylelint": "^14.9.1",
|
|
49
49
|
"stylelint-config-standard": "^26.0.0",
|
|
50
|
-
"svelte": "^3.
|
|
50
|
+
"svelte": "^3.49.0",
|
|
51
51
|
"testcafe": "^1.19.0",
|
|
52
|
-
"vite": "^
|
|
52
|
+
"vite": "^3.0.0"
|
|
53
53
|
},
|
|
54
54
|
"optionalDependencies": {
|
|
55
|
-
"mf-hosting": "^1.
|
|
55
|
+
"mf-hosting": "^1.7.0"
|
|
56
56
|
},
|
|
57
57
|
"repository": {
|
|
58
58
|
"type": "git",
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
"${install.dir}": "build/",
|
|
68
68
|
"${nginx.sites.dir}${name}.conf": "pkg/nginx.conf"
|
|
69
69
|
},
|
|
70
|
-
"groups": "
|
|
70
|
+
"groups": "examples",
|
|
71
|
+
"http.base.path": "/examples"
|
|
71
72
|
},
|
|
72
73
|
"release": {
|
|
73
74
|
"plugins": [
|
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
|
+
import { DataGrid, DATA_GRID} from "../data-grid.mjs";
|
|
3
4
|
|
|
4
|
-
export let columns = [];
|
|
5
5
|
export let source = { entries: [] };
|
|
6
6
|
|
|
7
|
-
const dataGrid =
|
|
8
|
-
|
|
9
|
-
addColumn: c => {
|
|
10
|
-
console.log("addColumn", c);
|
|
11
|
-
columns.push(c);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
setContext("DATA_GRID", dataGrid);
|
|
16
|
-
|
|
7
|
+
const dataGrid = new DataGrid();
|
|
8
|
+
setContext(DATA_GRID, dataGrid);
|
|
17
9
|
</script>
|
|
18
10
|
|
|
19
11
|
<table>
|
|
12
|
+
<!--<slot/>-->
|
|
20
13
|
<thead>
|
|
21
|
-
{#each columns as column}
|
|
22
|
-
|
|
14
|
+
{#each dataGrid.columns as column}
|
|
15
|
+
{column.id} {column.headerComponent}
|
|
16
|
+
<svelte:component this={column.headerComponent} />
|
|
23
17
|
{/each}
|
|
24
18
|
</thead>
|
|
25
19
|
<tbody>
|
|
26
20
|
{#each source.entries as entry}
|
|
27
21
|
<tr>
|
|
28
|
-
{#each columns as column}
|
|
22
|
+
{#each dataGrid.columns as column}
|
|
29
23
|
<td>{entry[column.id]}</td>
|
|
30
24
|
{/each}
|
|
31
25
|
</tr>
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
|
+
import { DATA_GRID} from "../data-grid.mjs";
|
|
3
4
|
|
|
4
5
|
export let id;
|
|
5
6
|
|
|
6
|
-
const dataGrid = getContext(
|
|
7
|
+
const dataGrid = getContext(DATA_GRID);
|
|
7
8
|
|
|
8
|
-
let
|
|
9
|
+
let headerComponent;
|
|
9
10
|
|
|
10
|
-
dataGrid.addColumn({ id,
|
|
11
|
+
dataGrid.addColumn({ id, headerComponent });
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<th {id} bind:this={
|
|
14
|
-
<slot>
|
|
14
|
+
<th {id} bind:this={headerComponent}>
|
|
15
|
+
<slot name="header">
|
|
15
16
|
{id}
|
|
16
17
|
</slot>
|
|
17
18
|
</th>
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
export let server;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
rss: 0
|
|
15
|
-
};
|
|
7
|
+
const memSlots = [
|
|
8
|
+
{ key: "external", title: "External" },
|
|
9
|
+
{ key: "heapTotal", title: "Heap Total" },
|
|
10
|
+
{ key: "heapUsed", title: "Heap Used" },
|
|
11
|
+
{ key: "arrayBuffers", title: "Array Buffers" },
|
|
12
|
+
{ key: "rss", title: "RSS" }
|
|
13
|
+
];
|
|
16
14
|
</script>
|
|
17
15
|
|
|
18
16
|
<tr>
|
|
@@ -21,34 +19,21 @@
|
|
|
21
19
|
<tr>
|
|
22
20
|
<td />
|
|
23
21
|
<td>Version</td>
|
|
24
|
-
<td>{server.version}</td>
|
|
22
|
+
<td>{#if server && server.version}{server.version}{:else}<div class="error">down</div>{/if}</td>
|
|
25
23
|
</tr>
|
|
26
24
|
<tr>
|
|
27
25
|
<td />
|
|
28
26
|
<td>Uptime</td>
|
|
29
27
|
<td>
|
|
30
|
-
{#if server.uptime >= 0}
|
|
28
|
+
{#if server && server.uptime >= 0}
|
|
31
29
|
<Duration seconds={server.uptime} />
|
|
32
30
|
{:else}<div class="error">down</div>{/if}
|
|
33
31
|
</td>
|
|
34
32
|
</tr>
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<td>Heap Used</td>
|
|
43
|
-
<td><Bytes value={memory.heapUsed} /></td>
|
|
44
|
-
</tr>
|
|
45
|
-
<tr>
|
|
46
|
-
<td />
|
|
47
|
-
<td>External</td>
|
|
48
|
-
<td><Bytes value={memory.external} /></td>
|
|
49
|
-
</tr>
|
|
50
|
-
<tr>
|
|
51
|
-
<td />
|
|
52
|
-
<td>RSS</td>
|
|
53
|
-
<td><Bytes value={memory.rss} /></td>
|
|
54
|
-
</tr>
|
|
33
|
+
{#each memSlots as { key, title }}
|
|
34
|
+
<tr>
|
|
35
|
+
<td />
|
|
36
|
+
<td>{title}</td>
|
|
37
|
+
<td>{#if server && server.memory}<Bytes value={server.memory[key]}/>{:else}<div class="error">down</div>{/if}</td>
|
|
38
|
+
</tr>
|
|
39
|
+
{/each}
|
package/vite.config.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
2
|
-
//import { extractFromPackage } from "npm-pkgbuild/src/module.mjs";
|
|
3
|
-
import { defineConfig } from "vite";
|
|
4
|
-
|
|
5
|
-
export default defineConfig(async ({ command, mode }) => {
|
|
6
|
-
const { extractFromPackage } = await import(
|
|
7
|
-
new URL("node_modules/npm-pkgbuild/src/module.mjs", import.meta.url)
|
|
8
|
-
);
|
|
9
|
-
const res = extractFromPackage({
|
|
10
|
-
dir: new URL("./", import.meta.url).pathname
|
|
11
|
-
});
|
|
12
|
-
const first = await res.next();
|
|
13
|
-
const pkg = first.value;
|
|
14
|
-
const properties = pkg.properties;
|
|
15
|
-
const base = properties["http.path"] + "/";
|
|
16
|
-
const production = mode === "production";
|
|
17
|
-
|
|
18
|
-
process.env["VITE_NAME"] = properties.name;
|
|
19
|
-
process.env["VITE_DESCRIPTION"] = properties.description;
|
|
20
|
-
process.env["VITE_VERSION"] = properties.version;
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
base,
|
|
24
|
-
root: "tests/app/src",
|
|
25
|
-
worker: { format: "es" },
|
|
26
|
-
plugins: [
|
|
27
|
-
svelte({
|
|
28
|
-
compilerOptions: {
|
|
29
|
-
dev: !production
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
],
|
|
33
|
-
optimizeDeps: {
|
|
34
|
-
exclude: [
|
|
35
|
-
...Object.keys(pkg.dependencies).filter(d => d.startsWith("svelte"))
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
server: { host: true },
|
|
39
|
-
build: {
|
|
40
|
-
outDir: "../../../build",
|
|
41
|
-
target: "esnext",
|
|
42
|
-
emptyOutDir: true,
|
|
43
|
-
minify: production,
|
|
44
|
-
sourcemap: true
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
});
|