Skip to content

Commit

Permalink
🐛 [plaoc/desktop-dev] 修复deno install relative path错误
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsword09 committed Jul 4, 2023
1 parent e7a9184 commit cfd6c45
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
20 changes: 19 additions & 1 deletion desktop-dev/deno.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"importMap": "import_map.json",
"lock": false,
"exclude": [
"**/assets/",
Expand All @@ -18,6 +17,25 @@
]
}
},
"imports": {
"cbor-x": "https://esm.sh/v124/cbor-x@1.5.3",
"@seald-io/nedb": "https://esm.sh/v124/@seald-io/nedb@4.0.2",
"popmotion": "https://esm.sh/v124/popmotion@11.0.5",
"electron-store": "https://esm.sh/v124/electron-store@8.1.0",
"colors": "https://deno.land/std@0.191.0/fmt/colors.ts",
"comlink": "https://esm.sh/v124/comlink@4.4.1",
"electron": "https://esm.sh/v124/electron@25.2.0",
"extract-zip": "https://esm.sh/v124/extract-zip@2.0.1",
"jszip": "https://esm.sh/v124/jszip@3.10.1",
"lit": "https://esm.sh/v124/lit@2.7.4",
"lit/": "https://esm.sh/v124/lit@2.7.4/",
"mime": "https://esm.sh/v124/mime@3.0.0",
"node-forge": "https://esm.sh/v124/node-forge@1.3.1",
"source-map-support": "https://esm.sh/v124/source-map-support@0.5.21",
"source-map-support/register": "https://esm.sh/v124/source-map-support@0.5.21/register.js",
"zod": "https://esm.sh/v124/zod@3.21.4",
"tar": "https://esm.sh/v124/tar@6.1.15"
},
"tasks": {
"dnt": "deno run -A ./scripts/dnt.ts",
"bundle": "deno run -A ./scripts/bundle.ts",
Expand Down
6 changes: 3 additions & 3 deletions desktop-dev/src/helper/zodHelper.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! use zod error: Relative import path "zod" not prefixed with / or ./ or ../ only remote
//! https://github.com/denoland/deno/issues/17598
import { RefinementCtx, z } from "https://deno.land/x/zod@v3.21.4/mod.ts";
import { RefinementCtx, z } from "zod";
import { $MMID } from "../core/types.ts";
// const z_mmid = z.string().endsWith(".dweb");
export const mmidType = z.custom<$MMID>((val) => {
return typeof val === "string" && val.endsWith(".dweb");
});
export * from "https://deno.land/x/zod@v3.21.4/mod.ts";
export * from "zod";
export { mmidType as mmid };

import type {
Expand All @@ -15,7 +15,7 @@ import type {
ZodObject,
ZodRawShape,
ZodTypeAny,
} from "https://deno.land/x/zod@v3.21.4/mod.ts";
} from "zod";

/// 以下代码来自 https://github.com/rileytomasek/zodix (MIT license)
/// 因为源码有点问题,并且引入了一些不该引入的包,所以这里只提取了部分有需要的,并修复了一些问题
Expand Down
24 changes: 12 additions & 12 deletions plaoc/deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"lock": false,
"exclude": [
"dist/",
"bundle/",
"build/"
],
"exclude": ["dist/", "bundle/", "build/"],
"imports": {
"https://deno.land/x/dweb/src/": "https://deno.land/x/dweb/src/",
"zod": "https://esm.sh/v124/zod@3.21.4",
"cbor-x": "https://esm.sh/v124/cbor-x@1.5.3/es2022/cbor-x.mjs",
"lit": "https://esm.sh/v124/lit@2.7.4",
"lit/": "https://esm.sh/v124/lit@2.7.4/",
"jimp": "https://esm.sh/v124/jimp@0.22.8",
"jsqr": "https://esm.sh/v124/jsqr@1.4.0"
},
"tasks": {
"build": "deno task build:client && deno task build:server && deno task build:demo",
"build:client": "deno run -A ./scripts/npm-build.ts client",
Expand All @@ -17,7 +22,6 @@
"pub": "deno run -A ./scripts/npm-pub.ts",
"test": "deno test -A --unstable --no-check ./test"
},
"importMap": "import_map.json",
"compilerOptions": {
"allowJs": false,
"strict": true,
Expand All @@ -26,11 +30,7 @@
},
"lint": {
"rules": {
"exclude": [
"no-namespace",
"no-empty-interface",
"require-await"
]
"exclude": ["no-namespace", "no-empty-interface", "require-await"]
}
},
"fmt": {
Expand All @@ -42,4 +42,4 @@
"proseWrap": "preserve"
}
}
}
}
11 changes: 0 additions & 11 deletions plaoc/import_map.json

This file was deleted.

0 comments on commit cfd6c45

Please sign in to comment.