Skip to content

Commit

Permalink
Move deno std from deno.land to jsr
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed May 31, 2024
1 parent b3fc811 commit b7fd2ca
Show file tree
Hide file tree
Showing 38 changed files with 56 additions and 49 deletions.
4 changes: 2 additions & 2 deletions config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { exists } from "std/fs/exists.ts";
import { JsonValue, parse } from "std/jsonc/mod.ts";
import { exists } from "@std/fs/exists";
import { JsonValue, parse } from "@std/jsonc";
import { isDocker } from "./utils.ts";

export type ConfigType = {
Expand Down
6 changes: 3 additions & 3 deletions db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
compare as compare_ver,
format as format_ver,
parse as parse_ver,
} from "std/semver/mod.ts";
import { unescape } from "std/html/mod.ts";
import { join, resolve } from "std/path/mod.ts";
} from "@std/semver";
import { unescape } from "@std/html";
import { join, resolve } from "@std/path";
import { SqliteError } from "sqlite/mod.ts";
import { SqliteError as Sqlite3Error } from "sqlite3/mod.ts";
import { Status } from "sqlite/src/constants.ts";
Expand Down
2 changes: 1 addition & 1 deletion db_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "std/assert/mod.ts";
import { assertEquals } from "@std/assert";
import { EhDb, EhFile, GMeta, PMeta } from "./db.ts";
import { TaskType } from "./task.ts";
import { DB_PERMISSION, remove_if_exists } from "./test_base.ts";
Expand Down
9 changes: 8 additions & 1 deletion import_map.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"imports": {
"std/": "https://deno.land/[email protected]/",
"@std/assert": "jsr:/@std/[email protected]",
"@std/cli/": "jsr:/@std/[email protected]/",
"@std/encoding/": "jsr:/@std/[email protected]/",
"@std/fs/": "jsr:/@std/[email protected]/",
"@std/html": "jsr:/@std/[email protected]",
"@std/jsonc": "jsr:/@std/[email protected]",
"@std/path": "jsr:/@std/[email protected]",
"@std/semver": "jsr:/@std/[email protected]",
"deno_dom/": "https://deno.land/x/[email protected]/",
"sqlite/": "https://deno.land/x/[email protected]/",
"zipjs/": "https://deno.land/x/[email protected]/",
Expand Down
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseArgs as parse } from "std/cli/parse_args.ts";
import { parseArgs as parse } from "@std/cli/parse-args";
import { load_settings } from "./config.ts";
import { check_file_permissions } from "./permissons.ts";
import { AlreadyClosedError, TaskManager } from "./task_manager.ts";
Expand Down
2 changes: 1 addition & 1 deletion page/GalleryMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { unescape } from "std/html/mod.ts";
import { unescape } from "@std/html";
import type { GMeta } from "../db.ts";

export type GalleryMetadataTorrentInfo = {
Expand Down
2 changes: 1 addition & 1 deletion page/GalleryMetadata_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, assertEquals } from "std/assert/mod.ts";
import { assert, assertEquals } from "@std/assert";
import { Client } from "../client.ts";
import { load_settings } from "../config.ts";
import { API_PERMISSION } from "../test_base.ts";
Expand Down
2 changes: 1 addition & 1 deletion page/GalleryPage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DOMParser, Element } from "deno_dom/deno-dom-wasm-noinit.ts";
import { extname } from "std/path/mod.ts";
import { extname } from "@std/path";
import { Client } from "../client.ts";
import type { EhFile, PMeta } from "../db.ts";
import { initDOMParser, map, parse_bool } from "../utils.ts";
Expand Down
2 changes: 1 addition & 1 deletion page/GalleryPage_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, assertEquals } from "std/assert/mod.ts";
import { assert, assertEquals } from "@std/assert";
import { Client } from "../client.ts";
import { load_settings } from "../config.ts";
import { API_PERMISSION } from "../test_base.ts";
Expand Down
2 changes: 1 addition & 1 deletion page/HomeOverviewPage_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "std/assert/mod.ts";
import { assert } from "@std/assert";
import { Client } from "../client.ts";
import { load_settings } from "../config.ts";
import { API_PERMISSION } from "../test_base.ts";
Expand Down
2 changes: 1 addition & 1 deletion page/MPVPage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DOMParser } from "deno_dom/deno-dom-wasm-noinit.ts";
import { extname } from "std/path/mod.ts";
import { extname } from "@std/path";
import { Client } from "../client.ts";
import { initDOMParser } from "../utils.ts";
import type { EhFile, PMeta } from "../db.ts";
Expand Down
2 changes: 1 addition & 1 deletion page/MPVPage_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, assertEquals } from "std/assert/mod.ts";
import { assert, assertEquals } from "@std/assert";
import { Client } from "../client.ts";
import { load_settings } from "../config.ts";

