Skip to content

Commit

Permalink
fix: 优化 colors 模块的引入规则
Browse files Browse the repository at this point in the history
  • Loading branch information
beezen committed Jan 31, 2024
1 parent b03c374 commit 8122ed5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": [
"@babel/env"
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-transform-runtime"
Expand Down
4 changes: 2 additions & 2 deletions scripts/rollup.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ const baseConfig = {
plugins: [
nodeExternals(),
resolve({ preferBuiltins: true, extensions: [".ts", ".js"] }),
commonjs({ extensions: [".ts", ".js"] }),
json(),
typescript(),
babel({
exclude: "node_modules/**",
babelHelpers: "runtime",
extensions: [".ts", ".js"]
}),
commonjs({ extensions: [".ts", ".js"] })
})
]
};

Expand Down
2 changes: 1 addition & 1 deletion src/actions/base.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as colors from "colors";
import { line, desensitize, printLog } from "../utils/index";
import { setConfig } from "../common";
import { baseInitConfig } from "../common/env";

const colors = require("colors");
interface LOptions {
list?: boolean;
all?: boolean;
Expand Down
6 changes: 4 additions & 2 deletions src/actions/helper.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as color from "colors";
import * as shell from "shelljs";
import * as inquirer from "inquirer";
import { changeLanguage } from "i18next";
import { setConfig } from "../common";
import { baseInitConfig } from "../common/env";
import { compareVersion, getPackageManager, printLog } from "../utils/index";
import { addUser, removeUser } from "./base";

const colors = require("colors");

/**
* 更新版本
* @param option 配置
Expand Down Expand Up @@ -38,7 +40,7 @@ export function updateVersion(option: { silent?: boolean }, curVersion: string)
let message = `${printLog("update.existVersion", {
type: "error",
isPrint: false
})}\n🌟 nucm ${curVersion.green}${color.red(latestVersion)}`;
})}\n🌟 nucm ${colors.green(curVersion)}${colors.red(latestVersion)}`;

inquirer
.prompt([
Expand Down
3 changes: 2 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as shell from "shelljs";
import { t } from "i18next";
import * as colors from "colors";
import * as fs from "fs-extra";

const colors = require("colors");

interface LogOptions {
type?: "info" | "warn" | "error"; // 日志类型
data?: {
Expand Down

0 comments on commit 8122ed5

Please sign in to comment.