mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-04 14:46:42 +00:00
feat: add KV interface to iframe, fix path alias bug (#79)
* feat: add KV interface to iframe, fix path alias bug * update template README's publish instruction * chore: update dependencies and sveltekit template
This commit is contained in:
parent
fd41247d37
commit
51f2f22f69
@ -1,5 +1,11 @@
|
||||
# create-kunkun
|
||||
|
||||
## 0.1.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Update sveltekit template
|
||||
|
||||
## 0.1.40
|
||||
|
||||
### Patch Changes
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "create-kunkun",
|
||||
"type": "module",
|
||||
"version": "0.1.40",
|
||||
"version": "0.1.42",
|
||||
"bin": {
|
||||
"create-kunkun": "dist/index.mjs"
|
||||
},
|
||||
|
@ -19,11 +19,11 @@
|
||||
"prettier-plugin-tailwindcss": "^0.6.9",
|
||||
"svelte": "^5.16.6",
|
||||
"svelte-check": "^4.1.1",
|
||||
"turbo": "^2.3.3",
|
||||
"turbo": "^2.3.4",
|
||||
"typescript": "5.7.2",
|
||||
"verify-package-export": "^0.0.2"
|
||||
},
|
||||
"packageManager": "pnpm@9.15.3",
|
||||
"packageManager": "pnpm@9.15.4",
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
||||
"name": "@kunkun/api",
|
||||
"version": "0.0.53",
|
||||
"version": "0.0.55",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kksh/api",
|
||||
"version": "0.0.53",
|
||||
"version": "0.0.55",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
|
@ -84,8 +84,13 @@ export function constructShellApi(
|
||||
program: string,
|
||||
args: string[],
|
||||
options: InternalSpawnOptions
|
||||
): Promise<ChildProcess<IOPayload>> {
|
||||
await verifyShellCmdPermission(ShellPermissionMap.execute, objectPermissions, program, args).catch(err => {
|
||||
): Promise<ChildProcess<IOPayload>> {
|
||||
await verifyShellCmdPermission(
|
||||
ShellPermissionMap.execute,
|
||||
objectPermissions,
|
||||
program,
|
||||
args
|
||||
).catch((err) => {
|
||||
throw new Error(err)
|
||||
})
|
||||
return invoke<ChildProcess<IOPayload>>("plugin:shellx|execute", {
|
||||
|
@ -25,6 +25,7 @@ import type {
|
||||
IDb,
|
||||
IEvent,
|
||||
IFs,
|
||||
IKV,
|
||||
IOpen,
|
||||
IPath,
|
||||
ISecurity,
|
||||
@ -50,6 +51,7 @@ export { type IUiIframeServer2, type IUiIframeServer1 } from "../../api/server-t
|
||||
*/
|
||||
type API = {
|
||||
db: IDb // for kunkun
|
||||
kv: IKV // for kunkun
|
||||
system: ISystem // for kunkun
|
||||
open: IOpen // for kunkun
|
||||
clipboard: IClipboard // inherit from tauri-api-adapter
|
||||
@ -86,6 +88,7 @@ export const {
|
||||
db,
|
||||
os,
|
||||
clipboard,
|
||||
kv,
|
||||
dialog,
|
||||
fs,
|
||||
log,
|
||||
|
@ -51,9 +51,6 @@ export function pathStartsWithAlias(path: string) {
|
||||
* @param scope expected to be like $DESKTOP/*, $DOWNLOAD/**, $DOCUMENT/abc/*.txt
|
||||
*/
|
||||
export async function translateScopeToPath(scope: string, extensionDir: string): Promise<string> {
|
||||
if (scope.startsWith("$EXTENSION")) {
|
||||
return pathAPI.join(extensionDir, scope.slice("$EXTENSION".length))
|
||||
}
|
||||
if (scope.startsWith("$EXTENSION_SUPPORT")) {
|
||||
const appDataDir = await pathAPI.appDataDir()
|
||||
if (extensionDir.startsWith(appDataDir)) {
|
||||
@ -66,6 +63,9 @@ export async function translateScopeToPath(scope: string, extensionDir: string):
|
||||
return extSupportDir
|
||||
}
|
||||
}
|
||||
if (scope.startsWith("$EXTENSION")) {
|
||||
return pathAPI.join(extensionDir, scope.slice("$EXTENSION".length))
|
||||
}
|
||||
for (const key of Object.keys(mapDirAliasToDirFn)) {
|
||||
if (scope.startsWith(key)) {
|
||||
const alias = key
|
||||
|
@ -21,7 +21,7 @@ export const breakingChangesVersionCheckpoints = [
|
||||
const checkpointVersions = breakingChangesVersionCheckpoints.map((c) => c.version)
|
||||
const sortedCheckpointVersions = sort(checkpointVersions)
|
||||
|
||||
export const version = "0.0.53"
|
||||
export const version = "0.0.55"
|
||||
|
||||
export function isVersionBetween(v: string, start: string, end: string) {
|
||||
const vCleaned = clean(v)
|
||||
|
@ -82,44 +82,4 @@ npx kksh@latest verify # Verify some basic settings
|
||||
npx kksh@latest verify --publish # Verify some basic settings before publishing
|
||||
```
|
||||
|
||||
It is recommended to build the extension with the same environment our CI uses.
|
||||
|
||||
The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`.
|
||||
|
||||
You can use the following command to build the extension with the same environment our CI uses.
|
||||
This requires you to have docker installed, and the shell you are using has access to it via `docker` command.
|
||||
|
||||
```bash
|
||||
npx kksh@latest build # Build the extension with
|
||||
```
|
||||
|
||||
`pnpm` is used to install dependencies and build the extension.
|
||||
|
||||
The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed.
|
||||
If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`.
|
||||
|
||||
After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension.
|
||||
The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files.
|
||||
|
||||
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.
|
||||
|
||||
After verifying the tarball, it's ready to be published.
|
||||
|
||||
Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR.
|
||||
|
||||
Once CI passed and PR merged, you can use your extension in Kunkun.
|
||||
|
||||
## Potential Error
|
||||
|
||||
Our CI uses `pnpm` to install dependencies. If you are on Windows, you may get error during build.
|
||||
|
||||
See issue https://github.com/kunkunsh/kunkun/issues/78
|
||||
|
||||
`bun` had problem building the extension when `pnpm` is used to install dependencies.
|
||||
|
||||
### Options
|
||||
|
||||
1. Install an older version of `bun` (1.1.27 should work)
|
||||
2. Install dependencies with `bun` or `npm` instead of `pnpm`
|
||||
|
||||
Our CI always builds the extension with on Linux and shouldn't have this problem.
|
||||
See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) for more details on how to publish your extension. You will need to publish your extension package to npm or jsr first with GitHub actioin, then register it on Kunkun's website.
|
||||
|
@ -38,32 +38,8 @@ The main benefit of using a meta-framework is that it comes with routing, and wi
|
||||
|
||||
```bash
|
||||
pnpm build # make sure the build npm script works
|
||||
npx kksh@latest verify # Verify some basic settings before publishing
|
||||
npx kksh@latest verify # Verify some basic settings
|
||||
npx kksh@latest verify --publish # Verify some basic settings before publishing
|
||||
```
|
||||
|
||||
It is recommended to build the extension with the same environment our CI uses.
|
||||
|
||||
The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`.
|
||||
|
||||
You can use the following command to build the extension with the same environment our CI uses.
|
||||
This requires you to have docker installed, and the shell you are using has access to it via `docker` command.
|
||||
|
||||
```bash
|
||||
npx kksh@latest build # Build the extension with
|
||||
```
|
||||
|
||||
`pnpm` is used to install dependencies and build the extension.
|
||||
|
||||
The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed.
|
||||
If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`.
|
||||
|
||||
After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension.
|
||||
The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files.
|
||||
|
||||
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.
|
||||
|
||||
After verifying the tarball, it's ready to be published.
|
||||
|
||||
Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR.
|
||||
|
||||
Once CI passed and PR merged, you can use your extension in Kunkun.
|
||||
See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) for more details on how to publish your extension. You will need to publish your extension package to npm or jsr first with GitHub actioin, then register it on Kunkun's website.
|
||||
|
@ -42,19 +42,20 @@
|
||||
"@kksh/api": "workspace:*",
|
||||
"@kksh/react": "0.1.1",
|
||||
"@radix-ui/react-icons": "^1.3.2",
|
||||
"next": "14.2.18",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"next": "14.2.18"
|
||||
"react-dom": "18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "15.0.3",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "15.0.3"
|
||||
"typescript": "^5"
|
||||
},
|
||||
"files": [
|
||||
"out"
|
||||
|
@ -38,32 +38,8 @@ The main benefit of using a meta-framework is that it comes with routing, and wi
|
||||
|
||||
```bash
|
||||
pnpm build # make sure the build npm script works
|
||||
npx kksh@latest verify # Verify some basic settings before publishing
|
||||
npx kksh@latest verify # Verify some basic settings
|
||||
npx kksh@latest verify --publish # Verify some basic settings before publishing
|
||||
```
|
||||
|
||||
It is recommended to build the extension with the same environment our CI uses.
|
||||
|
||||
The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`.
|
||||
|
||||
You can use the following command to build the extension with the same environment our CI uses.
|
||||
This requires you to have docker installed, and the shell you are using has access to it via `docker` command.
|
||||
|
||||
```bash
|
||||
npx kksh@latest build # Build the extension with
|
||||
```
|
||||
|
||||
`pnpm` is used to install dependencies and build the extension.
|
||||
|
||||
The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed.
|
||||
If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`.
|
||||
|
||||
After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension.
|
||||
The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files.
|
||||
|
||||
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.
|
||||
|
||||
After verifying the tarball, it's ready to be published.
|
||||
|
||||
Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR.
|
||||
|
||||
Once CI passed and PR merged, you can use your extension in Kunkun.
|
||||
See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) for more details on how to publish your extension. You will need to publish your extension package to npm or jsr first with GitHub actioin, then register it on Kunkun's website.
|
||||
|
@ -36,32 +36,8 @@ Kunkun provides meta-framework templates for Nuxt, Next, SvelteKit.
|
||||
|
||||
```bash
|
||||
pnpm build # make sure the build npm script works
|
||||
npx kksh@latest verify # Verify some basic settings before publishing
|
||||
npx kksh@latest verify # Verify some basic settings
|
||||
npx kksh@latest verify --publish # Verify some basic settings before publishing
|
||||
```
|
||||
|
||||
It is recommended to build the extension with the same environment our CI uses.
|
||||
|
||||
The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`.
|
||||
|
||||
You can use the following command to build the extension with the same environment our CI uses.
|
||||
This requires you to have docker installed, and the shell you are using has access to it via `docker` command.
|
||||
|
||||
```bash
|
||||
npx kksh@latest build # Build the extension with
|
||||
```
|
||||
|
||||
`pnpm` is used to install dependencies and build the extension.
|
||||
|
||||
The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed.
|
||||
If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`.
|
||||
|
||||
After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension.
|
||||
The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files.
|
||||
|
||||
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.
|
||||
|
||||
After verifying the tarball, it's ready to be published.
|
||||
|
||||
Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR.
|
||||
|
||||
Once CI passed and PR merged, you can use your extension in Kunkun.
|
||||
See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) for more details on how to publish your extension. You will need to publish your extension package to npm or jsr first with GitHub actioin, then register it on Kunkun's website.
|
||||
|
@ -36,32 +36,8 @@ Kunkun provides meta-framework templates for Nuxt, Next, SvelteKit.
|
||||
|
||||
```bash
|
||||
pnpm build # make sure the build npm script works
|
||||
npx kksh@latest verify # Verify some basic settings before publishing
|
||||
npx kksh@latest verify # Verify some basic settings
|
||||
npx kksh@latest verify --publish # Verify some basic settings before publishing
|
||||
```
|
||||
|
||||
It is recommended to build the extension with the same environment our CI uses.
|
||||
|
||||
The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`.
|
||||
|
||||
You can use the following command to build the extension with the same environment our CI uses.
|
||||
This requires you to have docker installed, and the shell you are using has access to it via `docker` command.
|
||||
|
||||
```bash
|
||||
npx kksh@latest build # Build the extension with
|
||||
```
|
||||
|
||||
`pnpm` is used to install dependencies and build the extension.
|
||||
|
||||
The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed.
|
||||
If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`.
|
||||
|
||||
After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension.
|
||||
The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files.
|
||||
|
||||
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.
|
||||
|
||||
After verifying the tarball, it's ready to be published.
|
||||
|
||||
Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR.
|
||||
|
||||
Once CI passed and PR merged, you can use your extension in Kunkun.
|
||||
See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) for more details on how to publish your extension. You will need to publish your extension package to npm or jsr first with GitHub actioin, then register it on Kunkun's website.
|
||||
|
@ -37,33 +37,7 @@ The main benefit of using a meta-framework is that it comes with routing, and wi
|
||||
## Verify Build and Publish
|
||||
|
||||
```bash
|
||||
pnpm build # make sure the build npm script works
|
||||
npx kksh@latest verify # Verify some basic settings before publishing
|
||||
npx kksh@latest verify --publish # run basic verification
|
||||
```
|
||||
|
||||
It is recommended to build the extension with the same environment our CI uses.
|
||||
|
||||
The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`.
|
||||
|
||||
You can use the following command to build the extension with the same environment our CI uses.
|
||||
This requires you to have docker installed, and the shell you are using has access to it via `docker` command.
|
||||
|
||||
```bash
|
||||
npx kksh@latest build # Build the extension with
|
||||
```
|
||||
|
||||
`pnpm` is used to install dependencies and build the extension.
|
||||
|
||||
The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed.
|
||||
If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`.
|
||||
|
||||
After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension.
|
||||
The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files.
|
||||
|
||||
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.
|
||||
|
||||
After verifying the tarball, it's ready to be published.
|
||||
|
||||
Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR.
|
||||
|
||||
Once CI passed and PR merged, you can use your extension in Kunkun.
|
||||
See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) for more details on how to publish your extension. You will need to publish your extension package to npm or jsr first with GitHub actioin, then register it on Kunkun's website.
|
||||
|
@ -1,15 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { clipboard, notification, ui, toast } from '@kksh/api/ui/iframe';
|
||||
import {
|
||||
ModeToggle,
|
||||
Button,
|
||||
Command,
|
||||
ModeWatcher,
|
||||
Separator,
|
||||
ThemeWrapper,
|
||||
updateTheme
|
||||
} from '@kksh/svelte5';
|
||||
import { ModeToggle, Button, Command, Separator, updateTheme } from '@kksh/svelte5';
|
||||
import ThemeCustomizer from '$lib/components/ThemeCustomizer.svelte';
|
||||
import {
|
||||
Calculator,
|
||||
@ -34,68 +26,64 @@
|
||||
let searchTerm = '';
|
||||
</script>
|
||||
|
||||
<ModeWatcher />
|
||||
<Command.Root class="h-screen rounded-lg border shadow-md" bind:value={highlighted}>
|
||||
<Command.Input placeholder="Type a command or search..." autofocus bind:value={searchTerm} />
|
||||
<div class="grow">
|
||||
<Command.List>
|
||||
<Command.Empty>No results found.</Command.Empty>
|
||||
<Command.Group heading="Suggestions">
|
||||
<Command.Item>
|
||||
<Calendar class="mr-2 h-4 w-4" />
|
||||
|
||||
<ThemeWrapper>
|
||||
<Command.Root class="h-screen rounded-lg border shadow-md" bind:value={highlighted}>
|
||||
<Command.Input placeholder="Type a command or search..." autofocus bind:value={searchTerm} />
|
||||
<div class="grow">
|
||||
<Command.List>
|
||||
<Command.Empty>No results found.</Command.Empty>
|
||||
<Command.Group heading="Suggestions">
|
||||
<Command.Item>
|
||||
<Calendar class="mr-2 h-4 w-4" />
|
||||
|
||||
<span>Calendar</span>
|
||||
</Command.Item>
|
||||
<Command.Item>
|
||||
<Smile class="mr-2 h-4 w-4" />
|
||||
<span>Search Emoji</span>
|
||||
</Command.Item>
|
||||
<Command.Item>
|
||||
<Calculator class="mr-2 h-4 w-4" />
|
||||
<span>Calculator</span>
|
||||
</Command.Item>
|
||||
</Command.Group>
|
||||
<Command.Separator />
|
||||
<Command.Group heading="Settings">
|
||||
<Command.Item>
|
||||
<User class="mr-2 h-4 w-4" />
|
||||
<span>Profile</span>
|
||||
<Command.Shortcut>⌘P</Command.Shortcut>
|
||||
</Command.Item>
|
||||
<Command.Item value="billllling">
|
||||
<CreditCard class="mr-2 h-4 w-4" />
|
||||
<span>Billing</span>
|
||||
<Command.Shortcut>⌘B</Command.Shortcut>
|
||||
</Command.Item>
|
||||
<Command.Item>
|
||||
<Settings class="mr-2 h-4 w-4" />
|
||||
<span>Settings</span>
|
||||
<Command.Shortcut>⌘S</Command.Shortcut>
|
||||
</Command.Item>
|
||||
</Command.Group>
|
||||
</Command.List>
|
||||
<span>Calendar</span>
|
||||
</Command.Item>
|
||||
<Command.Item>
|
||||
<Smile class="mr-2 h-4 w-4" />
|
||||
<span>Search Emoji</span>
|
||||
</Command.Item>
|
||||
<Command.Item>
|
||||
<Calculator class="mr-2 h-4 w-4" />
|
||||
<span>Calculator</span>
|
||||
</Command.Item>
|
||||
</Command.Group>
|
||||
<Command.Separator />
|
||||
<Command.Group heading="Settings">
|
||||
<Command.Item>
|
||||
<User class="mr-2 h-4 w-4" />
|
||||
<span>Profile</span>
|
||||
<Command.Shortcut>⌘P</Command.Shortcut>
|
||||
</Command.Item>
|
||||
<Command.Item value="billllling">
|
||||
<CreditCard class="mr-2 h-4 w-4" />
|
||||
<span>Billing</span>
|
||||
<Command.Shortcut>⌘B</Command.Shortcut>
|
||||
</Command.Item>
|
||||
<Command.Item>
|
||||
<Settings class="mr-2 h-4 w-4" />
|
||||
<span>Settings</span>
|
||||
<Command.Shortcut>⌘S</Command.Shortcut>
|
||||
</Command.Item>
|
||||
</Command.Group>
|
||||
</Command.List>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<SettingsIcon class="ml-2 h-4 w-4" />
|
||||
<div class="flex items-center space-x-2">
|
||||
<Button variant="ghost" size="sm">
|
||||
Open Application
|
||||
<kbd class="ml-1">↵</kbd>
|
||||
</Button>
|
||||
<Separator orientation="vertical" />
|
||||
<a href="{base}/about"><Button>About Page</Button></a>
|
||||
<Button
|
||||
onclick={async () => {
|
||||
toast.success(await clipboard.readText());
|
||||
}}
|
||||
>
|
||||
Read Clipboard
|
||||
</Button>
|
||||
<ModeToggle />
|
||||
<ThemeCustomizer />
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<SettingsIcon class="ml-2 h-4 w-4" />
|
||||
<div class="flex items-center space-x-2">
|
||||
<Button variant="ghost" size="sm">
|
||||
Open Application
|
||||
<kbd class="ml-1">↵</kbd>
|
||||
</Button>
|
||||
<Separator orientation="vertical" />
|
||||
<a href="{base}/about"><Button>About Page</Button></a>
|
||||
<Button
|
||||
onclick={async () => {
|
||||
toast.success(await clipboard.readText());
|
||||
}}
|
||||
>
|
||||
Read Clipboard
|
||||
</Button>
|
||||
<ModeToggle />
|
||||
<ThemeCustomizer />
|
||||
</div>
|
||||
</div>
|
||||
</Command.Root>
|
||||
</ThemeWrapper>
|
||||
</div>
|
||||
</Command.Root>
|
||||
|
@ -35,33 +35,7 @@ Kunkun provides meta-framework templates for Nuxt, Next, SvelteKit.
|
||||
## Verify Build and Publish
|
||||
|
||||
```bash
|
||||
pnpm build # make sure the build npm script works
|
||||
npx kksh@latest verify # Verify some basic settings before publishing
|
||||
npx kksh@latest verify --publish # run basic verification
|
||||
```
|
||||
|
||||
It is recommended to build the extension with the same environment our CI uses.
|
||||
|
||||
The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`.
|
||||
|
||||
You can use the following command to build the extension with the same environment our CI uses.
|
||||
This requires you to have docker installed, and the shell you are using has access to it via `docker` command.
|
||||
|
||||
```bash
|
||||
npx kksh@latest build # Build the extension with
|
||||
```
|
||||
|
||||
`pnpm` is used to install dependencies and build the extension.
|
||||
|
||||
The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed.
|
||||
If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`.
|
||||
|
||||
After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension.
|
||||
The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files.
|
||||
|
||||
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.
|
||||
|
||||
After verifying the tarball, it's ready to be published.
|
||||
|
||||
Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR.
|
||||
|
||||
Once CI passed and PR merged, you can use your extension in Kunkun.
|
||||
See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) for more details on how to publish your extension. You will need to publish your extension package to npm or jsr first with GitHub actioin, then register it on Kunkun's website.
|
||||
|
@ -82,44 +82,4 @@ npx kksh@latest verify # Verify some basic settings
|
||||
npx kksh@latest verify --publish # Verify some basic settings before publishing
|
||||
```
|
||||
|
||||
It is recommended to build the extension with the same environment our CI uses.
|
||||
|
||||
The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`.
|
||||
|
||||
You can use the following command to build the extension with the same environment our CI uses.
|
||||
This requires you to have docker installed, and the shell you are using has access to it via `docker` command.
|
||||
|
||||
```bash
|
||||
npx kksh@latest build # Build the extension with
|
||||
```
|
||||
|
||||
`pnpm` is used to install dependencies and build the extension.
|
||||
|
||||
The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed.
|
||||
If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`.
|
||||
|
||||
After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension.
|
||||
The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files.
|
||||
|
||||
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.
|
||||
|
||||
After verifying the tarball, it's ready to be published.
|
||||
|
||||
Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR.
|
||||
|
||||
Once CI passed and PR merged, you can use your extension in Kunkun.
|
||||
|
||||
## Potential Error
|
||||
|
||||
Our CI uses `pnpm` to install dependencies. If you are on Windows, you may get error during build.
|
||||
|
||||
See issue https://github.com/kunkunsh/kunkun/issues/78
|
||||
|
||||
`bun` had problem building the extension when `pnpm` is used to install dependencies.
|
||||
|
||||
### Options
|
||||
|
||||
1. Install an older version of `bun` (1.1.27 should work)
|
||||
2. Install dependencies with `bun` or `npm` instead of `pnpm`
|
||||
|
||||
Our CI always builds the extension with on Linux and shouldn't have this problem.
|
||||
See [Documentation](https://docs.kunkun.sh/guides/extensions/publish/design/) for more details on how to publish your extension. You will need to publish your extension package to npm or jsr first with GitHub actioin, then register it on Kunkun's website.
|
||||
|
61
pnpm-lock.yaml
generated
61
pnpm-lock.yaml
generated
@ -106,8 +106,8 @@ importers:
|
||||
specifier: ^4.1.1
|
||||
version: 4.1.1(picomatch@4.0.2)(svelte@5.16.6)(typescript@5.7.2)
|
||||
turbo:
|
||||
specifier: ^2.3.3
|
||||
version: 2.3.3
|
||||
specifier: ^2.3.4
|
||||
version: 2.3.4
|
||||
typescript:
|
||||
specifier: 5.7.2
|
||||
version: 5.7.2
|
||||
@ -850,6 +850,9 @@ importers:
|
||||
eslint-config-next:
|
||||
specifier: 15.0.3
|
||||
version: 15.0.3(eslint@8.57.1)(typescript@5.6.3)
|
||||
eslint-plugin-import:
|
||||
specifier: ^2.31.0
|
||||
version: 2.31.0(@typescript-eslint/parser@8.20.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1)
|
||||
postcss:
|
||||
specifier: ^8
|
||||
version: 8.4.49
|
||||
@ -10736,38 +10739,38 @@ packages:
|
||||
tunnel-agent@0.6.0:
|
||||
resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
|
||||
|
||||
turbo-darwin-64@2.3.3:
|
||||
resolution: {integrity: sha512-bxX82xe6du/3rPmm4aCC5RdEilIN99VUld4HkFQuw+mvFg6darNBuQxyWSHZTtc25XgYjQrjsV05888w1grpaA==}
|
||||
turbo-darwin-64@2.3.4:
|
||||
resolution: {integrity: sha512-uOi/cUIGQI7uakZygH+cZQ5D4w+aMLlVCN2KTGot+cmefatps2ZmRRufuHrEM0Rl63opdKD8/JIu+54s25qkfg==}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
turbo-darwin-arm64@2.3.3:
|
||||
resolution: {integrity: sha512-DYbQwa3NsAuWkCUYVzfOUBbSUBVQzH5HWUFy2Kgi3fGjIWVZOFk86ss+xsWu//rlEAfYwEmopigsPYSmW4X15A==}
|
||||
turbo-darwin-arm64@2.3.4:
|
||||
resolution: {integrity: sha512-IIM1Lq5R+EGMtM1YFGl4x8Xkr0MWb4HvyU8N4LNoQ1Be5aycrOE+VVfH+cDg/Q4csn+8bxCOxhRp5KmUflrVTQ==}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
turbo-linux-64@2.3.3:
|
||||
resolution: {integrity: sha512-eHj9OIB0dFaP6BxB88jSuaCLsOQSYWBgmhy2ErCu6D2GG6xW3b6e2UWHl/1Ho9FsTg4uVgo4DB9wGsKa5erjUA==}
|
||||
turbo-linux-64@2.3.4:
|
||||
resolution: {integrity: sha512-1aD2EfR7NfjFXNH3mYU5gybLJEFi2IGOoKwoPLchAFRQ6OEJQj201/oNo9CDL75IIrQo64/NpEgVyZtoPlfhfA==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
turbo-linux-arm64@2.3.3:
|
||||
resolution: {integrity: sha512-NmDE/NjZoDj1UWBhMtOPmqFLEBKhzGS61KObfrDEbXvU3lekwHeoPvAMfcovzswzch+kN2DrtbNIlz+/rp8OCg==}
|
||||
turbo-linux-arm64@2.3.4:
|
||||
resolution: {integrity: sha512-MxTpdKwxCaA5IlybPxgGLu54fT2svdqTIxRd0TQmpRJIjM0s4kbM+7YiLk0mOh6dGqlWPUsxz/A0Mkn8Xr5o7Q==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
turbo-windows-64@2.3.3:
|
||||
resolution: {integrity: sha512-O2+BS4QqjK3dOERscXqv7N2GXNcqHr9hXumkMxDj/oGx9oCatIwnnwx34UmzodloSnJpgSqjl8iRWiY65SmYoQ==}
|
||||
turbo-windows-64@2.3.4:
|
||||
resolution: {integrity: sha512-yyCrWqcRGu1AOOlrYzRnizEtdkqi+qKP0MW9dbk9OsMDXaOI5jlWtTY/AtWMkLw/czVJ7yS9Ex1vi9DB6YsFvw==}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
turbo-windows-arm64@2.3.3:
|
||||
resolution: {integrity: sha512-dW4ZK1r6XLPNYLIKjC4o87HxYidtRRcBeo/hZ9Wng2XM/MqqYkAyzJXJGgRMsc0MMEN9z4+ZIfnSNBrA0b08ag==}
|
||||
turbo-windows-arm64@2.3.4:
|
||||
resolution: {integrity: sha512-PggC3qH+njPfn1PDVwKrQvvQby8X09ufbqZ2Ha4uSu+5TvPorHHkAbZVHKYj2Y+tvVzxRzi4Sv6NdHXBS9Be5w==}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
turbo@2.3.3:
|
||||
resolution: {integrity: sha512-DUHWQAcC8BTiUZDRzAYGvpSpGLiaOQPfYXlCieQbwUvmml/LRGIe3raKdrOPOoiX0DYlzxs2nH6BoWJoZrj8hA==}
|
||||
turbo@2.3.4:
|
||||
resolution: {integrity: sha512-1kiLO5C0Okh5ay1DbHsxkPsw9Sjsbjzm6cF85CpWjR0BIyBFNDbKqtUyqGADRS1dbbZoQanJZVj4MS5kk8J42Q==}
|
||||
hasBin: true
|
||||
|
||||
tweetnacl@0.14.5:
|
||||
@ -23184,32 +23187,32 @@ snapshots:
|
||||
dependencies:
|
||||
safe-buffer: 5.2.1
|
||||
|
||||
turbo-darwin-64@2.3.3:
|
||||
turbo-darwin-64@2.3.4:
|
||||
optional: true
|
||||
|
||||
turbo-darwin-arm64@2.3.3:
|
||||
turbo-darwin-arm64@2.3.4:
|
||||
optional: true
|
||||
|
||||
turbo-linux-64@2.3.3:
|
||||
turbo-linux-64@2.3.4:
|
||||
optional: true
|
||||
|
||||
turbo-linux-arm64@2.3.3:
|
||||
turbo-linux-arm64@2.3.4:
|
||||
optional: true
|
||||
|
||||
turbo-windows-64@2.3.3:
|
||||
turbo-windows-64@2.3.4:
|
||||
optional: true
|
||||
|
||||
turbo-windows-arm64@2.3.3:
|
||||
turbo-windows-arm64@2.3.4:
|
||||
optional: true
|
||||
|
||||
turbo@2.3.3:
|
||||
turbo@2.3.4:
|
||||
optionalDependencies:
|
||||
turbo-darwin-64: 2.3.3
|
||||
turbo-darwin-arm64: 2.3.3
|
||||
turbo-linux-64: 2.3.3
|
||||
turbo-linux-arm64: 2.3.3
|
||||
turbo-windows-64: 2.3.3
|
||||
turbo-windows-arm64: 2.3.3
|
||||
turbo-darwin-64: 2.3.4
|
||||
turbo-darwin-arm64: 2.3.4
|
||||
turbo-linux-64: 2.3.4
|
||||
turbo-linux-arm64: 2.3.4
|
||||
turbo-windows-64: 2.3.4
|
||||
turbo-windows-arm64: 2.3.4
|
||||
|
||||
tweetnacl@0.14.5: {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user