Expand Down
2 changes: 1 addition & 1 deletion page/SinglePage_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, assertEquals } from "std/assert/mod.ts";
import { assert, assertEquals } from "@std/assert";
import { Client } from "../client.ts";
import { load_settings } from "../config.ts";
import { API_PERMISSION } from "../test_base.ts";
Expand Down
2 changes: 1 addition & 1 deletion pid_check.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { exists } from "std/fs/exists.ts";
import { exists } from "@std/fs/exists";

export async function check_running(pid: number) {
if (Deno.build.os == "windows") {
Expand Down
4 changes: 2 additions & 2 deletions routes/_middleware.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FreshContext } from "$fresh/server.ts";
import { join } from "std/path/mod.ts";
import { join } from "@std/path";
import {
get_file_response,
GetFileResponseOptions,
} from "../server/get_file_response.ts";
import { exists } from "std/fs/exists.ts";
import { exists } from "@std/fs/exists";
import { get_task_manager } from "../server.ts";
import { build_sw } from "../server/build_sw.ts";
import { i18n_get_lang } from "../server/i18ns.ts";
Expand Down
2 changes: 1 addition & 1 deletion routes/api/file/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "../../../server/get_file_response.ts";
import { parse_bool } from "../../../server/parse_form.ts";
import pbkdf2Hmac from "pbkdf2-hmac";
import { encodeBase64 as encode } from "std/encoding/base64.ts";
import { encodeBase64 as encode } from "@std/encoding/base64";
import { get_host, return_data, return_error } from "../../../server/utils.ts";
import type { EhFileExtend } from "../../../server/files.ts";
import { User, UserPermission } from "../../../db.ts";
Expand Down
2 changes: 1 addition & 1 deletion routes/api/file/random.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SortableURLSearchParams } from "../../../server/SortableURLSearchParams
import { get_host } from "../../../server/utils.ts";
import { User, UserPermission } from "../../../db.ts";
import pbkdf2Hmac from "pbkdf2-hmac";
import { encodeBase64 as encode } from "std/encoding/base64.ts";
import { encodeBase64 as encode } from "@std/encoding/base64";
import { return_data } from "../../../server/utils.ts";

