Skip to content

Commit

Permalink
fix: migrate to esm
Browse files Browse the repository at this point in the history
  • Loading branch information
northword committed May 14, 2024
1 parent 77b9efb commit 65936b7
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { Build, Config, Release, Serve } from ".";
import pkg from "../package.json";
import { Build, Config, Release, Serve } from "./index.js";
import { Command } from "commander";
import consola from "consola";
import updateNotifier from "update-notifier";
Expand Down
6 changes: 3 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Config, Context, OverrideConfig, UserConfig } from "./types";
import { bumppProgress } from "./utils/log";
import { dateFormat } from "./utils/string";
import { Config, Context, OverrideConfig, UserConfig } from "./types/index.js";
import { bumppProgress } from "./utils/log.js";
import { dateFormat } from "./utils/string.js";
import { loadConfig as c12 } from "c12";
import fs from "fs-extra";
import { createHooks } from "hookable";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Context } from "../types";
import { LogLevels } from "../utils/log";
import { Context } from "../types/index.js";
import { LogLevels } from "../utils/log.js";
import { ConsolaInstance, createConsola } from "consola";

export abstract class Base {
Expand Down
14 changes: 7 additions & 7 deletions src/lib/build.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Context } from "../types";
import { Manifest } from "../types/manifest";
import { UpdateJSON } from "../types/update-json";
import { generateHashSync } from "../utils/crypto";
import { dateFormat } from "../utils/string";
import { Base } from "./base";
import { Context } from "../types/index.js";
import { Manifest } from "../types/manifest.js";
import { UpdateJSON } from "../types/update-json.js";
import { generateHashSync } from "../utils/crypto.js";
import { dateFormat } from "../utils/string.js";
import { Base } from "./base.js";
import chalk from "chalk";
import { buildSync } from "esbuild";
import glob from "fast-glob";
Expand Down Expand Up @@ -103,7 +103,7 @@ export default class Build extends Base {
...(this.name && { name: this.name }),
...(this.version && { version: this.version }),
applications: {
//@ts-expect-error 此处不包含版本限制
//@ts-ignore 此处不包含版本限制
zotero: {
id: this.id,
update_url: this.updateURL,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/release.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Context } from "../types";
import { Context } from "../types/index.js";
import { Base } from "./base.js";
import versionBump from "bumpp";
import { versionBump } from "bumpp";
import conventionalChangelog from "conventional-changelog";
import { default as glob } from "fast-glob";
import fs from "fs-extra";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/serve.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Context } from "../types";
import { killZotero } from "../utils/kill-zotero";
import { Context } from "../types/index.js";
import { killZotero } from "../utils/kill-zotero.js";
import { Base } from "./base.js";
import Build from "./build.js";
import { execSync, spawn } from "child_process";
Expand Down
6 changes: 3 additions & 3 deletions src/types/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Context } from ".";
import { Manifest } from "./manifest";
import { UpdateJSON } from "./update-json";
import { Context } from "./index.js";
import { Manifest } from "./manifest.js";
import { UpdateJSON } from "./update-json.js";
import { type VersionBumpOptions } from "bumpp";
import { BuildOptions } from "esbuild";

Expand Down
2 changes: 1 addition & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Config, Hooks } from "./config";
import { Config, Hooks } from "./config.js";
import { Hookable } from "hookable";

type RecursivePartial<T> = {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/kill-zotero.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isRunning } from "./process";
import { isRunning } from "./process.js";
import { execSync } from "child_process";
import consola from "consola";
import { isLinux, isMacOS, isWindows } from "std-env";
Expand Down
2 changes: 1 addition & 1 deletion src/utils/log.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Config } from "../types";
import { Config } from "../types/index.js";
import { ProgressEvent, VersionBumpProgress } from "bumpp";
import chalk from "chalk";
import consola from "consola";
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"strict": true,
"resolveJsonModule": true,
Expand Down

0 comments on commit 65936b7

Please sign in to comment.