Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: import packages from jsr as much as possible #52

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"@/": "./src/",
"@schemas/": "./schemas/",
"@test/": "./test/",
"cliffy-command": "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts",
"cliffy-table": "https://deno.land/x/cliffy@v1.0.0-rc.3/table/mod.ts",
"@cliffy/command": "jsr:@cliffy/command@^1.0.0-rc.4",
"@cliffy/table": "jsr:@cliffy/table@^1.0.0-rc.4",
"@polyseam/cliffy-provider-gh-releases": "jsr:@polyseam/cliffy-provider-gh-releases@^0.3.0",
"log": "https://deno.land/std@0.204.0/log/mod.ts",
"path": "https://deno.land/std@0.204.0/path/mod.ts",
"@std/log": "jsr:@std/log@^0.204.0",
"@std/path": "jsr:@std/path@^0.204.0",
"sqlite": "https://deno.land/x/[email protected]/mod.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqlite 目前没有找到 https://jsr.io/packages?search=sqlite

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看下换成这个行不行
https://github.com/denodrivers/sqlite3

"@scure/base": "npm:@scure/[email protected]",
"jsonschema": "npm:[email protected]",
Expand Down
237 changes: 79 additions & 158 deletions deno.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, CompletionsCommand } from "cliffy-command";
import { Command, CompletionsCommand } from "@cliffy/command";

import { version } from "./deno.json" with { type: "json" };

Expand Down
2 changes: 1 addition & 1 deletion src/error-handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, ValidationError } from "cliffy-command";
import { Command, ValidationError } from "@cliffy/command";
import { getLogger } from "@/jcli/logger.ts";

export default function <T>(error: T, cmd: Command) {
Expand Down
2 changes: 1 addition & 1 deletion src/jcli/config/jcli-config-json.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LevelName } from "log";
import { LevelName } from "@std/log";
import { api } from "@/api/mod.ts";

export function jcliConfigDotJSONPath(): string {
Expand Down
2 changes: 1 addition & 1 deletion src/jcli/file/files-man.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { extname, join } from "path";
import { extname, join } from "@std/path";
import { api, DirEntry, FS } from "@/api/mod.ts";
import { digest } from "@/jcli/crypto.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/jcli/file/functions-man.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join } from "path";
import { join } from "@std/path";

import { chunk } from "@/utility/async-iterable.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/jcli/file/migrations-man.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join, parse } from "path";
import { join, parse } from "@std/path";
import { PreparedQuery } from "sqlite";

import { api, DBClass } from "@/api/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/jcli/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as log from "log";
import * as log from "@std/log";

const LOGGER = "jcli";

Expand Down
2 changes: 1 addition & 1 deletion src/jcli/project-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ProjectDotJSON,
projectDotJSONPath,
} from "@/jcli/config/project-json.ts";
import { dirname, join } from "path";
import { dirname, join } from "@std/path";

abstract class BaseBuilder {
protected configuration: ProjectDotJSON;
Expand Down
2 changes: 1 addition & 1 deletion src/jet/migration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from "path";
import { parse } from "@std/path";

/**
* A migration filename looks like:
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

import adminProjectsCommand from "@/subcommands/admin/projects/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/projects/create/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/projects/list/action.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GlobalOptions } from "@/args.ts";
import { Table } from "cliffy-table";
import { Table } from "@cliffy/table";
import { api } from "@/api/mod.ts";

export default async function action(
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/projects/list/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import errorHandler from "@/error-handler.ts";

import { GlobalOptions } from "@/args.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/projects/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

import createCommand from "@/subcommands/admin/projects/create/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/var/list/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { VarOptions } from "@/subcommands/admin/var/option.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/var/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

import setCommand from "./set/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/var/set/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { VarOptions } from "@/subcommands/admin/var/option.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/admin/var/unset/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { VarOptions } from "@/subcommands/admin/var/option.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/clone/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import errorHandler from "@/error-handler.ts";

import { GlobalOptions } from "@/args.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/commit/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import errorHandler from "@/error-handler.ts";

import { CommitOptions } from "./option.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/db/migrate/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/db/migrations/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/db/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

import migrateCommand from "@/subcommands/db/migrate/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/db/rollback/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/deploy/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/function/deploy/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { VarOptions } from "@/subcommands/admin/var/option.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/function/inspect/action.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { InspectOptions } from "./option.ts";
import { api, PROJECT_DB_PATH } from "@/api/mod.ts";
import { buildEnvironmentName } from "@/subcommands/admin/var/utilities.ts";
import { Table } from "cliffy-table";
import { Table } from "@cliffy/table";

export default async function (options: InspectOptions, functionName: string) {
const db = await api.db.connect(PROJECT_DB_PATH);
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/function/inspect/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { InspectOptions } from "./option.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/function/logs/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { LogsOptions } from "./option.ts";
import errorHandler from "@/error-handler.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/function/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

import deployCommand from "./deploy/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/generate/github-workflow/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import errorHandler from "@/error-handler.ts";

import { GithubWorkflowOptions } from "./option.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/generate/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

import githubWorkflowCommand from "./github-workflow/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/link/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import errorHandler from "@/error-handler.ts";

import { GlobalOptions } from "@/args.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/migrations/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

const command = new Command<GlobalOptions>()
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/plugin/install/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import errorHandler from "@/error-handler.ts";
import { VarOptions } from "@/subcommands/plugin/options.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/plugin/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

import installCommand from "@/subcommands/plugin/install/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/plugin/uninstall/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import errorHandler from "@/error-handler.ts";
import { VarOptions } from "@/subcommands/plugin/options.ts";

Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/projects/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import { GlobalOptions } from "@/args.ts";

const command = new Command<GlobalOptions>()
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/push/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from "cliffy-command";
import { Command } from "@cliffy/command";
import errorHandler from "@/error-handler.ts";

import { PushOptions } from "./option.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/subcommands/upgrade/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
GithubReleasesProvider,
GithubReleasesUpgradeCommand,
} from "@polyseam/cliffy-provider-gh-releases";
import { dirname } from "path";
import { dirname } from "@std/path";

const getOsAssetMap = () => {
const { os, arch } = Deno.build;
Expand Down
2 changes: 1 addition & 1 deletion test/api/db.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DB, DBClass } from "@/api/db.ts";
import { join } from "path";
import { join } from "@std/path";

export interface DBTest extends DB {
chdir(path: string): void;
Expand Down
2 changes: 1 addition & 1 deletion test/api/jet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from "path";
import { parse } from "@std/path";

import {
Deployment,
Expand Down