export const handler: Handlers = {
Expand Down
2 changes: 1 addition & 1 deletion routes/api/file/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { get_string, parse_bool } from "../../../server/parse_form.ts";
import { fb_get_size } from "../../../thumbnail/ffmpeg_binary.ts";
import { sure_dir } from "../../../utils.ts";
import mime from "mime";
import { extname, join, resolve } from "std/path/mod.ts";
import { extname, join, resolve } from "@std/path";
import { UserPermission } from "../../../db.ts";

export const handler: Handlers = {
Expand Down
4 changes: 2 additions & 2 deletions routes/api/thumbnail/[id].ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Handlers } from "$fresh/server.ts";
import { exists } from "std/fs/exists.ts";
import { exists } from "@std/fs/exists";
import { get_task_manager } from "../../../server.ts";
import { parse_bool, parse_int } from "../../../server/parse_form.ts";
import {
Expand All @@ -19,7 +19,7 @@ import {
} from "../../../server/get_file_response.ts";
import { get_host } from "../../../server/utils.ts";
import pbkdf2Hmac from "pbkdf2-hmac";
import { encodeBase64 as encode } from "std/encoding/base64.ts";
import { encodeBase64 as encode } from "@std/encoding/base64";
import { SortableURLSearchParams } from "../../../server/SortableURLSearchParams.ts";
import type * as FFMPEG_API from "../../../thumbnail/ffmpeg_api.ts";
import { User, UserPermission } from "../../../db.ts";
Expand Down
2 changes: 1 addition & 1 deletion routes/api/token.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Handlers } from "$fresh/server.ts";
import { decodeBase64 as decode } from "std/encoding/base64.ts";
import { decodeBase64 as decode } from "@std/encoding/base64";
import { get_string, parse_bool, parse_int } from "../../server/parse_form.ts";
import { return_data, return_error } from "../../server/utils.ts";
import { get_task_manager } from "../../server.ts";
Expand Down
2 changes: 1 addition & 1 deletion routes/api/user/change_password.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Handlers } from "$fresh/server.ts";
import isEqual from "lodash/isEqual";
import pbkdf2Hmac from "pbkdf2-hmac";
import { decodeBase64 } from "std/encoding/base64.ts";
import { decodeBase64 } from "@std/encoding/base64";
import { User } from "../../../db.ts";
import { get_task_manager } from "../../../server.ts";
import { get_string, parse_int } from "../../../server/parse_form.ts";
Expand Down
2 changes: 1 addition & 1 deletion routes/file/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
GetFileResponseOptions,
} from "../../server/get_file_response.ts";
import pbkdf2Hmac from "pbkdf2-hmac";
import { encodeBase64 as encode } from "std/encoding/base64.ts";
import { encodeBase64 as encode } from "@std/encoding/base64";

