@reliverse/dler 1.7.139 → 1.7.140
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/impl/auth/impl/init.d.ts +4 -4
- package/bin/impl/config/constants.d.ts +1 -1
- package/bin/impl/config/constants.js +1 -1
- package/bin/impl/config/prepare.js +2 -2
- package/bin/impl/providers/better-t-stack/types.d.ts +6 -6
- package/bin/impl/providers/reliverse-stack/rs-impl.d.ts +2 -2
- package/bin/impl/update/impl.d.ts +6 -0
- package/bin/impl/update/impl.js +98 -0
- package/bin/mod.d.ts +1 -1
- package/bin/mod.js +2 -0
- package/package.json +1 -1
|
@@ -146,17 +146,17 @@ export declare const optionsSchema: z.ZodObject<{
|
|
|
146
146
|
cwd: z.ZodString;
|
|
147
147
|
config: z.ZodOptional<z.ZodString>;
|
|
148
148
|
database: z.ZodOptional<z.ZodEnum<{
|
|
149
|
-
mysql: "mysql";
|
|
150
149
|
sqlite: "sqlite";
|
|
151
|
-
|
|
152
|
-
postgres: "postgres";
|
|
150
|
+
mysql: "mysql";
|
|
153
151
|
mssql: "mssql";
|
|
152
|
+
postgres: "postgres";
|
|
154
153
|
"drizzle:pg": "drizzle:pg";
|
|
155
154
|
"drizzle:mysql": "drizzle:mysql";
|
|
156
155
|
"drizzle:sqlite": "drizzle:sqlite";
|
|
157
156
|
"prisma:postgresql": "prisma:postgresql";
|
|
158
157
|
"prisma:mysql": "prisma:mysql";
|
|
159
158
|
"prisma:sqlite": "prisma:sqlite";
|
|
159
|
+
mongodb: "mongodb";
|
|
160
160
|
}>>;
|
|
161
161
|
"skip-db": z.ZodOptional<z.ZodBoolean>;
|
|
162
162
|
"skip-plugins": z.ZodOptional<z.ZodBoolean>;
|
|
@@ -165,7 +165,7 @@ export declare const optionsSchema: z.ZodObject<{
|
|
|
165
165
|
}, z.core.$strip>;
|
|
166
166
|
export declare const outroText = "\uD83E\uDD73 All Done, Happy Hacking!";
|
|
167
167
|
export declare function getLatestNpmVersion(packageName: string): Promise<string>;
|
|
168
|
-
export declare function getPackageManager(): Promise<"
|
|
168
|
+
export declare function getPackageManager(): Promise<"pnpm" | "bun" | "npm" | "yarn">;
|
|
169
169
|
export declare function getEnvFiles(cwd: string): Promise<string[]>;
|
|
170
170
|
export declare function updateEnvs({ envs, files, isCommented, }: {
|
|
171
171
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const PROJECT_ROOT: string;
|
|
2
|
-
export declare const cliVersion = "1.7.
|
|
2
|
+
export declare const cliVersion = "1.7.140";
|
|
3
3
|
export declare const cliName = "@reliverse/rse";
|
|
4
4
|
export declare const rseName = "@reliverse/rse";
|
|
5
5
|
export declare const dlerName = "@reliverse/dler";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
2
|
import path from "@reliverse/pathkit";
|
|
3
3
|
export const PROJECT_ROOT = path.resolve(process.cwd());
|
|
4
|
-
const version = "1.7.
|
|
4
|
+
const version = "1.7.140";
|
|
5
5
|
export const cliVersion = version;
|
|
6
6
|
export const cliName = "@reliverse/rse";
|
|
7
7
|
export const rseName = "@reliverse/rse";
|
|
@@ -230,7 +230,7 @@ function generateJsoncConfig(isDev, pkgDescription) {
|
|
|
230
230
|
"bumpSet": "${DEFAULT_CONFIG_RELIVERSE.bumpSet}",
|
|
231
231
|
// Common configuration
|
|
232
232
|
"commonPubPause": ${pausePublishValue},
|
|
233
|
-
"commonPubRegistry":
|
|
233
|
+
"commonPubRegistry": "npm",
|
|
234
234
|
"commonVerbose": ${verboseValue},
|
|
235
235
|
"displayBuildPubLogs": ${DEFAULT_CONFIG_RELIVERSE.displayBuildPubLogs},
|
|
236
236
|
// Core configuration
|
|
@@ -551,7 +551,7 @@ function generateConfig(isDev, pkgDescription, configKind = "ts", usePackageImpo
|
|
|
551
551
|
"",
|
|
552
552
|
" // Common configuration",
|
|
553
553
|
" commonPubPause: " + pausePublishValue + ",",
|
|
554
|
-
|
|
554
|
+
` commonPubRegistry: "npm",`,
|
|
555
555
|
" commonVerbose: " + verboseValue + ",",
|
|
556
556
|
" displayBuildPubLogs: " + DEFAULT_CONFIG_RELIVERSE.displayBuildPubLogs + ",",
|
|
557
557
|
"",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const DatabaseSchema: z.ZodEnum<{
|
|
3
3
|
none: "none";
|
|
4
|
-
mysql: "mysql";
|
|
5
4
|
sqlite: "sqlite";
|
|
6
|
-
|
|
5
|
+
mysql: "mysql";
|
|
7
6
|
postgres: "postgres";
|
|
7
|
+
mongodb: "mongodb";
|
|
8
8
|
}>;
|
|
9
9
|
export type Database = z.infer<typeof DatabaseSchema>;
|
|
10
10
|
export declare const ORMSchema: z.ZodEnum<{
|
|
11
11
|
none: "none";
|
|
12
|
-
drizzle: "drizzle";
|
|
13
12
|
prisma: "prisma";
|
|
13
|
+
drizzle: "drizzle";
|
|
14
14
|
mongoose: "mongoose";
|
|
15
15
|
}>;
|
|
16
16
|
export type ORM = z.infer<typeof ORMSchema>;
|
|
@@ -34,8 +34,8 @@ export type Runtime = z.infer<typeof RuntimeSchema>;
|
|
|
34
34
|
export declare const FrontendSchema: z.ZodEnum<{
|
|
35
35
|
none: "none";
|
|
36
36
|
svelte: "svelte";
|
|
37
|
-
nuxt: "nuxt";
|
|
38
37
|
solid: "solid";
|
|
38
|
+
nuxt: "nuxt";
|
|
39
39
|
next: "next";
|
|
40
40
|
"react-router": "react-router";
|
|
41
41
|
"tanstack-router": "tanstack-router";
|
|
@@ -55,15 +55,15 @@ export declare const AddonsSchema: z.ZodEnum<{
|
|
|
55
55
|
}>;
|
|
56
56
|
export type Addons = z.infer<typeof AddonsSchema>;
|
|
57
57
|
export declare const ExamplesSchema: z.ZodEnum<{
|
|
58
|
+
ai: "ai";
|
|
58
59
|
none: "none";
|
|
59
60
|
todo: "todo";
|
|
60
|
-
ai: "ai";
|
|
61
61
|
}>;
|
|
62
62
|
export type Examples = z.infer<typeof ExamplesSchema>;
|
|
63
63
|
export declare const PackageManagerSchema: z.ZodEnum<{
|
|
64
|
-
npm: "npm";
|
|
65
64
|
pnpm: "pnpm";
|
|
66
65
|
bun: "bun";
|
|
66
|
+
npm: "npm";
|
|
67
67
|
}>;
|
|
68
68
|
export type PackageManager = z.infer<typeof PackageManagerSchema>;
|
|
69
69
|
export declare const DatabaseSetupSchema: z.ZodEnum<{
|
|
@@ -14,7 +14,7 @@ export type BrowserRepoOption = "reliverse/template-browser-extension" | "unknow
|
|
|
14
14
|
export declare function configureBrowserExtension(): Promise<{
|
|
15
15
|
displayName: string;
|
|
16
16
|
description: string;
|
|
17
|
-
features: ("
|
|
17
|
+
features: ("webview" | "language" | "commands" | "themes")[];
|
|
18
18
|
activation: "onCommand" | "onLanguage" | "startup";
|
|
19
19
|
publisher: string;
|
|
20
20
|
}>;
|
|
@@ -24,7 +24,7 @@ export declare function configureBrowserExtension(): Promise<{
|
|
|
24
24
|
export declare function configureVSCodeExtension(): Promise<{
|
|
25
25
|
displayName: string;
|
|
26
26
|
description: string;
|
|
27
|
-
features: ("
|
|
27
|
+
features: ("webview" | "language" | "commands" | "themes")[];
|
|
28
28
|
activation: "onCommand" | "onLanguage" | "startup";
|
|
29
29
|
publisher: string;
|
|
30
30
|
}>;
|
|
@@ -32,9 +32,15 @@ export declare function prepareUpdateCandidates(args: UpdateArgs): Promise<{
|
|
|
32
32
|
candidates: string[];
|
|
33
33
|
allDepsMap: Record<string, any>;
|
|
34
34
|
}>;
|
|
35
|
+
export declare function prepareAllUpdateCandidates(args: UpdateArgs): Promise<{
|
|
36
|
+
candidates: string[];
|
|
37
|
+
allDepsMap: Record<string, any>;
|
|
38
|
+
packageJsonFiles: string[];
|
|
39
|
+
}>;
|
|
35
40
|
export declare function checkPackageUpdates(candidates: string[], allDepsMap: Record<string, any>, args: UpdateArgs): Promise<UpdateResult[]>;
|
|
36
41
|
export declare function handleInteractiveSelection(results: UpdateResult[]): Promise<UpdateResult[]>;
|
|
37
42
|
export declare function updateRootPackageJson(packageJsonPath: string, allDepsMap: Record<string, any>, toUpdate: UpdateResult[], savePrefix: string): Promise<number>;
|
|
43
|
+
export declare function updateAllPackageJsonFiles(packageJsonFiles: string[], toUpdate: UpdateResult[], savePrefix: string): Promise<number>;
|
|
38
44
|
export declare function handleRecursiveUpdates(args: UpdateArgs, options: PackageCheckOptions): Promise<number>;
|
|
39
45
|
export declare function handleWorkspaceUpdates(args: UpdateArgs, options: PackageCheckOptions): Promise<number>;
|
|
40
46
|
export declare function displayUpdateSummary(totalUpdated: number, args: UpdateArgs, isMonorepoProject: boolean, shouldUpdateWorkspaces: boolean): void;
|
package/bin/impl/update/impl.js
CHANGED
|
@@ -111,6 +111,72 @@ export async function prepareUpdateCandidates(args) {
|
|
|
111
111
|
}
|
|
112
112
|
return { candidates, allDepsMap };
|
|
113
113
|
}
|
|
114
|
+
export async function prepareAllUpdateCandidates(args) {
|
|
115
|
+
const packageJsonFiles = await determinePackageJsonFiles(args);
|
|
116
|
+
if (packageJsonFiles.length === 0) {
|
|
117
|
+
relinka("warn", "No package.json files found to process");
|
|
118
|
+
return { candidates: [], allDepsMap: {}, packageJsonFiles: [] };
|
|
119
|
+
}
|
|
120
|
+
const allDepsMap = {};
|
|
121
|
+
const allCandidates = /* @__PURE__ */ new Set();
|
|
122
|
+
for (const packageJsonPath of packageJsonFiles) {
|
|
123
|
+
try {
|
|
124
|
+
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
|
|
125
|
+
const { map } = collectTargetDependencies(packageJson, args);
|
|
126
|
+
const candidates2 = prepareDependenciesForUpdate(map, args);
|
|
127
|
+
for (const [dep, info] of Object.entries(map)) {
|
|
128
|
+
if (!allDepsMap[dep]) {
|
|
129
|
+
allDepsMap[dep] = { ...info, locations: new Set(info.locations) };
|
|
130
|
+
} else {
|
|
131
|
+
for (const location of info.locations) {
|
|
132
|
+
allDepsMap[dep].locations.add(location);
|
|
133
|
+
}
|
|
134
|
+
allDepsMap[dep].versionSpec = info.versionSpec;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
for (const candidate of candidates2) {
|
|
138
|
+
allCandidates.add(candidate);
|
|
139
|
+
}
|
|
140
|
+
} catch (error) {
|
|
141
|
+
relinka(
|
|
142
|
+
"warn",
|
|
143
|
+
`Failed to process ${packageJsonPath}: ${error instanceof Error ? error.message : String(error)}`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const candidates = Array.from(allCandidates);
|
|
148
|
+
if (candidates.length === 0) {
|
|
149
|
+
relinka(
|
|
150
|
+
"warn",
|
|
151
|
+
"No dependencies to update based on provided filters across all package.json files"
|
|
152
|
+
);
|
|
153
|
+
return { candidates: [], allDepsMap: {}, packageJsonFiles };
|
|
154
|
+
}
|
|
155
|
+
return { candidates, allDepsMap, packageJsonFiles };
|
|
156
|
+
}
|
|
157
|
+
async function determinePackageJsonFiles(args) {
|
|
158
|
+
const cwd = process.cwd();
|
|
159
|
+
const rootPackageJsonPath = path.resolve(cwd, "package.json");
|
|
160
|
+
const packageJsonFiles = [];
|
|
161
|
+
if (await fs.pathExists(rootPackageJsonPath)) {
|
|
162
|
+
packageJsonFiles.push(rootPackageJsonPath);
|
|
163
|
+
}
|
|
164
|
+
if (args.recursive) {
|
|
165
|
+
const allPackageJsons = await findAllPackageJsons(cwd);
|
|
166
|
+
const otherPackageJsons = allPackageJsons.filter((p) => p !== rootPackageJsonPath);
|
|
167
|
+
packageJsonFiles.push(...otherPackageJsons);
|
|
168
|
+
return packageJsonFiles;
|
|
169
|
+
}
|
|
170
|
+
const isMonorepoProject = await isMonorepo(cwd);
|
|
171
|
+
if (args.allWorkspaces) {
|
|
172
|
+
const workspacePkgJsons = await findWorkspacePackageJsons(cwd);
|
|
173
|
+
packageJsonFiles.push(...workspacePkgJsons);
|
|
174
|
+
} else if (!args.rootOnly && isMonorepoProject) {
|
|
175
|
+
const workspacePkgJsons = await findWorkspacePackageJsons(cwd);
|
|
176
|
+
packageJsonFiles.push(...workspacePkgJsons);
|
|
177
|
+
}
|
|
178
|
+
return packageJsonFiles;
|
|
179
|
+
}
|
|
114
180
|
export async function checkPackageUpdates(candidates, allDepsMap, args) {
|
|
115
181
|
const options = {
|
|
116
182
|
allowMajor: !!args["allowMajor"],
|
|
@@ -192,6 +258,38 @@ export async function handleInteractiveSelection(results) {
|
|
|
192
258
|
export async function updateRootPackageJson(packageJsonPath, allDepsMap, toUpdate, savePrefix) {
|
|
193
259
|
return await updatePackageJsonFile(packageJsonPath, allDepsMap, toUpdate, savePrefix);
|
|
194
260
|
}
|
|
261
|
+
export async function updateAllPackageJsonFiles(packageJsonFiles, toUpdate, savePrefix) {
|
|
262
|
+
if (packageJsonFiles.length === 0 || toUpdate.length === 0) {
|
|
263
|
+
return 0;
|
|
264
|
+
}
|
|
265
|
+
let totalUpdated = 0;
|
|
266
|
+
for (const packageJsonPath of packageJsonFiles) {
|
|
267
|
+
try {
|
|
268
|
+
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
|
|
269
|
+
const { map: fileDepsMap } = collectTargetDependencies(packageJson, {});
|
|
270
|
+
const fileSpecificUpdates = toUpdate.filter((update) => fileDepsMap[update.package]);
|
|
271
|
+
if (fileSpecificUpdates.length > 0) {
|
|
272
|
+
const updated = await updatePackageJsonFile(
|
|
273
|
+
packageJsonPath,
|
|
274
|
+
fileDepsMap,
|
|
275
|
+
fileSpecificUpdates,
|
|
276
|
+
savePrefix
|
|
277
|
+
);
|
|
278
|
+
totalUpdated += updated;
|
|
279
|
+
if (updated > 0) {
|
|
280
|
+
const relativePath = path.relative(process.cwd(), packageJsonPath);
|
|
281
|
+
relinka("verbose", `Updated ${updated} dependencies in ${relativePath}`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
} catch (error) {
|
|
285
|
+
relinka(
|
|
286
|
+
"warn",
|
|
287
|
+
`Failed to process ${packageJsonPath}: ${error instanceof Error ? error.message : String(error)}`
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return totalUpdated;
|
|
292
|
+
}
|
|
195
293
|
export async function handleRecursiveUpdates(args, options) {
|
|
196
294
|
const allPackageJsons = await findAllPackageJsons(process.cwd());
|
|
197
295
|
const rootPackageJsonPath = path.resolve(process.cwd(), "package.json");
|
package/bin/mod.d.ts
CHANGED
|
@@ -308,7 +308,7 @@ export { openVercelTools } from "./impl/toolbox/toolbox-vercel";
|
|
|
308
308
|
export type { BundleSource, IndentOptions, MagicStringOptions, OverwriteOptions, StringTransformer, TransformResult, UpdateOptions, } from "./impl/transform/transform-impl-mod";
|
|
309
309
|
export { append, compose, createBundle, createTransformer, createTransformerFromMagicString, indent, insertAt, overwrite, pipe, prepend, readAndTransform, remove, replace, replaceAll, slice, template, transformAndWrite, transformMultiple, trim, update, wrapWith, } from "./impl/transform/transform-impl-mod";
|
|
310
310
|
export type { AppParams, ArgTypeShared, BaseBuildEntry, BaseConfig, Behavior, BiomeConfig, BiomeConfigResult, BuildContext, BuildEntry, BuildHooks, BuildOptions, BuildPreset, CamelCase, CheckIssue, CheckResult, ColumnType, CommonCliArgs, CopyBuildEntry, CopyHooks, CreateLoaderOptions, DatabasePostgresProvider, DatabaseProvider, DeploymentService, DetectedProject, DirectoryType, DistDirs, DistDirsAll, EsbuildOptions, GitModParams, HyphenatedStringToCamelCase, IconName, InputFile, IntegrationCategory, IntegrationConfig, IntegrationOption, IntegrationOptions, IterableError, Loader, LoaderContext, LoaderResult, LoadFile, MkdistBuildEntry, MkdistHooks, MkdistOptions, ModernReplacement, MonorepoType, NavItem, NavItemWithChildren, NavigationEntry, OutputFile, ParamsOmitReli, ParamsOmitSkipPN, PerfTimer, PrismaField, PrismaModel, ProjectConfigReturn, ProjectSelectionResult, RemovalConfig, RollupBuildEntry, RollupBuildOptions, RollupHooks, RollupOptions, RulesCheckOptions, ShadcnConfig, SubOption, TableSchema, Theme, UnifiedBuildConfig, UntypedBuildEntry, UntypedHooks, UntypedOutput, UntypedOutputs, VSCodeSettings, } from "./impl/types/mod";
|
|
311
|
-
export { checkPackageUpdates, displayUpdateSummary, getEffectiveLinker, handleCatalogOnlyUpdate, handleInstallation, handleInteractiveSelection, handleRecursiveUpdates, handleToolUpgrades, handleWorkspaceUpdates, prepareUpdateCandidates, updateRootPackageJson, validatePackageJson, validateUpdateArgs, } from "./impl/update/impl";
|
|
311
|
+
export { checkPackageUpdates, displayUpdateSummary, getEffectiveLinker, handleCatalogOnlyUpdate, handleInstallation, handleInteractiveSelection, handleRecursiveUpdates, handleToolUpgrades, handleWorkspaceUpdates, prepareAllUpdateCandidates, prepareUpdateCandidates, updateAllPackageJsonFiles, updateRootPackageJson, validatePackageJson, validateUpdateArgs, } from "./impl/update/impl";
|
|
312
312
|
export type { DependencyInfo, PackageCheckOptions, UpdateResult, UpgradeResult, } from "./impl/update/utils";
|
|
313
313
|
export { applyVersionUpdate, CACHE_TTL, checkPackageUpdate, collectTargetDependencies, displayUpdateResults, fetchVersionFromRegistry, findAllPackageJsons, findWorkspacePackageJsons, getGlobalPackages, getLatestVersion, getPmOptions, handleGlobalUpdates, isCatalogReference, isMonorepo, isNonSemverSpecifier, isNpmAlias, isSemverCompatible, isWorkspaceDependency, prepareDependenciesForUpdate, runInstallCommand, runInstallCommandWithFilter, updateGlobalPackage, updatePackageJsonFile, updateWorkspacePackages, upgradeBun, upgradeDlerGlobal, upgradeDlerLocal, upgradeGit, upgradeNode, upgradeNpm, upgradePnpm, upgradeYarn, versionCache, } from "./impl/update/utils";
|
|
314
314
|
export type { UploadFile, UploadResult } from "./impl/upload/providers/providers-mod";
|
package/bin/mod.js
CHANGED
|
@@ -755,7 +755,9 @@ export {
|
|
|
755
755
|
handleRecursiveUpdates,
|
|
756
756
|
handleToolUpgrades,
|
|
757
757
|
handleWorkspaceUpdates,
|
|
758
|
+
prepareAllUpdateCandidates,
|
|
758
759
|
prepareUpdateCandidates,
|
|
760
|
+
updateAllPackageJsonFiles,
|
|
759
761
|
updateRootPackageJson,
|
|
760
762
|
validatePackageJson,
|
|
761
763
|
validateUpdateArgs
|