mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00
refactor: Command class rename (#90)
* refactor: rename WorkerExtension to TemplateUiCommand, HeadlessWorkerExtension to HeadlessCommand * ci: update npm publish workflow to include refactor branch * ci: add push trigger for JSR publish workflow and bump API package version * ci: add pnpm setup to npm publish workflow * chore: add repository field to package.json for @kksh/api
This commit is contained in:
parent
b4b7851366
commit
46d6872614
2
.github/workflows/jsr-publish.yml
vendored
2
.github/workflows/jsr-publish.yml
vendored
@ -1,5 +1,7 @@
|
|||||||
name: JSR Publish
|
name: JSR Publish
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: [develop, main]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
39
.github/workflows/npm-publish.yml
vendored
Normal file
39
.github/workflows/npm-publish.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: NPM Package Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [develop, main, refactor/rename-ext]
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish-npm:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "22.x"
|
||||||
|
registry-url: "https://registry.npmjs.org"
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
|
- run: pnpm install
|
||||||
|
- run: pnpm build
|
||||||
|
working-directory: packages/api
|
||||||
|
- name: Check if version is already published
|
||||||
|
working-directory: packages/api
|
||||||
|
run: |
|
||||||
|
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
||||||
|
npm view @kksh/api@$PACKAGE_VERSION
|
||||||
|
continue-on-error: true
|
||||||
|
id: check_version
|
||||||
|
- name: Publish
|
||||||
|
working-directory: packages/api
|
||||||
|
if: steps.check_version.outcome != 'success'
|
||||||
|
run: npm publish --provenance --access public
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
@ -1,5 +1,12 @@
|
|||||||
# kksh
|
# kksh
|
||||||
|
|
||||||
|
## 0.0.31
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.30
|
## 0.0.30
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "kksh",
|
"name": "kksh",
|
||||||
"module": "dist/cli.js",
|
"module": "dist/cli.js",
|
||||||
"version": "0.0.30",
|
"version": "0.0.31",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
"kksh": "./dist/cli.js",
|
"kksh": "./dist/cli.js",
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# create-kunkun
|
# create-kunkun
|
||||||
|
|
||||||
|
## 0.1.43
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.1.42
|
## 0.1.42
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "create-kunkun",
|
"name": "create-kunkun",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.1.42",
|
"version": "0.1.43",
|
||||||
"bin": {
|
"bin": {
|
||||||
"create-kunkun": "dist/index.mjs"
|
"create-kunkun": "dist/index.mjs"
|
||||||
},
|
},
|
||||||
|
@ -4,7 +4,7 @@ import { winExtMap } from "@/stores/winExtMap"
|
|||||||
import { trimSlash } from "@/utils/url"
|
import { trimSlash } from "@/utils/url"
|
||||||
import { constructExtensionSupportDir } from "@kksh/api"
|
import { constructExtensionSupportDir } from "@kksh/api"
|
||||||
import { db, spawnExtensionFileServer } from "@kksh/api/commands"
|
import { db, spawnExtensionFileServer } from "@kksh/api/commands"
|
||||||
import type { HeadlessWorkerExtension } from "@kksh/api/headless"
|
import type { HeadlessCommand } from "@kksh/api/headless"
|
||||||
import { CustomUiCmd, ExtPackageJsonExtra, HeadlessCmd, TemplateUiCmd } from "@kksh/api/models"
|
import { CustomUiCmd, ExtPackageJsonExtra, HeadlessCmd, TemplateUiCmd } from "@kksh/api/models"
|
||||||
import { constructJarvisServerAPIWithPermissions, type IApp } from "@kksh/api/ui"
|
import { constructJarvisServerAPIWithPermissions, type IApp } from "@kksh/api/ui"
|
||||||
import { launchNewExtWindow, loadExtensionManifestFromDisk } from "@kksh/extension"
|
import { launchNewExtWindow, loadExtensionManifestFromDisk } from "@kksh/extension"
|
||||||
@ -101,7 +101,7 @@ export async function onHeadlessCmdSelect(
|
|||||||
} satisfies IApp
|
} satisfies IApp
|
||||||
}
|
}
|
||||||
const io = new WorkerParentIO(worker)
|
const io = new WorkerParentIO(worker)
|
||||||
const rpc = new RPCChannel<typeof serverAPI2, HeadlessWorkerExtension>(io, {
|
const rpc = new RPCChannel<typeof serverAPI2, HeadlessCommand>(io, {
|
||||||
expose: serverAPI2
|
expose: serverAPI2
|
||||||
})
|
})
|
||||||
const workerAPI = rpc.getAPI()
|
const workerAPI = rpc.getAPI()
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
NodeNameEnum,
|
NodeNameEnum,
|
||||||
toast,
|
toast,
|
||||||
type IComponent,
|
type IComponent,
|
||||||
type WorkerExtension
|
type TemplateUiCommand
|
||||||
} from "@kksh/api/ui/worker"
|
} from "@kksh/api/ui/worker"
|
||||||
import { LoadingBar } from "@kksh/ui"
|
import { LoadingBar } from "@kksh/ui"
|
||||||
import { Templates } from "@kksh/ui/extension"
|
import { Templates } from "@kksh/ui/extension"
|
||||||
@ -35,7 +35,7 @@
|
|||||||
let listviewInputRef = $state<HTMLInputElement | null>(null)
|
let listviewInputRef = $state<HTMLInputElement | null>(null)
|
||||||
let { loadedExt, scriptPath, extInfoInDB } = $derived(data)
|
let { loadedExt, scriptPath, extInfoInDB } = $derived(data)
|
||||||
let actionPanelOpen = $state(false)
|
let actionPanelOpen = $state(false)
|
||||||
let workerAPI: WorkerExtension | undefined = undefined
|
let workerAPI: TemplateUiCommand | undefined = undefined
|
||||||
let unlistenRefreshWorkerExt: UnlistenFn | undefined
|
let unlistenRefreshWorkerExt: UnlistenFn | undefined
|
||||||
let unlistenFileDrop: UnlistenFn | undefined
|
let unlistenFileDrop: UnlistenFn | undefined
|
||||||
let worker: Worker | undefined
|
let worker: Worker | undefined
|
||||||
@ -223,7 +223,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const io = new WorkerParentIO(worker)
|
const io = new WorkerParentIO(worker)
|
||||||
const rpc = new RPCChannel<typeof serverAPI2, WorkerExtension>(io, {
|
const rpc = new RPCChannel<typeof serverAPI2, TemplateUiCommand>(io, {
|
||||||
expose: serverAPI2
|
expose: serverAPI2
|
||||||
})
|
})
|
||||||
workerAPI = rpc.getAPI()
|
workerAPI = rpc.getAPI()
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
# @kksh/api
|
# @kksh/api
|
||||||
|
|
||||||
|
## 0.1.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- Rename WorkerExtension to TemplateUiCommand, and HeadlessWorkerExtension to HeadlessCommand
|
||||||
|
|
||||||
## 0.0.53
|
## 0.0.53
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
# @kksh/api
|
# @kksh/api
|
||||||
|
|
||||||

