@reliverse/dler 1.7.114 → 1.7.115
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.
- package/bin/app/add/add-local/core/templates.d.ts +3 -3
- package/bin/app/add/add-local/core/templates.js +8 -8
- package/bin/app/add/cmd.js +2 -2
- package/bin/app/ai/ai-impl/ai-chat.d.ts +2 -2
- package/bin/app/ai/ai-impl/ai-types.d.ts +2 -2
- package/bin/app/ai/ai-impl/relinter/relinter.d.ts +2 -2
- package/bin/app/ai/ai-menu.d.ts +2 -2
- package/bin/app/ai/cmd.js +4 -4
- package/bin/app/better/auth/cmd.js +1 -6
- package/bin/app/build/build-library.d.ts +5 -4
- package/bin/app/build/build-regular.d.ts +4 -3
- package/bin/app/build/cmd.d.ts +10 -0
- package/bin/app/build/cmd.js +29 -12
- package/bin/app/build/impl.d.ts +3 -2
- package/bin/app/build/library-flow.d.ts +5 -4
- package/bin/app/build/postbuild.d.ts +2 -2
- package/bin/app/build/postbuild.js +0 -6
- package/bin/app/build/prebuild.d.ts +2 -2
- package/bin/app/build/prebuild.js +0 -6
- package/bin/app/build/regular-flow.d.ts +4 -3
- package/bin/app/check/cmd.js +2 -2
- package/bin/app/config/constants.d.ts +1 -1
- package/bin/app/config/constants.js +1 -1
- package/bin/app/config/content.d.ts +1 -1
- package/bin/app/config/content.js +2 -2
- package/bin/app/config/core-cfg.d.ts +5 -5
- package/bin/app/config/core-cfg.js +27 -16
- package/bin/app/config/create.d.ts +6 -5
- package/bin/app/config/create.js +13 -22
- package/bin/app/config/def-utils.d.ts +3 -3
- package/bin/app/config/def-utils.js +10 -8
- package/bin/app/config/detect.d.ts +4 -2
- package/bin/app/config/detect.js +36 -6
- package/bin/app/config/gen-cfg.js +4 -4
- package/bin/app/config/load.d.ts +2 -2
- package/bin/app/config/load.js +1 -1
- package/bin/app/config/migrate.d.ts +1 -1
- package/bin/app/config/migrate.js +7 -3
- package/bin/app/config/path.d.ts +1 -1
- package/bin/app/config/path.js +3 -3
- package/bin/app/config/prepare.d.ts +1 -1
- package/bin/app/config/prepare.js +83 -81
- package/bin/app/config/prompts.d.ts +1 -1
- package/bin/app/config/prompts.js +1 -1
- package/bin/app/config/read.d.ts +3 -3
- package/bin/app/config/read.js +13 -35
- package/bin/app/config/repair.d.ts +2 -2
- package/bin/app/config/repair.js +12 -12
- package/bin/app/config/unstable.d.ts +3 -3
- package/bin/app/config/unstable.js +2 -14
- package/bin/app/config/update.d.ts +3 -3
- package/bin/app/config/update.js +41 -48
- package/bin/app/env/env-impl.js +2 -2
- package/bin/app/init/cmd-2.js +2 -2
- package/bin/app/init/init-utils/init-utils.js +7 -7
- package/bin/app/init/init-utils/mm-deprecated/editor-menu.d.ts +3 -2
- package/bin/app/init/init-utils/mm-deprecated/editor-menu.js +1 -6
- package/bin/app/init/use-template/cp-impl.d.ts +5 -4
- package/bin/app/init/use-template/cp-mod.d.ts +3 -3
- package/bin/app/init/use-template/cp-mod.js +5 -5
- package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/showCloneProjectMenu.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/compose-env-file/cef-impl.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/compose-env-file/cef-mod.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/deploy.d.ts +4 -3
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/gdp-mod.d.ts +5 -4
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/git.d.ts +6 -5
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/github.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-private-repo.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-private-repo.js +6 -3
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-repo-exists.d.ts +3 -2
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-repo-exists.js +4 -4
- package/bin/app/invoke/cmd.js +2 -2
- package/bin/app/mrse/cmd.js +2 -2
- package/bin/app/mrse/mrse-impl.js +2 -2
- package/bin/app/providers/better-t-stack/types.d.ts +5 -5
- package/bin/app/providers/package.json +3 -0
- package/bin/app/providers/reliverse-stack/reliverse-stack-mod.js +2 -2
- package/bin/app/providers/reliverse-stack/rs-impl.d.ts +4 -4
- package/bin/app/pub/cmd.d.ts +10 -0
- package/bin/app/pub/cmd.js +27 -12
- package/bin/app/pub/impl.d.ts +3 -2
- package/bin/app/rempts/cmd.js +2 -2
- package/bin/app/rules/reliverse/dler-config-health/dler-config-health.d.ts +1 -1
- package/bin/app/rules/reliverse/dler-config-health/dler-config-health.js +1 -1
- package/bin/app/schema/cmd.js +3 -3
- package/bin/app/{config/reltypes-content.js → schema/gen.js} +475 -229
- package/bin/app/schema/mod.d.ts +1224 -0
- package/bin/app/schema/mod.js +329 -0
- package/bin/app/{config/reltypes-utils.js → schema/utils.js} +6 -3
- package/bin/app/toolbox/cmd.js +2 -2
- package/bin/app/toolbox/toolbox-impl.d.ts +3 -2
- package/bin/app/types/mod.d.ts +10 -1518
- package/bin/app/types/mod.js +0 -161
- package/bin/app/update/impl.d.ts +1 -0
- package/bin/app/update/impl.js +102 -1
- package/bin/app/utils/common.d.ts +3 -0
- package/bin/app/utils/common.js +28 -0
- package/bin/app/utils/decideHelper.d.ts +2 -2
- package/bin/app/utils/downloading/downloadRepo.d.ts +2 -2
- package/bin/app/utils/downloading/downloadRepo.js +3 -3
- package/bin/app/utils/downloading/handleDownload.d.ts +2 -2
- package/bin/app/utils/finalize.d.ts +2 -1
- package/bin/app/utils/handlers/handleCleanup.js +2 -2
- package/bin/app/utils/handlers/handleCodemods.d.ts +2 -2
- package/bin/app/utils/projectRepository.d.ts +3 -4
- package/bin/app/utils/prompts/askUsernameFrontend.d.ts +2 -2
- package/bin/app/utils/prompts/askUsernameFrontend.js +3 -3
- package/bin/app/utils/resolve-cross-libs.js +2 -2
- package/bin/app/utils/schemaMemory.d.ts +1 -1
- package/bin/app/utils/startEndPrompts.d.ts +8 -2
- package/bin/app/utils/startEndPrompts.js +43 -12
- package/bin/app/utils/utils-build.d.ts +2 -2
- package/bin/app/utils/utils-clean.d.ts +1 -1
- package/bin/app/utils/utils-deps.d.ts +2 -2
- package/bin/app/utils/utils-determine.d.ts +1 -1
- package/bin/app/utils/utils-jsr-json.d.ts +2 -2
- package/bin/app/utils/utils-package-json-libraries.d.ts +3 -3
- package/bin/app/utils/utils-package-json-regular.d.ts +2 -2
- package/bin/dler.js +2 -92
- package/bin/mod.d.ts +431 -438
- package/bin/mod.js +36 -27
- package/package.json +10 -10
- package/bin/app/agg/cmd.d.ts +0 -72
- package/bin/app/agg/cmd.js +0 -128
- package/bin/app/cli/cmd.d.ts +0 -12
- package/bin/app/cli/cmd.js +0 -56
- package/bin/app/cli/impl.d.ts +0 -3
- package/bin/app/cli/impl.js +0 -88
- package/bin/app/config/default-cfg.d.ts +0 -3
- package/bin/app/config/default-cfg.js +0 -155
- package/bin/app/config/default.d.ts +0 -6
- package/bin/app/config/default.js +0 -159
- package/bin/app/config/schema.d.ts +0 -130
- package/bin/app/config/schema.js +0 -443
- package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/getMainMenuOptions.d.ts +0 -12
- package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/getMainMenuOptions.js +0 -69
- package/bin/app/init/use-template/cp-modules/cli-main-modules/modules/showStartEndPrompt.d.ts +0 -2
- package/bin/app/init/use-template/cp-modules/cli-main-modules/modules/showStartEndPrompt.js +0 -26
- package/bin/app/schema/schema-impl.d.ts +0 -2
- package/bin/app/schema/schema-impl.js +0 -24
- package/bin/app/update/cmd.d.ts +0 -103
- package/bin/app/update/cmd.js +0 -299
- package/bin/app/utils/native-cli/nc-impl.d.ts +0 -15
- package/bin/app/utils/native-cli/nc-impl.js +0 -154
- package/bin/app/utils/native-cli/nc-mod.d.ts +0 -3
- package/bin/app/utils/native-cli/nc-mod.js +0 -44
- package/bin/app/web/README.md +0 -149
- package/bin/app/web/cmd.d.ts +0 -2
- package/bin/app/web/cmd.js +0 -11
- package/bin/dler-go +0 -4
- package/bin/dler-rust +0 -4
- /package/bin/app/{config/reltypes-content.d.ts → schema/gen.d.ts} +0 -0
- /package/bin/app/{config/reltypes-utils.d.ts → schema/utils.d.ts} +0 -0
- /package/bin/app/utils/{hasOnlyRseConfig.d.ts → hasOnlyReliverseConfig.d.ts} +0 -0
- /package/bin/app/utils/{hasOnlyRseConfig.js → hasOnlyReliverseConfig.js} +0 -0
package/bin/app/update/cmd.js
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { re } from "@reliverse/relico";
|
|
2
|
-
import { relinka } from "@reliverse/relinka";
|
|
3
|
-
import { defineArgs, defineCommand, multiselectPrompt } from "@reliverse/rempts";
|
|
4
|
-
import { readPackageJSON } from "pkg-types";
|
|
5
|
-
import {
|
|
6
|
-
checkPackageUpdates,
|
|
7
|
-
displayUpdateSummary,
|
|
8
|
-
getEffectiveLinker,
|
|
9
|
-
handleCatalogOnlyUpdate,
|
|
10
|
-
handleInstallation,
|
|
11
|
-
handleInteractiveSelection,
|
|
12
|
-
handleRecursiveUpdates,
|
|
13
|
-
handleWorkspaceUpdates,
|
|
14
|
-
prepareUpdateCandidates,
|
|
15
|
-
updateRootPackageJson,
|
|
16
|
-
validatePackageJson,
|
|
17
|
-
validateUpdateArgs
|
|
18
|
-
} from "./impl.js";
|
|
19
|
-
import {
|
|
20
|
-
displayUpdateResults,
|
|
21
|
-
isMonorepo,
|
|
22
|
-
upgradeBun,
|
|
23
|
-
upgradeDlerGlobal,
|
|
24
|
-
upgradeDlerLocal,
|
|
25
|
-
upgradeGit,
|
|
26
|
-
upgradeNode,
|
|
27
|
-
upgradeNpm,
|
|
28
|
-
upgradePnpm,
|
|
29
|
-
upgradeYarn
|
|
30
|
-
} from "./utils.js";
|
|
31
|
-
export default defineCommand({
|
|
32
|
-
meta: {
|
|
33
|
-
name: "update",
|
|
34
|
-
description: "Update all dependencies and catalogs to their latest available versions (recursively finds all package.json files by default)"
|
|
35
|
-
},
|
|
36
|
-
args: defineArgs({
|
|
37
|
-
name: {
|
|
38
|
-
type: "array",
|
|
39
|
-
description: "Specific dependencies to update (default: all dependencies)"
|
|
40
|
-
},
|
|
41
|
-
ignore: {
|
|
42
|
-
type: "array",
|
|
43
|
-
description: "Dependencies to exclude from updates"
|
|
44
|
-
},
|
|
45
|
-
"dev-only": {
|
|
46
|
-
type: "boolean",
|
|
47
|
-
description: "Update only devDependencies"
|
|
48
|
-
},
|
|
49
|
-
"prod-only": {
|
|
50
|
-
type: "boolean",
|
|
51
|
-
description: "Update only dependencies (production)"
|
|
52
|
-
},
|
|
53
|
-
"peer-only": {
|
|
54
|
-
type: "boolean",
|
|
55
|
-
description: "Update only peerDependencies"
|
|
56
|
-
},
|
|
57
|
-
"optional-only": {
|
|
58
|
-
type: "boolean",
|
|
59
|
-
description: "Update only optionalDependencies"
|
|
60
|
-
},
|
|
61
|
-
"catalogs-only": {
|
|
62
|
-
type: "boolean",
|
|
63
|
-
description: "Update ONLY catalog dependencies (catalogs are included by default)"
|
|
64
|
-
},
|
|
65
|
-
"dry-run": {
|
|
66
|
-
type: "boolean",
|
|
67
|
-
description: "Preview updates without making changes"
|
|
68
|
-
},
|
|
69
|
-
concurrency: {
|
|
70
|
-
type: "number",
|
|
71
|
-
description: "Number of concurrent version checks",
|
|
72
|
-
default: 5
|
|
73
|
-
},
|
|
74
|
-
"with-check-script": {
|
|
75
|
-
type: "boolean",
|
|
76
|
-
description: "Run `bun check` after updating (Bun only)"
|
|
77
|
-
},
|
|
78
|
-
linker: {
|
|
79
|
-
type: "string",
|
|
80
|
-
description: "Linker strategy: 'isolated' for monorepos, 'hoisted' for single packages",
|
|
81
|
-
allowed: ["isolated", "hoisted"],
|
|
82
|
-
default: "hoisted"
|
|
83
|
-
},
|
|
84
|
-
"with-install": {
|
|
85
|
-
type: "boolean",
|
|
86
|
-
description: "Run install after updating",
|
|
87
|
-
alias: "with-i"
|
|
88
|
-
},
|
|
89
|
-
global: {
|
|
90
|
-
type: "boolean",
|
|
91
|
-
description: "Update global packages",
|
|
92
|
-
alias: "g"
|
|
93
|
-
},
|
|
94
|
-
interactive: {
|
|
95
|
-
type: "boolean",
|
|
96
|
-
description: "Interactively select dependencies to update"
|
|
97
|
-
},
|
|
98
|
-
filter: {
|
|
99
|
-
type: "array",
|
|
100
|
-
description: "Filter workspaces (e.g., 'pkg-*', '!pkg-c')"
|
|
101
|
-
},
|
|
102
|
-
"all-workspaces": {
|
|
103
|
-
type: "boolean",
|
|
104
|
-
description: "Update dependencies across all workspace packages (requires --no-recursive)"
|
|
105
|
-
},
|
|
106
|
-
"root-only": {
|
|
107
|
-
type: "boolean",
|
|
108
|
-
description: "Update only the root package.json (requires --no-recursive)"
|
|
109
|
-
},
|
|
110
|
-
recursive: {
|
|
111
|
-
type: "boolean",
|
|
112
|
-
description: "Recursively find and update ALL package.json files in current directory tree (default: true, use --no-recursive to disable)",
|
|
113
|
-
alias: "r",
|
|
114
|
-
default: true
|
|
115
|
-
},
|
|
116
|
-
"save-prefix": {
|
|
117
|
-
type: "string",
|
|
118
|
-
description: "Version prefix: '^', '~', or 'none' for exact",
|
|
119
|
-
allowed: ["^", "~", "none"],
|
|
120
|
-
default: "^"
|
|
121
|
-
},
|
|
122
|
-
"allow-major": {
|
|
123
|
-
type: "boolean",
|
|
124
|
-
description: "Allow major version updates to latest available (disable with --no-allow-major)",
|
|
125
|
-
default: true
|
|
126
|
-
},
|
|
127
|
-
"upgrade-tools": {
|
|
128
|
-
type: "boolean",
|
|
129
|
-
description: "Upgrade system development tools (dler, git, node.js, npm, bun, yarn, pnpm)",
|
|
130
|
-
alias: "upgrade"
|
|
131
|
-
},
|
|
132
|
-
"upgrade-interactive": {
|
|
133
|
-
type: "boolean",
|
|
134
|
-
description: "Interactively select which tools to upgrade (use with --upgrade-tools)",
|
|
135
|
-
default: true
|
|
136
|
-
}
|
|
137
|
-
}),
|
|
138
|
-
async run({ args }) {
|
|
139
|
-
try {
|
|
140
|
-
if (args["upgrade-tools"]) {
|
|
141
|
-
await handleToolUpgrades(args);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
await validateUpdateArgs(args);
|
|
145
|
-
if (args.global) {
|
|
146
|
-
const { handleGlobalUpdates } = await import("./utils.js");
|
|
147
|
-
return await handleGlobalUpdates(args);
|
|
148
|
-
}
|
|
149
|
-
const catalogUpdated = await handleCatalogOnlyUpdate(args);
|
|
150
|
-
if (catalogUpdated) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const packageJsonPath = await validatePackageJson();
|
|
154
|
-
const { effectiveLinker } = await getEffectiveLinker(args);
|
|
155
|
-
const { candidates, allDepsMap } = await prepareUpdateCandidates(args);
|
|
156
|
-
if (candidates.length === 0) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const results = await checkPackageUpdates(candidates, allDepsMap, args);
|
|
160
|
-
displayUpdateResults(results);
|
|
161
|
-
let toUpdate = results.filter((r) => r.updated && !r.error);
|
|
162
|
-
if (toUpdate.length === 0) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (args.interactive) {
|
|
166
|
-
toUpdate = await handleInteractiveSelection(results);
|
|
167
|
-
if (toUpdate.length === 0) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (args["dry-run"]) {
|
|
172
|
-
relinka("log", "Dry run mode - no changes were made");
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
const rootUpdated = await updateRootPackageJson(
|
|
176
|
-
packageJsonPath,
|
|
177
|
-
allDepsMap,
|
|
178
|
-
toUpdate,
|
|
179
|
-
args["save-prefix"]
|
|
180
|
-
);
|
|
181
|
-
let totalUpdated = rootUpdated;
|
|
182
|
-
const options = {
|
|
183
|
-
allowMajor: !!args["allow-major"],
|
|
184
|
-
savePrefix: args["save-prefix"],
|
|
185
|
-
concurrency: args.concurrency || 5
|
|
186
|
-
};
|
|
187
|
-
if (args.recursive) {
|
|
188
|
-
const recursiveUpdated = await handleRecursiveUpdates(args, options);
|
|
189
|
-
totalUpdated += recursiveUpdated;
|
|
190
|
-
} else {
|
|
191
|
-
const isMonorepoProject = await isMonorepo(process.cwd());
|
|
192
|
-
const shouldUpdateWorkspaces = args["all-workspaces"] || !args["root-only"] && isMonorepoProject;
|
|
193
|
-
const workspaceUpdated = await handleWorkspaceUpdates(args, options);
|
|
194
|
-
totalUpdated += workspaceUpdated;
|
|
195
|
-
displayUpdateSummary(totalUpdated, args, isMonorepoProject, shouldUpdateWorkspaces);
|
|
196
|
-
}
|
|
197
|
-
const packageJson = await readPackageJSON();
|
|
198
|
-
await handleInstallation(args, effectiveLinker, packageJson);
|
|
199
|
-
} catch (error) {
|
|
200
|
-
relinka(
|
|
201
|
-
"error",
|
|
202
|
-
`Failed to update dependencies: ${error instanceof Error ? error.message : String(error)}`
|
|
203
|
-
);
|
|
204
|
-
process.exit(1);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
async function handleToolUpgrades(args) {
|
|
209
|
-
const toolUpgradeFunctions = [
|
|
210
|
-
{ name: "dler (local)", fn: upgradeDlerLocal },
|
|
211
|
-
{ name: "dler (global)", fn: upgradeDlerGlobal },
|
|
212
|
-
{ name: "git", fn: upgradeGit },
|
|
213
|
-
{ name: "node.js", fn: upgradeNode },
|
|
214
|
-
{ name: "npm", fn: upgradeNpm },
|
|
215
|
-
{ name: "bun", fn: upgradeBun },
|
|
216
|
-
{ name: "yarn", fn: upgradeYarn },
|
|
217
|
-
{ name: "pnpm", fn: upgradePnpm }
|
|
218
|
-
];
|
|
219
|
-
let results = [];
|
|
220
|
-
if (args["upgrade-interactive"]) {
|
|
221
|
-
const preliminaryResults = await Promise.all(
|
|
222
|
-
toolUpgradeFunctions.map(async ({ fn }) => await fn())
|
|
223
|
-
);
|
|
224
|
-
const availableTools = toolUpgradeFunctions.map((tool, index) => ({
|
|
225
|
-
...tool,
|
|
226
|
-
result: preliminaryResults[index]
|
|
227
|
-
})).filter(({ result }) => result && result.status !== "not-found");
|
|
228
|
-
if (availableTools.length === 0) {
|
|
229
|
-
relinka("warn", "No tools available for upgrade");
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
const selectedTools = await multiselectPrompt({
|
|
233
|
-
title: "Select tools to upgrade",
|
|
234
|
-
displayInstructions: true,
|
|
235
|
-
options: [
|
|
236
|
-
{ label: "Exit", value: "exit" },
|
|
237
|
-
...availableTools.map(({ name, result }) => {
|
|
238
|
-
const isUpToDate = result && result.status === "up-to-date";
|
|
239
|
-
const hasErrors = result && result.status === "error";
|
|
240
|
-
const canUpgrade = result && result.status === "upgraded";
|
|
241
|
-
let label = name;
|
|
242
|
-
if (isUpToDate) {
|
|
243
|
-
label += " (up-to-date)";
|
|
244
|
-
} else if (hasErrors) {
|
|
245
|
-
label += " (has errors)";
|
|
246
|
-
} else if (canUpgrade) {
|
|
247
|
-
label += " (can be upgraded)";
|
|
248
|
-
}
|
|
249
|
-
return {
|
|
250
|
-
label: isUpToDate || hasErrors ? re.gray(label) : label,
|
|
251
|
-
value: name,
|
|
252
|
-
disabled: isUpToDate || hasErrors,
|
|
253
|
-
hint: hasErrors ? result.message : void 0
|
|
254
|
-
};
|
|
255
|
-
})
|
|
256
|
-
]
|
|
257
|
-
});
|
|
258
|
-
if (selectedTools.length === 0 || selectedTools.includes("exit")) {
|
|
259
|
-
relinka("info", "Exiting upgrade process");
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
const actualSelectedTools = selectedTools.filter((tool) => tool !== "exit");
|
|
263
|
-
relinka("info", `Upgrading ${actualSelectedTools.length} selected tools...`);
|
|
264
|
-
for (const toolName of actualSelectedTools) {
|
|
265
|
-
const tool = availableTools.find((t) => t.name === toolName);
|
|
266
|
-
if (tool) {
|
|
267
|
-
const result = await tool.fn();
|
|
268
|
-
results.push(result);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
} else {
|
|
272
|
-
results = await Promise.all(toolUpgradeFunctions.map(async ({ fn }) => await fn()));
|
|
273
|
-
}
|
|
274
|
-
const upgraded = results.filter((r) => r.status === "upgraded");
|
|
275
|
-
const upToDate = results.filter((r) => r.status === "up-to-date");
|
|
276
|
-
const notFound = results.filter((r) => r.status === "not-found");
|
|
277
|
-
const errors = results.filter((r) => r.status === "error");
|
|
278
|
-
if (upgraded.length > 0) {
|
|
279
|
-
relinka("success", `Upgraded ${upgraded.length} tools:`);
|
|
280
|
-
upgraded.forEach(
|
|
281
|
-
(r) => relinka("verbose", ` \u2713 ${r.tool}${r.message ? ` - ${r.message}` : ""}`)
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
if (upToDate.length > 0) {
|
|
285
|
-
relinka("info", `${upToDate.length} tools already up-to-date:`);
|
|
286
|
-
upToDate.forEach(
|
|
287
|
-
(r) => relinka("verbose", ` \u2022 ${r.tool}${r.message ? ` - ${r.message}` : ""}`)
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
if (notFound.length > 0) {
|
|
291
|
-
relinka("warn", `${notFound.length} tools not installed (skipped):`);
|
|
292
|
-
notFound.forEach((r) => relinka("verbose", ` - ${r.tool}`));
|
|
293
|
-
}
|
|
294
|
-
if (errors.length > 0) {
|
|
295
|
-
relinka("error", `${errors.length} tools had errors:`);
|
|
296
|
-
errors.forEach((r) => relinka("verbose", ` \u2717 ${r.tool}${r.message ? ` - ${r.message}` : ""}`));
|
|
297
|
-
}
|
|
298
|
-
relinka("success", "Upgrade check completed!");
|
|
299
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Downloads all files for a given JSR package concurrently.
|
|
3
|
-
*
|
|
4
|
-
* @param scope - e.g. "luca"
|
|
5
|
-
* @param packageName - e.g. "flag"
|
|
6
|
-
* @param version - Specific version; if omitted, the highest valid version is chosen.
|
|
7
|
-
* @param outputDir - Where to save files. (Defaults to "<__dirname>/output")
|
|
8
|
-
* @param useSinglePath - If true, writes all files directly into outputDir; otherwise uses a nested structure.
|
|
9
|
-
* @param concurrency - Maximum number of parallel downloads (default: 5)
|
|
10
|
-
* @param pkgIsCLI - Whether the package is a CLI tool.
|
|
11
|
-
* @param msgDownloadStarted - Optional custom message when download starts.
|
|
12
|
-
* @param revertTsxFiles - If true (and pkgIsCLI), renames -tsx.txt files back to .tsx after download.
|
|
13
|
-
* @param cliInstallDeps - If true (and pkgIsCLI), installs dependencies after download.
|
|
14
|
-
*/
|
|
15
|
-
export declare function downloadJsrDist(scope: string, packageName: string, version?: string, outputDir?: string, useSinglePath?: boolean, concurrency?: number, pkgIsCLI?: boolean, msgDownloadStarted?: string, revertTsxFiles?: boolean, cliInstallDeps?: boolean): Promise<void>;
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { dirname, join } from "@reliverse/pathkit";
|
|
2
|
-
import fs, { ensuredir } from "@reliverse/relifso";
|
|
3
|
-
import { relinka } from "@reliverse/relinka";
|
|
4
|
-
import { installDependencies } from "nypm";
|
|
5
|
-
import { ofetch } from "ofetch";
|
|
6
|
-
import pLimit from "p-limit";
|
|
7
|
-
import semver from "semver";
|
|
8
|
-
import { glob } from "tinyglobby";
|
|
9
|
-
import { fileURLToPath } from "url";
|
|
10
|
-
const verbose = false;
|
|
11
|
-
const BASE_URL = "https://jsr.io";
|
|
12
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = dirname(__filename);
|
|
14
|
-
async function fetchJson(url) {
|
|
15
|
-
try {
|
|
16
|
-
return await ofetch(url, {
|
|
17
|
-
headers: { Accept: "application/json" }
|
|
18
|
-
});
|
|
19
|
-
} catch (error) {
|
|
20
|
-
throw new Error(`Failed to fetch JSON from "${url}" (error: ${error})`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function getPackageMeta(scope, packageName) {
|
|
24
|
-
const url = `${BASE_URL}/@${scope}/${packageName}/meta.json`;
|
|
25
|
-
return fetchJson(url);
|
|
26
|
-
}
|
|
27
|
-
function pickVersionFromMeta(meta, userVersion) {
|
|
28
|
-
if (userVersion) {
|
|
29
|
-
const info = meta.versions[userVersion];
|
|
30
|
-
if (!info) {
|
|
31
|
-
throw new Error(`Version "${userVersion}" not found in package metadata.`);
|
|
32
|
-
}
|
|
33
|
-
if (info.yanked) {
|
|
34
|
-
throw new Error(`Version "${userVersion}" is yanked and cannot be downloaded.`);
|
|
35
|
-
}
|
|
36
|
-
return userVersion;
|
|
37
|
-
}
|
|
38
|
-
const versions = Object.keys(meta.versions).filter((v) => {
|
|
39
|
-
const versionInfo = meta.versions[v];
|
|
40
|
-
return versionInfo && !versionInfo.yanked && semver.valid(v);
|
|
41
|
-
});
|
|
42
|
-
if (versions.length === 0) {
|
|
43
|
-
throw new Error("No valid (non-yanked, semver) versions found for this package.");
|
|
44
|
-
}
|
|
45
|
-
versions.sort((a, b) => semver.rcompare(a, b));
|
|
46
|
-
return versions[0];
|
|
47
|
-
}
|
|
48
|
-
async function getVersionMeta(scope, packageName, version) {
|
|
49
|
-
const url = `${BASE_URL}/@${scope}/${packageName}/${version}_meta.json`;
|
|
50
|
-
return fetchJson(url);
|
|
51
|
-
}
|
|
52
|
-
async function downloadFile(scope, packageName, version, filePath, outputDir, useSinglePath) {
|
|
53
|
-
const trimmedFilePath = filePath.replace(/^\//, "");
|
|
54
|
-
const url = `${BASE_URL}/@${scope}/${packageName}/${version}/${trimmedFilePath}`;
|
|
55
|
-
const buffer = Buffer.from(
|
|
56
|
-
await ofetch(url, {
|
|
57
|
-
headers: { Accept: "*/*" },
|
|
58
|
-
responseType: "arrayBuffer"
|
|
59
|
-
})
|
|
60
|
-
);
|
|
61
|
-
const targetFilePath = useSinglePath ? join(outputDir, trimmedFilePath) : join(outputDir, scope, packageName, version, trimmedFilePath);
|
|
62
|
-
await ensuredir(dirname(targetFilePath));
|
|
63
|
-
await fs.writeFile(targetFilePath, buffer);
|
|
64
|
-
relinka("verbose", `Downloaded: ${url} -> ${targetFilePath}`);
|
|
65
|
-
}
|
|
66
|
-
async function isPackageDownloaded(filePaths, outputDir, useSinglePath, scope, packageName, version) {
|
|
67
|
-
try {
|
|
68
|
-
for (const filePath of filePaths) {
|
|
69
|
-
const trimmedFilePath = filePath.replace(/^\//, "");
|
|
70
|
-
const targetFilePath = useSinglePath ? join(outputDir, trimmedFilePath) : join(outputDir, scope, packageName, version, trimmedFilePath);
|
|
71
|
-
if (!await fs.pathExists(targetFilePath)) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
} catch {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
async function renameTxtToTsx(dir) {
|
|
81
|
-
try {
|
|
82
|
-
const files = await glob("**/*-tsx.txt", {
|
|
83
|
-
cwd: dir,
|
|
84
|
-
absolute: true
|
|
85
|
-
});
|
|
86
|
-
for (const filePath of files) {
|
|
87
|
-
const newPath = filePath.replace(/-tsx\.txt$/, ".tsx");
|
|
88
|
-
await fs.rename(filePath, newPath);
|
|
89
|
-
if (verbose) {
|
|
90
|
-
relinka("verbose", `Renamed: ${filePath} -> ${newPath}`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
} catch (error) {
|
|
94
|
-
relinka(
|
|
95
|
-
"error",
|
|
96
|
-
"Error renaming -tsx.txt files:",
|
|
97
|
-
error instanceof Error ? error.message : String(error)
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
export async function downloadJsrDist(scope, packageName, version, outputDir = join(__dirname, "output"), useSinglePath = true, concurrency = 5, pkgIsCLI = true, msgDownloadStarted, revertTsxFiles = false, cliInstallDeps = true) {
|
|
102
|
-
try {
|
|
103
|
-
const meta = await getPackageMeta(scope, packageName);
|
|
104
|
-
const resolvedVersion = version || pickVersionFromMeta(meta);
|
|
105
|
-
const versionMeta = await getVersionMeta(scope, packageName, resolvedVersion);
|
|
106
|
-
const filePaths = Object.keys(versionMeta.manifest);
|
|
107
|
-
const isDownloaded = await isPackageDownloaded(
|
|
108
|
-
filePaths,
|
|
109
|
-
outputDir,
|
|
110
|
-
useSinglePath,
|
|
111
|
-
scope,
|
|
112
|
-
packageName,
|
|
113
|
-
resolvedVersion
|
|
114
|
-
);
|
|
115
|
-
if (isDownloaded) {
|
|
116
|
-
relinka(
|
|
117
|
-
"success",
|
|
118
|
-
`@${scope}/${packageName}@${resolvedVersion} is already downloaded.`,
|
|
119
|
-
pkgIsCLI ? `Use "bun ${outputDir}/bin/mod.ts" to run it (short command coming soon).` : void 0
|
|
120
|
-
);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
relinka(
|
|
124
|
-
"info",
|
|
125
|
-
msgDownloadStarted ?? `Downloading ${scope}/${packageName}@${resolvedVersion} from JSR...`
|
|
126
|
-
);
|
|
127
|
-
const limit = pLimit(concurrency);
|
|
128
|
-
const tasks = filePaths.map(
|
|
129
|
-
(filePath) => limit(
|
|
130
|
-
() => downloadFile(scope, packageName, resolvedVersion, filePath, outputDir, useSinglePath)
|
|
131
|
-
)
|
|
132
|
-
);
|
|
133
|
-
await Promise.all(tasks);
|
|
134
|
-
if (pkgIsCLI && revertTsxFiles) {
|
|
135
|
-
relinka("verbose", "Reverting .tsx files...");
|
|
136
|
-
await renameTxtToTsx(outputDir);
|
|
137
|
-
}
|
|
138
|
-
if (pkgIsCLI && cliInstallDeps) {
|
|
139
|
-
relinka("info", "Installing dependencies...");
|
|
140
|
-
await installDependencies({
|
|
141
|
-
cwd: outputDir,
|
|
142
|
-
silent: false
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
relinka(
|
|
146
|
-
"success",
|
|
147
|
-
`All files for @${scope}/${packageName} downloaded successfully.`,
|
|
148
|
-
pkgIsCLI ? `Use "bun ${outputDir}/bin/mod.ts" to run it (short command coming soon).` : void 0
|
|
149
|
-
);
|
|
150
|
-
} catch (error) {
|
|
151
|
-
relinka("error", `Something went wrong while downloading ${scope}/${packageName}:`, `${error}`);
|
|
152
|
-
throw error;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import fs from "@reliverse/relifso";
|
|
2
|
-
import { confirmPrompt } from "@reliverse/rempts";
|
|
3
|
-
import { downloadJsrDist } from "./nc-impl.js";
|
|
4
|
-
export async function showNativeCliMenu({ outputDir }) {
|
|
5
|
-
const dirExists = await fs.pathExists(outputDir);
|
|
6
|
-
if (dirExists) {
|
|
7
|
-
try {
|
|
8
|
-
const files = await fs.readdir(outputDir);
|
|
9
|
-
if (files.length > 0) {
|
|
10
|
-
const shouldOverwrite = await confirmPrompt({
|
|
11
|
-
title: "Bun runtime files already exist in the target directory.",
|
|
12
|
-
content: "Do you want to proceed and potentially overwrite existing files?",
|
|
13
|
-
defaultValue: false
|
|
14
|
-
});
|
|
15
|
-
if (!shouldOverwrite) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error("Error checking directory:", error);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
const shouldUseBunRuntime = await confirmPrompt({
|
|
24
|
-
title: "I see you have Bun installed, but the process was run using the Node.js runtime. Do you want to use the Bun runtime?",
|
|
25
|
-
content: "Press <Enter> to allow me to download the CLI from JSR and install it globally. (The download speed depends on your internet connection.)",
|
|
26
|
-
defaultValue: true
|
|
27
|
-
});
|
|
28
|
-
if (!shouldUseBunRuntime) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
await downloadJsrDist(
|
|
32
|
-
"reliverse",
|
|
33
|
-
"cli",
|
|
34
|
-
void 0,
|
|
35
|
-
// This will pick the latest version automatically
|
|
36
|
-
outputDir,
|
|
37
|
-
true,
|
|
38
|
-
5,
|
|
39
|
-
true,
|
|
40
|
-
"Downloading Bun-native rse from JSR...",
|
|
41
|
-
true,
|
|
42
|
-
true
|
|
43
|
-
);
|
|
44
|
-
}
|
package/bin/app/web/README.md
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
# RSE Web UI
|
|
2
|
-
|
|
3
|
-
A modern web interface for the Reliverse Stack Engine (RSE) that replicates the CLI functionality in a beautiful, user-friendly web application.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **🎨 Modern UI**: Built with React 19, Tailwind CSS, and shadcn/ui components
|
|
8
|
-
- **⚡ Powered by Bun**: Leverages Bun's capabilities for fast performance and native APIs
|
|
9
|
-
- **✨ Project Creation**: Complete project creation flow with multiple project types
|
|
10
|
-
- **🌓 Dark/Light Mode**: Built-in theme switching
|
|
11
|
-
- **📱 Responsive Design**: Works on desktop and mobile devices
|
|
12
|
-
|
|
13
|
-
## Main Menu Options
|
|
14
|
-
|
|
15
|
-
### ✨ Create a project in rse web ui
|
|
16
|
-
|
|
17
|
-
Replicates the full CLI project creation flow with:
|
|
18
|
-
|
|
19
|
-
- **Project Type Selection**: Web, Mobile, VS Code Extension, Browser Extension, CLI
|
|
20
|
-
- **Configuration Options**: Architecture, frameworks, domains, i18n settings
|
|
21
|
-
- **Real-time Progress**: Visual feedback during project creation
|
|
22
|
-
- **CLI Integration**: Uses the same underlying logic as the CLI
|
|
23
|
-
|
|
24
|
-
### 💬 Chat with Reliverse AI
|
|
25
|
-
|
|
26
|
-
*Coming Soon* - AI-powered assistance for project development
|
|
27
|
-
|
|
28
|
-
### 👈 Exit
|
|
29
|
-
|
|
30
|
-
Gracefully shuts down the web server with proper user feedback
|
|
31
|
-
|
|
32
|
-
## Architecture
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
src-ts/app/web/src/
|
|
36
|
-
├── app/ # Server-side code
|
|
37
|
-
│ ├── api/ # API handlers
|
|
38
|
-
│ │ └── routes/ # API routes
|
|
39
|
-
│ │ └── handlers.tsx # Project creation & shutdown APIs
|
|
40
|
-
│ ├── rese.tsx # Rese.js framework config
|
|
41
|
-
│ ├── index.html # Main entry HTML file
|
|
42
|
-
│ ├── layout.tsx # Main React application
|
|
43
|
-
│ └── styles/ # Global styles
|
|
44
|
-
├── ui/ # UI components
|
|
45
|
-
│ ├── components/ # Custom components
|
|
46
|
-
│ │ ├── MainMenu.tsx # Main menu interface
|
|
47
|
-
│ │ ├── CreateProject.tsx # Project creation flow
|
|
48
|
-
│ │ ├── ExitPage.tsx # Server shutdown interface
|
|
49
|
-
│ │ └── ProjectCreationService.tsx # CLI integration service
|
|
50
|
-
│ └── primitives/ # shadcn/ui base components
|
|
51
|
-
└── lib/ # Utilities
|
|
52
|
-
├── utils.ts # Common utilities
|
|
53
|
-
└── theme.tsx # Theme provider
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Technology Stack
|
|
57
|
-
|
|
58
|
-
- **Runtime**: Bun (required for full functionality)
|
|
59
|
-
- **Frontend**: React 19 (Rese.js framework)
|
|
60
|
-
- **Styling**: Tailwind CSS + shadcn/ui
|
|
61
|
-
- **Server**: Bun's native serve API
|
|
62
|
-
- **Hot Reload**: Built-in Bun HMR support
|
|
63
|
-
|
|
64
|
-
## Usage
|
|
65
|
-
|
|
66
|
-
### Development
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
bun dev:web # Start with hot reloading
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Production
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
rse web # Start production server
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## API Endpoints
|
|
79
|
-
|
|
80
|
-
### POST /api/create-project
|
|
81
|
-
|
|
82
|
-
Creates a new project based on the provided configuration.
|
|
83
|
-
|
|
84
|
-
**Request Body:**
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
{
|
|
88
|
-
name: string;
|
|
89
|
-
category: "website" | "mobile" | "vscode" | "browser" | "cli";
|
|
90
|
-
architecture?: "fullstack" | "separated";
|
|
91
|
-
mobileFramework?: "lynx" | "react-native";
|
|
92
|
-
domain?: string;
|
|
93
|
-
enableI18n: boolean;
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### POST /api/shutdown
|
|
98
|
-
|
|
99
|
-
Gracefully shuts down the web server.
|
|
100
|
-
|
|
101
|
-
## Integration with CLI
|
|
102
|
-
|
|
103
|
-
The web UI integrates directly with the CLI implementation:
|
|
104
|
-
|
|
105
|
-
- **Project Creation**: Uses the same `createWebProject` function from the CLI
|
|
106
|
-
- **Configuration**: Converts web form data to CLI-compatible config objects
|
|
107
|
-
- **Templates**: Supports the same project templates as the CLI
|
|
108
|
-
- **Validation**: Implements the same validation rules
|
|
109
|
-
|
|
110
|
-
## Bun-Specific Features
|
|
111
|
-
|
|
112
|
-
The web UI leverages Bun's capabilities:
|
|
113
|
-
|
|
114
|
-
- **File System**: Direct access to Bun's file APIs for project creation
|
|
115
|
-
- **Dynamic Imports**: Runtime import of CLI modules
|
|
116
|
-
- **Performance**: Fast startup and execution times
|
|
117
|
-
- **Native APIs**: Built-in fetch, serve, and other web standards
|
|
118
|
-
|
|
119
|
-
## Browser Compatibility
|
|
120
|
-
|
|
121
|
-
- Modern browsers with ES2022+ support
|
|
122
|
-
- WebSocket support for hot reloading (development)
|
|
123
|
-
- Responsive design for mobile devices
|
|
124
|
-
|
|
125
|
-
## Contributing
|
|
126
|
-
|
|
127
|
-
When adding new features:
|
|
128
|
-
|
|
129
|
-
1. Follow the existing architecture patterns
|
|
130
|
-
2. Use TypeScript for type safety
|
|
131
|
-
3. Leverage Bun's features where appropriate
|
|
132
|
-
4. Maintain consistency with the CLI implementation
|
|
133
|
-
5. Add proper error handling and user feedback
|
|
134
|
-
|
|
135
|
-
## Environment Detection
|
|
136
|
-
|
|
137
|
-
The code automatically detects Bun runtime:
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
// Inside web/src/* - use Bun features
|
|
141
|
-
if (typeof Bun !== "undefined") {
|
|
142
|
-
// Use Bun APIs
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Outside web/src/* - use Node.js or detect Bun
|
|
146
|
-
if (process.versions.bun) {
|
|
147
|
-
// Bun-specific code
|
|
148
|
-
}
|
|
149
|
-
```
|
package/bin/app/web/cmd.d.ts
DELETED
package/bin/app/web/cmd.js
DELETED
package/bin/dler-go
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
echo "Dler postinstall step not performed."
|
|
3
|
-
echo "The postinstall replaces this placeholder script with a native Go binary for your operating system, making Dler lightning fast. If you see this message, it means you didn't run the postinstall step, or your package manager blocked running it."
|
|
4
|
-
exit 1
|
package/bin/dler-rust
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
echo "Dler postinstall step not performed."
|
|
3
|
-
echo "The postinstall replaces this placeholder script with a native Rust binary for your operating system, making Dler lightning fast. If you see this message, it means you didn't run the postinstall step, or your package manager blocked running it."
|
|
4
|
-
exit 1
|