@reliverse/dler 1.2.1 → 1.2.3
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 +126 -61
- package/bin/app/build/cmd.js +17 -0
- package/bin/app/deps/impl/types.js +0 -0
- package/bin/{cli/args/inject → app/inject/impl}/ts-expect-error.txt +3 -3
- package/bin/app/libs/cmd.js +0 -0
- package/bin/app/mono/cmd.js +0 -0
- package/bin/app/pub/cmd.js +17 -0
- package/bin/app/relifso/cmd.js +5 -0
- package/bin/{cli/args/init/libs/reinit/reint-impl → app/relifso/impl}/reinit-mod.txt +5 -5
- package/bin/{cli/args/init/libs/reinit/reint-impl → app/relifso/impl}/templates/t-license.js +1 -1
- package/bin/app/relifso/impl/types.js +0 -0
- package/bin/app/relinka/cmd.js +0 -0
- package/bin/{cli/args/init/init-mod.txt → app/rempts/cmd.txt} +1 -1
- package/bin/{cli/args/init/cmd → app/rempts/impl}/index.js +5 -4
- package/bin/app/spell/cmd.js +0 -0
- package/bin/app/split/cmd.js +0 -0
- package/bin/{cli/args/tools/index.js → app/tools/cmd.js} +2 -2
- package/bin/{cli/args/tools/tools-impl.js → app/tools/impl.js} +15 -15
- package/bin/{tools.txt → app/tools/tools.txt} +1 -1
- package/bin/cli.js +104 -3
- package/bin/init.js +22 -6
- package/bin/libs/cfg/cfg-default.js +1 -0
- package/bin/libs/sdk/sdk-impl/build/build-library.js +68 -36
- package/bin/libs/sdk/sdk-impl/build/build-regular.js +22 -12
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/auto.js +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.js +4 -7
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist.js +3 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/watch.js +3 -3
- package/bin/libs/sdk/sdk-impl/library-flow.js +1 -1
- package/bin/libs/sdk/sdk-impl/pub/pub-library.js +9 -9
- package/bin/libs/sdk/sdk-impl/pub/pub-regular.js +4 -4
- package/bin/libs/sdk/sdk-impl/regular-flow.js +17 -11
- package/bin/libs/sdk/sdk-impl/utils/tools/tools-impl.js +6 -6
- package/bin/libs/sdk/sdk-impl/utils/utils-build.js +2 -2
- package/bin/libs/sdk/sdk-impl/utils/utils-bump.js +4 -4
- package/bin/libs/sdk/sdk-impl/utils/utils-fs.js +2 -5
- package/bin/libs/sdk/sdk-impl/utils/utils-info.js +4 -4
- package/bin/libs/sdk/sdk-impl/utils/utils-jsr-json.js +3 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-paths.js +6 -6
- package/bin/libs/sdk/sdk-impl/utils/utils-pkg-json-libs.js +2 -2
- package/bin/libs/sdk/sdk-impl/utils/utils-pkg-json-reg.js +8 -5
- package/bin/load.js +1 -1
- package/bin/mod.js +7 -39
- package/package.json +7 -8
- package/bin/cli/args/deps/deps-mod.js +0 -48
- package/bin/cli/args/init/libs/reinit/reinit-mod.js +0 -5
- package/bin/cli/args/init/types.js +0 -1
- package/bin/cli/args/spell/spell-mod.js +0 -44
- package/bin/cli/args/split/split-mod.js +0 -26
- /package/bin/{cli/args/agg/agg-mod.js → app/agg/cmd.js} +0 -0
- /package/bin/{cli/args/conv/conv-mod.js → app/auth/cmd.js} +0 -0
- /package/bin/{cli/args/deps/types.js → app/cmds.js} +0 -0
- /package/bin/{cli/args → app}/conv/README.md +0 -0
- /package/bin/{cli/args/init/libs/reinit/reint-impl/types.js → app/conv/cmd.js} +0 -0
- /package/bin/{cli/args/mono/mono-mod.js → app/deps/cmd.js} +0 -0
- /package/bin/{cli/args/deps → app/deps/impl}/analyzer.js +0 -0
- /package/bin/{cli/args/deps → app/deps/impl}/filesystem.js +0 -0
- /package/bin/{cli/args/deps → app/deps/impl}/formatter.js +0 -0
- /package/bin/{cli/args/deps → app/deps/impl}/parser.js +0 -0
- /package/bin/{cli/args → app}/inject/README.md +0 -0
- /package/bin/{cli/args/inject/inject-mod.js → app/inject/cmd.js} +0 -0
- /package/bin/{cli/args/inject → app/inject/impl}/arg-ts-expect-error.txt +0 -0
- /package/bin/{cli/args/inject → app/inject/impl}/inject-mod.txt +0 -0
- /package/bin/{cli/args/inject → app/inject/impl}/reinject.config.js +0 -0
- /package/bin/{cli/args/merger → app/merge}/README.md +0 -0
- /package/bin/{cli/args/merger/merger-mod.txt → app/merge/cmd.txt} +0 -0
- /package/bin/{cli/args/init/libs/reinit/reint-impl → app/relifso/impl}/const.js +0 -0
- /package/bin/{cli/args/init/libs/reinit/reint-impl → app/relifso/impl}/templates/t-gitignore.js +0 -0
- /package/bin/{cli/args/init/libs/reinit/reint-impl → app/relifso/impl}/templates/t-readme.js +0 -0
- /package/bin/{cli/args/init/libs/reinit/reint-impl → app/relifso/impl}/utils.js +0 -0
- /package/bin/{cli/args/init → app/rempts}/README.md +0 -0
- /package/bin/{cli/args → app}/split/README.md +0 -0
- /package/bin/{cli/args/split/split-impl.js → app/split/impl.js} +0 -0
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./build/build-regular.js";
|
|
7
7
|
import { regular_pubToJsr, regular_pubToNpm } from "./pub/pub-regular.js";
|
|
8
8
|
import { CONCURRENCY_DEFAULT } from "./utils/utils-consts.js";
|
|
9
|
-
export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, commonPubRegistry, coreEntrySrcDir, distNpmDirName, distNpmBuilder, coreEntryFile, distJsrDryRun, distJsrFailOnWarn, commonPubPause, distJsrDirName, distJsrBuilder, transpileTarget, transpileFormat, transpileSplitting, transpileMinify, transpileSourcemap, transpilePublicPath, distJsrAllowDirty, distJsrSlowTypes, unifiedBundlerOutExt, rmDepsMode, transpileStub, transpileWatch, distJsrGenTsconfig, coreDeclarations) {
|
|
9
|
+
export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, commonPubRegistry, coreEntrySrcDir, distNpmDirName, distNpmBuilder, coreEntryFile, distJsrDryRun, distJsrFailOnWarn, commonPubPause, distJsrDirName, distJsrBuilder, transpileTarget, transpileFormat, transpileSplitting, transpileMinify, transpileSourcemap, transpilePublicPath, distJsrAllowDirty, distJsrSlowTypes, unifiedBundlerOutExt, rmDepsMode, transpileStub, transpileWatch, distJsrGenTsconfig, coreDeclarations, config) {
|
|
10
10
|
if (libsActMode !== "main-project-only" && libsActMode !== "main-and-libs") {
|
|
11
11
|
relinka(
|
|
12
|
-
"
|
|
12
|
+
"log",
|
|
13
13
|
"Skipping main project build/publish as libsActMode is set to 'libs-only'"
|
|
14
14
|
);
|
|
15
15
|
return;
|
|
@@ -17,7 +17,7 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
17
17
|
switch (commonPubRegistry) {
|
|
18
18
|
case "jsr":
|
|
19
19
|
relinka(
|
|
20
|
-
"
|
|
20
|
+
"log",
|
|
21
21
|
"Initializing build process for main project to JSR only..."
|
|
22
22
|
);
|
|
23
23
|
await regular_buildJsrDist(
|
|
@@ -40,7 +40,8 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
40
40
|
transpileStub,
|
|
41
41
|
transpileWatch,
|
|
42
42
|
distJsrGenTsconfig,
|
|
43
|
-
coreDeclarations
|
|
43
|
+
coreDeclarations,
|
|
44
|
+
config
|
|
44
45
|
);
|
|
45
46
|
if (!isDev) {
|
|
46
47
|
await regular_pubToJsr(
|
|
@@ -57,7 +58,7 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
57
58
|
break;
|
|
58
59
|
case "npm":
|
|
59
60
|
relinka(
|
|
60
|
-
"
|
|
61
|
+
"log",
|
|
61
62
|
"Initializing build process for main project to NPM only..."
|
|
62
63
|
);
|
|
63
64
|
await regular_buildNpmDist(
|
|
@@ -78,7 +79,8 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
78
79
|
transpileStub,
|
|
79
80
|
transpileWatch,
|
|
80
81
|
timer,
|
|
81
|
-
coreDeclarations
|
|
82
|
+
coreDeclarations,
|
|
83
|
+
config
|
|
82
84
|
);
|
|
83
85
|
if (!isDev) {
|
|
84
86
|
await regular_pubToNpm(
|
|
@@ -92,7 +94,7 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
92
94
|
break;
|
|
93
95
|
case "npm-jsr": {
|
|
94
96
|
relinka(
|
|
95
|
-
"
|
|
97
|
+
"log",
|
|
96
98
|
"Initializing build process for main project to both NPM and JSR..."
|
|
97
99
|
);
|
|
98
100
|
const buildTasks = [
|
|
@@ -116,7 +118,8 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
116
118
|
transpileStub,
|
|
117
119
|
transpileWatch,
|
|
118
120
|
distJsrGenTsconfig,
|
|
119
|
-
coreDeclarations
|
|
121
|
+
coreDeclarations,
|
|
122
|
+
config
|
|
120
123
|
),
|
|
121
124
|
() => regular_buildNpmDist(
|
|
122
125
|
isDev,
|
|
@@ -136,7 +139,8 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
136
139
|
transpileStub,
|
|
137
140
|
transpileWatch,
|
|
138
141
|
timer,
|
|
139
|
-
coreDeclarations
|
|
142
|
+
coreDeclarations,
|
|
143
|
+
config
|
|
140
144
|
)
|
|
141
145
|
];
|
|
142
146
|
await pAll(buildTasks, { concurrency: CONCURRENCY_DEFAULT });
|
|
@@ -188,7 +192,8 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
188
192
|
transpileStub,
|
|
189
193
|
transpileWatch,
|
|
190
194
|
timer,
|
|
191
|
-
coreDeclarations
|
|
195
|
+
coreDeclarations,
|
|
196
|
+
config
|
|
192
197
|
),
|
|
193
198
|
() => regular_buildJsrDist(
|
|
194
199
|
isDev,
|
|
@@ -210,7 +215,8 @@ export async function processRegularFlow(timer, isDev, coreIsCLI, libsActMode, c
|
|
|
210
215
|
transpileStub,
|
|
211
216
|
transpileWatch,
|
|
212
217
|
distJsrGenTsconfig,
|
|
213
|
-
coreDeclarations
|
|
218
|
+
coreDeclarations,
|
|
219
|
+
config
|
|
214
220
|
)
|
|
215
221
|
];
|
|
216
222
|
await pAll(fallbackBuildTasks, { concurrency: CONCURRENCY_DEFAULT });
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { relinka } from "@reliverse/relinka";
|
|
2
2
|
export function printUsage(isDev) {
|
|
3
|
-
relinka("
|
|
4
|
-
relinka("
|
|
5
|
-
relinka("
|
|
3
|
+
relinka("log", "====================");
|
|
4
|
+
relinka("log", "TOOLS USAGE EXAMPLES");
|
|
5
|
+
relinka("log", "====================");
|
|
6
6
|
relinka(
|
|
7
|
-
"
|
|
7
|
+
"log",
|
|
8
8
|
`${isDev ? "bun dev:agg" : "dler tools"} --tool agg --input <dir> --out <file> [options]`
|
|
9
9
|
);
|
|
10
10
|
if (isDev) {
|
|
11
11
|
relinka(
|
|
12
|
-
"
|
|
12
|
+
"log",
|
|
13
13
|
"bun dev:tools agg --input src/libs/sdk/sdk-impl --out src/libs/sdk/sdk-mod.ts --recursive --named --strip src/libs/sdk"
|
|
14
14
|
);
|
|
15
15
|
} else {
|
|
16
16
|
relinka(
|
|
17
|
-
"
|
|
17
|
+
"log",
|
|
18
18
|
"dler tools --tool agg --input src/libs --out aggregator.ts --recursive --named"
|
|
19
19
|
);
|
|
20
20
|
}
|
|
@@ -91,10 +91,10 @@ export async function renameEntryFile(isJsr, outDirBin, originalEntryFileBasenam
|
|
|
91
91
|
}
|
|
92
92
|
if (sourceEntryPath !== targetEntryPath) {
|
|
93
93
|
await fs.rename(sourceEntryPath, targetEntryPath);
|
|
94
|
-
relinka("
|
|
94
|
+
relinka("log", `Renamed entry file to ${targetEntryPath}`);
|
|
95
95
|
} else {
|
|
96
96
|
relinka(
|
|
97
|
-
"
|
|
97
|
+
"log",
|
|
98
98
|
`Source entry file ${sourceEntryPath} already has the target name. Skipping rename.`
|
|
99
99
|
);
|
|
100
100
|
}
|
|
@@ -37,7 +37,7 @@ const TS_VERSION_REGEXES = [
|
|
|
37
37
|
export async function bumpHandler(bumpMode, bumpDisable, commonPubPause, bumpFilter) {
|
|
38
38
|
if (bumpDisable || commonPubPause) {
|
|
39
39
|
relinka(
|
|
40
|
-
"
|
|
40
|
+
"log",
|
|
41
41
|
"Skipping version bump because it is either `bumpDisable: true` or `commonPubPause: true` in your dler config."
|
|
42
42
|
);
|
|
43
43
|
return;
|
|
@@ -55,7 +55,7 @@ export async function bumpHandler(bumpMode, bumpDisable, commonPubPause, bumpFil
|
|
|
55
55
|
throw new Error(`Invalid existing version in package.json: ${oldVersion}`);
|
|
56
56
|
}
|
|
57
57
|
relinka(
|
|
58
|
-
"
|
|
58
|
+
"log",
|
|
59
59
|
`Auto-incrementing version from ${oldVersion} using "${bumpMode}"`
|
|
60
60
|
);
|
|
61
61
|
const incremented = autoIncrementVersion(oldVersion, bumpMode);
|
|
@@ -63,7 +63,7 @@ export async function bumpHandler(bumpMode, bumpDisable, commonPubPause, bumpFil
|
|
|
63
63
|
await bumpVersions(oldVersion, incremented, bumpFilter);
|
|
64
64
|
await setBumpDisabled(true, commonPubPause);
|
|
65
65
|
} else {
|
|
66
|
-
relinka("
|
|
66
|
+
relinka("log", `Version is already at ${oldVersion}, no bump needed.`);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
export async function setBumpDisabled(value, commonPubPause) {
|
|
@@ -72,7 +72,7 @@ export async function setBumpDisabled(value, commonPubPause) {
|
|
|
72
72
|
}
|
|
73
73
|
const dlerCfgPath = path.join(PROJECT_ROOT, ".config/dler.ts");
|
|
74
74
|
if (!await fs.pathExists(dlerCfgPath)) {
|
|
75
|
-
relinka("
|
|
75
|
+
relinka("log", "No .config/dler.ts found to update bumpDisable");
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
let content = await readFileSafe(dlerCfgPath, "", "bumpDisable update");
|
|
@@ -157,11 +157,8 @@ ${filesToDelete.join("\n")}`);
|
|
|
157
157
|
await pMap(snapshotDirs, async (dir) => fs.remove(dir), {
|
|
158
158
|
concurrency: CONCURRENCY_DEFAULT
|
|
159
159
|
});
|
|
160
|
-
relinka(
|
|
161
|
-
|
|
162
|
-
`Deleted snapshot directories:
|
|
163
|
-
${snapshotDirs.join("\n")}`
|
|
164
|
-
);
|
|
160
|
+
relinka("log", `Deleted snapshot directories:
|
|
161
|
+
${snapshotDirs.join("\n")}`);
|
|
165
162
|
}
|
|
166
163
|
}
|
|
167
164
|
export async function readFileSafe(filePath, isJsr, reason) {
|
|
@@ -19,22 +19,22 @@ export async function finalizeBuild(timer, commonPubPause, libsList, distNpmDirN
|
|
|
19
19
|
});
|
|
20
20
|
if (!commonPubPause) {
|
|
21
21
|
relinka(
|
|
22
|
-
"
|
|
22
|
+
"info",
|
|
23
23
|
`\u{1F389} Build and publishing completed successfully (in ${transpileFormattedTime})`
|
|
24
24
|
);
|
|
25
25
|
} else {
|
|
26
26
|
relinka(
|
|
27
|
-
"
|
|
27
|
+
"info",
|
|
28
28
|
`\u{1F389} Test build completed successfully (in ${transpileFormattedTime})`
|
|
29
29
|
);
|
|
30
30
|
if (!isDev) {
|
|
31
31
|
relinka(
|
|
32
|
-
"
|
|
32
|
+
"warn",
|
|
33
33
|
"\u{1F4DD} Publish process is currently paused in your config file"
|
|
34
34
|
);
|
|
35
35
|
} else {
|
|
36
36
|
relinka(
|
|
37
|
-
"
|
|
37
|
+
"warn",
|
|
38
38
|
"\u{1F4DD} Publish is paused, you're in dev mode (use `bun pub` to publish)"
|
|
39
39
|
);
|
|
40
40
|
}
|
|
@@ -5,7 +5,7 @@ import path from "pathe";
|
|
|
5
5
|
import { readPackageJSON } from "pkg-types";
|
|
6
6
|
import { glob } from "tinyglobby";
|
|
7
7
|
import { cliDomainDocs, CONCURRENCY_DEFAULT } from "./utils-consts.js";
|
|
8
|
-
export async function createJsrJSON(outDirRoot, isLib, libName = "unknown-lib-name", libDescription = "unknown-lib-description") {
|
|
8
|
+
export async function createJsrJSON(outDirRoot, isLib, libName = "unknown-lib-name", libDescription = "unknown-lib-description", coreDescription) {
|
|
9
9
|
relinka("verbose", `Creating jsr.json configuration (isLib: ${isLib})`);
|
|
10
10
|
const originalPkg = await readPackageJSON();
|
|
11
11
|
let { description, name } = originalPkg;
|
|
@@ -13,6 +13,8 @@ export async function createJsrJSON(outDirRoot, isLib, libName = "unknown-lib-na
|
|
|
13
13
|
if (isLib) {
|
|
14
14
|
name = libName;
|
|
15
15
|
description = libDescription;
|
|
16
|
+
} else {
|
|
17
|
+
description = coreDescription || description;
|
|
16
18
|
}
|
|
17
19
|
const pkgHomepage = cliDomainDocs;
|
|
18
20
|
const jsrConfig = {
|
|
@@ -545,11 +545,11 @@ export async function convertImportPaths(options) {
|
|
|
545
545
|
throw error;
|
|
546
546
|
}
|
|
547
547
|
relinka(
|
|
548
|
-
"
|
|
548
|
+
"log",
|
|
549
549
|
`Starting import path conversion (${fromType} -> ${toType}) in directory: ${baseDir}`
|
|
550
550
|
);
|
|
551
551
|
if (distJsrDryRun) {
|
|
552
|
-
relinka("
|
|
552
|
+
relinka("log", "Dry run mode enabled: No files will be modified.");
|
|
553
553
|
}
|
|
554
554
|
const fileProcessor = async (filePath) => {
|
|
555
555
|
return processFileContent(
|
|
@@ -585,7 +585,7 @@ export async function convertImportPaths(options) {
|
|
|
585
585
|
).length;
|
|
586
586
|
const errorResults = results.filter((r) => !r.success);
|
|
587
587
|
relinka(
|
|
588
|
-
"
|
|
588
|
+
"log",
|
|
589
589
|
`Import path conversion finished. ${successCount} files processed successfully (${changedCount} modified), ${errorResults.length} errors.`
|
|
590
590
|
);
|
|
591
591
|
for (const result of errorResults) {
|
|
@@ -618,11 +618,11 @@ export async function convertImportExtensionsJsToTs(options) {
|
|
|
618
618
|
throw error;
|
|
619
619
|
}
|
|
620
620
|
relinka(
|
|
621
|
-
"
|
|
621
|
+
"log",
|
|
622
622
|
`Starting .js -> .ts import extension conversion in directory: ${absoluteDirPath}`
|
|
623
623
|
);
|
|
624
624
|
if (distJsrDryRun) {
|
|
625
|
-
relinka("
|
|
625
|
+
relinka("log", "Dry run mode enabled: No files will be modified.");
|
|
626
626
|
}
|
|
627
627
|
const fileProcessor = async (filePath) => {
|
|
628
628
|
return processFileContent(
|
|
@@ -645,7 +645,7 @@ export async function convertImportExtensionsJsToTs(options) {
|
|
|
645
645
|
).length;
|
|
646
646
|
const errorResults = results.filter((r) => !r.success);
|
|
647
647
|
relinka(
|
|
648
|
-
"
|
|
648
|
+
"log",
|
|
649
649
|
`Extension conversion finished. ${successCount} files processed successfully (${changedCount} modified), ${errorResults.length} errors.`
|
|
650
650
|
);
|
|
651
651
|
for (const result of errorResults) {
|
|
@@ -103,7 +103,7 @@ async function library_getlibPkgKeepDeps(libName, originalDeps, outDirBin, isJsr
|
|
|
103
103
|
return result2;
|
|
104
104
|
}
|
|
105
105
|
if (libConfig.libPkgKeepDeps === true) {
|
|
106
|
-
relinka("
|
|
106
|
+
relinka("log", `Preserving all dependencies for lib ${libName}`);
|
|
107
107
|
const originalPkg = await readPackageJSON();
|
|
108
108
|
const devDeps = originalDeps === originalPkg.devDependencies;
|
|
109
109
|
const result2 = Object.entries(originalDeps).reduce(
|
|
@@ -129,7 +129,7 @@ async function library_getlibPkgKeepDeps(libName, originalDeps, outDirBin, isJsr
|
|
|
129
129
|
}
|
|
130
130
|
if (Array.isArray(libConfig.libPkgKeepDeps)) {
|
|
131
131
|
relinka(
|
|
132
|
-
"
|
|
132
|
+
"log",
|
|
133
133
|
`Including specific dependencies for lib ${libName}: ${libConfig.libPkgKeepDeps.join(", ")}`
|
|
134
134
|
);
|
|
135
135
|
const result2 = Object.entries(originalDeps).reduce(
|
|
@@ -6,12 +6,15 @@ import {
|
|
|
6
6
|
readPackageJSON
|
|
7
7
|
} from "pkg-types";
|
|
8
8
|
import { cliDomainDocs } from "./utils-consts.js";
|
|
9
|
-
export async function regular_createPackageJSON(outDirRoot, isJsr, coreIsCLI, unifiedBundlerOutExt, rmDepsMode, rmDepsPatterns) {
|
|
9
|
+
export async function regular_createPackageJSON(outDirRoot, isJsr, coreIsCLI, unifiedBundlerOutExt, rmDepsMode, rmDepsPatterns, coreDescription) {
|
|
10
10
|
relinka(
|
|
11
|
-
"
|
|
11
|
+
"log",
|
|
12
12
|
`Generating distribution package.json and tsconfig.json (isJsr=${isJsr})...`
|
|
13
13
|
);
|
|
14
|
-
const commonPkg = await regular_createCommonPackageFields(
|
|
14
|
+
const commonPkg = await regular_createCommonPackageFields(
|
|
15
|
+
coreIsCLI,
|
|
16
|
+
coreDescription
|
|
17
|
+
);
|
|
15
18
|
const originalPkg = await readPackageJSON();
|
|
16
19
|
const packageName = originalPkg.name || "";
|
|
17
20
|
const cliCommandName = packageName.startsWith("@") ? packageName.split("/").pop() || "cli" : packageName;
|
|
@@ -104,7 +107,7 @@ export async function regular_createPackageJSON(outDirRoot, isJsr, coreIsCLI, un
|
|
|
104
107
|
}
|
|
105
108
|
relinka("verbose", `Created package.json in ${outDirRoot}`);
|
|
106
109
|
}
|
|
107
|
-
async function regular_createCommonPackageFields(coreIsCLI) {
|
|
110
|
+
async function regular_createCommonPackageFields(coreIsCLI, coreDescription) {
|
|
108
111
|
relinka("verbose", "Generating common package fields");
|
|
109
112
|
const originalPkg = await readPackageJSON();
|
|
110
113
|
const { author, description, keywords, license, name, version } = originalPkg;
|
|
@@ -112,7 +115,7 @@ async function regular_createCommonPackageFields(coreIsCLI) {
|
|
|
112
115
|
const pkgHomepage = cliDomainDocs;
|
|
113
116
|
const commonPkg = {
|
|
114
117
|
dependencies: originalPkg.dependencies || {},
|
|
115
|
-
description,
|
|
118
|
+
description: coreDescription || description,
|
|
116
119
|
homepage: pkgHomepage,
|
|
117
120
|
license: license || "MIT",
|
|
118
121
|
name,
|
package/bin/load.js
CHANGED
package/bin/mod.js
CHANGED
|
@@ -1,46 +1,14 @@
|
|
|
1
|
-
import { defineCommand,
|
|
2
|
-
import { dler } from "./cli.js";
|
|
1
|
+
import { runMain, defineCommand, defineArgs } from "@reliverse/rempts";
|
|
3
2
|
import { initDlerConfig } from "./init.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
meta: {
|
|
7
|
-
name: "dler",
|
|
8
|
-
version: "1.2.0",
|
|
9
|
-
description: "dler CLI https://docs.reliverse.org"
|
|
10
|
-
},
|
|
11
|
-
args: {
|
|
3
|
+
const main = defineCommand({
|
|
4
|
+
args: defineArgs({
|
|
12
5
|
dev: {
|
|
13
6
|
type: "boolean",
|
|
14
7
|
description: "Runs the CLI in dev mode"
|
|
15
8
|
}
|
|
16
|
-
},
|
|
17
|
-
async
|
|
18
|
-
|
|
19
|
-
await validateDevCwd(isDev, ["dler"], "dler", "reliverse");
|
|
20
|
-
await initDlerConfig(isDev);
|
|
21
|
-
await dler(isDev);
|
|
9
|
+
}),
|
|
10
|
+
async onCmdInit({ args }) {
|
|
11
|
+
await initDlerConfig(args.dev);
|
|
22
12
|
}
|
|
23
13
|
});
|
|
24
|
-
await runMain(
|
|
25
|
-
fileBasedCmds: {
|
|
26
|
-
enable: true,
|
|
27
|
-
// Enables file-based subcommand detection.
|
|
28
|
-
cmdsRootPath: "src/cli/args"
|
|
29
|
-
// Directory to scan for subcommands.
|
|
30
|
-
},
|
|
31
|
-
alias: {
|
|
32
|
-
v: "verbose"
|
|
33
|
-
// Maps shorthand flag -v to --verbose.
|
|
34
|
-
},
|
|
35
|
-
strict: false,
|
|
36
|
-
// Do not throw errors for unknown flags.
|
|
37
|
-
warnOnUnknown: false,
|
|
38
|
-
// Warn when encountering unknown flags.
|
|
39
|
-
negatedBoolean: true
|
|
40
|
-
// Support for negated booleans (e.g., --no-verbose).
|
|
41
|
-
// unknown: (flagName) => {
|
|
42
|
-
// relinka("warn", "Unknown flag encountered:", flagName);
|
|
43
|
-
// return false;
|
|
44
|
-
// },
|
|
45
|
-
// TODO: unknownErrorMsg: "An unhandled error occurred, please report it at https://github.com/reliverse/dler"
|
|
46
|
-
});
|
|
14
|
+
await runMain(main);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@reliverse/relico": "^1.1.
|
|
4
|
-
"@reliverse/relinka": "^1.4.
|
|
5
|
-
"@reliverse/rempts": "^1.
|
|
3
|
+
"@reliverse/relico": "^1.1.2",
|
|
4
|
+
"@reliverse/relinka": "^1.4.5",
|
|
5
|
+
"@reliverse/rempts": "^1.7.4",
|
|
6
6
|
"@rollup/plugin-alias": "^5.1.1",
|
|
7
7
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
8
8
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"@rollup/pluginutils": "^5.1.4",
|
|
12
12
|
"bun": "^1.2.13",
|
|
13
13
|
"chalk": "^5.4.1",
|
|
14
|
-
"commander": "^13.1.0",
|
|
15
14
|
"defu": "^6.1.4",
|
|
16
15
|
"esbuild": "^0.25.4",
|
|
17
16
|
"execa": "^9.5.3",
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
"license": "MIT",
|
|
42
41
|
"name": "@reliverse/dler",
|
|
43
42
|
"type": "module",
|
|
44
|
-
"version": "1.2.
|
|
43
|
+
"version": "1.2.3",
|
|
45
44
|
"keywords": [
|
|
46
45
|
"reliverse",
|
|
47
46
|
"cli",
|
|
@@ -67,12 +66,12 @@
|
|
|
67
66
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
68
67
|
"@types/bun": "^1.2.13",
|
|
69
68
|
"@types/fs-extra": "^11.0.4",
|
|
70
|
-
"@types/node": "^22.15.
|
|
69
|
+
"@types/node": "^22.15.18",
|
|
71
70
|
"@types/semver": "^7.7.0",
|
|
72
71
|
"eslint": "^9.26.0",
|
|
73
72
|
"eslint-plugin-no-relative-import-paths": "^1.6.1",
|
|
74
|
-
"eslint-plugin-perfectionist": "^4.
|
|
75
|
-
"knip": "^5.
|
|
73
|
+
"eslint-plugin-perfectionist": "^4.13.0",
|
|
74
|
+
"knip": "^5.56.0",
|
|
76
75
|
"typescript": "^5.8.3",
|
|
77
76
|
"typescript-eslint": "^8.32.1"
|
|
78
77
|
},
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { re } from "@reliverse/relico";
|
|
2
|
-
import { Command } from "commander";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { analyzeDependencies } from "./analyzer.js";
|
|
5
|
-
import { formatOutput } from "./formatter.js";
|
|
6
|
-
export const createCli = () => {
|
|
7
|
-
const program = new Command();
|
|
8
|
-
program.name("deps").description("Find dependencies used but not listed in package.json").version("1.0.0").option(
|
|
9
|
-
"-d, --directory <path>",
|
|
10
|
-
"directory to scan (defaults to current directory)",
|
|
11
|
-
"."
|
|
12
|
-
).option(
|
|
13
|
-
"-a, --all",
|
|
14
|
-
"show all dependencies (both listed and not listed)",
|
|
15
|
-
false
|
|
16
|
-
).option("-i, --ignore <patterns>", "comma-separated patterns to ignore", "").option("-j, --json", "output in JSON format", false).option(
|
|
17
|
-
"-b, --include-builtins",
|
|
18
|
-
"include Node.js built-in modules in the output",
|
|
19
|
-
false
|
|
20
|
-
).action(async (cmdOptions) => {
|
|
21
|
-
try {
|
|
22
|
-
const directory = path.resolve(cmdOptions.directory);
|
|
23
|
-
const ignorePatterns = cmdOptions.ignore ? cmdOptions.ignore.split(",") : [];
|
|
24
|
-
const options = {
|
|
25
|
-
directory,
|
|
26
|
-
showAll: cmdOptions.all,
|
|
27
|
-
ignorePatterns,
|
|
28
|
-
json: cmdOptions.json,
|
|
29
|
-
includeBuiltins: cmdOptions.includeBuiltins
|
|
30
|
-
};
|
|
31
|
-
console.log(re.gray(`Scanning directory: ${directory}`));
|
|
32
|
-
const result = await analyzeDependencies(options);
|
|
33
|
-
const output = formatOutput(result, options);
|
|
34
|
-
console.log(output);
|
|
35
|
-
if (result.missingDependencies.length > 0) {
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.error("Error:", error);
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return program;
|
|
44
|
-
};
|
|
45
|
-
const cli = createCli();
|
|
46
|
-
if (require.main === module) {
|
|
47
|
-
cli.parse(process.argv);
|
|
48
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { FILE_TYPES } from "./reint-impl/const.js";
|
|
2
|
-
export { gitignoreTemplate } from "./reint-impl/templates/t-gitignore.js";
|
|
3
|
-
export { licenseTemplate } from "./reint-impl/templates/t-license.js";
|
|
4
|
-
export { readmeTemplate } from "./reint-impl/templates/t-readme.js";
|
|
5
|
-
export { escapeMarkdownCodeBlocks } from "./reint-impl/utils.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./libs/reinit/reint-impl/types.js";
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import { spells } from "../../../libs/sdk/sdk-impl/spell/spell-mod.js";
|
|
3
|
-
export const createCli = () => {
|
|
4
|
-
const program = new Command();
|
|
5
|
-
program.name("dler-spells").description("Execute magic spells in your codebase").version("1.0.0");
|
|
6
|
-
program.command("trigger").description("Trigger magic spells").option(
|
|
7
|
-
"--spells <spells>",
|
|
8
|
-
'Comma-separated list of spells to execute (or "all")',
|
|
9
|
-
"all"
|
|
10
|
-
).option(
|
|
11
|
-
"--files <files>",
|
|
12
|
-
"Comma-separated list of files to process (or all if not specified)"
|
|
13
|
-
).option("--dry-run", "Preview changes without applying them", false).action(async (options) => {
|
|
14
|
-
const requestedSpells = options.spells ? options.spells.split(",") : ["all"];
|
|
15
|
-
const files = options.files ? options.files.split(",") : [];
|
|
16
|
-
console.log(`Triggering spells: ${requestedSpells.join(", ")}`);
|
|
17
|
-
if (files.length) {
|
|
18
|
-
console.log(`On files: ${files.join(", ")}`);
|
|
19
|
-
} else {
|
|
20
|
-
console.log("On all files");
|
|
21
|
-
}
|
|
22
|
-
if (options.dryRun) {
|
|
23
|
-
console.log("DRY RUN - No changes will be applied");
|
|
24
|
-
}
|
|
25
|
-
const results = await spells({
|
|
26
|
-
spells: requestedSpells,
|
|
27
|
-
files,
|
|
28
|
-
dryRun: options.dryRun
|
|
29
|
-
});
|
|
30
|
-
console.log("\nResults:");
|
|
31
|
-
for (const result of results) {
|
|
32
|
-
const status = result.success ? "\u2713" : "\u2717";
|
|
33
|
-
console.log(
|
|
34
|
-
`${status} ${result.file}: ${result.spell.type} - ${result.message}`
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
return program;
|
|
39
|
-
};
|
|
40
|
-
const cli = createCli();
|
|
41
|
-
async function main() {
|
|
42
|
-
cli.parse(process.argv);
|
|
43
|
-
}
|
|
44
|
-
await main();
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import fs from "fs-extra";
|
|
2
|
-
import {
|
|
3
|
-
getAllSourceFiles,
|
|
4
|
-
parseCommandLineArgs,
|
|
5
|
-
splitLargeFileByLines,
|
|
6
|
-
splitLargeFunctions
|
|
7
|
-
} from "./split-impl.js";
|
|
8
|
-
async function main() {
|
|
9
|
-
const { directory, fileLineThreshold, funcLineThreshold } = parseCommandLineArgs();
|
|
10
|
-
const allFiles = getAllSourceFiles(directory);
|
|
11
|
-
for (const filePath of allFiles) {
|
|
12
|
-
const lineCount = fs.readFileSync(filePath, "utf8").split("\n").length;
|
|
13
|
-
if (lineCount > fileLineThreshold) {
|
|
14
|
-
const newSplits = splitLargeFileByLines(filePath, fileLineThreshold);
|
|
15
|
-
newSplits.forEach((splitFilePath) => {
|
|
16
|
-
splitLargeFunctions(splitFilePath, funcLineThreshold);
|
|
17
|
-
});
|
|
18
|
-
} else {
|
|
19
|
-
splitLargeFunctions(filePath, funcLineThreshold);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
main().catch((err) => {
|
|
24
|
-
console.error(err);
|
|
25
|
-
process.exit(1);
|
|
26
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/bin/{cli/args/init/libs/reinit/reint-impl → app/relifso/impl}/templates/t-gitignore.js
RENAMED
|
File without changes
|
/package/bin/{cli/args/init/libs/reinit/reint-impl → app/relifso/impl}/templates/t-readme.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|