|
[](https://www.npmjs.com/package/@kksh/api)
|
||||||
|
[](https://jsr.io/@kunkun/api)
|
||||||
|
|
||||||
[Kunkun API](https://www.npmjs.com/package/@kksh/api) is an NPM package designed for developers to create extensions for Kunkun.
|
[Kunkun API](https://www.npmjs.com/package/@kksh/api) is an NPM package designed for developers to create extensions for Kunkun.
|
||||||
|
|
||||||
|
On NPM this package is published as `@kksh/api`, and on JSR it is published as `@kunkun/api`.
|
||||||
|
|
||||||
`@kksh/api` provides a set of APIs for extensions to interact with Kunkun and System APIs. The APIs include:
|
`@kksh/api` provides a set of APIs for extensions to interact with Kunkun and System APIs. The APIs include:
|
||||||
|
|
||||||
- Clipboard
|
- Clipboard
|
||||||
@ -25,19 +28,4 @@
|
|||||||
- UI
|
- UI
|
||||||
- etc.
|
- etc.
|
||||||
|
|
||||||
Read more details in documentation at https://docs.kunkun.sh,
|
Read more details in documentation at https://docs.kunkun.sh, and generated docs at https://docs.api.kunkun.sh/
|
||||||
and generated docs at https://docs.api.kunkun.sh/
|
|
||||||
|
|
||||||
## Dev
|
|
||||||
|
|
||||||
### Dependency Graph
|
|
||||||
|
|
||||||
To detect circular dependencies
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pnpm madge ./src/ui/worker/index.ts --circular # detect circular dependencies
|
|
||||||
pnpm dep-tree ./src/ui/worker/index.ts
|
|
||||||
|
|
||||||
|
|
||||||
pnpm test # this will detect circular dependencies in all files
|
|
||||||
```
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
||||||
"name": "@kunkun/api",
|
"name": "@kunkun/api",
|
||||||
"version": "0.0.57",
|
"version": "0.1.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@kksh/api",
|
"name": "@kksh/api",
|
||||||
"version": "0.0.57",
|
"version": "0.1.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/kunkunsh/kunkun.git"
|
||||||
|
},
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
|
@ -41,7 +41,7 @@ export async function findLocalhostKunkunPorts(): Promise<number[]> {
|
|||||||
return onlinePorts
|
return onlinePorts
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function refreshTemplateWorkerExtensionViaServer() {
|
export async function refreshTemplateWorkerCommandViaServer() {
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
|
||||||
const ports = await findLocalhostKunkunPorts()
|
const ports = await findLocalhostKunkunPorts()
|
||||||
console.log("Kunkun ports", ports)
|
console.log("Kunkun ports", ports)
|
||||||
@ -62,7 +62,7 @@ export async function refreshTemplateWorkerExtensionViaServer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function refreshTemplateWorkerExtensionViaDeepLink() {
|
export async function refreshTemplateWorkerCommandViaDeepLink() {
|
||||||
console.log("Send Refresh Worker Extension Request")
|
console.log("Send Refresh Worker Extension Request")
|
||||||
|
|
||||||
const platform = await os.platform()
|
const platform = await os.platform()
|
||||||
@ -83,12 +83,12 @@ export async function refreshTemplateWorkerExtensionViaDeepLink() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const refreshTemplateWorkerExtension = refreshTemplateWorkerExtensionViaServer
|
export const refreshTemplateWorkerCommand = refreshTemplateWorkerCommandViaServer
|
||||||
|
|
||||||
export function kununWorkerTemplateExtensionRollupPlugin() {
|
export function kununWorkerTemplateCommandRollupPlugin() {
|
||||||
return {
|
return {
|
||||||
async writeBundle() {
|
async writeBundle() {
|
||||||
await refreshTemplateWorkerExtensionViaDeepLink()
|
await refreshTemplateWorkerCommandViaDeepLink()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export abstract class HeadlessWorkerExtension {
|
export abstract class HeadlessCommand {
|
||||||
/**
|
/**
|
||||||
* Load the extension. Initialize the extension.
|
* Load the extension. Initialize the extension.
|
||||||
* Will be called once when the extension is first loaded.
|
* Will be called once when the extension is first loaded.
|
||||||
|
@ -33,7 +33,7 @@ import { constructPathAPI } from "../api/path"
|
|||||||
import type { IShellServer } from "../api/server-types"
|
import type { IShellServer } from "../api/server-types"
|
||||||
import { constructShellAPI } from "../api/shell"
|
import { constructShellAPI } from "../api/shell"
|
||||||
import { constructToastAPI } from "../api/toast"
|
import { constructToastAPI } from "../api/toast"
|
||||||
import type { HeadlessWorkerExtension } from "./ext"
|
import type { HeadlessCommand } from "./ext"
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* API Interfaces */
|
/* API Interfaces */
|
||||||
@ -53,7 +53,7 @@ export type {
|
|||||||
} from "tauri-api-adapter"
|
} from "tauri-api-adapter"
|
||||||
export type { ISystem, IToast, IUiIframe, IDb, IKV, IFs, IOpen, IEvent } from "../api/client"
|
export type { ISystem, IToast, IUiIframe, IDb, IKV, IFs, IOpen, IEvent } from "../api/client"
|
||||||
export type { IShell } from "../api/shell"
|
export type { IShell } from "../api/shell"
|
||||||
export { HeadlessWorkerExtension } from "./ext"
|
export { HeadlessCommand } from "./ext"
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* RPC */
|
/* RPC */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
@ -87,7 +87,7 @@ type API = {
|
|||||||
const io = new WorkerChildIO()
|
const io = new WorkerChildIO()
|
||||||
const rpc = new RPCChannel<{}, API, DestroyableIoInterface>(io, {})
|
const rpc = new RPCChannel<{}, API, DestroyableIoInterface>(io, {})
|
||||||
export const api = rpc.getAPI()
|
export const api = rpc.getAPI()
|
||||||
export function expose(api: HeadlessWorkerExtension) {
|
export function expose(api: HeadlessCommand) {
|
||||||
rpc.expose(api)
|
rpc.expose(api)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export abstract class WorkerExtension {
|
export abstract class TemplateUiCommand {
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* Common */
|
/* Common */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
@ -45,7 +45,7 @@ import { constructShellAPI } from "../../api/shell"
|
|||||||
import { constructToastAPI } from "../../api/toast"
|
import { constructToastAPI } from "../../api/toast"
|
||||||
import type { FormSchema, ListSchema, MarkdownSchema } from "../../models"
|
import type { FormSchema, ListSchema, MarkdownSchema } from "../../models"
|
||||||
import type { IComponent } from "./components"
|
import type { IComponent } from "./components"
|
||||||
import type { WorkerExtension } from "./ext"
|
import type { TemplateUiCommand } from "./ext"
|
||||||
|
|
||||||
export interface IUiWorker {
|
export interface IUiWorker {
|
||||||
render: (view: IComponent<ListSchema.List | FormSchema.Form | MarkdownSchema>) => Promise<void>
|
render: (view: IComponent<ListSchema.List | FormSchema.Form | MarkdownSchema>) => Promise<void>
|
||||||
@ -58,7 +58,7 @@ export interface IUiWorker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// export { expose, wrap } from "@huakunshen/comlink"
|
// export { expose, wrap } from "@huakunshen/comlink"
|
||||||
export { WorkerExtension, WorkerExtension as TemplateUiExtension } from "./ext"
|
export { TemplateUiCommand } from "./ext"
|
||||||
/**
|
/**
|
||||||
* For the APIs annotated with "inherit from tauri-api-adapter", they inherit the client API completely from tauri-api-adapter
|
* For the APIs annotated with "inherit from tauri-api-adapter", they inherit the client API completely from tauri-api-adapter
|
||||||
* There may be server API changes for them, but the client API can be inherited
|
* There may be server API changes for them, but the client API can be inherited
|
||||||
@ -95,7 +95,7 @@ const io = new WorkerChildIO()
|
|||||||
const rpc = new RPCChannel<{}, API, DestroyableIoInterface>(io, {})
|
const rpc = new RPCChannel<{}, API, DestroyableIoInterface>(io, {})
|
||||||
export const api = rpc.getAPI()
|
export const api = rpc.getAPI()
|
||||||
|
|
||||||
export function expose(api: WorkerExtension) {
|
export function expose(api: TemplateUiCommand) {
|
||||||
rpc.expose(api)
|
rpc.expose(api)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ export const breakingChangesVersionCheckpoints = [
|
|||||||
const checkpointVersions = breakingChangesVersionCheckpoints.map((c) => c.version)
|
const checkpointVersions = breakingChangesVersionCheckpoints.map((c) => c.version)
|
||||||
const sortedCheckpointVersions = sort(checkpointVersions)
|
const sortedCheckpointVersions = sort(checkpointVersions)
|
||||||
|
|
||||||
export const version = "0.0.57"
|
export const version = "0.1.0"
|
||||||
|
|
||||||
export function isVersionBetween(v: string, start: string, end: string) {
|
export function isVersionBetween(v: string, start: string, end: string) {
|
||||||
const vCleaned = clean(v)
|
const vCleaned = clean(v)
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# demo-template-extension
|
# demo-template-extension
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { watch } from "fs"
|
import { watch } from "fs"
|
||||||
import { join } from "path"
|
import { join } from "path"
|
||||||
import { refreshTemplateWorkerExtension } from "@kksh/api/dev"
|
import { refreshTemplateWorkerCommand } from "@kksh/api/dev"
|
||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
|
|
||||||
async function build() {
|
async function build() {
|
||||||
@ -12,7 +12,7 @@ async function build() {
|
|||||||
minify: true,
|
minify: true,
|
||||||
target: "browser"
|
target: "browser"
|
||||||
})
|
})
|
||||||
await refreshTemplateWorkerExtension()
|
await refreshTemplateWorkerCommand()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../schema/manifest-json-schema.json",
|
"$schema": "../../schema/manifest-json-schema.json",
|
||||||
"name": "demo-template-extension",
|
"name": "demo-template-extension",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { expose, HeadlessWorkerExtension, toast } from "@kksh/api/headless"
|
import { expose, HeadlessCommand, toast } from "@kksh/api/headless"
|
||||||
|
|
||||||
class DemoHeadlessExt extends HeadlessWorkerExtension {
|
class DemoHeadlessExt extends HeadlessCommand {
|
||||||
load(): Promise<void> {
|
load(): Promise<void> {
|
||||||
console.log("Demo Headless Extension Loaded")
|
console.log("Demo Headless Extension Loaded")
|
||||||
toast.info("Demo Headless Extension Loaded")
|
toast.info("Demo Headless Extension Loaded")
|
||||||
|
@ -16,9 +16,9 @@ import {
|
|||||||
path,
|
path,
|
||||||
security,
|
security,
|
||||||
shell,
|
shell,
|
||||||
|
TemplateUiCommand,
|
||||||
toast,
|
toast,
|
||||||
ui,
|
ui
|
||||||
WorkerExtension
|
|
||||||
} from "@kksh/api/ui/worker"
|
} from "@kksh/api/ui/worker"
|
||||||
import { IconType } from "@kunkun/api/models"
|
import { IconType } from "@kunkun/api/models"
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ const allItems: List.Item[] = itemsTitle.map(
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
class ExtensionTemplate extends WorkerExtension {
|
class ExtensionTemplate extends TemplateUiCommand {
|
||||||
async onBeforeGoBack() {
|
async onBeforeGoBack() {
|
||||||
console.log("onBeforeGoBack")
|
console.log("onBeforeGoBack")
|
||||||
// console.log(`Try killing pid: ${this.apiProcess?.pid}`)
|
// console.log(`Try killing pid: ${this.apiProcess?.pid}`)
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-sveltekit
|
# template-ext-sveltekit
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.kunkun.sh",
|
"$schema": "https://schema.kunkun.sh",
|
||||||
"name": "ext-sveltekit-exp",
|
"name": "ext-sveltekit-exp",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { watch } from "fs"
|
import { watch } from "fs"
|
||||||
import { join } from "path"
|
import { join } from "path"
|
||||||
import { refreshTemplateWorkerExtension } from "@kksh/api/dev"
|
import { refreshTemplateWorkerCommand } from "@kksh/api/dev"
|
||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
|
|
||||||
const entrypoints = ["./src/index.ts"]
|
const entrypoints = ["./src/index.ts"]
|
||||||
@ -11,7 +11,7 @@ async function build() {
|
|||||||
await $`bun build --minify --target=browser --outdir=./dist ${entrypoint}`
|
await $`bun build --minify --target=browser --outdir=./dist ${entrypoint}`
|
||||||
}
|
}
|
||||||
if (Bun.argv.includes("dev")) {
|
if (Bun.argv.includes("dev")) {
|
||||||
await refreshTemplateWorkerExtension()
|
await refreshTemplateWorkerCommand()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
@ -10,12 +10,12 @@ import {
|
|||||||
Markdown,
|
Markdown,
|
||||||
path,
|
path,
|
||||||
shell,
|
shell,
|
||||||
|
TemplateUiCommand,
|
||||||
toast,
|
toast,
|
||||||
ui,
|
ui
|
||||||
WorkerExtension
|
|
||||||
} from "@kksh/api/ui/worker"
|
} from "@kksh/api/ui/worker"
|
||||||
|
|
||||||
class ExtensionTemplate extends WorkerExtension {
|
class ExtensionTemplate extends TemplateUiCommand {
|
||||||
async onFormSubmit(value: Record<string, any>): Promise<void> {
|
async onFormSubmit(value: Record<string, any>): Promise<void> {
|
||||||
console.log("Form submitted", value)
|
console.log("Form submitted", value)
|
||||||
toast.success(`Form submitted: ${JSON.stringify(value)}`)
|
toast.success(`Form submitted: ${JSON.stringify(value)}`)
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-worker
|
# template-ext-worker
|
||||||
|
|
||||||
|
## 0.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.5
|
## 0.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { watch } from "fs"
|
import { watch } from "fs"
|
||||||
import { join } from "path"
|
import { join } from "path"
|
||||||
import { refreshTemplateWorkerExtension } from "@kksh/api/dev"
|
import { refreshTemplateWorkerCommand } from "@kksh/api/dev"
|
||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
|
|
||||||
const entrypoints = ["./src/index.ts"]
|
const entrypoints = ["./src/index.ts"]
|
||||||
@ -11,7 +11,7 @@ async function build() {
|
|||||||
await $`bun build --minify --target=browser --outdir=./dist ${entrypoint}`
|
await $`bun build --minify --target=browser --outdir=./dist ${entrypoint}`
|
||||||
}
|
}
|
||||||
if (Bun.argv.includes("dev")) {
|
if (Bun.argv.includes("dev")) {
|
||||||
await refreshTemplateWorkerExtension()
|
await refreshTemplateWorkerCommand()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-headless",
|
"name": "template-ext-headless",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { clipboard, expose, HeadlessWorkerExtension, toast } from "@kksh/api/headless"
|
import { clipboard, expose, HeadlessCommand, toast } from "@kksh/api/headless"
|
||||||
import { v4 as uuidv4 } from "uuid"
|
import { v4 as uuidv4 } from "uuid"
|
||||||
|
|
||||||
class UuidExt extends HeadlessWorkerExtension {
|
class UuidExt extends HeadlessCommand {
|
||||||
async load() {
|
async load() {
|
||||||
const uuid = uuidv4()
|
const uuid = uuidv4()
|
||||||
return clipboard
|
return clipboard
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-next
|
# template-ext-next
|
||||||
|
|
||||||
|
## 0.1.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.1.4
|
## 0.1.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-next",
|
"name": "template-ext-next",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-nuxt
|
# template-ext-nuxt
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-nuxt",
|
"name": "template-ext-nuxt",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-react
|
# template-ext-react
|
||||||
|
|
||||||
|
## 0.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.5
|
## 0.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-react",
|
"name": "template-ext-react",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-svelte
|
# template-ext-svelte
|
||||||
|
|
||||||
|
## 0.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.5
|
## 0.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-svelte",
|
"name": "template-ext-svelte",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-sveltekit
|
# template-ext-sveltekit
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-sveltekit",
|
"name": "template-ext-sveltekit",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-vue
|
# template-ext-vue
|
||||||
|
|
||||||
|
## 0.0.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.3
|
## 0.0.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "template-ext-vue",
|
"name": "template-ext-vue",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-worker
|
# template-ext-worker
|
||||||
|
|
||||||
|
## 0.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.0
|
||||||
|
|
||||||
## 0.0.5
|
## 0.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { watch } from "fs"
|
import { watch } from "fs"
|
||||||
import { join } from "path"
|
import { join } from "path"
|
||||||
import { refreshTemplateWorkerExtension } from "@kksh/api/dev"
|
import { refreshTemplateWorkerCommand } from "@kksh/api/dev"
|
||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
|
|
||||||
const entrypoints = ["./src/index.ts"]
|
const entrypoints = ["./src/index.ts"]
|
||||||
@ -11,7 +11,7 @@ async function build() {
|
|||||||
await $`bun build --minify --target=browser --outdir=./dist ${entrypoint}`
|
await $`bun build --minify --target=browser --outdir=./dist ${entrypoint}`
|
||||||
}
|
}
|
||||||
if (Bun.argv.includes("dev")) {
|
if (Bun.argv.includes("dev")) {
|
||||||
await refreshTemplateWorkerExtension()
|
await refreshTemplateWorkerCommand()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-worker",
|
"name": "template-ext-worker",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
|
@ -9,13 +9,12 @@ import {
|
|||||||
List,
|
List,
|
||||||
path,
|
path,
|
||||||
shell,
|
shell,
|
||||||
|
TemplateUiCommand,
|
||||||
toast,
|
toast,
|
||||||
ui,
|
ui
|
||||||
WorkerExtension
|
|
||||||
} from "@kksh/api/ui/worker"
|
} from "@kksh/api/ui/worker"
|
||||||
import { setupI18n, t } from "./i18n"
|
|
||||||
|
|
||||||
class ExtensionTemplate extends WorkerExtension {
|
class ExtensionTemplate extends TemplateUiCommand {
|
||||||
async onFormSubmit(value: Record<string, any>): Promise<void> {
|
async onFormSubmit(value: Record<string, any>): Promise<void> {
|
||||||
console.log("Form submitted", value)
|
console.log("Form submitted", value)
|
||||||
toast.success(`Form submitted: ${JSON.stringify(value)}`)
|
toast.success(`Form submitted: ${JSON.stringify(value)}`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user