Added Grep plug
parent
b2e7bc8494
commit
60ab40005a
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
"editor.formatOnSave": true,
|
||||
"deno.enable": true,
|
||||
"deno.importMap": "import_map.json",
|
||||
"deno.config": "deno.jsonc",
|
||||
"deno.config": "deno.json",
|
||||
"deno.unstable": true,
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "denoland.vscode-deno"
|
||||
|
|
|
@ -15,8 +15,7 @@ await esbuild.build({
|
|||
logLevel: "error",
|
||||
minify: true,
|
||||
plugins: denoPlugins({
|
||||
importMapURL: new URL("./import_map.json", import.meta.url)
|
||||
.toString(),
|
||||
configPath: new URL("./deno.json", import.meta.url).pathname,
|
||||
}),
|
||||
});
|
||||
const bundleJs = await Deno.readTextFile("dist/silverbullet.js");
|
||||
|
|
|
@ -27,6 +27,7 @@ if (import.meta.main) {
|
|||
debug: args.debug,
|
||||
reload: args.reload,
|
||||
info: args.info,
|
||||
configPath: new URL("deno.json", import.meta.url).pathname,
|
||||
},
|
||||
);
|
||||
esbuild.stop();
|
||||
|
|
|
@ -105,8 +105,7 @@ async function buildCopyBundleAssets() {
|
|||
jsxFragment: "Fragment",
|
||||
jsxImportSource: "https://esm.sh/preact@10.23.1",
|
||||
plugins: denoPlugins({
|
||||
importMapURL: new URL("./import_map.json", import.meta.url)
|
||||
.toString(),
|
||||
configPath: new URL("./deno.json", import.meta.url).pathname,
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ const workerRuntimeUrl =
|
|||
export type CompileOptions = {
|
||||
debug?: boolean;
|
||||
runtimeUrl?: string;
|
||||
// path to config file
|
||||
configPath?: string;
|
||||
// path to import map
|
||||
importMap?: string;
|
||||
// Reload plug import cache
|
||||
reload?: boolean;
|
||||
|
@ -103,9 +106,9 @@ setupMessageListener(functionMapping, manifest);
|
|||
treeShaking: true,
|
||||
plugins: [
|
||||
...denoPlugins({
|
||||
// TODO do this differently
|
||||
importMapURL: options.importMap ||
|
||||
new URL("../import_map.json", import.meta.url).toString(),
|
||||
configPath: options.configPath &&
|
||||
path.resolve(Deno.cwd(), options.configPath),
|
||||
importMapURL: options.importMap,
|
||||
loader: "native",
|
||||
}),
|
||||
],
|
||||
|
|
|
@ -2,12 +2,13 @@ import { compileManifests } from "./compile.ts";
|
|||
import * as esbuild from "esbuild";
|
||||
|
||||
export async function plugCompileCommand(
|
||||
{ watch, dist, debug, info, importmap, runtimeUrl }: {
|
||||
{ watch, dist, debug, info, importmap, config, runtimeUrl }: {
|
||||
watch: boolean;
|
||||
dist: string;
|
||||
debug: boolean;
|
||||
info: boolean;
|
||||
importmap?: string;
|
||||
config?: string;
|
||||
runtimeUrl?: string;
|
||||
},
|
||||
...manifestPaths: string[]
|
||||
|
@ -23,6 +24,7 @@ export async function plugCompileCommand(
|
|||
importMap: importmap
|
||||
? new URL(importmap, `file://${Deno.cwd()}/`).toString()
|
||||
: undefined,
|
||||
configPath: config,
|
||||
},
|
||||
);
|
||||
esbuild.stop();
|
||||
|
|
|
@ -1,4 +1,55 @@
|
|||
{
|
||||
"tasks": {
|
||||
"clean": "rm -rf dist dist_client_bundle dist_plug_bundle website_build",
|
||||
"deep-clean-mac": "rm -f deno.lock && rm -rf $HOME/Library/Caches/deno && deno task clean",
|
||||
"install": "deno install -g -f --unstable-kv --unstable-worker-options -A --import-map deno.json silverbullet.ts",
|
||||
"check": "find . -name '*.ts*' | xargs deno check",
|
||||
"test": "deno test -A --unstable-kv --unstable-worker-options",
|
||||
"bench": "deno bench",
|
||||
"build": "deno run -A build_plugs.ts && deno run -A build_web.ts",
|
||||
"plugs": "deno run -A build_plugs.ts",
|
||||
"server": "deno run -A --unstable-kv --unstable-worker-options --check silverbullet.ts",
|
||||
"generate": "./scripts/generate.sh",
|
||||
|
||||
"watch-web": "deno run -A --check build_web.ts --watch",
|
||||
"watch-server": "deno run -A --unstable-kv --unstable-worker-options --check --watch silverbullet.ts",
|
||||
"watch-plugs": "deno run -A --check build_plugs.ts -w",
|
||||
|
||||
"bundle": "deno run -A build_bundle.ts",
|
||||
|
||||
"compile": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options -o silverbullet dist/silverbullet.js",
|
||||
"server:dist:linux-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-unknown-linux-gnu -o silverbullet dist/silverbullet.js && zip silverbullet-server-linux-x86_64.zip silverbullet",
|
||||
"server:dist:linux-aarch64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target aarch64-unknown-linux-gnu -o silverbullet dist/silverbullet.js && zip silverbullet-server-linux-aarch64 silverbullet",
|
||||
"server:dist:darwin-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-apple-darwin -o silverbullet dist/silverbullet.js && zip silverbullet-server-darwin-x86_64.zip silverbullet",
|
||||
"server:dist:darwin-aarch64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target aarch64-apple-darwin -o silverbullet dist/silverbullet.js && zip silverbullet-server-darwin-aarch64.zip silverbullet",
|
||||
"server:dist:windows-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-pc-windows-msvc -o silverbullet.exe dist/silverbullet.js && zip silverbullet-server-windows-x86_64.zip silverbullet.exe"
|
||||
},
|
||||
|
||||
"compilerOptions": {
|
||||
"lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"],
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "https://esm.sh/preact@10.23.1"
|
||||
},
|
||||
"lint": {
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist_bundle"
|
||||
],
|
||||
"rules": {
|
||||
"exclude": ["no-explicit-any"]
|
||||
}
|
||||
},
|
||||
"fmt": {
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist_bundle",
|
||||
"website",
|
||||
"website_build",
|
||||
"test_space",
|
||||
"README.md"
|
||||
]
|
||||
},
|
||||
|
||||
"imports": {
|
||||
"@lezer/common": "https://esm.sh/@lezer/common@1.2.1&target=es2022",
|
||||
"@lezer/lr": "https://esm.sh/@lezer/lr@1.4.1?external=@lezer/common&target=es2022",
|
54
deno.jsonc
54
deno.jsonc
|
@ -1,54 +0,0 @@
|
|||
{
|
||||
"tasks": {
|
||||
"clean": "rm -rf dist dist_client_bundle dist_plug_bundle website_build",
|
||||
"deep-clean-mac": "rm -f deno.lock && rm -rf $HOME/Library/Caches/deno && deno task clean",
|
||||
"install": "deno install -g -f --unstable-kv --unstable-worker-options -A --importmap import_map.json silverbullet.ts",
|
||||
"check": "find . -name '*.ts*' | xargs deno check",
|
||||
"test": "deno test -A --unstable-kv --unstable-worker-options",
|
||||
"build": "deno run -A build_plugs.ts && deno run -A build_web.ts",
|
||||
"plugs": "deno run -A build_plugs.ts",
|
||||
"server": "deno run -A --unstable-kv --unstable-worker-options --check silverbullet.ts",
|
||||
|
||||
"watch-web": "deno run -A --check build_web.ts --watch",
|
||||
"watch-server": "deno run -A --unstable-kv --unstable-worker-options --check --watch silverbullet.ts",
|
||||
"watch-plugs": "deno run -A --check build_plugs.ts -w",
|
||||
|
||||
"bundle": "deno run -A build_bundle.ts",
|
||||
// Regenerates some bundle files (checked into the repo)
|
||||
"generate": "./scripts/generate.sh",
|
||||
|
||||
// Compile
|
||||
"compile": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options -o silverbullet dist/silverbullet.js",
|
||||
"server:dist:linux-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-unknown-linux-gnu -o silverbullet dist/silverbullet.js && zip silverbullet-server-linux-x86_64.zip silverbullet",
|
||||
"server:dist:linux-aarch64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target aarch64-unknown-linux-gnu -o silverbullet dist/silverbullet.js && zip silverbullet-server-linux-aarch64 silverbullet",
|
||||
"server:dist:darwin-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-apple-darwin -o silverbullet dist/silverbullet.js && zip silverbullet-server-darwin-x86_64.zip silverbullet",
|
||||
"server:dist:darwin-aarch64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target aarch64-apple-darwin -o silverbullet dist/silverbullet.js && zip silverbullet-server-darwin-aarch64.zip silverbullet",
|
||||
"server:dist:windows-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-pc-windows-msvc -o silverbullet.exe dist/silverbullet.js && zip silverbullet-server-windows-x86_64.zip silverbullet.exe"
|
||||
},
|
||||
|
||||
"compilerOptions": {
|
||||
"lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"],
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "https://esm.sh/preact@10.23.1"
|
||||
},
|
||||
"importMap": "import_map.json",
|
||||
"lint": {
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist_bundle"
|
||||
],
|
||||
"rules": {
|
||||
"exclude": ["no-explicit-any"]
|
||||
}
|
||||
},
|
||||
"fmt": {
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist_bundle",
|
||||
"website",
|
||||
"website_build",
|
||||
"test_space",
|
||||
"README.md"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// Remember to keep in sync with import_map.json !
|
||||
// Remember to keep in sync with deno.json !
|
||||
// We have to use different deps for client and server as esbuild doesn't
|
||||
// support wildcard exporting. See https://github.com/evanw/esbuild/issues/1420
|
||||
export {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Remember to keep in sync with import_map.json !
|
||||
// Remember to keep in sync with deno.json !
|
||||
// We have to use different deps for client and server as esbuild doesn't
|
||||
// support wildcard exporting. See https://github.com/evanw/esbuild/issues/1420
|
||||
export { globToRegExp } from "https://deno.land/std@0.165.0/path/glob.ts";
|
||||
|
|
|
@ -72,6 +72,7 @@ await new Command()
|
|||
{ default: "." },
|
||||
)
|
||||
.option("--importmap <path:string>", "Path to import map file to use")
|
||||
.option("-c, --config <path:string>", "Path to deno.json file to use")
|
||||
.option("--runtimeUrl <url:string>", "URL to worker_runtime.ts to use")
|
||||
.action(plugCompileCommand)
|
||||
// plug:run
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
uri: https://github.com/Maarrk/silverbullet-grep/releases/latest/download/grep.plug.js
|
||||
repo: https://github.com/Maarrk/silverbullet-grep
|
||||
author: Marek S. Łukasiewicz
|
||||
tags: plug
|
||||
---
|
||||
|
||||
![[!raw.githubusercontent.com/Maarrk/silverbullet-grep/main/README]]
|
||||
```
|
Loading…
Reference in New Issue