@reliverse/dler 2.2.17 → 2.3.1
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 +190 -55
- package/dist/cli.js +5 -2
- package/dist/cmds/biome/cmd.d.ts +5 -1
- package/dist/cmds/biome/cmd.js +20 -29
- package/dist/cmds/biome/impl.js +26 -21
- package/dist/cmds/build/cmd.d.ts +91 -1
- package/dist/cmds/build/cmd.js +289 -580
- package/dist/cmds/clean/cmd.d.ts +14 -1
- package/dist/cmds/clean/cmd.js +61 -112
- package/dist/cmds/clean/impl.js +61 -76
- package/dist/cmds/clean/presets.js +2 -9
- package/dist/cmds/init/cmd.d.ts +9 -0
- package/dist/cmds/init/cmd.js +87 -0
- package/dist/cmds/publish/cmd.d.ts +32 -1
- package/dist/cmds/publish/cmd.js +125 -165
- package/dist/cmds/senv/cmd.d.ts +7 -1
- package/dist/cmds/senv/cmd.js +41 -80
- package/dist/cmds/test/cmd.d.ts +9 -0
- package/dist/cmds/test/cmd.js +157 -0
- package/dist/cmds/tsc/cache.d.ts +2 -2
- package/dist/cmds/tsc/cache.js +37 -19
- package/dist/cmds/tsc/cmd.d.ts +14 -1
- package/dist/cmds/tsc/cmd.js +44 -80
- package/dist/cmds/tsc/impl.js +42 -92
- package/dist/cmds/update/cmd.d.ts +11 -1
- package/dist/cmds/update/cmd.js +57 -81
- package/dist/cmds/update/impl.js +16 -30
- package/dist/cmds/update/utils.js +116 -82
- package/dist/mod.d.ts +3 -0
- package/dist/mod.js +6 -0
- package/dist/utils/find-entry.d.ts +1 -0
- package/dist/utils/find-entry.js +46 -0
- package/package.json +53 -30
- package/src/cli.ts +9 -0
- package/LICENSE +0 -21
- /package/dist/{cmds/const.d.ts → const.d.ts} +0 -0
- /package/dist/{cmds/const.js → const.js} +0 -0
|
@@ -24,7 +24,7 @@ export function isSemverCompatible(currentVersionRange, latestVersion) {
|
|
|
24
24
|
if (isWorkspaceDependency(currentVersionRange)) {
|
|
25
25
|
return false;
|
|
26
26
|
}
|
|
27
|
-
if (!currentVersionRange.startsWith("^")
|
|
27
|
+
if (!(currentVersionRange.startsWith("^") || currentVersionRange.startsWith("~"))) {
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
30
|
return semver.satisfies(latestVersion, currentVersionRange);
|
|
@@ -40,37 +40,57 @@ export function collectTargetDependencies(pkg) {
|
|
|
40
40
|
const optionalDependencies = pkg.optionalDependencies || {};
|
|
41
41
|
for (const dep of Object.keys(dependencies)) {
|
|
42
42
|
const version = dependencies[dep];
|
|
43
|
-
if (!version)
|
|
44
|
-
|
|
43
|
+
if (!version) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (!map[dep]) {
|
|
47
|
+
map[dep] = { versionSpec: version, locations: /* @__PURE__ */ new Set() };
|
|
48
|
+
}
|
|
45
49
|
map[dep].versionSpec = version;
|
|
46
50
|
map[dep].locations.add("dependencies");
|
|
47
51
|
}
|
|
48
52
|
for (const dep of Object.keys(devDependencies)) {
|
|
49
53
|
const version = devDependencies[dep];
|
|
50
|
-
if (!version)
|
|
51
|
-
|
|
54
|
+
if (!version) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (!map[dep]) {
|
|
58
|
+
map[dep] = { versionSpec: version, locations: /* @__PURE__ */ new Set() };
|
|
59
|
+
}
|
|
52
60
|
map[dep].versionSpec = version;
|
|
53
61
|
map[dep].locations.add("devDependencies");
|
|
54
62
|
}
|
|
55
63
|
for (const dep of Object.keys(peerDependencies)) {
|
|
56
64
|
const version = peerDependencies[dep];
|
|
57
|
-
if (!version)
|
|
58
|
-
|
|
65
|
+
if (!version) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (!map[dep]) {
|
|
69
|
+
map[dep] = { versionSpec: version, locations: /* @__PURE__ */ new Set() };
|
|
70
|
+
}
|
|
59
71
|
map[dep].versionSpec = version;
|
|
60
72
|
map[dep].locations.add("peerDependencies");
|
|
61
73
|
}
|
|
62
74
|
for (const dep of Object.keys(optionalDependencies)) {
|
|
63
75
|
const version = optionalDependencies[dep];
|
|
64
|
-
if (!version)
|
|
65
|
-
|
|
76
|
+
if (!version) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (!map[dep]) {
|
|
80
|
+
map[dep] = { versionSpec: version, locations: /* @__PURE__ */ new Set() };
|
|
81
|
+
}
|
|
66
82
|
map[dep].versionSpec = version;
|
|
67
83
|
map[dep].locations.add("optionalDependencies");
|
|
68
84
|
}
|
|
69
85
|
const workspacesCatalog = pkg.workspaces?.catalog || {};
|
|
70
86
|
for (const dep of Object.keys(workspacesCatalog)) {
|
|
71
87
|
const version = workspacesCatalog[dep];
|
|
72
|
-
if (!version)
|
|
73
|
-
|
|
88
|
+
if (!version) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (!map[dep]) {
|
|
92
|
+
map[dep] = { versionSpec: version, locations: /* @__PURE__ */ new Set() };
|
|
93
|
+
}
|
|
74
94
|
map[dep].versionSpec = version;
|
|
75
95
|
map[dep].locations.add("catalog");
|
|
76
96
|
}
|
|
@@ -79,8 +99,12 @@ export function collectTargetDependencies(pkg) {
|
|
|
79
99
|
const catalog = workspacesCatalogs[catalogName] || {};
|
|
80
100
|
for (const dep of Object.keys(catalog)) {
|
|
81
101
|
const version = catalog[dep];
|
|
82
|
-
if (!version)
|
|
83
|
-
|
|
102
|
+
if (!version) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (!map[dep]) {
|
|
106
|
+
map[dep] = { versionSpec: version, locations: /* @__PURE__ */ new Set() };
|
|
107
|
+
}
|
|
84
108
|
map[dep].versionSpec = version;
|
|
85
109
|
map[dep].locations.add(`catalogs.${catalogName}`);
|
|
86
110
|
}
|
|
@@ -88,8 +112,12 @@ export function collectTargetDependencies(pkg) {
|
|
|
88
112
|
const topLevelCatalog = pkg.catalog || {};
|
|
89
113
|
for (const dep of Object.keys(topLevelCatalog)) {
|
|
90
114
|
const version = topLevelCatalog[dep];
|
|
91
|
-
if (!version)
|
|
92
|
-
|
|
115
|
+
if (!version) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (!map[dep]) {
|
|
119
|
+
map[dep] = { versionSpec: version, locations: /* @__PURE__ */ new Set() };
|
|
120
|
+
}
|
|
93
121
|
map[dep].versionSpec = version;
|
|
94
122
|
map[dep].locations.add("catalog");
|
|
95
123
|
}
|
|
@@ -98,8 +126,12 @@ export function collectTargetDependencies(pkg) {
|
|
|
98
126
|
const catalog = topLevelCatalogs[catalogName] || {};
|
|
99
127
|
for (const dep of Object.keys(catalog)) {
|
|
100
128
|
const version = catalog[dep];
|
|
101
|
-
if (!version)
|
|
102
|
-
|
|
129
|
+
if (!version) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (!map[dep]) {
|
|
133
|
+
map[dep] = { versionSpec: version, locations: /* @__PURE__ */ new Set() };
|
|
134
|
+
}
|
|
103
135
|
map[dep].versionSpec = version;
|
|
104
136
|
map[dep].locations.add(`catalogs.${catalogName}`);
|
|
105
137
|
}
|
|
@@ -108,44 +140,63 @@ export function collectTargetDependencies(pkg) {
|
|
|
108
140
|
}
|
|
109
141
|
export function applyVersionUpdate(pkg, depName, newVersion, locations) {
|
|
110
142
|
if (locations.has("dependencies")) {
|
|
111
|
-
if (!pkg.dependencies)
|
|
143
|
+
if (!pkg.dependencies) {
|
|
144
|
+
pkg.dependencies = {};
|
|
145
|
+
}
|
|
112
146
|
pkg.dependencies[depName] = newVersion;
|
|
113
147
|
}
|
|
114
148
|
if (locations.has("devDependencies")) {
|
|
115
|
-
if (!pkg.devDependencies)
|
|
149
|
+
if (!pkg.devDependencies) {
|
|
150
|
+
pkg.devDependencies = {};
|
|
151
|
+
}
|
|
116
152
|
pkg.devDependencies[depName] = newVersion;
|
|
117
153
|
}
|
|
118
154
|
if (locations.has("peerDependencies")) {
|
|
119
|
-
if (!pkg.peerDependencies)
|
|
155
|
+
if (!pkg.peerDependencies) {
|
|
156
|
+
pkg.peerDependencies = {};
|
|
157
|
+
}
|
|
120
158
|
pkg.peerDependencies[depName] = newVersion;
|
|
121
159
|
}
|
|
122
160
|
if (locations.has("optionalDependencies")) {
|
|
123
|
-
if (!pkg.optionalDependencies)
|
|
161
|
+
if (!pkg.optionalDependencies) {
|
|
162
|
+
pkg.optionalDependencies = {};
|
|
163
|
+
}
|
|
124
164
|
pkg.optionalDependencies[depName] = newVersion;
|
|
125
165
|
}
|
|
126
166
|
const ensureWorkspaces = () => {
|
|
127
|
-
if (!pkg.workspaces)
|
|
167
|
+
if (!pkg.workspaces) {
|
|
168
|
+
pkg.workspaces = {};
|
|
169
|
+
}
|
|
128
170
|
};
|
|
129
171
|
if (locations.has("catalog")) {
|
|
130
172
|
ensureWorkspaces();
|
|
131
173
|
const workspaces = pkg.workspaces;
|
|
132
174
|
if (workspaces) {
|
|
133
|
-
if (!workspaces.catalog)
|
|
175
|
+
if (!workspaces.catalog) {
|
|
176
|
+
workspaces.catalog = {};
|
|
177
|
+
}
|
|
134
178
|
workspaces.catalog[depName] = newVersion;
|
|
135
179
|
}
|
|
136
|
-
if (pkg.catalog)
|
|
180
|
+
if (pkg.catalog) {
|
|
181
|
+
pkg.catalog[depName] = newVersion;
|
|
182
|
+
}
|
|
137
183
|
}
|
|
138
184
|
for (const loc of locations) {
|
|
139
185
|
const match = /^catalogs\.(.+)$/.exec(loc);
|
|
140
186
|
if (match) {
|
|
141
187
|
const catalogName = match[1] ?? "";
|
|
142
|
-
if (!catalogName)
|
|
188
|
+
if (!catalogName) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
143
191
|
ensureWorkspaces();
|
|
144
192
|
const workspaces = pkg.workspaces;
|
|
145
193
|
if (workspaces) {
|
|
146
|
-
if (!workspaces.catalogs)
|
|
147
|
-
|
|
194
|
+
if (!workspaces.catalogs) {
|
|
195
|
+
workspaces.catalogs = {};
|
|
196
|
+
}
|
|
197
|
+
if (!workspaces.catalogs[catalogName]) {
|
|
148
198
|
workspaces.catalogs[catalogName] = {};
|
|
199
|
+
}
|
|
149
200
|
workspaces.catalogs[catalogName][depName] = newVersion;
|
|
150
201
|
}
|
|
151
202
|
if (pkg.catalogs?.[catalogName]) {
|
|
@@ -155,9 +206,7 @@ export function applyVersionUpdate(pkg, depName, newVersion, locations) {
|
|
|
155
206
|
}
|
|
156
207
|
}
|
|
157
208
|
export async function fetchVersionFromRegistry(packageName) {
|
|
158
|
-
const response = await fetch(
|
|
159
|
-
`https://registry.npmjs.org/${packageName}/latest`
|
|
160
|
-
);
|
|
209
|
+
const response = await fetch(`https://registry.npmjs.org/${packageName}/latest`);
|
|
161
210
|
if (!response.ok) {
|
|
162
211
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
163
212
|
}
|
|
@@ -168,9 +217,7 @@ export async function getLatestVersion(packageName) {
|
|
|
168
217
|
try {
|
|
169
218
|
return await fetchVersionFromRegistry(packageName);
|
|
170
219
|
} catch (error) {
|
|
171
|
-
throw new Error(
|
|
172
|
-
`Failed to get latest version for ${packageName}: ${error}`
|
|
173
|
-
);
|
|
220
|
+
throw new Error(`Failed to get latest version for ${packageName}: ${error}`);
|
|
174
221
|
}
|
|
175
222
|
}
|
|
176
223
|
export async function checkPackageUpdate(packageName, versionSpec, locations, options) {
|
|
@@ -178,7 +225,7 @@ export async function checkPackageUpdate(packageName, versionSpec, locations, op
|
|
|
178
225
|
const latest = await getLatestVersion(packageName);
|
|
179
226
|
const cleanCurrent = versionSpec.replace(/^[\^~]/, "");
|
|
180
227
|
let isCompatible = isSemverCompatible(versionSpec, latest);
|
|
181
|
-
const isExact = !versionSpec.startsWith("^")
|
|
228
|
+
const isExact = !(versionSpec.startsWith("^") || versionSpec.startsWith("~"));
|
|
182
229
|
if (isExact || !isCompatible && options.allowMajor) {
|
|
183
230
|
isCompatible = true;
|
|
184
231
|
}
|
|
@@ -215,9 +262,7 @@ export function prepareDependenciesForUpdate(allDepsMap, args) {
|
|
|
215
262
|
return dep === pattern;
|
|
216
263
|
});
|
|
217
264
|
});
|
|
218
|
-
const exactMatches = filteredDeps.filter(
|
|
219
|
-
(dep) => namePatterns.includes(dep)
|
|
220
|
-
);
|
|
265
|
+
const exactMatches = filteredDeps.filter((dep) => namePatterns.includes(dep));
|
|
221
266
|
const patternMatches = filteredDeps.length - exactMatches.length;
|
|
222
267
|
if (patternMatches > 0) {
|
|
223
268
|
logger.debug(
|
|
@@ -225,9 +270,7 @@ export function prepareDependenciesForUpdate(allDepsMap, args) {
|
|
|
225
270
|
);
|
|
226
271
|
}
|
|
227
272
|
if (filteredDeps.length === 0) {
|
|
228
|
-
logger.warn(
|
|
229
|
-
`No dependencies found matching patterns: ${namePatterns.join(", ")}`
|
|
230
|
-
);
|
|
273
|
+
logger.warn(`No dependencies found matching patterns: ${namePatterns.join(", ")}`);
|
|
231
274
|
}
|
|
232
275
|
} else {
|
|
233
276
|
const ignoreList = args.ignore || [];
|
|
@@ -241,18 +284,14 @@ export function prepareDependenciesForUpdate(allDepsMap, args) {
|
|
|
241
284
|
});
|
|
242
285
|
const ignoredCount = depsToUpdate.length - filteredDeps.length;
|
|
243
286
|
if (ignoredCount > 0 && ignoreList.length > 0) {
|
|
244
|
-
logger.debug(
|
|
245
|
-
`Ignored ${ignoredCount} dependencies matching ignore patterns`
|
|
246
|
-
);
|
|
287
|
+
logger.debug(`Ignored ${ignoredCount} dependencies matching ignore patterns`);
|
|
247
288
|
}
|
|
248
289
|
}
|
|
249
290
|
const ignoreFields = args.ignoreFields || [];
|
|
250
291
|
if (ignoreFields.length > 0) {
|
|
251
292
|
filteredDeps = filteredDeps.filter((dep) => {
|
|
252
293
|
const locations = allDepsMap[dep]?.locations || /* @__PURE__ */ new Set();
|
|
253
|
-
return !Array.from(locations).some(
|
|
254
|
-
(location) => ignoreFields.includes(location)
|
|
255
|
-
);
|
|
294
|
+
return !Array.from(locations).some((location) => ignoreFields.includes(location));
|
|
256
295
|
});
|
|
257
296
|
const ignoredFieldsCount = depsToUpdate.length - filteredDeps.length;
|
|
258
297
|
if (ignoredFieldsCount > 0) {
|
|
@@ -263,13 +302,19 @@ export function prepareDependenciesForUpdate(allDepsMap, args) {
|
|
|
263
302
|
}
|
|
264
303
|
return filteredDeps.filter((dep) => {
|
|
265
304
|
const versionSpec = allDepsMap[dep]?.versionSpec ?? "";
|
|
266
|
-
if (!versionSpec)
|
|
267
|
-
|
|
305
|
+
if (!versionSpec) {
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
if (isNonSemverSpecifier(versionSpec)) {
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
268
311
|
return true;
|
|
269
312
|
});
|
|
270
313
|
}
|
|
271
314
|
export async function updatePackageJsonFile(packageJsonPath, dependencies, updatesToApply, savePrefix, fieldsToIgnore = []) {
|
|
272
|
-
if (updatesToApply.length === 0)
|
|
315
|
+
if (updatesToApply.length === 0) {
|
|
316
|
+
return 0;
|
|
317
|
+
}
|
|
273
318
|
try {
|
|
274
319
|
const packageJson = JSON.parse(
|
|
275
320
|
await fs.readFile(packageJsonPath, { encoding: "utf8" })
|
|
@@ -277,7 +322,9 @@ export async function updatePackageJsonFile(packageJsonPath, dependencies, updat
|
|
|
277
322
|
const updatedPackageJson = { ...packageJson };
|
|
278
323
|
for (const update of updatesToApply) {
|
|
279
324
|
const depInfo = dependencies[update.package];
|
|
280
|
-
if (!depInfo)
|
|
325
|
+
if (!depInfo) {
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
281
328
|
const locations = depInfo.locations || /* @__PURE__ */ new Set();
|
|
282
329
|
const shouldIgnore = Array.from(locations).some(
|
|
283
330
|
(location) => fieldsToIgnore.includes(location)
|
|
@@ -296,19 +343,12 @@ export async function updatePackageJsonFile(packageJsonPath, dependencies, updat
|
|
|
296
343
|
} else {
|
|
297
344
|
newVersion = savePrefix === "none" ? update.latestVersion : `${savePrefix}${update.latestVersion}`;
|
|
298
345
|
}
|
|
299
|
-
applyVersionUpdate(
|
|
300
|
-
updatedPackageJson,
|
|
301
|
-
update.package,
|
|
302
|
-
newVersion,
|
|
303
|
-
locations
|
|
304
|
-
);
|
|
346
|
+
applyVersionUpdate(updatedPackageJson, update.package, newVersion, locations);
|
|
305
347
|
}
|
|
306
|
-
await fs.writeFile(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
{ encoding: "utf8" }
|
|
311
|
-
);
|
|
348
|
+
await fs.writeFile(packageJsonPath, `${JSON.stringify(updatedPackageJson, null, 2)}
|
|
349
|
+
`, {
|
|
350
|
+
encoding: "utf8"
|
|
351
|
+
});
|
|
312
352
|
return updatesToApply.length;
|
|
313
353
|
} catch (error) {
|
|
314
354
|
logger.warn(
|
|
@@ -320,9 +360,7 @@ export async function updatePackageJsonFile(packageJsonPath, dependencies, updat
|
|
|
320
360
|
export function displayStructuredUpdateResults(results, packageJsonFiles, fileDepsMap, showDetails = false) {
|
|
321
361
|
const toUpdate = results.filter((r) => r.updated && !r.error);
|
|
322
362
|
const errors = results.filter((r) => r.error);
|
|
323
|
-
const upToDate = results.filter(
|
|
324
|
-
(r) => !r.updated && !r.error && r.semverCompatible
|
|
325
|
-
);
|
|
363
|
+
const upToDate = results.filter((r) => !(r.updated || r.error) && r.semverCompatible);
|
|
326
364
|
if (errors.length > 0) {
|
|
327
365
|
logger.warn(`Failed to check ${errors.length} dependencies:`);
|
|
328
366
|
for (const error of errors) {
|
|
@@ -368,29 +406,25 @@ export function displayStructuredUpdateResults(results, packageJsonFiles, fileDe
|
|
|
368
406
|
}
|
|
369
407
|
byCategory.get(category)?.push(result);
|
|
370
408
|
}
|
|
371
|
-
const upToDateInFile = fileResults.filter(
|
|
372
|
-
(r) => !r.updated && !r.error && r.semverCompatible
|
|
373
|
-
);
|
|
409
|
+
const upToDateInFile = fileResults.filter((r) => !(r.updated || r.error) && r.semverCompatible);
|
|
374
410
|
if (upToDateInFile.length > 0) {
|
|
375
411
|
logger.log(` * ${upToDateInFile.length} deps are already up to date`);
|
|
376
412
|
}
|
|
377
413
|
const toUpdateInFile = fileResults.filter((r) => r.updated && !r.error);
|
|
378
414
|
if (toUpdateInFile.length > 0) {
|
|
379
415
|
logger.log(` * ${toUpdateInFile.length} deps can be updated:`);
|
|
380
|
-
const sortedCategories = Array.from(byCategory.entries()).sort(
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
);
|
|
416
|
+
const sortedCategories = Array.from(byCategory.entries()).sort(([a], [b]) => {
|
|
417
|
+
const order = {
|
|
418
|
+
catalog: 0,
|
|
419
|
+
dependencies: 1,
|
|
420
|
+
devDependencies: 2,
|
|
421
|
+
peerDependencies: 3,
|
|
422
|
+
optionalDependencies: 4
|
|
423
|
+
};
|
|
424
|
+
const aOrder = order[a] ?? 999;
|
|
425
|
+
const bOrder = order[b] ?? 999;
|
|
426
|
+
return aOrder - bOrder;
|
|
427
|
+
});
|
|
394
428
|
for (const [category, updates] of sortedCategories) {
|
|
395
429
|
const categoryUpdates = updates.filter((r) => r.updated && !r.error);
|
|
396
430
|
if (categoryUpdates.length > 0) {
|
package/dist/mod.d.ts
ADDED
package/dist/mod.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findEntry(cwd?: string): Promise<string | undefined>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
const COMMON_ENTRIES = [
|
|
4
|
+
"src/cli.ts",
|
|
5
|
+
"src/mod.ts",
|
|
6
|
+
"src/main.ts",
|
|
7
|
+
"cli.ts",
|
|
8
|
+
"mod.ts",
|
|
9
|
+
"index.ts",
|
|
10
|
+
"main.ts",
|
|
11
|
+
"src/cli.js",
|
|
12
|
+
"src/index.js",
|
|
13
|
+
"src/mod.js",
|
|
14
|
+
"src/main.js",
|
|
15
|
+
"cli.js",
|
|
16
|
+
"mod.js",
|
|
17
|
+
"index.js",
|
|
18
|
+
"main.js"
|
|
19
|
+
];
|
|
20
|
+
export async function findEntry(cwd = process.cwd()) {
|
|
21
|
+
for (const entry of COMMON_ENTRIES) {
|
|
22
|
+
const fullPath = path.join(cwd, entry);
|
|
23
|
+
if (existsSync(fullPath)) {
|
|
24
|
+
return entry;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const pkgPath = path.join(cwd, "package.json");
|
|
28
|
+
if (existsSync(pkgPath)) {
|
|
29
|
+
try {
|
|
30
|
+
const pkg = await Bun.file(pkgPath).json();
|
|
31
|
+
if (pkg.bin) {
|
|
32
|
+
if (typeof pkg.bin === "string") {
|
|
33
|
+
return pkg.bin;
|
|
34
|
+
}
|
|
35
|
+
if (typeof pkg.bin === "object") {
|
|
36
|
+
const firstBin = Object.values(pkg.bin)[0];
|
|
37
|
+
if (typeof firstBin === "string") {
|
|
38
|
+
return firstBin;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} catch {
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return void 0;
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reliverse/dler",
|
|
3
|
+
"version": "2.3.1",
|
|
3
4
|
"description": "@reliverse/dler is a framework which helps TypeScript and JavaScript developers create their libraries and CLI tools. It provides ready-to-use primitives, so you don't have to write them from scratch.",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"build-tool",
|
|
7
|
+
"bun",
|
|
8
|
+
"cli",
|
|
9
|
+
"development",
|
|
10
|
+
"rempts",
|
|
11
|
+
"toolchain",
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/reliverse/dler#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/reliverse/dler/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "blefnk",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/reliverse/dler.git",
|
|
23
|
+
"directory": "packages/cli"
|
|
24
|
+
},
|
|
8
25
|
"bin": {
|
|
9
|
-
"dler": "
|
|
26
|
+
"dler": "./src/cli.ts"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"module": "./src/mod.ts",
|
|
33
|
+
"types": "./src/mod.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/mod.d.ts",
|
|
37
|
+
"import": "./dist/mod.js"
|
|
38
|
+
}
|
|
10
39
|
},
|
|
11
40
|
"dependencies": {
|
|
41
|
+
"@reliverse/build": "2.3.1",
|
|
42
|
+
"@reliverse/bump": "2.3.1",
|
|
43
|
+
"@reliverse/config": "2.3.1",
|
|
44
|
+
"@reliverse/datetime": "2.3.1",
|
|
45
|
+
"@reliverse/helpers": "2.3.1",
|
|
46
|
+
"@reliverse/mapkit": "2.3.1",
|
|
47
|
+
"@reliverse/matcha": "2.3.1",
|
|
48
|
+
"@reliverse/pathkit": "2.3.1",
|
|
49
|
+
"@reliverse/publish": "2.3.1",
|
|
50
|
+
"@reliverse/relico": "2.3.1",
|
|
51
|
+
"@reliverse/relifso": "2.3.1",
|
|
52
|
+
"@reliverse/relinka": "2.3.1",
|
|
53
|
+
"@reliverse/rempts-core": "2.3.1",
|
|
54
|
+
"@reliverse/rempts-utils": "2.3.1",
|
|
55
|
+
"@reliverse/typerso": "2.3.1",
|
|
12
56
|
"c12": "^3.3.3",
|
|
13
|
-
"semver": "^7.7.3",
|
|
14
|
-
"lookpath": "^1.2.3",
|
|
15
57
|
"clipboardy": "^5.0.2",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"@reliverse/bump": "2.2.10",
|
|
20
|
-
"@reliverse/build": "2.2.9",
|
|
21
|
-
"@reliverse/relinka": "2.2.9",
|
|
22
|
-
"@reliverse/matcha": "2.2.9",
|
|
23
|
-
"@reliverse/rempts": "2.2.9",
|
|
24
|
-
"@reliverse/helpers": "2.2.13",
|
|
25
|
-
"@reliverse/typerso": "2.2.9",
|
|
26
|
-
"@reliverse/relifso": "2.2.10",
|
|
27
|
-
"@reliverse/mapkit": "2.2.9",
|
|
28
|
-
"@reliverse/pathkit": "2.2.13"
|
|
58
|
+
"lookpath": "^1.2.3",
|
|
59
|
+
"semver": "^7.7.3",
|
|
60
|
+
"arktype": "^2.1.29"
|
|
29
61
|
},
|
|
30
|
-
"keywords": [
|
|
31
|
-
"dler",
|
|
32
|
-
"build"
|
|
33
|
-
],
|
|
34
62
|
"publishConfig": {
|
|
35
63
|
"access": "public"
|
|
36
|
-
}
|
|
37
|
-
"files": [
|
|
38
|
-
"dist",
|
|
39
|
-
"package.json"
|
|
40
|
-
],
|
|
41
|
-
"license": "MIT"
|
|
64
|
+
}
|
|
42
65
|
}
|
package/src/cli.ts
ADDED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Nazar Kornienko (blefnk), Bleverse, Reliverse
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
File without changes
|
|
File without changes
|