@reliverse/dler 1.7.66 → 1.7.68
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/README.md +37 -12
- package/bin/app/update/cmd.d.ts +32 -0
- package/bin/app/update/cmd.js +171 -24
- package/bin/libs/cfg/cfg-impl/rse-config/rse-impl/rse-define.d.ts +14 -14
- package/bin/libs/sdk/sdk-impl/config/info.js +1 -1
- package/bin/libs/sdk/sdk-impl/config/load.d.ts +8 -0
- package/bin/libs/sdk/sdk-impl/config/load.js +54 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
# 🧬 dler
|
|
1
|
+
# 🧬 dler • unified package manager with sweet powers
|
|
2
2
|
|
|
3
3
|
[sponsor](https://github.com/sponsors/blefnk) — [discord](https://discord.gg/pb8ukbwpsj) — [github](https://github.com/reliverse/dler) — [npm](https://npmjs.com/@reliverse/dler)
|
|
4
4
|
|
|
5
|
-
> @reliverse/dler (`/ˈdiː.lər/`, dealer) is
|
|
5
|
+
> @reliverse/dler (prev. relidler; `/ˈdiː.lər/`, dealer) is a unified package manager for typescript/javascript projects.
|
|
6
|
+
>
|
|
7
|
+
> dler is your package manager's best friend. dler extends bun, pnpm, yarn, and npm core functionalities by going far beyond.
|
|
6
8
|
>
|
|
7
9
|
> at its core, dler is a flexible, unified, and fully automated bundler for typescript/javascript projects that doubles as an npm/jsr publishing tool. beyond bundling, dler serves as a comprehensive codemod toolkit for modern typescript/javascript development.
|
|
8
10
|
|
|
9
11
|
## features
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
- **built-in bun environment** when dler is installed as a standalone application
|
|
13
14
|
- **`unjs/unbuild` drop-in** with different powerful capabilities like publishing
|
|
14
15
|
- **automated publishing** to npm/jsr registries with intelligent workflow management
|
|
15
16
|
- **reliable builds** with comprehensive typescript/javascript support and error handling
|
|
16
17
|
- **smart versioning** with automatic version bumps and semantic release integration
|
|
17
18
|
- **zero configuration** eliminates `package.json` maintenance headaches forever
|
|
18
|
-
|
|
19
|
-
### ⚡ developer experience
|
|
20
|
-
|
|
21
19
|
- **performance optimized** for speed with modern build pipelines and caching
|
|
22
|
-
- **
|
|
20
|
+
- **17 built-in commands** — comprehensive [dler commands](#dler-commands) for every workflow
|
|
23
21
|
- **path resolution magic** converts typescript aliases to relative imports automatically
|
|
24
22
|
- **highly configurable** via dedicated configuration files with sensible defaults
|
|
25
23
|
- **dual interface** — cli for everyday use, sdk for advanced programmatic control
|
|
26
|
-
|
|
27
|
-
### 🔧 advanced capabilities
|
|
28
|
-
|
|
29
24
|
- **clean distribution builds** automatically removes internal logs and debug code
|
|
30
25
|
- **monorepo ready** with experimental `libs` feature for multi-library projects
|
|
31
26
|
- **magic spells** — extensible plugin system for custom build transformations
|
|
@@ -98,6 +93,7 @@ bun i -g update --latest
|
|
|
98
93
|
|
|
99
94
|
- **when installed globally**: use `dler` anywhere.
|
|
100
95
|
- **when installed as dev dep**: use with package manager name prefix, e.g. `bun dler`, inside your project directory.
|
|
96
|
+
- **when installed as standalone**: ...
|
|
101
97
|
|
|
102
98
|
### 2. prepare your project
|
|
103
99
|
|
|
@@ -150,7 +146,7 @@ dler [build|pub|--help] # if installed globally
|
|
|
150
146
|
|
|
151
147
|
## dler commands
|
|
152
148
|
|
|
153
|
-
dler ships with a flexible command system (prev. plugins) and **
|
|
149
|
+
dler ships with a flexible command system (prev. plugins) and **17 built-in commands** (from [reliverse addons](https://reliverse.org/addons) collection).
|
|
154
150
|
|
|
155
151
|
feel free to create your own commands. commands can be implemented as built-in directly in `src/app/<command>/impl/*` and then imported from `src/app/<command>/cmd.ts`; or implemented in your own library and then imported from `src/app/<command>/cmd.ts`.
|
|
156
152
|
|
|
@@ -904,6 +900,35 @@ bun add @reliverse/dler-sdk
|
|
|
904
900
|
|
|
905
901
|
**usage example**: [@reliverse/rse](https://github.com/reliverse/rse-website-builder) leverages this sdk to extend its functionality.
|
|
906
902
|
|
|
903
|
+
### 17. `update`
|
|
904
|
+
|
|
905
|
+
updates your project's dependencies to the latest version.
|
|
906
|
+
|
|
907
|
+
updates not only `dependencies`/`devDependencies`/`peerDependencies`/`optionalDependencies`, but also [monorepo catalogs](https://bun.sh/docs/install/catalogs).
|
|
908
|
+
|
|
909
|
+
```bash
|
|
910
|
+
bun dler update
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
**params:**
|
|
914
|
+
|
|
915
|
+
- `--with-check-script` (boolean) — runs `bun check` after updating (exclusive for bun environment at the moment)
|
|
916
|
+
|
|
917
|
+
**example package.json:**
|
|
918
|
+
|
|
919
|
+
```json
|
|
920
|
+
{
|
|
921
|
+
"scripts": {
|
|
922
|
+
"latest": "bun dler update --with-check-script",
|
|
923
|
+
"check": "tsc --noEmit && eslint --cache --fix . && biome check --fix --unsafe . && knip"
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
**coming soon:**
|
|
929
|
+
|
|
930
|
+
- recursive lookup for deps in multiple package.json files (e.g. monorepo; or case when you have `C:/foo/bar1/package.json` and `C:/foo/bar2/package.json` and using `dler update` in `C:/foo`).
|
|
931
|
+
|
|
907
932
|
## related
|
|
908
933
|
|
|
909
934
|
special thanks to the project that inspired `@reliverse/dler`:
|
package/bin/app/update/cmd.d.ts
CHANGED
|
@@ -17,6 +17,21 @@ declare const _default: import("@reliverse/rempts").Command<{
|
|
|
17
17
|
description: string;
|
|
18
18
|
default: false;
|
|
19
19
|
};
|
|
20
|
+
"peer-only": {
|
|
21
|
+
type: "boolean";
|
|
22
|
+
description: string;
|
|
23
|
+
default: false;
|
|
24
|
+
};
|
|
25
|
+
"optional-only": {
|
|
26
|
+
type: "boolean";
|
|
27
|
+
description: string;
|
|
28
|
+
default: false;
|
|
29
|
+
};
|
|
30
|
+
"catalogs-only": {
|
|
31
|
+
type: "boolean";
|
|
32
|
+
description: string;
|
|
33
|
+
default: false;
|
|
34
|
+
};
|
|
20
35
|
"dry-run": {
|
|
21
36
|
type: "boolean";
|
|
22
37
|
description: string;
|
|
@@ -27,5 +42,22 @@ declare const _default: import("@reliverse/rempts").Command<{
|
|
|
27
42
|
description: string;
|
|
28
43
|
default: number;
|
|
29
44
|
};
|
|
45
|
+
"with-check-script": {
|
|
46
|
+
type: "boolean";
|
|
47
|
+
description: string;
|
|
48
|
+
default: false;
|
|
49
|
+
};
|
|
50
|
+
linker: {
|
|
51
|
+
type: "string";
|
|
52
|
+
description: string;
|
|
53
|
+
allowed: string[];
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
"no-install": {
|
|
57
|
+
type: "boolean";
|
|
58
|
+
description: string;
|
|
59
|
+
default: false;
|
|
60
|
+
alias: string;
|
|
61
|
+
};
|
|
30
62
|
}>;
|
|
31
63
|
export default _default;
|
package/bin/app/update/cmd.js
CHANGED
|
@@ -6,6 +6,7 @@ import { $ } from "bun";
|
|
|
6
6
|
import pMap from "p-map";
|
|
7
7
|
import { readPackageJSON } from "pkg-types";
|
|
8
8
|
import semver from "semver";
|
|
9
|
+
import { getConfigBunfig } from "../../libs/sdk/sdk-impl/config/load.js";
|
|
9
10
|
import { latestVersion } from "../../libs/sdk/sdk-impl/utils/pm/pm-meta.js";
|
|
10
11
|
function isNpmAlias(versionSpec) {
|
|
11
12
|
return versionSpec.startsWith("npm:");
|
|
@@ -13,9 +14,6 @@ function isNpmAlias(versionSpec) {
|
|
|
13
14
|
function isWorkspaceDependency(versionSpec) {
|
|
14
15
|
return versionSpec.startsWith("workspace:");
|
|
15
16
|
}
|
|
16
|
-
function isCatalogDependency(versionSpec) {
|
|
17
|
-
return versionSpec.startsWith("catalog:");
|
|
18
|
-
}
|
|
19
17
|
function isSemverCompatible(currentVersionRange, latestVersion2) {
|
|
20
18
|
try {
|
|
21
19
|
if (isNpmAlias(currentVersionRange)) {
|
|
@@ -24,9 +22,6 @@ function isSemverCompatible(currentVersionRange, latestVersion2) {
|
|
|
24
22
|
if (isWorkspaceDependency(currentVersionRange)) {
|
|
25
23
|
return false;
|
|
26
24
|
}
|
|
27
|
-
if (isCatalogDependency(currentVersionRange)) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
25
|
if (!currentVersionRange.startsWith("^") && !currentVersionRange.startsWith("~")) {
|
|
31
26
|
return false;
|
|
32
27
|
}
|
|
@@ -81,6 +76,21 @@ export default defineCommand({
|
|
|
81
76
|
description: "Update only dependencies (production)",
|
|
82
77
|
default: false
|
|
83
78
|
},
|
|
79
|
+
"peer-only": {
|
|
80
|
+
type: "boolean",
|
|
81
|
+
description: "Update only peerDependencies",
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
84
|
+
"optional-only": {
|
|
85
|
+
type: "boolean",
|
|
86
|
+
description: "Update only optionalDependencies",
|
|
87
|
+
default: false
|
|
88
|
+
},
|
|
89
|
+
"catalogs-only": {
|
|
90
|
+
type: "boolean",
|
|
91
|
+
description: "Update only catalog dependencies",
|
|
92
|
+
default: false
|
|
93
|
+
},
|
|
84
94
|
"dry-run": {
|
|
85
95
|
type: "boolean",
|
|
86
96
|
description: "Show what would be updated without making changes",
|
|
@@ -90,6 +100,23 @@ export default defineCommand({
|
|
|
90
100
|
type: "number",
|
|
91
101
|
description: "Number of concurrent version checks",
|
|
92
102
|
default: 5
|
|
103
|
+
},
|
|
104
|
+
"with-check-script": {
|
|
105
|
+
type: "boolean",
|
|
106
|
+
description: "Run `bun check` after updating (exclusive for bun environment at the moment)",
|
|
107
|
+
default: false
|
|
108
|
+
},
|
|
109
|
+
linker: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Linker strategy (pro tip: use 'isolated' in a monorepo project, 'hoisted' (default) in a project where you have only one package.json). When this option is explicitly set, it takes precedence over bunfig.toml install.linker setting.",
|
|
112
|
+
allowed: ["isolated", "hoisted"],
|
|
113
|
+
default: "hoisted"
|
|
114
|
+
},
|
|
115
|
+
"no-install": {
|
|
116
|
+
type: "boolean",
|
|
117
|
+
description: "Skip the install step after updating dependencies",
|
|
118
|
+
default: false,
|
|
119
|
+
alias: "no-i"
|
|
93
120
|
}
|
|
94
121
|
}),
|
|
95
122
|
async run({ args }) {
|
|
@@ -99,21 +126,103 @@ export default defineCommand({
|
|
|
99
126
|
relinka("error", "No package.json found in current directory");
|
|
100
127
|
return process.exit(1);
|
|
101
128
|
}
|
|
102
|
-
|
|
129
|
+
let effectiveLinker = args.linker;
|
|
130
|
+
if (typeof Bun !== "undefined") {
|
|
131
|
+
const bunfigConfig = await getConfigBunfig();
|
|
132
|
+
if (bunfigConfig?.install?.linker) {
|
|
133
|
+
const bunfigLinker = bunfigConfig.install.linker;
|
|
134
|
+
if ((bunfigLinker === "isolated" || bunfigLinker === "hoisted") && args.linker === "hoisted") {
|
|
135
|
+
effectiveLinker = bunfigLinker;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (args.linker !== "hoisted") {
|
|
140
|
+
effectiveLinker = args.linker;
|
|
141
|
+
}
|
|
103
142
|
const packageJson = await readPackageJSON();
|
|
104
143
|
const dependencies = packageJson.dependencies || {};
|
|
105
144
|
const devDependencies = packageJson.devDependencies || {};
|
|
145
|
+
const peerDependencies = packageJson.peerDependencies || {};
|
|
146
|
+
const optionalDependencies = packageJson.optionalDependencies || {};
|
|
147
|
+
const workspaces = packageJson.workspaces || {};
|
|
148
|
+
const catalog = workspaces.catalog || packageJson.catalog || {};
|
|
149
|
+
const catalogs = workspaces.catalogs || packageJson.catalogs || {};
|
|
106
150
|
let targetDeps = {};
|
|
107
|
-
|
|
108
|
-
|
|
151
|
+
const depSources = {};
|
|
152
|
+
const exclusiveFlags = [
|
|
153
|
+
args["dev-only"],
|
|
154
|
+
args["prod-only"],
|
|
155
|
+
args["peer-only"],
|
|
156
|
+
args["optional-only"],
|
|
157
|
+
args["catalogs-only"]
|
|
158
|
+
].filter(Boolean);
|
|
159
|
+
if (exclusiveFlags.length > 1) {
|
|
160
|
+
relinka(
|
|
161
|
+
"error",
|
|
162
|
+
"Cannot specify multiple exclusive flags (--dev-only, --prod-only, --peer-only, --optional-only, --catalogs-only)"
|
|
163
|
+
);
|
|
109
164
|
return process.exit(1);
|
|
110
165
|
}
|
|
111
166
|
if (args["dev-only"]) {
|
|
112
167
|
targetDeps = { ...devDependencies };
|
|
168
|
+
Object.keys(devDependencies).forEach((dep) => {
|
|
169
|
+
depSources[dep] = "devDependencies";
|
|
170
|
+
});
|
|
113
171
|
} else if (args["prod-only"]) {
|
|
114
172
|
targetDeps = { ...dependencies };
|
|
173
|
+
Object.keys(dependencies).forEach((dep) => {
|
|
174
|
+
depSources[dep] = "dependencies";
|
|
175
|
+
});
|
|
176
|
+
} else if (args["peer-only"]) {
|
|
177
|
+
targetDeps = { ...peerDependencies };
|
|
178
|
+
Object.keys(peerDependencies).forEach((dep) => {
|
|
179
|
+
depSources[dep] = "peerDependencies";
|
|
180
|
+
});
|
|
181
|
+
} else if (args["optional-only"]) {
|
|
182
|
+
targetDeps = { ...optionalDependencies };
|
|
183
|
+
Object.keys(optionalDependencies).forEach((dep) => {
|
|
184
|
+
depSources[dep] = "optionalDependencies";
|
|
185
|
+
});
|
|
186
|
+
} else if (args["catalogs-only"]) {
|
|
187
|
+
Object.keys(catalog).forEach((dep) => {
|
|
188
|
+
targetDeps[dep] = catalog[dep];
|
|
189
|
+
depSources[dep] = "catalog";
|
|
190
|
+
});
|
|
191
|
+
Object.keys(catalogs).forEach((catalogName) => {
|
|
192
|
+
Object.keys(catalogs[catalogName]).forEach((dep) => {
|
|
193
|
+
targetDeps[dep] = catalogs[catalogName][dep];
|
|
194
|
+
depSources[dep] = `catalogs.${catalogName}`;
|
|
195
|
+
});
|
|
196
|
+
});
|
|
115
197
|
} else {
|
|
116
|
-
targetDeps = {
|
|
198
|
+
targetDeps = {
|
|
199
|
+
...dependencies,
|
|
200
|
+
...devDependencies,
|
|
201
|
+
...peerDependencies,
|
|
202
|
+
...optionalDependencies
|
|
203
|
+
};
|
|
204
|
+
Object.keys(dependencies).forEach((dep) => {
|
|
205
|
+
depSources[dep] = "dependencies";
|
|
206
|
+
});
|
|
207
|
+
Object.keys(devDependencies).forEach((dep) => {
|
|
208
|
+
depSources[dep] = "devDependencies";
|
|
209
|
+
});
|
|
210
|
+
Object.keys(peerDependencies).forEach((dep) => {
|
|
211
|
+
depSources[dep] = "peerDependencies";
|
|
212
|
+
});
|
|
213
|
+
Object.keys(optionalDependencies).forEach((dep) => {
|
|
214
|
+
depSources[dep] = "optionalDependencies";
|
|
215
|
+
});
|
|
216
|
+
Object.keys(catalog).forEach((dep) => {
|
|
217
|
+
targetDeps[dep] = catalog[dep];
|
|
218
|
+
depSources[dep] = "catalog";
|
|
219
|
+
});
|
|
220
|
+
Object.keys(catalogs).forEach((catalogName) => {
|
|
221
|
+
Object.keys(catalogs[catalogName]).forEach((dep) => {
|
|
222
|
+
targetDeps[dep] = catalogs[catalogName][dep];
|
|
223
|
+
depSources[dep] = `catalogs.${catalogName}`;
|
|
224
|
+
});
|
|
225
|
+
});
|
|
117
226
|
}
|
|
118
227
|
const depsToUpdate = Object.keys(targetDeps);
|
|
119
228
|
let filteredDeps = [];
|
|
@@ -138,7 +247,6 @@ export default defineCommand({
|
|
|
138
247
|
);
|
|
139
248
|
return;
|
|
140
249
|
}
|
|
141
|
-
relinka("info", `Checking ${semverDeps.length} dependencies for updates...`);
|
|
142
250
|
const results = await pMap(
|
|
143
251
|
semverDeps,
|
|
144
252
|
async (dep) => {
|
|
@@ -150,7 +258,8 @@ export default defineCommand({
|
|
|
150
258
|
latestVersion: "unknown",
|
|
151
259
|
updated: false,
|
|
152
260
|
error: "Current version not found",
|
|
153
|
-
semverCompatible: false
|
|
261
|
+
semverCompatible: false,
|
|
262
|
+
location: depSources[dep]
|
|
154
263
|
};
|
|
155
264
|
}
|
|
156
265
|
try {
|
|
@@ -162,7 +271,8 @@ export default defineCommand({
|
|
|
162
271
|
currentVersion: cleanCurrent,
|
|
163
272
|
latestVersion: latest,
|
|
164
273
|
updated: latest !== cleanCurrent && isCompatible,
|
|
165
|
-
semverCompatible: isCompatible
|
|
274
|
+
semverCompatible: isCompatible,
|
|
275
|
+
location: depSources[dep]
|
|
166
276
|
};
|
|
167
277
|
} catch (error) {
|
|
168
278
|
return {
|
|
@@ -171,7 +281,8 @@ export default defineCommand({
|
|
|
171
281
|
latestVersion: currentVersion,
|
|
172
282
|
updated: false,
|
|
173
283
|
error: error instanceof Error ? error.message : String(error),
|
|
174
|
-
semverCompatible: false
|
|
284
|
+
semverCompatible: false,
|
|
285
|
+
location: depSources[dep]
|
|
175
286
|
};
|
|
176
287
|
}
|
|
177
288
|
},
|
|
@@ -183,36 +294,72 @@ export default defineCommand({
|
|
|
183
294
|
if (errors.length > 0) {
|
|
184
295
|
relinka("warn", `Failed to check ${errors.length} dependencies:`);
|
|
185
296
|
for (const error of errors) {
|
|
186
|
-
relinka("warn", ` ${error.package}: ${error.error}`);
|
|
297
|
+
relinka("warn", ` ${error.package} (${error.location}): ${error.error}`);
|
|
187
298
|
}
|
|
188
299
|
}
|
|
300
|
+
if (toUpdate.length === 0) {
|
|
301
|
+
relinka("success", `All ${upToDate.length} deps are already up to date`);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
189
304
|
if (upToDate.length > 0) {
|
|
190
305
|
relinka("success", `${upToDate.length} dependencies are up to date`);
|
|
191
306
|
}
|
|
192
307
|
if (toUpdate.length === 0) {
|
|
193
|
-
relinka("
|
|
308
|
+
relinka("success", `All ${upToDate.length} deps are already up to date`);
|
|
194
309
|
return;
|
|
195
310
|
}
|
|
196
311
|
relinka("info", `${toUpdate.length} dependencies can be updated:`);
|
|
197
312
|
for (const update of toUpdate) {
|
|
198
|
-
relinka(
|
|
313
|
+
relinka(
|
|
314
|
+
"log",
|
|
315
|
+
` ${update.package} (${update.location}): ${update.currentVersion} \u2192 ${update.latestVersion}`
|
|
316
|
+
);
|
|
199
317
|
}
|
|
200
318
|
if (args["dry-run"]) {
|
|
201
319
|
relinka("info", "Dry run mode - no changes were made");
|
|
202
320
|
return;
|
|
203
321
|
}
|
|
204
|
-
relinka("info", "Updating package.json...");
|
|
205
322
|
const updatedPackageJson = { ...packageJson };
|
|
206
323
|
for (const update of toUpdate) {
|
|
207
324
|
const dep = update.package;
|
|
208
325
|
const newVersion = `^${update.latestVersion}`;
|
|
209
|
-
|
|
326
|
+
const location = update.location;
|
|
327
|
+
if (location === "dependencies" && dependencies[dep]) {
|
|
210
328
|
if (!updatedPackageJson.dependencies) updatedPackageJson.dependencies = {};
|
|
211
329
|
updatedPackageJson.dependencies[dep] = newVersion;
|
|
212
|
-
}
|
|
213
|
-
if (devDependencies[dep]) {
|
|
330
|
+
} else if (location === "devDependencies" && devDependencies[dep]) {
|
|
214
331
|
if (!updatedPackageJson.devDependencies) updatedPackageJson.devDependencies = {};
|
|
215
332
|
updatedPackageJson.devDependencies[dep] = newVersion;
|
|
333
|
+
} else if (location === "peerDependencies" && peerDependencies[dep]) {
|
|
334
|
+
if (!updatedPackageJson.peerDependencies) updatedPackageJson.peerDependencies = {};
|
|
335
|
+
updatedPackageJson.peerDependencies[dep] = newVersion;
|
|
336
|
+
} else if (location === "optionalDependencies" && optionalDependencies[dep]) {
|
|
337
|
+
if (!updatedPackageJson.optionalDependencies)
|
|
338
|
+
updatedPackageJson.optionalDependencies = {};
|
|
339
|
+
updatedPackageJson.optionalDependencies[dep] = newVersion;
|
|
340
|
+
} else if (location === "catalog" && catalog[dep]) {
|
|
341
|
+
if (!updatedPackageJson.workspaces) updatedPackageJson.workspaces = {};
|
|
342
|
+
if (!updatedPackageJson.workspaces.catalog)
|
|
343
|
+
updatedPackageJson.workspaces.catalog = {};
|
|
344
|
+
updatedPackageJson.workspaces.catalog[dep] = newVersion;
|
|
345
|
+
if (updatedPackageJson.catalog) {
|
|
346
|
+
updatedPackageJson.catalog[dep] = newVersion;
|
|
347
|
+
}
|
|
348
|
+
} else if (location?.startsWith("catalogs.")) {
|
|
349
|
+
const catalogName = location.split(".")[1];
|
|
350
|
+
if (catalogName) {
|
|
351
|
+
if (!updatedPackageJson.workspaces)
|
|
352
|
+
updatedPackageJson.workspaces = {};
|
|
353
|
+
if (!updatedPackageJson.workspaces.catalogs)
|
|
354
|
+
updatedPackageJson.workspaces.catalogs = {};
|
|
355
|
+
if (!updatedPackageJson.workspaces.catalogs[catalogName]) {
|
|
356
|
+
updatedPackageJson.workspaces.catalogs[catalogName] = {};
|
|
357
|
+
}
|
|
358
|
+
updatedPackageJson.workspaces.catalogs[catalogName][dep] = newVersion;
|
|
359
|
+
if (updatedPackageJson.catalogs && updatedPackageJson.catalogs[catalogName]) {
|
|
360
|
+
updatedPackageJson.catalogs[catalogName][dep] = newVersion;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
216
363
|
}
|
|
217
364
|
}
|
|
218
365
|
await fs.writeFile(
|
|
@@ -221,9 +368,9 @@ export default defineCommand({
|
|
|
221
368
|
"utf8"
|
|
222
369
|
);
|
|
223
370
|
relinka("success", `Updated ${toUpdate.length} dependencies in package.json`);
|
|
224
|
-
if (typeof Bun !== "undefined") {
|
|
225
|
-
await $`bun install`;
|
|
226
|
-
if (packageJson.scripts?.check) {
|
|
371
|
+
if (typeof Bun !== "undefined" && !args["no-install"]) {
|
|
372
|
+
await $`bun install --linker ${effectiveLinker}`;
|
|
373
|
+
if (packageJson.scripts?.check && args["with-check-script"]) {
|
|
227
374
|
await $`bun check`;
|
|
228
375
|
}
|
|
229
376
|
} else {
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import type { RseConfig } from "./rse-types";
|
|
2
2
|
export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
3
|
-
version?: string | undefined;
|
|
4
3
|
$schema?: "./schema.json" | "https://reliverse.org/schema.json" | undefined;
|
|
5
4
|
projectName?: string | undefined;
|
|
6
5
|
projectAuthor?: string | undefined;
|
|
7
6
|
projectDescription?: string | undefined;
|
|
7
|
+
version?: string | undefined;
|
|
8
8
|
projectLicense?: string | undefined;
|
|
9
9
|
projectRepository?: string | undefined;
|
|
10
10
|
projectDomain?: string | undefined;
|
|
11
11
|
projectGitService?: "none" | "github" | "gitlab" | "bitbucket" | undefined;
|
|
12
12
|
projectDeployService?: "none" | "vercel" | "netlify" | "railway" | "deno" | undefined;
|
|
13
|
-
projectPackageManager?: "
|
|
13
|
+
projectPackageManager?: "pnpm" | "bun" | "npm" | "yarn" | undefined;
|
|
14
14
|
projectState?: "creating" | "created" | undefined;
|
|
15
|
-
projectCategory?: "
|
|
15
|
+
projectCategory?: "cli" | "unknown" | "website" | "vscode" | "browser" | "library" | "mobile" | undefined;
|
|
16
16
|
projectSubcategory?: "unknown" | "e-commerce" | "tool" | undefined;
|
|
17
|
-
projectFramework?: "
|
|
17
|
+
projectFramework?: "rempts" | "unknown" | "vscode" | "nextjs" | "vite" | "svelte" | "remix" | "astro" | "nuxt" | "solid" | "qwik" | "vue" | "wxt" | "lynx" | "react-native" | "expo" | "capacitor" | "ionic" | "electron" | "tauri" | "neutralino" | "citty" | "commander" | "cac" | "meow" | "yargs" | "webextension" | "browser-extension" | "npm-jsr" | undefined;
|
|
18
18
|
projectTemplate?: "unknown" | "blefnk/relivator-nextjs-template" | "blefnk/relivator-docker-template" | "blefnk/next-react-ts-src-minimal" | "blefnk/all-in-one-nextjs-template" | "blefnk/create-t3-app" | "blefnk/create-next-app" | "blefnk/astro-starlight-template" | "blefnk/versator-nextjs-template" | "blefnk/relivator-lynxjs-template" | "blefnk/relivator-react-native-template" | "reliverse/template-browser-extension" | "microsoft/vscode-extension-samples" | "microsoft/vscode-extension-template" | "rsetarter-template" | "blefnk/deno-cli-tutorial" | undefined;
|
|
19
19
|
projectTemplateDate?: string | undefined;
|
|
20
20
|
features?: {
|
|
21
|
-
commands?: string[] | undefined;
|
|
22
21
|
i18n?: boolean | undefined;
|
|
23
22
|
analytics?: boolean | undefined;
|
|
24
23
|
themeMode?: "light" | "dark" | "dark-light" | undefined;
|
|
@@ -28,30 +27,31 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
28
27
|
testing?: boolean | undefined;
|
|
29
28
|
docker?: boolean | undefined;
|
|
30
29
|
ci?: boolean | undefined;
|
|
30
|
+
commands?: string[] | undefined;
|
|
31
31
|
webview?: string[] | undefined;
|
|
32
32
|
language?: string[] | undefined;
|
|
33
33
|
themes?: string[] | undefined;
|
|
34
34
|
} | undefined;
|
|
35
35
|
preferredLibraries?: {
|
|
36
|
-
search?: "unknown" | "algolia" | undefined;
|
|
37
36
|
i18n?: "unknown" | "next-intl" | undefined;
|
|
38
37
|
analytics?: "unknown" | "vercel" | undefined;
|
|
39
38
|
authentication?: "unknown" | "better-auth" | "clerk" | "next-auth" | "supabase-auth" | "auth0" | undefined;
|
|
40
|
-
api?: "
|
|
41
|
-
testing?: "
|
|
39
|
+
api?: "unknown" | "hono" | "trpc" | "graphql" | "rest" | undefined;
|
|
40
|
+
testing?: "unknown" | "bun" | "vitest" | "jest" | "playwright" | "cypress" | undefined;
|
|
42
41
|
stateManagement?: "unknown" | "zustand" | "jotai" | "redux-toolkit" | undefined;
|
|
43
42
|
formManagement?: "unknown" | "react-hook-form" | "formik" | undefined;
|
|
44
|
-
styling?: "
|
|
43
|
+
styling?: "unknown" | "tailwind" | "styled-components" | "css-modules" | "sass" | undefined;
|
|
45
44
|
uiComponents?: "unknown" | "shadcn-ui" | "chakra-ui" | "material-ui" | undefined;
|
|
46
45
|
databaseLibrary?: "unknown" | "drizzle" | "prisma" | "supabase" | undefined;
|
|
47
46
|
databaseProvider?: "unknown" | "pg" | "mysql" | "sqlite" | "mongodb" | undefined;
|
|
48
|
-
linting?: "
|
|
49
|
-
formatting?: "
|
|
47
|
+
linting?: "unknown" | "eslint" | undefined;
|
|
48
|
+
formatting?: "unknown" | "biome" | undefined;
|
|
50
49
|
payment?: "unknown" | "stripe" | undefined;
|
|
51
50
|
monitoring?: "unknown" | "sentry" | undefined;
|
|
52
51
|
logging?: "unknown" | "axiom" | undefined;
|
|
53
52
|
forms?: "unknown" | "react-hook-form" | undefined;
|
|
54
53
|
notifications?: "unknown" | "sonner" | undefined;
|
|
54
|
+
search?: "unknown" | "algolia" | undefined;
|
|
55
55
|
uploads?: "unknown" | "uploadthing" | undefined;
|
|
56
56
|
validation?: "unknown" | "zod" | "typebox" | "valibot" | undefined;
|
|
57
57
|
documentation?: "unknown" | "starlight" | "nextra" | undefined;
|
|
@@ -75,7 +75,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
75
75
|
indentStyle?: "space" | "tab" | undefined;
|
|
76
76
|
quoteMark?: "single" | "double" | undefined;
|
|
77
77
|
semicolons?: boolean | undefined;
|
|
78
|
-
trailingComma?: "
|
|
78
|
+
trailingComma?: "none" | "es5" | "all" | undefined;
|
|
79
79
|
bracketSpacing?: boolean | undefined;
|
|
80
80
|
arrowParens?: "always" | "avoid" | undefined;
|
|
81
81
|
tabWidth?: number | undefined;
|
|
@@ -96,7 +96,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
96
96
|
importSymbol?: string | undefined;
|
|
97
97
|
} | undefined;
|
|
98
98
|
monorepo?: {
|
|
99
|
-
type?: "
|
|
99
|
+
type?: "none" | "turborepo" | "nx" | "pnpm" | "bun" | undefined;
|
|
100
100
|
packages?: string[] | undefined;
|
|
101
101
|
sharedPackages?: string[] | undefined;
|
|
102
102
|
} | undefined;
|
|
@@ -113,7 +113,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
113
113
|
repoBranch?: string | undefined;
|
|
114
114
|
repoPrivacy?: "unknown" | "public" | "private" | undefined;
|
|
115
115
|
projectArchitecture?: "unknown" | "fullstack" | "separated" | undefined;
|
|
116
|
-
projectRuntime?: "bun" | "
|
|
116
|
+
projectRuntime?: "bun" | "deno" | "node" | undefined;
|
|
117
117
|
skipPromptsUseAutoBehavior?: boolean | undefined;
|
|
118
118
|
deployBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
119
119
|
depsBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
@@ -5,3 +5,11 @@ import type { DlerConfig } from "./types.js";
|
|
|
5
5
|
* Uses jiti for seamless TypeScript and ESM support.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getConfigDler(): Promise<DlerConfig>;
|
|
8
|
+
/**
|
|
9
|
+
* Searches for and loads bunfig.toml configuration files.
|
|
10
|
+
* Checks both local (project root) and global locations.
|
|
11
|
+
* Merges configurations with local overriding global.
|
|
12
|
+
*
|
|
13
|
+
* @returns The merged bunfig configuration or null if no config found
|
|
14
|
+
*/
|
|
15
|
+
export declare function getConfigBunfig(): Promise<Record<string, any> | null>;
|
|
@@ -31,3 +31,57 @@ export async function getConfigDler() {
|
|
|
31
31
|
relinka("log", `Config file not found at ${configPath}. Using default configuration.`);
|
|
32
32
|
return defineConfigDler();
|
|
33
33
|
}
|
|
34
|
+
export async function getConfigBunfig() {
|
|
35
|
+
const cwd = process.cwd();
|
|
36
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE || "";
|
|
37
|
+
const xdgConfigHome = process.env.XDG_CONFIG_HOME;
|
|
38
|
+
const localPaths = [resolve(cwd, "bunfig.toml"), resolve(cwd, ".bunfig.toml")];
|
|
39
|
+
const globalPaths = [
|
|
40
|
+
...homeDir ? [resolve(homeDir, ".bunfig.toml")] : [],
|
|
41
|
+
...xdgConfigHome ? [resolve(xdgConfigHome, ".bunfig.toml")] : []
|
|
42
|
+
];
|
|
43
|
+
let globalConfig = {};
|
|
44
|
+
let localConfig = {};
|
|
45
|
+
for (const configPath of globalPaths) {
|
|
46
|
+
if (await fs.pathExists(configPath)) {
|
|
47
|
+
try {
|
|
48
|
+
const configContent = await fs.readFile(configPath, "utf-8");
|
|
49
|
+
let config;
|
|
50
|
+
if (typeof Bun !== "undefined") {
|
|
51
|
+
config = Bun.TOML.parse(configContent);
|
|
52
|
+
} else {
|
|
53
|
+
throw new Error(
|
|
54
|
+
"TOML parsing requires Bun runtime. Please run with Bun to load bunfig.toml files."
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
globalConfig = { ...globalConfig, ...config };
|
|
58
|
+
} catch (error) {
|
|
59
|
+
relinka("error", `Error loading global bunfig from ${configPath}:`, error);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
for (const configPath of localPaths) {
|
|
64
|
+
if (await fs.pathExists(configPath)) {
|
|
65
|
+
try {
|
|
66
|
+
const configContent = await fs.readFile(configPath, "utf-8");
|
|
67
|
+
let config;
|
|
68
|
+
if (typeof Bun !== "undefined") {
|
|
69
|
+
config = Bun.TOML.parse(configContent);
|
|
70
|
+
} else {
|
|
71
|
+
throw new Error(
|
|
72
|
+
"TOML parsing requires Bun runtime. Please run with Bun to load bunfig.toml files."
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
localConfig = { ...localConfig, ...config };
|
|
76
|
+
break;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
relinka("error", `Error loading local bunfig from ${configPath}:`, error);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const mergedConfig = { ...globalConfig, ...localConfig };
|
|
83
|
+
if (Object.keys(mergedConfig).length === 0) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return mergedConfig;
|
|
87
|
+
}
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"cssnano": "^7.1.0",
|
|
23
23
|
"defu": "^6.1.4",
|
|
24
24
|
"destr": "^2.0.5",
|
|
25
|
-
"esbuild": "^0.25.
|
|
25
|
+
"esbuild": "^0.25.8",
|
|
26
26
|
"execa": "^9.6.0",
|
|
27
27
|
"file-type": "^21.0.0",
|
|
28
28
|
"fix-dts-default-cjs-exports": "^1.0.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"license": "MIT",
|
|
59
59
|
"name": "@reliverse/dler",
|
|
60
60
|
"type": "module",
|
|
61
|
-
"version": "1.7.
|
|
61
|
+
"version": "1.7.68",
|
|
62
62
|
"keywords": [
|
|
63
63
|
"reliverse",
|
|
64
64
|
"cli",
|