@reliverse/dler 1.7.16 → 1.7.18
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 +134 -206
- package/bin/app/agg/run.js +2 -8
- package/bin/app/build/cmd.js +4 -4
- package/bin/app/build/impl.d.ts +2 -6
- package/bin/app/build/impl.js +2 -46
- package/bin/app/conv/cmd.d.ts +8 -33
- package/bin/app/conv/cmd.js +185 -163
- package/bin/app/copy/cmd.js +1 -1
- package/bin/app/init/init-impl.js +3 -3
- package/bin/app/init/init-types.d.ts +8 -8
- package/bin/app/merge/cmd.d.ts +10 -24
- package/bin/app/merge/cmd.js +47 -464
- package/bin/app/migrate/codemods/anything-bun.js +1 -1
- package/bin/app/migrate/codemods/fs-relifso.d.ts +2 -2
- package/bin/app/migrate/codemods/fs-relifso.js +1 -1
- package/bin/app/migrate/codemods/nodenext-bundler.d.ts +2 -2
- package/bin/app/migrate/codemods/nodenext-bundler.js +1 -1
- package/bin/app/migrate/codemods/path-pathkit.d.ts +2 -2
- package/bin/app/migrate/codemods/path-pathkit.js +1 -1
- package/bin/app/migrate/codemods/readdir-glob.d.ts +2 -2
- package/bin/app/migrate/codemods/readdir-glob.js +1 -1
- package/bin/app/mkdist/cmd.js +4 -2
- package/bin/app/pack/cmd.d.ts +44 -0
- package/bin/app/pack/cmd.js +313 -0
- package/bin/app/pub/cmd.js +4 -4
- package/bin/app/pub/impl.d.ts +7 -0
- package/bin/app/pub/impl.js +97 -0
- package/bin/app/rename/cmd.js +1 -1
- package/bin/app/spell/cmd.d.ts +14 -5
- package/bin/app/spell/cmd.js +33 -33
- package/bin/app/spell/old.js +0 -0
- package/bin/app/{mock → unpack}/cmd.d.ts +10 -14
- package/bin/app/unpack/cmd.js +200 -0
- package/bin/cli.js +2 -2
- package/bin/libs/cfg/cfg-mod.d.ts +69 -0
- package/bin/libs/cfg/cfg-mod.js +61 -0
- package/bin/libs/cfg/rse/rse-impl/rse-biome.d.ts +2 -0
- package/bin/libs/cfg/rse/rse-impl/rse-biome.js +34 -0
- package/bin/libs/cfg/rse/rse-impl/rse-consts.d.ts +35 -0
- package/bin/libs/cfg/rse/rse-impl/rse-consts.js +37 -0
- package/bin/libs/cfg/rse/rse-impl/rse-content.d.ts +14 -0
- package/bin/libs/cfg/rse/rse-impl/rse-content.js +15 -0
- package/bin/libs/cfg/rse/rse-impl/rse-core.d.ts +14 -0
- package/bin/libs/cfg/rse/rse-impl/rse-core.js +63 -0
- package/bin/libs/cfg/rse/rse-impl/rse-create.d.ts +36 -0
- package/bin/libs/cfg/rse/rse-impl/rse-create.js +254 -0
- package/bin/libs/cfg/rse/rse-impl/rse-def-utils.d.ts +6 -0
- package/bin/libs/cfg/rse/rse-impl/rse-def-utils.js +225 -0
- package/bin/libs/cfg/rse/rse-impl/rse-default.d.ts +3 -0
- package/bin/libs/cfg/rse/rse-impl/rse-default.js +155 -0
- package/bin/libs/cfg/rse/rse-impl/rse-define.d.ts +125 -0
- package/bin/libs/cfg/rse/rse-impl/rse-define.js +4 -0
- package/bin/libs/cfg/rse/rse-impl/rse-detect.d.ts +23 -0
- package/bin/libs/cfg/rse/rse-impl/rse-detect.js +347 -0
- package/bin/libs/cfg/rse/rse-impl/rse-gen-cfg.d.ts +3 -0
- package/bin/libs/cfg/rse/rse-impl/rse-gen-cfg.js +186 -0
- package/bin/libs/cfg/rse/rse-impl/rse-inject.d.ts +1 -0
- package/bin/libs/cfg/rse/rse-impl/rse-inject.js +57 -0
- package/bin/libs/cfg/rse/rse-impl/rse-migrate.d.ts +5 -0
- package/bin/libs/cfg/rse/rse-impl/rse-migrate.js +56 -0
- package/bin/libs/cfg/rse/rse-impl/rse-path.d.ts +11 -0
- package/bin/libs/cfg/rse/rse-impl/rse-path.js +33 -0
- package/bin/libs/cfg/rse/rse-impl/rse-prompts.d.ts +5 -0
- package/bin/libs/cfg/rse/rse-impl/rse-prompts.js +12 -0
- package/bin/libs/cfg/rse/rse-impl/rse-read.d.ts +11 -0
- package/bin/libs/cfg/rse/rse-impl/rse-read.js +84 -0
- package/bin/libs/cfg/rse/rse-impl/rse-repair.d.ts +16 -0
- package/bin/libs/cfg/rse/rse-impl/rse-repair.js +137 -0
- package/bin/libs/cfg/rse/rse-impl/rse-schema.d.ts +130 -0
- package/bin/libs/cfg/rse/rse-impl/rse-schema.js +444 -0
- package/bin/libs/cfg/rse/rse-impl/rse-types.d.ts +75 -0
- package/bin/libs/cfg/rse/rse-impl/rse-types.js +0 -0
- package/bin/libs/cfg/rse/rse-impl/rse-unstable.d.ts +11 -0
- package/bin/libs/cfg/rse/rse-impl/rse-unstable.js +41 -0
- package/bin/libs/cfg/rse/rse-impl/rse-update.d.ts +10 -0
- package/bin/libs/cfg/rse/rse-impl/rse-update.js +152 -0
- package/bin/libs/cfg/rse/rse-impl/rse-utils.d.ts +17 -0
- package/bin/libs/cfg/rse/rse-impl/rse-utils.js +86 -0
- package/bin/libs/cfg/rse/rse-mod.d.ts +20 -0
- package/bin/libs/cfg/rse/rse-mod.js +20 -0
- package/bin/libs/cfg/types.d.ts +533 -0
- package/bin/libs/cfg/types.js +0 -0
- package/bin/libs/sdk/sdk-impl/build/build-library.d.ts +5 -5
- package/bin/libs/sdk/sdk-impl/build/build-library.js +1 -174
- package/bin/libs/sdk/sdk-impl/build/build-regular.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.js +287 -240
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/vue.d.ts +4 -4
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.d.ts +8 -5
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.js +199 -119
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/spinner.d.ts +99 -0
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/spinner.js +206 -0
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-mod.js +92 -46
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/raw.d.ts +2 -2
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/utils.d.ts +2 -2
- package/bin/libs/sdk/sdk-impl/config/default.d.ts +6 -0
- package/bin/libs/sdk/sdk-impl/{cfg → config}/default.js +8 -18
- package/bin/libs/sdk/sdk-impl/{cfg → config}/info.js +1 -1
- package/bin/libs/sdk/sdk-impl/{cfg → config}/init.js +53 -43
- package/bin/libs/sdk/sdk-impl/{cfg → config}/load.d.ts +2 -2
- package/bin/libs/sdk/sdk-impl/{cfg → config}/load.js +6 -6
- package/bin/libs/sdk/sdk-impl/config/types.d.ts +533 -0
- package/bin/libs/sdk/sdk-impl/config/types.js +0 -0
- package/bin/libs/sdk/sdk-impl/library-flow.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/regular-flow.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/rules/reliverse/dler-config-health/dler-config-health.js +2 -2
- package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/deps-types.d.ts +6 -6
- package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/filesystem.js +1 -1
- package/bin/libs/sdk/sdk-impl/rules/reliverse/no-index-files/no-index-files.js +1 -1
- package/bin/libs/sdk/sdk-impl/rules/reliverse/self-include/self-include.js +2 -2
- package/bin/libs/sdk/sdk-impl/spell/applyMagicSpells.d.ts +38 -0
- package/bin/libs/sdk/sdk-impl/spell/applyMagicSpells.js +474 -0
- package/bin/libs/sdk/sdk-impl/spell/spells.d.ts +31 -0
- package/bin/libs/sdk/sdk-impl/spell/spells.js +85 -0
- package/bin/libs/sdk/sdk-impl/utils/binary.js +1 -1
- package/bin/libs/sdk/sdk-impl/utils/comments.d.ts +6 -0
- package/bin/libs/sdk/sdk-impl/utils/comments.js +41 -0
- package/bin/libs/sdk/sdk-impl/utils/finalize.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/utils/finalize.js +1 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-constants.d.ts +6 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-constants.js +7 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-file-utils.d.ts +5 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-file-utils.js +40 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-types.d.ts +24 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-types.js +0 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pub-json-utils.d.ts +17 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pub-json-utils.js +46 -0
- package/bin/libs/sdk/sdk-impl/utils/replacements.d.ts +0 -0
- package/bin/libs/sdk/sdk-impl/utils/replacements.js +0 -0
- package/bin/libs/sdk/sdk-impl/utils/resolve-cross-libs.d.ts +3 -0
- package/bin/libs/sdk/sdk-impl/utils/resolve-cross-libs.js +194 -0
- package/bin/libs/sdk/sdk-impl/utils/utils-build.d.ts +1 -2
- package/bin/libs/sdk/sdk-impl/utils/utils-clean.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-deps.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-determine.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-error-cwd.d.ts +4 -0
- package/bin/libs/sdk/sdk-impl/utils/utils-error-cwd.js +1 -0
- package/bin/libs/sdk/sdk-impl/utils/utils-jsr-json.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-package-json-libraries.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-package-json-regular.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-security.d.ts +1 -3
- package/bin/libs/sdk/sdk-impl/utils/utils-security.js +11 -10
- package/bin/libs/sdk/sdk-mod.d.ts +1 -6
- package/bin/libs/sdk/sdk-mod.js +0 -31
- package/bin/libs/sdk/sdk-types.d.ts +39 -582
- package/bin/mod.d.ts +1 -1
- package/bin/mod.js +1 -1
- package/package.json +12 -4
- package/bin/app/mock/cmd.js +0 -284
- package/bin/app/mock/mock.d.ts +0 -11
- package/bin/app/mock/mock.js +0 -97
- package/bin/libs/sdk/sdk-impl/cfg/default.d.ts +0 -5
- package/bin/libs/sdk/sdk-impl/cfg/define.d.ts +0 -2
- package/bin/libs/sdk/sdk-impl/cfg/define.js +0 -4
- package/bin/libs/sdk/sdk-impl/spell/spell-executors.d.ts +0 -10
- package/bin/libs/sdk/sdk-impl/spell/spell-executors.js +0 -307
- package/bin/libs/sdk/sdk-impl/spell/spell-filesystem.d.ts +0 -7
- package/bin/libs/sdk/sdk-impl/spell/spell-filesystem.js +0 -74
- package/bin/libs/sdk/sdk-impl/spell/spell-mod.d.ts +0 -4
- package/bin/libs/sdk/sdk-impl/spell/spell-mod.js +0 -87
- package/bin/libs/sdk/sdk-impl/spell/spell-parser.d.ts +0 -4
- package/bin/libs/sdk/sdk-impl/spell/spell-parser.js +0 -58
- package/bin/libs/sdk/sdk-impl/spell/spell-types.d.ts +0 -60
- /package/bin/{libs/sdk/sdk-impl/spell/spell-types.js → app/spell/old.d.ts} +0 -0
- /package/bin/libs/sdk/sdk-impl/{cfg → config}/info.d.ts +0 -0
- /package/bin/libs/sdk/sdk-impl/{cfg → config}/init.d.ts +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { RseConfig } from "./rse-types";
|
|
2
|
+
export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
3
|
+
version?: string | undefined;
|
|
4
|
+
$schema?: "./schema.json" | "https://reliverse.org/schema.json" | undefined;
|
|
5
|
+
projectName?: string | undefined;
|
|
6
|
+
projectAuthor?: string | undefined;
|
|
7
|
+
projectDescription?: string | undefined;
|
|
8
|
+
projectLicense?: string | undefined;
|
|
9
|
+
projectRepository?: string | undefined;
|
|
10
|
+
projectDomain?: string | undefined;
|
|
11
|
+
projectGitService?: "none" | "github" | "gitlab" | "bitbucket" | undefined;
|
|
12
|
+
projectDeployService?: "none" | "vercel" | "netlify" | "railway" | "deno" | undefined;
|
|
13
|
+
projectPackageManager?: "bun" | "npm" | "pnpm" | "yarn" | undefined;
|
|
14
|
+
projectState?: "creating" | "created" | undefined;
|
|
15
|
+
projectCategory?: "browser" | "cli" | "unknown" | "website" | "vscode" | "library" | "mobile" | undefined;
|
|
16
|
+
projectSubcategory?: "unknown" | "e-commerce" | "tool" | undefined;
|
|
17
|
+
projectFramework?: "rempts" | "npm-jsr" | "vue" | "unknown" | "vscode" | "nextjs" | "vite" | "svelte" | "remix" | "astro" | "nuxt" | "solid" | "qwik" | "wxt" | "lynx" | "react-native" | "expo" | "capacitor" | "ionic" | "electron" | "tauri" | "neutralino" | "citty" | "commander" | "cac" | "meow" | "yargs" | "webextension" | "browser-extension" | undefined;
|
|
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
|
+
projectTemplateDate?: string | undefined;
|
|
20
|
+
features?: {
|
|
21
|
+
i18n?: boolean | undefined;
|
|
22
|
+
analytics?: boolean | undefined;
|
|
23
|
+
themeMode?: "light" | "dark" | "dark-light" | undefined;
|
|
24
|
+
authentication?: boolean | undefined;
|
|
25
|
+
api?: boolean | undefined;
|
|
26
|
+
database?: boolean | undefined;
|
|
27
|
+
testing?: boolean | undefined;
|
|
28
|
+
docker?: boolean | undefined;
|
|
29
|
+
ci?: boolean | undefined;
|
|
30
|
+
commands?: string[] | undefined;
|
|
31
|
+
webview?: string[] | undefined;
|
|
32
|
+
language?: string[] | undefined;
|
|
33
|
+
themes?: string[] | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
preferredLibraries?: {
|
|
36
|
+
search?: "unknown" | "algolia" | undefined;
|
|
37
|
+
cdn?: "unknown" | "cloudflare" | undefined;
|
|
38
|
+
i18n?: "unknown" | "next-intl" | undefined;
|
|
39
|
+
analytics?: "unknown" | "vercel" | undefined;
|
|
40
|
+
authentication?: "unknown" | "better-auth" | "clerk" | "next-auth" | "supabase-auth" | "auth0" | undefined;
|
|
41
|
+
api?: "unknown" | "hono" | "trpc" | "graphql" | "rest" | undefined;
|
|
42
|
+
testing?: "bun" | "unknown" | "vitest" | "jest" | "playwright" | "cypress" | undefined;
|
|
43
|
+
stateManagement?: "unknown" | "zustand" | "jotai" | "redux-toolkit" | undefined;
|
|
44
|
+
formManagement?: "unknown" | "react-hook-form" | "formik" | undefined;
|
|
45
|
+
styling?: "sass" | "unknown" | "tailwind" | "styled-components" | "css-modules" | undefined;
|
|
46
|
+
uiComponents?: "unknown" | "shadcn-ui" | "chakra-ui" | "material-ui" | undefined;
|
|
47
|
+
databaseLibrary?: "unknown" | "drizzle" | "prisma" | "supabase" | undefined;
|
|
48
|
+
databaseProvider?: "unknown" | "pg" | "mysql" | "sqlite" | "mongodb" | undefined;
|
|
49
|
+
linting?: "eslint" | "unknown" | undefined;
|
|
50
|
+
formatting?: "biome" | "unknown" | undefined;
|
|
51
|
+
payment?: "unknown" | "stripe" | undefined;
|
|
52
|
+
monitoring?: "unknown" | "sentry" | undefined;
|
|
53
|
+
logging?: "unknown" | "axiom" | undefined;
|
|
54
|
+
forms?: "unknown" | "react-hook-form" | undefined;
|
|
55
|
+
notifications?: "unknown" | "sonner" | undefined;
|
|
56
|
+
uploads?: "unknown" | "uploadthing" | undefined;
|
|
57
|
+
validation?: "unknown" | "zod" | "typebox" | "valibot" | undefined;
|
|
58
|
+
documentation?: "unknown" | "starlight" | "nextra" | undefined;
|
|
59
|
+
icons?: "unknown" | "lucide" | undefined;
|
|
60
|
+
mail?: "unknown" | "resend" | undefined;
|
|
61
|
+
cache?: "unknown" | "redis" | undefined;
|
|
62
|
+
storage?: "unknown" | "cloudflare" | undefined;
|
|
63
|
+
cms?: "unknown" | "contentlayer" | undefined;
|
|
64
|
+
seo?: "unknown" | "next-seo" | undefined;
|
|
65
|
+
motion?: "unknown" | "framer" | undefined;
|
|
66
|
+
charts?: "unknown" | "recharts" | undefined;
|
|
67
|
+
dates?: "unknown" | "dayjs" | undefined;
|
|
68
|
+
markdown?: "unknown" | "mdx" | undefined;
|
|
69
|
+
security?: "unknown" | "auth" | undefined;
|
|
70
|
+
routing?: "unknown" | "next" | "react-router" | "tanstack-router" | undefined;
|
|
71
|
+
} | undefined;
|
|
72
|
+
codeStyle?: {
|
|
73
|
+
lineWidth?: number | undefined;
|
|
74
|
+
indentSize?: number | undefined;
|
|
75
|
+
indentStyle?: "space" | "tab" | undefined;
|
|
76
|
+
quoteMark?: "single" | "double" | undefined;
|
|
77
|
+
semicolons?: boolean | undefined;
|
|
78
|
+
trailingComma?: "none" | "all" | "es5" | undefined;
|
|
79
|
+
bracketSpacing?: boolean | undefined;
|
|
80
|
+
arrowParens?: "always" | "avoid" | undefined;
|
|
81
|
+
tabWidth?: number | undefined;
|
|
82
|
+
jsToTs?: boolean | undefined;
|
|
83
|
+
dontRemoveComments?: boolean | undefined;
|
|
84
|
+
shouldAddComments?: boolean | undefined;
|
|
85
|
+
typeOrInterface?: "type" | "interface" | "mixed" | undefined;
|
|
86
|
+
importOrRequire?: "mixed" | "import" | "require" | undefined;
|
|
87
|
+
cjsToEsm?: boolean | undefined;
|
|
88
|
+
modernize?: {
|
|
89
|
+
replaceFs?: boolean | undefined;
|
|
90
|
+
replacePath?: boolean | undefined;
|
|
91
|
+
replaceHttp?: boolean | undefined;
|
|
92
|
+
replaceProcess?: boolean | undefined;
|
|
93
|
+
replaceConsole?: boolean | undefined;
|
|
94
|
+
replaceEvents?: boolean | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
importSymbol?: string | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
monorepo?: {
|
|
99
|
+
type?: "none" | "bun" | "turborepo" | "nx" | "pnpm" | undefined;
|
|
100
|
+
packages?: string[] | undefined;
|
|
101
|
+
sharedPackages?: string[] | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
ignoreDependencies?: string[] | undefined;
|
|
104
|
+
customRules?: {
|
|
105
|
+
[x: string]: unknown;
|
|
106
|
+
} | undefined;
|
|
107
|
+
multipleRepoCloneMode?: boolean | undefined;
|
|
108
|
+
customUserFocusedRepos?: string[] | undefined;
|
|
109
|
+
customDevsFocusedRepos?: string[] | undefined;
|
|
110
|
+
hideRepoSuggestions?: boolean | undefined;
|
|
111
|
+
customReposOnNewProject?: boolean | undefined;
|
|
112
|
+
envComposerOpenBrowser?: boolean | undefined;
|
|
113
|
+
repoBranch?: string | undefined;
|
|
114
|
+
repoPrivacy?: "unknown" | "public" | "private" | undefined;
|
|
115
|
+
projectArchitecture?: "unknown" | "fullstack" | "separated" | undefined;
|
|
116
|
+
projectRuntime?: "bun" | "node" | "deno" | undefined;
|
|
117
|
+
skipPromptsUseAutoBehavior?: boolean | undefined;
|
|
118
|
+
deployBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
119
|
+
depsBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
120
|
+
gitBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
121
|
+
i18nBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
122
|
+
scriptsBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
123
|
+
existingRepoBehavior?: "prompt" | "autoYes" | "autoNo" | "autoYesSkipCommit" | undefined;
|
|
124
|
+
relinterConfirm?: "autoYes" | "promptOnce" | "promptEachFile" | undefined;
|
|
125
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type PackageJson } from "pkg-types";
|
|
2
|
+
import type { ProjectFramework } from "./rse-types";
|
|
3
|
+
import type { DetectedProject } from "./rse-types";
|
|
4
|
+
export declare function detectProjectFramework(projectPath: string): Promise<ProjectFramework | null>;
|
|
5
|
+
export declare function getPackageJson(projectPath: string): Promise<PackageJson | null>;
|
|
6
|
+
export declare function getPackageJsonSafe(projectPath: string): Promise<PackageJson | null>;
|
|
7
|
+
export declare function detectProject(projectPath: string, isDev: boolean): Promise<DetectedProject | null>;
|
|
8
|
+
export declare function detectProjectsWithRseConfig(projectPath: string, isDev: boolean): Promise<DetectedProject[]>;
|
|
9
|
+
export declare function detectFeatures(projectPath: string, packageJson: PackageJson | null): Promise<{
|
|
10
|
+
i18n: boolean;
|
|
11
|
+
analytics: boolean;
|
|
12
|
+
themeMode: "light" | "dark" | "dark-light";
|
|
13
|
+
authentication: boolean;
|
|
14
|
+
api: boolean;
|
|
15
|
+
database: boolean;
|
|
16
|
+
testing: boolean;
|
|
17
|
+
docker: boolean;
|
|
18
|
+
ci: boolean;
|
|
19
|
+
commands: string[];
|
|
20
|
+
webview: string[];
|
|
21
|
+
language: string[];
|
|
22
|
+
themes: string[];
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import path from "@reliverse/pathkit";
|
|
2
|
+
import fs from "@reliverse/relifso";
|
|
3
|
+
import { relinka } from "@reliverse/relinka";
|
|
4
|
+
import { readPackageJSON } from "pkg-types";
|
|
5
|
+
import { getProjectContent } from "./rse-content.js";
|
|
6
|
+
import { PROJECT_FRAMEWORK_FILES } from "./rse-default.js";
|
|
7
|
+
import { getRseConfigPath } from "./rse-path.js";
|
|
8
|
+
import { readRseConfig } from "./rse-read.js";
|
|
9
|
+
export async function detectProjectFramework(projectPath) {
|
|
10
|
+
const packageJson = await getPackageJson(projectPath);
|
|
11
|
+
if (!packageJson) {
|
|
12
|
+
for (const [type, files] of Object.entries(PROJECT_FRAMEWORK_FILES)) {
|
|
13
|
+
for (const file of files) {
|
|
14
|
+
const [filePath = file] = file.split(":");
|
|
15
|
+
if (filePath !== "package.json" && await fs.pathExists(path.join(projectPath, filePath))) {
|
|
16
|
+
return type;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const deps = {
|
|
23
|
+
...packageJson.dependencies ?? {},
|
|
24
|
+
...packageJson.devDependencies ?? {}
|
|
25
|
+
};
|
|
26
|
+
const matches = [];
|
|
27
|
+
for (const [type, files] of Object.entries(PROJECT_FRAMEWORK_FILES)) {
|
|
28
|
+
for (const file of files) {
|
|
29
|
+
const [filePath = file, packageName] = file.split(":");
|
|
30
|
+
if (filePath === "package.json" && packageName) {
|
|
31
|
+
if (packageName in deps) {
|
|
32
|
+
matches.push({ type, priority: 1 });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (matches.length > 0) {
|
|
38
|
+
const [firstMatch] = matches;
|
|
39
|
+
return firstMatch?.type ?? null;
|
|
40
|
+
}
|
|
41
|
+
for (const [type, files] of Object.entries(PROJECT_FRAMEWORK_FILES)) {
|
|
42
|
+
for (const file of files) {
|
|
43
|
+
const [filePath = file] = file.split(":");
|
|
44
|
+
if (filePath !== "package.json" && await fs.pathExists(path.join(projectPath, filePath))) {
|
|
45
|
+
return type;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
export async function getPackageJson(projectPath) {
|
|
52
|
+
try {
|
|
53
|
+
const packageJsonPath = path.join(projectPath, "package.json");
|
|
54
|
+
if (!await fs.pathExists(packageJsonPath)) return null;
|
|
55
|
+
return await readPackageJSON(projectPath);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
const packageJsonPath = path.join(projectPath, "package.json");
|
|
58
|
+
if (await fs.pathExists(packageJsonPath)) {
|
|
59
|
+
relinka(
|
|
60
|
+
"warn",
|
|
61
|
+
"Could not read package.json:",
|
|
62
|
+
error instanceof Error ? error.message : String(error)
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export async function getPackageJsonSafe(projectPath) {
|
|
69
|
+
const packageJsonPath = path.join(projectPath, "package.json");
|
|
70
|
+
if (!await fs.pathExists(packageJsonPath)) return null;
|
|
71
|
+
return await readPackageJSON(projectPath);
|
|
72
|
+
}
|
|
73
|
+
export async function detectProject(projectPath, isDev) {
|
|
74
|
+
try {
|
|
75
|
+
const { requiredContent, optionalContent } = await getProjectContent(projectPath);
|
|
76
|
+
if (!requiredContent.filePackageJson) return null;
|
|
77
|
+
const { configPath } = await getRseConfigPath(projectPath, isDev, false);
|
|
78
|
+
if (!await fs.pathExists(configPath)) return null;
|
|
79
|
+
const config = await readRseConfig(configPath, isDev);
|
|
80
|
+
if (!config) return null;
|
|
81
|
+
return {
|
|
82
|
+
name: path.basename(projectPath),
|
|
83
|
+
path: projectPath,
|
|
84
|
+
config,
|
|
85
|
+
needsDepsInstall: !optionalContent.dirNodeModules,
|
|
86
|
+
hasGit: optionalContent.dirGit
|
|
87
|
+
};
|
|
88
|
+
} catch (error) {
|
|
89
|
+
relinka(
|
|
90
|
+
"warn",
|
|
91
|
+
`Error processing ${projectPath}: ${error instanceof Error ? error.message : String(error)}`
|
|
92
|
+
);
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export async function detectProjectsWithRseConfig(projectPath, isDev) {
|
|
97
|
+
const detected = [];
|
|
98
|
+
const rootProject = await detectProject(projectPath, isDev);
|
|
99
|
+
if (rootProject) detected.push(rootProject);
|
|
100
|
+
try {
|
|
101
|
+
const items = await fs.readdir(projectPath, { withFileTypes: true });
|
|
102
|
+
const subProjects = await Promise.all(
|
|
103
|
+
items.filter((item) => item.isDirectory()).map(async (item) => {
|
|
104
|
+
const effectiveProjectPath = path.join(projectPath, item.name);
|
|
105
|
+
return await detectProject(effectiveProjectPath, isDev);
|
|
106
|
+
})
|
|
107
|
+
);
|
|
108
|
+
for (const project of subProjects) {
|
|
109
|
+
if (project) detected.push(project);
|
|
110
|
+
}
|
|
111
|
+
} catch (error) {
|
|
112
|
+
relinka(
|
|
113
|
+
"warn",
|
|
114
|
+
`Error reading directory ${projectPath}: ${error instanceof Error ? error.message : String(error)}`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return detected;
|
|
118
|
+
}
|
|
119
|
+
export async function detectFeatures(projectPath, packageJson) {
|
|
120
|
+
const deps = {
|
|
121
|
+
...packageJson?.dependencies ?? {},
|
|
122
|
+
...packageJson?.devDependencies ?? {}
|
|
123
|
+
};
|
|
124
|
+
const hasNextAuth = "next-auth" in deps;
|
|
125
|
+
const hasClerk = "@clerk/nextjs" in deps;
|
|
126
|
+
const hasBetterAuth = "better-auth" in deps;
|
|
127
|
+
const hasAuth0 = "@auth0/nextjs-auth0" in deps;
|
|
128
|
+
const hasPrisma = "@prisma/client" in deps;
|
|
129
|
+
const hasDrizzle = "drizzle-orm" in deps;
|
|
130
|
+
const hasSupabase = "@supabase/supabase-js" in deps;
|
|
131
|
+
const hasMongoose = "mongoose" in deps;
|
|
132
|
+
const hasPg = "pg" in deps || "@neondatabase/serverless" in deps;
|
|
133
|
+
const hasMysql = "mysql" in deps || "mysql2" in deps;
|
|
134
|
+
const hasSqlite = "sqlite" in deps || "sqlite3" in deps || "better-sqlite3" in deps;
|
|
135
|
+
const hasMongo = "mongodb" in deps || "mongoose" in deps;
|
|
136
|
+
const hasVercelAnalytics = "@vercel/analytics" in deps;
|
|
137
|
+
const hasSegmentAnalytics = "@segment/analytics-next" in deps;
|
|
138
|
+
const hasGoogleAnalytics = "ga-4-react" in deps || "react-ga" in deps;
|
|
139
|
+
const hasPlausible = "next-plausible" in deps;
|
|
140
|
+
const hasFathom = "fathom-client" in deps;
|
|
141
|
+
const hasZustand = "zustand" in deps;
|
|
142
|
+
const hasJotai = "jotai" in deps;
|
|
143
|
+
const hasRedux = "@reduxjs/toolkit" in deps || "redux" in deps;
|
|
144
|
+
const hasReactHookForm = "react-hook-form" in deps;
|
|
145
|
+
const hasFormik = "formik" in deps;
|
|
146
|
+
const hasTailwind = "tailwindcss" in deps;
|
|
147
|
+
const hasStyledComponents = "styled-components" in deps;
|
|
148
|
+
const hasCssModules = packageJson?.dependencies && Object.keys(deps).some((key) => key.includes("css-loader") || key.includes("css-modules"));
|
|
149
|
+
const hasSass = "sass" in deps || "node-sass" in deps;
|
|
150
|
+
const hasShadcnUi = await fs.pathExists(path.join(projectPath, "components/ui"));
|
|
151
|
+
const hasChakraUi = "@chakra-ui/react" in deps;
|
|
152
|
+
const hasMaterialUi = "@mui/material" in deps;
|
|
153
|
+
const hasBunTest = packageJson?.scripts && Object.values(packageJson.scripts).some(
|
|
154
|
+
(script) => script && typeof script === "string" && script.includes("bun test")
|
|
155
|
+
);
|
|
156
|
+
const hasVitest = "vitest" in deps;
|
|
157
|
+
const hasJest = "jest" in deps;
|
|
158
|
+
const hasPlaywright = "@playwright/test" in deps;
|
|
159
|
+
const hasCypress = "cypress" in deps;
|
|
160
|
+
const hasHono = "hono" in deps;
|
|
161
|
+
const hasTrpc = "@trpc/server" in deps;
|
|
162
|
+
const hasGraphql = "graphql" in deps || "apollo-server" in deps;
|
|
163
|
+
const hasRest = await fs.pathExists(path.join(projectPath, "src/api")) || await fs.pathExists(path.join(projectPath, "src/app/api"));
|
|
164
|
+
const hasEslint = "eslint" in deps;
|
|
165
|
+
const hasBiome = "@biomejs/biome" in deps;
|
|
166
|
+
const hasStripe = "stripe" in deps || "@stripe/stripe-js" in deps;
|
|
167
|
+
const hasSentry = "@sentry/nextjs" in deps || "@sentry/react" in deps;
|
|
168
|
+
const hasAxiom = "next-axiom" in deps;
|
|
169
|
+
const hasSonner = "sonner" in deps;
|
|
170
|
+
const hasAlgolia = "algoliasearch" in deps || "react-instantsearch" in deps;
|
|
171
|
+
const hasUploadthing = "uploadthing" in deps;
|
|
172
|
+
const hasZod = "zod" in deps;
|
|
173
|
+
const hasTypebox = "@sinclair/typebox" in deps;
|
|
174
|
+
const hasValibot = "valibot" in deps;
|
|
175
|
+
const hasStarlight = "@astrojs/starlight" in deps;
|
|
176
|
+
const hasNextra = "nextra" in deps;
|
|
177
|
+
const hasLucide = "lucide-react" in deps;
|
|
178
|
+
const hasResend = "resend" in deps;
|
|
179
|
+
const hasRedis = "redis" in deps || "@upstash/redis" in deps;
|
|
180
|
+
const hasCloudflare = "cloudflare" in deps || "@cloudflare/workers-types" in deps;
|
|
181
|
+
const hasContentlayer = "contentlayer" in deps;
|
|
182
|
+
const hasNextIntl = "next-intl" in deps;
|
|
183
|
+
const hasI18next = "i18next" in deps || "react-i18next" in deps;
|
|
184
|
+
const hasRosetta = "rosetta" in deps;
|
|
185
|
+
const hasNextSeo = "next-seo" in deps;
|
|
186
|
+
const hasFramer = "framer-motion" in deps;
|
|
187
|
+
const hasRecharts = "recharts" in deps;
|
|
188
|
+
const hasDayjs = "dayjs" in deps;
|
|
189
|
+
const hasMdx = "mdx" in deps || "@next/mdx" in deps;
|
|
190
|
+
const hasDocker = await fs.pathExists(path.join(projectPath, "Dockerfile"));
|
|
191
|
+
const hasCI = await fs.pathExists(path.join(projectPath, ".github/workflows")) || await fs.pathExists(path.join(projectPath, ".gitlab-ci.yml"));
|
|
192
|
+
const languages = ["typescript"];
|
|
193
|
+
if ("python" in deps || await fs.pathExists(path.join(projectPath, "requirements.txt"))) {
|
|
194
|
+
languages.push("python");
|
|
195
|
+
}
|
|
196
|
+
if (await fs.pathExists(path.join(projectPath, "go.mod"))) {
|
|
197
|
+
languages.push("go");
|
|
198
|
+
}
|
|
199
|
+
if (await fs.pathExists(path.join(projectPath, "Cargo.toml"))) {
|
|
200
|
+
languages.push("rust");
|
|
201
|
+
}
|
|
202
|
+
const themes = ["default"];
|
|
203
|
+
if (hasTailwind) {
|
|
204
|
+
themes.push("tailwind");
|
|
205
|
+
}
|
|
206
|
+
if (hasChakraUi) {
|
|
207
|
+
themes.push("chakra");
|
|
208
|
+
}
|
|
209
|
+
if (hasMaterialUi) {
|
|
210
|
+
themes.push("material");
|
|
211
|
+
}
|
|
212
|
+
if (hasStyledComponents) {
|
|
213
|
+
themes.push("styled-components");
|
|
214
|
+
}
|
|
215
|
+
if (hasCssModules) {
|
|
216
|
+
themes.push("css-modules");
|
|
217
|
+
}
|
|
218
|
+
if (hasSass) {
|
|
219
|
+
themes.push("sass");
|
|
220
|
+
}
|
|
221
|
+
if (hasShadcnUi) {
|
|
222
|
+
themes.push("shadcn");
|
|
223
|
+
}
|
|
224
|
+
if (hasZustand) {
|
|
225
|
+
themes.push("zustand");
|
|
226
|
+
}
|
|
227
|
+
if (hasJotai) {
|
|
228
|
+
themes.push("jotai");
|
|
229
|
+
}
|
|
230
|
+
if (hasRedux) {
|
|
231
|
+
themes.push("redux");
|
|
232
|
+
}
|
|
233
|
+
if (hasReactHookForm) {
|
|
234
|
+
themes.push("react-hook-form");
|
|
235
|
+
}
|
|
236
|
+
if (hasFormik) {
|
|
237
|
+
themes.push("formik");
|
|
238
|
+
}
|
|
239
|
+
if (hasEslint) {
|
|
240
|
+
themes.push("eslint");
|
|
241
|
+
}
|
|
242
|
+
if (hasBiome) {
|
|
243
|
+
themes.push("biome");
|
|
244
|
+
}
|
|
245
|
+
if (hasStripe) {
|
|
246
|
+
themes.push("stripe");
|
|
247
|
+
}
|
|
248
|
+
if (hasSentry) {
|
|
249
|
+
themes.push("sentry");
|
|
250
|
+
}
|
|
251
|
+
if (hasAxiom) {
|
|
252
|
+
themes.push("axiom");
|
|
253
|
+
}
|
|
254
|
+
if (hasSonner) {
|
|
255
|
+
themes.push("sonner");
|
|
256
|
+
}
|
|
257
|
+
if (hasAlgolia) {
|
|
258
|
+
themes.push("algolia");
|
|
259
|
+
}
|
|
260
|
+
if (hasUploadthing) {
|
|
261
|
+
themes.push("uploadthing");
|
|
262
|
+
}
|
|
263
|
+
if (hasZod) {
|
|
264
|
+
themes.push("zod");
|
|
265
|
+
}
|
|
266
|
+
if (hasTypebox) {
|
|
267
|
+
themes.push("typebox");
|
|
268
|
+
}
|
|
269
|
+
if (hasValibot) {
|
|
270
|
+
themes.push("valibot");
|
|
271
|
+
}
|
|
272
|
+
if (hasStarlight) {
|
|
273
|
+
themes.push("starlight");
|
|
274
|
+
}
|
|
275
|
+
if (hasNextra) {
|
|
276
|
+
themes.push("nextra");
|
|
277
|
+
}
|
|
278
|
+
if (hasLucide) {
|
|
279
|
+
themes.push("lucide");
|
|
280
|
+
}
|
|
281
|
+
if (hasResend) {
|
|
282
|
+
themes.push("resend");
|
|
283
|
+
}
|
|
284
|
+
if (hasRedis) {
|
|
285
|
+
themes.push("redis");
|
|
286
|
+
}
|
|
287
|
+
if (hasCloudflare) {
|
|
288
|
+
themes.push("cloudflare");
|
|
289
|
+
}
|
|
290
|
+
if (hasContentlayer) {
|
|
291
|
+
themes.push("contentlayer");
|
|
292
|
+
}
|
|
293
|
+
if (hasNextSeo) {
|
|
294
|
+
themes.push("next-seo");
|
|
295
|
+
}
|
|
296
|
+
if (hasFramer) {
|
|
297
|
+
themes.push("framer-motion");
|
|
298
|
+
}
|
|
299
|
+
if (hasRecharts) {
|
|
300
|
+
themes.push("recharts");
|
|
301
|
+
}
|
|
302
|
+
if (hasDayjs) {
|
|
303
|
+
themes.push("dayjs");
|
|
304
|
+
}
|
|
305
|
+
if (hasMdx) {
|
|
306
|
+
themes.push("mdx");
|
|
307
|
+
}
|
|
308
|
+
const webviews = [];
|
|
309
|
+
if ("electron" in deps) {
|
|
310
|
+
webviews.push("electron");
|
|
311
|
+
}
|
|
312
|
+
if ("tauri" in deps) {
|
|
313
|
+
webviews.push("tauri");
|
|
314
|
+
}
|
|
315
|
+
if ("capacitor" in deps) {
|
|
316
|
+
webviews.push("capacitor");
|
|
317
|
+
}
|
|
318
|
+
if ("react-native" in deps) {
|
|
319
|
+
webviews.push("react-native");
|
|
320
|
+
}
|
|
321
|
+
const commands = [];
|
|
322
|
+
if (packageJson?.scripts) {
|
|
323
|
+
for (const [name] of Object.entries(packageJson.scripts)) {
|
|
324
|
+
if (name !== "start" && name !== "build" && name !== "dev" && name !== "test") {
|
|
325
|
+
commands.push(name);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
const hasTestingFramework = !!(hasJest || hasVitest || hasPlaywright || hasCypress || hasBunTest);
|
|
330
|
+
return {
|
|
331
|
+
i18n: hasNextIntl || hasI18next || hasRosetta,
|
|
332
|
+
analytics: hasVercelAnalytics || hasSegmentAnalytics || hasGoogleAnalytics || hasPlausible || hasFathom,
|
|
333
|
+
themeMode: "dark-light",
|
|
334
|
+
authentication: hasNextAuth || hasClerk || hasBetterAuth || hasAuth0 || hasSupabase,
|
|
335
|
+
api: hasHono || hasTrpc || hasGraphql || hasRest,
|
|
336
|
+
database: hasPrisma || hasDrizzle || hasSupabase || hasMongoose || hasPg || hasMysql || hasSqlite || hasMongo,
|
|
337
|
+
testing: hasTestingFramework,
|
|
338
|
+
docker: hasDocker,
|
|
339
|
+
ci: hasCI,
|
|
340
|
+
commands: commands.slice(0, 10),
|
|
341
|
+
// Limit to 10 commands to avoid overly large configs
|
|
342
|
+
webview: webviews,
|
|
343
|
+
language: languages,
|
|
344
|
+
themes: themes.slice(0, 20)
|
|
345
|
+
// Limit to 20 themes to avoid overly large configs
|
|
346
|
+
};
|
|
347
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DeploymentService } from "./rse-types";
|
|
2
|
+
export declare function generateConfigFiles(projectPath: string, overwrite: boolean, projectName: string, deployService: DeploymentService, primaryDomain: string, frontendUsername: string, enableI18n: boolean, isDev: boolean, filesToGenerate?: string[]): Promise<void>;
|
|
3
|
+
export declare function generateProjectConfigs(projectPath: string, projectName: string, frontendUsername: string, deployService: DeploymentService, primaryDomain: string, enableI18n: boolean, isDev: boolean): Promise<void>;
|