export const handler: Handlers = {
async GET(req, ctx) {
Expand Down
2 changes: 1 addition & 1 deletion routes/file/[verify]/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
GetFileResponseOptions,
} from "../../../server/get_file_response.ts";
import pbkdf2Hmac from "pbkdf2-hmac";
import { encodeBase64 as encode } from "std/encoding/base64.ts";
import { encodeBase64 as encode } from "@std/encoding/base64";

export const handler: Handlers = {
async GET(req, ctx) {
Expand Down
2 changes: 1 addition & 1 deletion routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Handlers } from "$fresh/server.ts";
import { get_task_manager } from "../server.ts";
import { get_host } from "../server/utils.ts";
import { exists } from "std/fs/exists.ts";
import { exists } from "@std/fs/exists";

export const handler: Handlers = {
async GET(req, _ctx) {
Expand Down
4 changes: 2 additions & 2 deletions routes/thumbnail/[id].ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Handlers } from "$fresh/server.ts";
import { exists } from "std/fs/exists.ts";
import { exists } from "@std/fs/exists";
import { get_task_manager } from "../../server.ts";
import { parse_int } from "../../server/parse_form.ts";
import { generate_filename, ThumbnailConfig } from "../../thumbnail/base.ts";
Expand All @@ -9,7 +9,7 @@ import {
GetFileResponseOptions,
} from "../../server/get_file_response.ts";
import pbkdf2Hmac from "pbkdf2-hmac";
import { encodeBase64 as encode } from "std/encoding/base64.ts";
import { encodeBase64 as encode } from "@std/encoding/base64";
import { SortableURLSearchParams } from "../../server/SortableURLSearchParams.ts";

export const handler: Handlers = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/download_ffi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dirname } from "std/path/mod.ts";
import { dirname } from "@std/path";
import { sure_dir } from "../utils.ts";

const map = JSON.parse(await Deno.readTextFile("./import_map.json")).imports;
Expand Down
2 changes: 1 addition & 1 deletion server/SortableURLSearchParams_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "std/assert/mod.ts";
import { assertEquals } from "@std/assert";
import { SortableURLSearchParams } from "./SortableURLSearchParams.ts";

Deno.test("SortableURLSearchParams_test", () => {
Expand Down
2 changes: 1 addition & 1 deletion server/build_sw.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { build } from "esbuild/mod.js";
import { join, resolve } from "std/path/mod.ts";
import { join, resolve } from "@std/path";
import { asyncForEach, calFileMd5, checkMapFile } from "../utils.ts";

export async function build_sw() {
Expand Down
2 changes: 1 addition & 1 deletion server/get_file_response.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { exists } from "std/fs/exists.ts";
import { exists } from "@std/fs/exists";
import mime from "mime";
import { parse_range } from "./range_parser.ts";

Expand Down
6 changes: 3 additions & 3 deletions server/i18ns.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { exists } from "std/fs/exists.ts";
import { parse } from "std/jsonc/mod.ts";
import { join } from "std/path/mod.ts";
import { exists } from "@std/fs/exists";
import { parse } from "@std/jsonc";
import { join } from "@std/path";
import type { I18NMap } from "./i18n.ts";
import { pick } from "accept-language-parser/";
import { get_host } from "./utils.ts";
Expand Down
2 changes: 1 addition & 1 deletion server/parse_form_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "std/assert/mod.ts";
import { assertEquals } from "@std/assert";
import { parse_bool, parse_int } from "./parse_form.ts";

Deno.test("parse_bool_test", async () => {
Expand Down
2 changes: 1 addition & 1 deletion server/range_parser_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, assertEquals } from "std/assert/mod.ts";
import { assert, assertEquals } from "@std/assert";
import { parse_range } from "./range_parser.ts";

Deno.test("parse_range_test", () => {
Expand Down
6 changes: 3 additions & 3 deletions tasks/download.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "std/assert/mod.ts";
import { assert } from "@std/assert";
import { Client } from "../client.ts";
import type { Config } from "../config.ts";
import type { EhDb, EhFile, PMeta } from "../db.ts";
Expand All @@ -20,8 +20,8 @@ import {
sure_dir,
TimeoutError,
} from "../utils.ts";
import { join, resolve } from "std/path/mod.ts";
import { exists } from "std/fs/exists.ts";
import { join, resolve } from "@std/path";
import { exists } from "@std/fs/exists";
import { ProgressReadable } from "../utils/progress_readable.ts";

export type DownloadConfig = {
Expand Down
2 changes: 1 addition & 1 deletion tasks/export_zip.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join } from "std/path/mod.ts";
import { join } from "@std/path";
import { Uint8ArrayReader, ZipWriter } from "zipjs/index.js";
import type { EhDb } from "../db.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion test_base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { exists } from "std/fs/exists.ts";
import { exists } from "@std/fs/exists";

export const API_PERMISSION: Deno.PermissionOptions = {
read: ["./config.json"],
Expand Down
2 changes: 1 addition & 1 deletion thumbnail/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join } from "std/path/mod.ts";
import { join } from "@std/path";
import { filterFilename } from "../utils.ts";
import type { EhFile } from "../db.ts";

Expand Down
4 changes: 2 additions & 2 deletions utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { exists, existsSync } from "std/fs/exists.ts";
import { extname } from "std/path/mod.ts";
import { exists, existsSync } from "@std/fs/exists";
import { extname } from "@std/path";
import { initParser } from "deno_dom/deno-dom-wasm-noinit.ts";
import { configure } from "zipjs/index.js";
import { MD5 } from "lifegpc-md5";
Expand Down
2 changes: 1 addition & 1 deletion utils_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, assertEquals } from "std/assert/mod.ts";
import { assert, assertEquals } from "@std/assert";
import { check_running } from "./pid_check.ts";
import {
add_suffix_to_path,
Expand Down

0 comments on commit b7fd2ca

Please sign in to comment.