@reliverse/dler 1.7.71 → 1.7.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import { re } from "@reliverse/relico";
1
2
  import { relinka } from "@reliverse/relinka";
2
3
  import { defineArgs, defineCommand, multiselectPrompt } from "@reliverse/rempts";
3
4
  import { lookpath } from "lookpath";
@@ -45,7 +46,7 @@ export default defineCommand({
45
46
  title: "Select tools to upgrade",
46
47
  displayInstructions: true,
47
48
  options: [
48
- { label: "Exit", value: "exit", disabled: true },
49
+ { label: "Exit", value: "exit" },
49
50
  ...availableTools.map(({ name, result }) => {
50
51
  const isUpToDate = result && result.status === "up-to-date";
51
52
  const hasErrors = result && result.status === "error";
@@ -59,9 +60,9 @@ export default defineCommand({
59
60
  label += " (can be upgraded)";
60
61
  }
61
62
  return {
62
- label,
63
+ label: isUpToDate || hasErrors ? re.gray(label) : label,
63
64
  value: name,
64
- disabled: isUpToDate,
65
+ disabled: isUpToDate || hasErrors,
65
66
  hint: hasErrors ? result.message : void 0
66
67
  };
67
68
  })
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.71";
2
+ const version = "1.7.73";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -1,9 +1,8 @@
1
1
  import path from "@reliverse/pathkit";
2
2
  import fs from "@reliverse/relifso";
3
3
  import { relinka } from "@reliverse/relinka";
4
- import { readPackageJSON, writePackageJSON } from "pkg-types";
4
+ import { readPackageJSON } from "pkg-types";
5
5
  import { DEFAULT_CONFIG_DLER } from "./default.js";
6
- import { detectPackageManager } from "../utils/pm/pm-detect.js";
7
6
  const CONFIG_FILENAME = ".config/dler.ts";
8
7
  export async function ensureDlerConfig(isDev) {
9
8
  const configPath = path.resolve(process.cwd(), CONFIG_FILENAME);
@@ -48,10 +47,6 @@ export async function prepareDlerEnvironment(isDev) {
48
47
  if (await fs.pathExists(tsconfigPath)) {
49
48
  await ensureTsconfigIncludes(tsconfigPath);
50
49
  }
51
- const packageJsonPath = path.resolve(cwd, "package.json");
52
- if (await fs.pathExists(packageJsonPath)) {
53
- await ensurePackageJsonScript(cwd, packageJsonPath);
54
- }
55
50
  }
56
51
  async function ensureGitignoreEntries(cwd) {
57
52
  const gitignorePath = path.resolve(cwd, ".gitignore");
@@ -101,34 +96,6 @@ async function ensureTsconfigIncludes(tsconfigPath) {
101
96
  );
102
97
  }
103
98
  }
104
- async function ensurePackageJsonScript(cwd, packageJsonPath) {
105
- try {
106
- const pkg = await readPackageJSON(packageJsonPath);
107
- const hasDlerDep = pkg.dependencies && "@reliverse/dler" in pkg.dependencies || pkg.devDependencies && "@reliverse/dler" in pkg.devDependencies;
108
- if (!hasDlerDep) {
109
- return;
110
- }
111
- if (pkg.scripts && pkg.scripts.dler) {
112
- return;
113
- }
114
- const packageManager = await detectPackageManager(cwd);
115
- const pmCommand = packageManager?.command || "bun";
116
- const updatedPkg = {
117
- ...pkg,
118
- scripts: {
119
- ...pkg.scripts,
120
- dler: `${pmCommand} dler`
121
- }
122
- };
123
- await writePackageJSON(packageJsonPath, updatedPkg);
124
- relinka("success", `Added "dler": "${pmCommand} dler" script to package.json`);
125
- } catch (error) {
126
- relinka(
127
- "warn",
128
- `Could not update package.json: ${error instanceof Error ? error.message : String(error)}`
129
- );
130
- }
131
- }
132
99
  function getCoreIsCLI(isDev) {
133
100
  return isDev ? `coreIsCLI: { enabled: true, scripts: { dler: "cli.ts" } },` : `// coreIsCLI: {
134
101
  // enabled: false,
package/package.json CHANGED
@@ -52,7 +52,7 @@
52
52
  "license": "MIT",
53
53
  "name": "@reliverse/dler",
54
54
  "type": "module",
55
- "version": "1.7.71",
55
+ "version": "1.7.73",
56
56
  "keywords": [
57
57
  "reliverse",
58
58
  "cli",