mirror of
https://github.com/joel-st/kunkun-nostr-goto-repo.git
synced 2025-06-18 16:15:02 +00:00
pre conversion
This commit is contained in:
parent
0ba44f679d
commit
b6da438a7d
12
build.ts
12
build.ts
@ -3,7 +3,17 @@ import { join } from "path"
|
||||
import { refreshTemplateWorkerCommand } from "@kksh/api/dev"
|
||||
import { $ } from "bun"
|
||||
|
||||
const entrypoints = ["./src/index-github.ts", "./src/index-nostrcom.ts"]
|
||||
// Define an empty array to store entrypoints
|
||||
const entrypoints: string[] = [];
|
||||
|
||||
|
||||
if (Bun.argv.includes("--headless")) {
|
||||
entrypoints.push("./src/index-github.ts", "./src/index-nostrcom.ts")
|
||||
}
|
||||
|
||||
if (Bun.argv.includes("--template")) {
|
||||
entrypoints.push("./src/index-nip.ts")
|
||||
}
|
||||
|
||||
async function build() {
|
||||
try {
|
||||
|
1
dist/assets/index-B-iQgq6W.css
vendored
1
dist/assets/index-B-iQgq6W.css
vendored
File diff suppressed because one or more lines are too long
58
dist/assets/index-BZYRh09w.js
vendored
58
dist/assets/index-BZYRh09w.js
vendored
File diff suppressed because one or more lines are too long
1
dist/extension.svg
vendored
1
dist/extension.svg
vendored
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path fill="currentColor" d="M412.5 22.17c-.6 0-1.2.1-1.7.1c-9 .72-15.4 5.89-16.2 8.96c-2.1 7.02-3.6 16.36-2.2 22.82s3.4 10.34 14.2 12.22c16.6 2.88 35.4-.64 51.8-6.43c13-4.61 24.2-10.62 31.3-15.14c-.4-.67-.8-1.27-1.4-1.78c-1.5-1.26-4.3-2.53-8.6-3.31c-8.7-1.57-22.2-.88-36-1.57l-4.3-.22l-2.5-3.5c-6.2-8.57-14.6-11.93-22.7-12.14h-1.7zm-14 60.61c-3.9 10.17-4.5 20.22-2.8 29.52c2.2 12.2 9.5 22.1 13.6 32.9c14 36.6.8 45.4-20.8 51.1c22.3 20 33.3 44.4 35 68.3c30-45.7 35.3-86.2 1.3-128.6c-6.7-8.3-9.9-18.2-11.4-26.8c-1.5-7.9-.8-15.35 3.7-23.91c-4.5-.11-9-.51-13.5-1.29c-1.8-.31-3.4-.72-5.1-1.22M108.4 126.9c-29.04-.2-53.3 25.3-56.66 60c10.56-10.7 25.02-17.7 46.11-17.2c-20.2 13.7-33.69 29.2-44.34 45.3c1.77 8.2 4.64 16.5 8.8 24.9c38.09-52.5 60.99-29.6 72.69.1c10.8-20 27.4-36 47-48.1c-21.4-46.4-49.2-64.8-73.6-65m180.2 55c-3.4 0-6.9 0-10.4.2c-12.4.5-25 2.2-37.3 5.1c-46.3 11-86.3 38-97.9 81.1c22.2 7.6 40.7 16.4 56.7 25.4c31.6 4.7 63.8 3.2 91.4-2.5c38.5-8 67-25.4 73.3-39.7l16.4 7.2c-11 25.4-44.7 41.6-86 50.1c-19 4-39.9 6-61.3 5.7c4.3 2.8 8.4 5.5 12.4 8.1c27.1 17.6 48.4 29.7 82.6 28c35.6-2.9 62.6-25.9 72.9-54.6c10.2-28.7 4.4-62.5-28.7-89.5c-19.2-15.8-50.6-24.4-84.1-24.6m-92.5 130.4c-4.4 8.8-8.1 18-10.6 26.2c-18.6 8.8-25 12.1-34.8 33.2c-35.5 15.3-50.4 38.2-61.34 71.5c-22.48 6.1-40.85 5-63.06-9.9c-12.14 16.1 6.05 30.4 22.64 36.9c21.16 8.3 50.31 2.8 55.46-7.2c16.5-32.5 31.1-54.7 61.7-77c13.1-1.4 22.4-2.4 34.3-18c21.6 2.2 39.3-8 55-18.1c7.8 17.9 23.5 41.8 20.7 58.9c-11.8 9.5-8 21.3-8.3 24.1c6 17.9 66.2-5.8 108 18c22.4 12.8 27.9 44.9 69.4 37.9c6.8-1.1 5.3-7.2.6-8.9c-37.4-13.7-27.6-21-44.8-48.1c-32-.8-59.3-5.2-95.4-16.1c-10.4-3 3.2-24.8 13.3-47c-33.4-.9-57.8-14.7-82.9-31c-12.4-8.1-25.2-16.8-39.9-25.4"/></svg>
|
Before Width: | Height: | Size: 1.8 KiB |
6
dist/index-nip.js
vendored
Normal file
6
dist/index-nip.js
vendored
Normal file
File diff suppressed because one or more lines are too long
14
dist/index.html
vendored
14
dist/index.html
vendored
@ -1,14 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/extension.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Kunkun Nostr Open Specific NIP</title>
|
||||
<script type="module" crossorigin src="/assets/index-BZYRh09w.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B-iQgq6W.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
13
index.html
13
index.html
@ -1,13 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/extension.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Kunkun Nostr Open Specific NIP</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/index-nip.jsx"></script>
|
||||
</body>
|
||||
</html>
|
21
package.json
21
package.json
@ -27,15 +27,6 @@
|
||||
"type": "iconify",
|
||||
"value": "majesticons:open"
|
||||
},
|
||||
"customUiCmds": [
|
||||
{
|
||||
"main": "/index-nip.js",
|
||||
"dist": "dist",
|
||||
"devMain": "http://localhost:5173",
|
||||
"name": "Nostr Open Specific NIP",
|
||||
"cmds": []
|
||||
}
|
||||
],
|
||||
"headlessCmds": [
|
||||
{
|
||||
"name": "Nostr Open NIP Repository (github.com)",
|
||||
@ -47,13 +38,19 @@
|
||||
"main": "dist/index-nostrcom.js",
|
||||
"cmds": []
|
||||
}
|
||||
],
|
||||
"templateUiCmds": [
|
||||
{
|
||||
"name": "Nostr Open Specific NIP",
|
||||
"main": "dist/index-nip.js",
|
||||
"cmds": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"dev:template": "bun build.ts dev --template",
|
||||
"dev:headless": "bun build.ts dev --headless",
|
||||
"build:headless": "bun build.ts",
|
||||
"dev:nip": "vite",
|
||||
"build:nip": "vite build"
|
||||
"build": "bun build.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/react": "^5.2.0",
|
||||
|
@ -1,6 +0,0 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
import {
|
||||
Action,
|
||||
clipboard,
|
||||
expose,
|
||||
Icon,
|
||||
IconEnum,
|
||||
List,
|
||||
open,
|
||||
TemplateUiCommand,
|
||||
toast,
|
||||
ui,
|
||||
} from "@kksh/api/ui/template";
|
||||
|
||||
interface Nip {
|
||||
nip: string;
|
||||
title: string;
|
||||
rawTitle: string;
|
||||
urlGithub: string;
|
||||
urlNostrCom: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
class NostrOpenSpecificNip extends TemplateUiCommand {
|
||||
private nips: Nip[] = [];
|
||||
private loading: boolean = false;
|
||||
private searchQuery: string = "";
|
||||
|
||||
async load() {
|
||||
this.loading = true;
|
||||
this.updateUI();
|
||||
try {
|
||||
this.nips = await this.fetchNostrNips();
|
||||
} catch (error) {
|
||||
console.error('Failed to load NIPs:', error);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
this.updateUI();
|
||||
}
|
||||
}
|
||||
|
||||
// Function to fetch NIPs from GitHub
|
||||
async fetchNostrNips(): Promise<Nip[]> {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Filter NIPs based on search query
|
||||
getFilteredNips(): Nip[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Handle search input change
|
||||
handleSearchInput(query: string): void {
|
||||
this.searchQuery = query;
|
||||
this.updateUI();
|
||||
}
|
||||
|
||||
// Open URL in browser
|
||||
handleOpenUrl(url: string): void {
|
||||
open.url(url);
|
||||
}
|
||||
|
||||
updateUI() {
|
||||
return 'Nostr NIPs';
|
||||
}
|
||||
}
|
||||
|
||||
expose(new NostrOpenSpecificNip());
|
@ -1,6 +0,0 @@
|
||||
@import url("@kksh/react/css");
|
||||
@import url("@kksh/react/themes");
|
||||
/* @tailwind base; */
|
||||
/* This adds white border to command components under dark mode */
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
@ -1,12 +0,0 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: [
|
||||
"./index.html",
|
||||
"./src/**/*.jsx"
|
||||
// "./node_modules/@kksh/react/dist/**/*.{js,ts,jsx,tsx}"
|
||||
],
|
||||
theme: {
|
||||
extend: {}
|
||||
},
|
||||
plugins: []
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import preact from "@preact/preset-vite"
|
||||
import { defineConfig } from "vite"
|
||||
import { resolve } from 'path'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [preact()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'react': 'preact/compat',
|
||||
'react-dom/test-utils': 'preact/test-utils',
|
||||
'react-dom': 'preact/compat',
|
||||
'react/jsx-runtime': 'preact/jsx-runtime',
|
||||
}
|
||||
}
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user