@reliverse/dler 1.7.54 → 1.7.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/app/agg/run.js
CHANGED
|
@@ -1,20 +1,63 @@
|
|
|
1
|
+
import path from "@reliverse/pathkit";
|
|
2
|
+
import fs from "@reliverse/relifso";
|
|
1
3
|
import { selectPrompt, runCmd, confirmPrompt, inputPrompt } from "@reliverse/rempts";
|
|
2
4
|
import { getAggCmd } from "../cmds.js";
|
|
3
5
|
import { getConfigDler } from "../../libs/sdk/sdk-impl/config/load.js";
|
|
6
|
+
async function fileExists(filePath) {
|
|
7
|
+
return await fs.pathExists(filePath);
|
|
8
|
+
}
|
|
9
|
+
async function findMainEntryFile(config) {
|
|
10
|
+
const { coreEntryFile, coreEntrySrcDir } = config;
|
|
11
|
+
if (coreEntryFile && coreEntrySrcDir) {
|
|
12
|
+
const configuredPath = path.join(coreEntrySrcDir, coreEntryFile);
|
|
13
|
+
if (await fileExists(configuredPath)) {
|
|
14
|
+
return configuredPath;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const fallbackPatterns = [
|
|
18
|
+
path.join(coreEntrySrcDir || "src", "mod.ts"),
|
|
19
|
+
path.join(coreEntrySrcDir || "src", "index.ts"),
|
|
20
|
+
path.join(coreEntrySrcDir || "src", "mod.js"),
|
|
21
|
+
path.join(coreEntrySrcDir || "src", "index.js")
|
|
22
|
+
];
|
|
23
|
+
for (const pattern of fallbackPatterns) {
|
|
24
|
+
if (await fileExists(pattern)) {
|
|
25
|
+
return pattern;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
4
30
|
export async function promptAggCommand() {
|
|
5
31
|
const config = await getConfigDler();
|
|
6
32
|
let selectedLibName = null;
|
|
33
|
+
const mainEntryFile = await findMainEntryFile(config);
|
|
7
34
|
if (config?.libsList && Object.keys(config.libsList).length > 0) {
|
|
8
35
|
const libs = Object.entries(config.libsList).map(([name, lib]) => ({
|
|
9
36
|
value: name,
|
|
10
37
|
label: name,
|
|
11
38
|
hint: `${config.libsDirSrc}/${lib.libDirName}/${lib.libDirName}-impl`
|
|
12
39
|
}));
|
|
13
|
-
|
|
40
|
+
if (mainEntryFile) {
|
|
41
|
+
libs.unshift({
|
|
42
|
+
value: "main",
|
|
43
|
+
label: "Main package",
|
|
44
|
+
hint: mainEntryFile
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
libs.push({ value: "", label: "Skip selection", hint: "" });
|
|
14
48
|
selectedLibName = await selectPrompt({
|
|
15
|
-
title: "Select a
|
|
49
|
+
title: "Select a package to aggregate or skip",
|
|
16
50
|
options: libs
|
|
17
51
|
});
|
|
52
|
+
} else if (mainEntryFile) {
|
|
53
|
+
const shouldUseMain = await confirmPrompt({
|
|
54
|
+
title: "Use main package for aggregation?",
|
|
55
|
+
content: `Found: ${mainEntryFile}`,
|
|
56
|
+
defaultValue: true
|
|
57
|
+
});
|
|
58
|
+
if (shouldUseMain) {
|
|
59
|
+
selectedLibName = "main";
|
|
60
|
+
}
|
|
18
61
|
}
|
|
19
62
|
let imports = false;
|
|
20
63
|
let input = "";
|
|
@@ -25,11 +68,18 @@ export async function promptAggCommand() {
|
|
|
25
68
|
let separateTypesFile = false;
|
|
26
69
|
let typesOut = "";
|
|
27
70
|
if (selectedLibName && selectedLibName !== "") {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
input =
|
|
31
|
-
out =
|
|
32
|
-
strip =
|
|
71
|
+
if (selectedLibName === "main" && mainEntryFile) {
|
|
72
|
+
const entryDir = path.dirname(mainEntryFile);
|
|
73
|
+
input = entryDir;
|
|
74
|
+
out = mainEntryFile;
|
|
75
|
+
strip = entryDir;
|
|
76
|
+
} else {
|
|
77
|
+
const libConfig = config?.libsList?.[selectedLibName];
|
|
78
|
+
if (config && libConfig) {
|
|
79
|
+
input = `${config.libsDirSrc}/${libConfig.libDirName}/${libConfig.libDirName}-impl`;
|
|
80
|
+
out = `${config.libsDirSrc}/${libConfig.libMainFile}`;
|
|
81
|
+
strip = `${config.libsDirSrc}/${libConfig.libDirName}`;
|
|
82
|
+
}
|
|
33
83
|
}
|
|
34
84
|
}
|
|
35
85
|
if (!selectedLibName || !input) {
|
|
@@ -11,10 +11,10 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
11
11
|
projectGitService?: "none" | "github" | "gitlab" | "bitbucket" | undefined;
|
|
12
12
|
projectDeployService?: "none" | "vercel" | "netlify" | "railway" | "deno" | undefined;
|
|
13
13
|
projectPackageManager?: "npm" | "bun" | "yarn" | "pnpm" | undefined;
|
|
14
|
-
projectState?: "
|
|
15
|
-
projectCategory?: "
|
|
14
|
+
projectState?: "created" | "creating" | undefined;
|
|
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?: {
|
|
@@ -34,17 +34,18 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
34
34
|
} | undefined;
|
|
35
35
|
preferredLibraries?: {
|
|
36
36
|
search?: "unknown" | "algolia" | undefined;
|
|
37
|
+
cdn?: "unknown" | "cloudflare" | undefined;
|
|
37
38
|
i18n?: "unknown" | "next-intl" | undefined;
|
|
38
39
|
analytics?: "unknown" | "vercel" | undefined;
|
|
39
40
|
authentication?: "unknown" | "better-auth" | "clerk" | "next-auth" | "supabase-auth" | "auth0" | undefined;
|
|
40
41
|
api?: "rest" | "unknown" | "hono" | "trpc" | "graphql" | undefined;
|
|
41
|
-
testing?: "bun" | "
|
|
42
|
+
testing?: "bun" | "unknown" | "vitest" | "jest" | "playwright" | "cypress" | undefined;
|
|
42
43
|
stateManagement?: "unknown" | "zustand" | "jotai" | "redux-toolkit" | undefined;
|
|
43
44
|
formManagement?: "unknown" | "react-hook-form" | "formik" | undefined;
|
|
44
|
-
styling?: "
|
|
45
|
+
styling?: "unknown" | "tailwind" | "styled-components" | "css-modules" | "sass" | undefined;
|
|
45
46
|
uiComponents?: "unknown" | "shadcn-ui" | "chakra-ui" | "material-ui" | undefined;
|
|
46
47
|
databaseLibrary?: "unknown" | "drizzle" | "prisma" | "supabase" | undefined;
|
|
47
|
-
databaseProvider?: "
|
|
48
|
+
databaseProvider?: "unknown" | "pg" | "mysql" | "sqlite" | "mongodb" | undefined;
|
|
48
49
|
linting?: "eslint" | "unknown" | undefined;
|
|
49
50
|
formatting?: "biome" | "unknown" | undefined;
|
|
50
51
|
payment?: "unknown" | "stripe" | undefined;
|
|
@@ -57,9 +58,8 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
57
58
|
documentation?: "unknown" | "starlight" | "nextra" | undefined;
|
|
58
59
|
icons?: "unknown" | "lucide" | undefined;
|
|
59
60
|
mail?: "unknown" | "resend" | undefined;
|
|
60
|
-
cache?: "
|
|
61
|
+
cache?: "unknown" | "redis" | undefined;
|
|
61
62
|
storage?: "unknown" | "cloudflare" | undefined;
|
|
62
|
-
cdn?: "unknown" | "cloudflare" | undefined;
|
|
63
63
|
cms?: "unknown" | "contentlayer" | undefined;
|
|
64
64
|
seo?: "unknown" | "next-seo" | undefined;
|
|
65
65
|
motion?: "unknown" | "framer" | undefined;
|
|
@@ -67,7 +67,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
67
67
|
dates?: "unknown" | "dayjs" | undefined;
|
|
68
68
|
markdown?: "unknown" | "mdx" | undefined;
|
|
69
69
|
security?: "unknown" | "auth" | undefined;
|
|
70
|
-
routing?: "
|
|
70
|
+
routing?: "unknown" | "next" | "react-router" | "tanstack-router" | undefined;
|
|
71
71
|
} | undefined;
|
|
72
72
|
codeStyle?: {
|
|
73
73
|
lineWidth?: number | undefined;
|
|
@@ -83,7 +83,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
83
83
|
dontRemoveComments?: boolean | undefined;
|
|
84
84
|
shouldAddComments?: boolean | undefined;
|
|
85
85
|
typeOrInterface?: "type" | "interface" | "mixed" | undefined;
|
|
86
|
-
importOrRequire?: "import" | "
|
|
86
|
+
importOrRequire?: "import" | "mixed" | "require" | undefined;
|
|
87
87
|
cjsToEsm?: boolean | undefined;
|
|
88
88
|
modernize?: {
|
|
89
89
|
replaceFs?: boolean | undefined;
|
|
@@ -111,9 +111,9 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
111
111
|
customReposOnNewProject?: boolean | undefined;
|
|
112
112
|
envComposerOpenBrowser?: boolean | undefined;
|
|
113
113
|
repoBranch?: string | undefined;
|
|
114
|
-
repoPrivacy?: "
|
|
114
|
+
repoPrivacy?: "unknown" | "public" | "private" | undefined;
|
|
115
115
|
projectArchitecture?: "unknown" | "fullstack" | "separated" | undefined;
|
|
116
|
-
projectRuntime?: "
|
|
116
|
+
projectRuntime?: "node" | "bun" | "deno" | undefined;
|
|
117
117
|
skipPromptsUseAutoBehavior?: boolean | undefined;
|
|
118
118
|
deployBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
119
119
|
depsBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|