|
1 |
| -# Kunkun Custom UI Extension Template (SvelteKit) |
| 1 | +# Kunkun Extension Sqlite Browser |
2 | 2 |
|
3 |
| -[Custom UI Extension Documentation](https://docs.kunkun.sh/extensions/custom-ui-ext/) |
4 |
| - |
5 |
| -This is a template for a custom UI extension. |
6 |
| - |
7 |
| -This type of extension is basically a static website. You can use any frontend framework you like, this template uses [SvelteKit](https://svelte.dev/). |
8 |
| - |
9 |
| -It is assumed that you have some knowledge of frontend development with SvelteKit. |
10 |
| - |
11 |
| -## Development |
12 |
| - |
13 |
| -Development is the same as developing a normal website. |
14 |
| - |
15 |
| -```bash |
16 |
| -pnpm install |
17 |
| -pnpm dev |
18 |
| -pnpm build |
19 |
| -``` |
20 |
| - |
21 |
| -- To develop and preview the extension in Kunkun, you need to run the `Add Dev Extension` command in Kunkun, and register this extension's path. |
22 |
| - |
23 |
| -In `package.json`, `"devMain"` is the url for development server, and `"main"` is the path to static `.html` file for production. |
24 |
| - |
25 |
| -To load the extension in development mode, you have to enable it with `Toggle Dev Extension Live Load Mode` command in Kunkun. A `Live` badge will be shown on the commands. This indicates that dev extensions will be loaded from `devMain` instead of `main`. |
26 |
| - |
27 |
| -## Advanced |
28 |
| - |
29 |
| -### Rendering Mode |
30 |
| - |
31 |
| -This is a Meta-Framework template, and already configured with SSG rendering mode. |
32 |
| -Please do not enable SSR unless you know what you are doing. |
33 |
| -There will not be a JS runtime in production, and Kunkun always load the extension as static files. |
34 |
| - |
35 |
| -The main benefit of using a meta-framework is that it comes with routing, and will output multiple `.html` files, which makes multi-command support much easier. |
36 |
| - |
37 |
| -## Verify Build and Publish |
38 |
| - |
39 |
| -```bash |
40 |
| -pnpm build # make sure the build npm script works |
41 |
| -npx kksh@latest verify # Verify some basic settings before publishing |
42 |
| -``` |
43 |
| - |
44 |
| -It is recommended to build the extension with the same environment our CI uses. |
45 |
| - |
46 |
| -The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`. |
47 |
| - |
48 |
| -You can use the following command to build the extension with the same environment our CI uses. |
49 |
| -This requires you to have docker installed, and the shell you are using has access to it via `docker` command. |
50 |
| - |
51 |
| -```bash |
52 |
| -npx kksh@latest build # Build the extension with |
53 |
| -``` |
54 |
| - |
55 |
| -`pnpm` is used to install dependencies and build the extension. |
56 |
| - |
57 |
| -The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed. |
58 |
| -If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`. |
59 |
| - |
60 |
| -After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension. |
61 |
| -The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files. |
62 |
| - |
63 |
| -This tarball is the final product that will be published and installed in Kunkun. You can further verify your extension by installing this tarball directly in Kunkun. |
64 |
| - |
65 |
| -After verifying the tarball, it's ready to be published. |
66 |
| - |
67 |
| -Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR. |
68 |
| - |
69 |
| -Once CI passed and PR merged, you can use your extension in Kunkun. |
| 3 | +- NPM: https://www.npmjs.com/package/kunkun-ext-sqlite-browser |
| 4 | +- Store: https://kunkun.sh/store/sqlite-browser |
0 commit comments