kempo 3.2.1 → 4.2.0
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/dist/components/Component.js +1 -1
- package/dist/components/Dialog.js +1 -1
- package/dist/components/LazyComponent.js +1 -1
- package/dist/components/Split.js +1 -1
- package/dist/components/Toast.js +1 -0
- package/dist/utils/Server.js +1 -0
- package/dist/utils/drag.js +1 -1
- package/dist/utils/fs-utils.js +1 -0
- package/dist/utils/minify.js +1 -0
- package/dist/utils/watchWindowSize.js +1 -0
- package/docs/components/split.html +19 -0
- package/docs/components/toast.html +330 -0
- package/docs/icons/error.svg +1 -0
- package/docs/icons/warning.svg +1 -0
- package/docs/kempo/components/Component.js +1 -1
- package/docs/kempo/components/Dialog.js +1 -1
- package/docs/kempo/components/LazyComponent.js +1 -1
- package/docs/kempo/components/Split.js +1 -1
- package/docs/kempo/components/Toast.js +1 -0
- package/docs/kempo/utils/Server.js +1 -0
- package/docs/kempo/utils/drag.js +1 -1
- package/docs/kempo/utils/fs-utils.js +1 -0
- package/docs/kempo/utils/minify.js +1 -0
- package/docs/kempo/utils/watchWindowSize.js +1 -0
- package/docs/nav.inc.html +2 -1
- package/docs/utils/Server.html +119 -0
- package/icons/error.svg +1 -0
- package/icons/warning.svg +1 -0
- package/package.json +2 -4
- package/scripts/build.js +8 -8
- package/scripts/docs.js +20 -20
- package/src/components/Dialog.js +11 -1
- package/src/components/Split.js +38 -13
- package/src/components/Toast.js +424 -0
- package/src/utils/Server.js +189 -0
- package/src/utils/fs-utils.js +41 -0
- package/src/utils/watchWindowSize.js +15 -0
- package/test/index.js +27 -16
- package/scripts/test.js +0 -31
package/test/index.js
CHANGED
|
@@ -1,25 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Server } from '../src/utils/Server.js';
|
|
2
2
|
import fs from 'fs/promises';
|
|
3
|
-
import path from 'path';
|
|
4
3
|
import cli from '../src/utils/cli.js';
|
|
5
4
|
|
|
6
5
|
const {
|
|
7
|
-
|
|
6
|
+
port = 8084
|
|
8
7
|
} = cli();
|
|
9
8
|
|
|
10
|
-
const
|
|
9
|
+
const server = new Server();
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
server
|
|
12
|
+
.static('/', './test')
|
|
13
|
+
.static('/kempo', './kempo')
|
|
14
|
+
.get('/api/tests', async (req, res) => {
|
|
15
|
+
try {
|
|
16
|
+
const tests = {};
|
|
17
|
+
const categories = await fs.readdir('./test/tests/');
|
|
18
|
+
for(let i = 0; i < categories.length; i++){
|
|
19
|
+
tests[categories[i]] = (await fs.readdir(`./test/tests/${categories[i]}/`))
|
|
20
|
+
.map(t => t.slice(0, t.length - 8));
|
|
21
|
+
}
|
|
22
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
23
|
+
res.end(JSON.stringify(tests));
|
|
24
|
+
} catch (err) {
|
|
25
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
26
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
try {
|
|
31
|
+
await server.listen(port);
|
|
24
32
|
console.log(`Tests Running on: http://localhost:${port}`);
|
|
25
|
-
})
|
|
33
|
+
} catch (err) {
|
|
34
|
+
console.error('Failed to start server:', err.message);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
package/scripts/test.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import express from 'express';
|
|
2
|
-
import { dirname, join } from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import {
|
|
5
|
-
getArgs,
|
|
6
|
-
runChildNodeProcess
|
|
7
|
-
} from '../src/utils/cli.js';
|
|
8
|
-
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = dirname(__filename);
|
|
11
|
-
|
|
12
|
-
const options = getArgs({
|
|
13
|
-
p: 'port',
|
|
14
|
-
b: 'build',
|
|
15
|
-
s: 'src'
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
port = 8084,
|
|
20
|
-
build = true
|
|
21
|
-
} = options;
|
|
22
|
-
|
|
23
|
-
const app = express();
|
|
24
|
-
|
|
25
|
-
app.use('/kempo', express.static('src'));
|
|
26
|
-
app.use('/icons', express.static('icons'));
|
|
27
|
-
app.use(express.static('test'));
|
|
28
|
-
|
|
29
|
-
app.listen(port, () => {
|
|
30
|
-
console.log(`Docs Running on: http://localhost:${port}`);
|
|
31
|
-
});
|