@reliverse/config 1.5.12 → 2.2.8
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/dist/impl/build.d.ts +166 -0
- package/dist/impl/build.js +10 -0
- package/dist/impl/core.d.ts +24 -0
- package/dist/impl/core.js +36 -0
- package/dist/impl/discovery.d.ts +66 -0
- package/dist/impl/discovery.js +158 -0
- package/dist/impl/publish.d.ts +39 -0
- package/dist/impl/publish.js +11 -0
- package/dist/impl/types.d.ts +7 -0
- package/dist/impl/types.js +0 -0
- package/dist/mod.d.ts +21 -0
- package/dist/mod.js +45 -0
- package/package.json +27 -28
- package/LICENSE +0 -21
- package/README.md +0 -67
- package/bin/main.d.ts +0 -139
- package/bin/main.js +0 -417
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { type BaseConfig } from "./core.js";
|
|
2
|
+
import type { PackageKind } from "./publish.js";
|
|
3
|
+
export interface AssetOptions {
|
|
4
|
+
publicPath?: string;
|
|
5
|
+
copyFiles?: string[];
|
|
6
|
+
imageOptimization?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PerformanceBudget {
|
|
9
|
+
maxBundleSize?: number;
|
|
10
|
+
maxChunkSize?: number;
|
|
11
|
+
maxAssetSize?: number;
|
|
12
|
+
maxInitialChunkSize?: number;
|
|
13
|
+
maxAsyncChunkSize?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface HtmlOptions {
|
|
16
|
+
entryPoints?: string[];
|
|
17
|
+
inject?: boolean;
|
|
18
|
+
minify?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface DtsOptions {
|
|
21
|
+
/** Whether to generate declaration files */
|
|
22
|
+
enable?: boolean;
|
|
23
|
+
/** Provider for generating declaration files */
|
|
24
|
+
provider?: "dts-bundle-generator" | "api-extractor" | "typescript" | "mkdist";
|
|
25
|
+
/** Whether to bundle declaration files into a single file */
|
|
26
|
+
bundle?: boolean;
|
|
27
|
+
/** Output directory for declaration files (relative to package root) */
|
|
28
|
+
distPath?: string;
|
|
29
|
+
/** Whether to build with project references */
|
|
30
|
+
build?: boolean;
|
|
31
|
+
/** Whether to abort on declaration generation errors */
|
|
32
|
+
abortOnError?: boolean;
|
|
33
|
+
/** Whether to auto-set extension based on format (.d.ts, .d.mts, .d.cts) */
|
|
34
|
+
autoExtension?: boolean;
|
|
35
|
+
/** Path aliases for declaration files */
|
|
36
|
+
alias?: Record<string, string>;
|
|
37
|
+
/** Use experimental tsgo instead of TypeScript Compiler API */
|
|
38
|
+
tsgo?: boolean;
|
|
39
|
+
/** Banner content for declaration files */
|
|
40
|
+
banner?: string;
|
|
41
|
+
/** Footer content for declaration files */
|
|
42
|
+
footer?: string;
|
|
43
|
+
/** Options specific to dts-bundle-generator */
|
|
44
|
+
dtsBundleGenerator?: {
|
|
45
|
+
preferredConfigPath?: string;
|
|
46
|
+
externalInlines?: string[];
|
|
47
|
+
externalImports?: string[];
|
|
48
|
+
externalTypes?: string[];
|
|
49
|
+
umdModuleName?: string;
|
|
50
|
+
noBanner?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/** Options specific to mkdist provider */
|
|
53
|
+
mkdist?: {
|
|
54
|
+
addRelativeDeclarationExtensions?: boolean;
|
|
55
|
+
pattern?: string;
|
|
56
|
+
globOptions?: Record<string, unknown>;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface GoBuildOptions {
|
|
60
|
+
/** Whether to enable Go build */
|
|
61
|
+
enable?: boolean;
|
|
62
|
+
/** Build provider: xgo (cross-compilation) or native (limited cross-compilation) */
|
|
63
|
+
provider?: "xgo" | "native";
|
|
64
|
+
/** Target platforms (e.g., "linux/amd64" or ["linux/amd64", "windows/amd64"]) */
|
|
65
|
+
targets?: string | string[];
|
|
66
|
+
/** Output directory for Go binaries (relative to package root, default: "release") */
|
|
67
|
+
outputDir?: string;
|
|
68
|
+
/** Output binary name prefix (default: derived from package name) */
|
|
69
|
+
outputName?: string;
|
|
70
|
+
/** Go build mode: c-shared, c-archive, or exe */
|
|
71
|
+
buildMode?: "c-shared" | "c-archive" | "exe";
|
|
72
|
+
/** Linker flags (default: "-s -w") */
|
|
73
|
+
ldflags?: string;
|
|
74
|
+
/** Main Go file to build (default: "main.go") */
|
|
75
|
+
mainFile?: string;
|
|
76
|
+
/** Go version for xgo (default: "1.20.3") */
|
|
77
|
+
goVersion?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface PackageBuildConfig {
|
|
80
|
+
enable?: boolean;
|
|
81
|
+
bundler?: "bun" | "mkdist";
|
|
82
|
+
target?: "browser" | "bun" | "node";
|
|
83
|
+
format?: "esm" | "cjs" | "iife";
|
|
84
|
+
minify?: boolean | {
|
|
85
|
+
whitespace?: boolean;
|
|
86
|
+
syntax?: boolean;
|
|
87
|
+
identifiers?: boolean;
|
|
88
|
+
};
|
|
89
|
+
sourcemap?: string | boolean;
|
|
90
|
+
splitting?: boolean;
|
|
91
|
+
external?: string | string[];
|
|
92
|
+
bytecode?: boolean;
|
|
93
|
+
drop?: string | string[];
|
|
94
|
+
packages?: string;
|
|
95
|
+
publicPath?: string;
|
|
96
|
+
root?: string;
|
|
97
|
+
define?: Record<string, string>;
|
|
98
|
+
naming?: {
|
|
99
|
+
chunk?: string;
|
|
100
|
+
entry?: string;
|
|
101
|
+
asset?: string;
|
|
102
|
+
};
|
|
103
|
+
env?: string | Record<string, string>;
|
|
104
|
+
banner?: string | Record<string, string>;
|
|
105
|
+
footer?: string | Record<string, string>;
|
|
106
|
+
conditions?: string | string[];
|
|
107
|
+
loader?: Record<string, string>;
|
|
108
|
+
ignoreDCEAnnotations?: boolean;
|
|
109
|
+
emitDCEAnnotations?: boolean;
|
|
110
|
+
throw?: boolean;
|
|
111
|
+
jsx?: string | {
|
|
112
|
+
factory?: string;
|
|
113
|
+
fragment?: string;
|
|
114
|
+
importSource?: string;
|
|
115
|
+
pragma?: string;
|
|
116
|
+
pragmaFrag?: string;
|
|
117
|
+
runtime?: "automatic" | "classic";
|
|
118
|
+
development?: boolean;
|
|
119
|
+
};
|
|
120
|
+
keepNames?: boolean;
|
|
121
|
+
html?: boolean | HtmlOptions;
|
|
122
|
+
assets?: AssetOptions;
|
|
123
|
+
cssChunking?: boolean;
|
|
124
|
+
macros?: boolean;
|
|
125
|
+
sideEffects?: boolean | string[];
|
|
126
|
+
bundleAnalyzer?: boolean;
|
|
127
|
+
typeCheck?: boolean;
|
|
128
|
+
generateTypes?: boolean;
|
|
129
|
+
performanceBudget?: PerformanceBudget;
|
|
130
|
+
imageOptimization?: boolean;
|
|
131
|
+
fontOptimization?: boolean;
|
|
132
|
+
cssOptimization?: boolean;
|
|
133
|
+
svgAsReact?: boolean;
|
|
134
|
+
cssModules?: boolean;
|
|
135
|
+
workerSupport?: boolean;
|
|
136
|
+
compile?: boolean;
|
|
137
|
+
windowsHideConsole?: boolean;
|
|
138
|
+
windowsIcon?: string;
|
|
139
|
+
windowsTitle?: string;
|
|
140
|
+
windowsPublisher?: string;
|
|
141
|
+
windowsVersion?: string;
|
|
142
|
+
windowsDescription?: string;
|
|
143
|
+
windowsCopyright?: string;
|
|
144
|
+
dts?: boolean | DtsOptions;
|
|
145
|
+
go?: GoBuildOptions;
|
|
146
|
+
kind?: PackageKind;
|
|
147
|
+
bin?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface BuildConfig extends BaseConfig {
|
|
150
|
+
global?: PackageBuildConfig;
|
|
151
|
+
packages?: Record<string, PackageBuildConfig>;
|
|
152
|
+
patterns?: Array<{
|
|
153
|
+
pattern: string;
|
|
154
|
+
config: PackageBuildConfig;
|
|
155
|
+
}>;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get package-specific build configuration from dler.ts
|
|
159
|
+
*/
|
|
160
|
+
export declare const getPackageBuildConfig: (packageName: string, dlerConfig: {
|
|
161
|
+
build?: BuildConfig;
|
|
162
|
+
} | null) => Promise<PackageBuildConfig | undefined>;
|
|
163
|
+
/**
|
|
164
|
+
* Merge build options with package-specific configuration
|
|
165
|
+
*/
|
|
166
|
+
export declare const mergeBuildOptions: <T extends Record<string, any>>(cliOptions: T, packageConfig?: PackageBuildConfig) => T;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { mergeConfig, resolvePackageConfig } from "./core.js";
|
|
2
|
+
export const getPackageBuildConfig = async (packageName, dlerConfig) => {
|
|
3
|
+
return resolvePackageConfig(
|
|
4
|
+
packageName,
|
|
5
|
+
dlerConfig?.build
|
|
6
|
+
);
|
|
7
|
+
};
|
|
8
|
+
export const mergeBuildOptions = (cliOptions, packageConfig) => {
|
|
9
|
+
return mergeConfig(cliOptions, packageConfig);
|
|
10
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BuildConfig } from "./build.js";
|
|
2
|
+
import type { PublishConfig } from "./publish.js";
|
|
3
|
+
export interface BaseConfig {
|
|
4
|
+
global?: Record<string, any>;
|
|
5
|
+
packages?: Record<string, Record<string, any>>;
|
|
6
|
+
patterns?: Array<{
|
|
7
|
+
pattern: string;
|
|
8
|
+
config: Record<string, any>;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export interface DlerConfig {
|
|
12
|
+
build?: BuildConfig;
|
|
13
|
+
publish?: PublishConfig;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Generic function to resolve package-specific configuration using pattern matching
|
|
17
|
+
* Priority: packages (exact match) → patterns (glob match) → global
|
|
18
|
+
*/
|
|
19
|
+
export declare const resolvePackageConfig: <T extends Record<string, any>>(packageName: string, config: BaseConfig | null | undefined) => T | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Generic function to merge configuration options
|
|
22
|
+
* CLI options take precedence over config options
|
|
23
|
+
*/
|
|
24
|
+
export declare const mergeConfig: <T extends Record<string, any>>(cliOptions: T, configOptions?: Record<string, any>) => T;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const resolvePackageConfig = (packageName, config) => {
|
|
2
|
+
if (!config) {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
if (config.packages?.[packageName]) {
|
|
6
|
+
const packageConfig = config.packages[packageName];
|
|
7
|
+
if (packageConfig.enable === false) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
return packageConfig;
|
|
11
|
+
}
|
|
12
|
+
if (config.patterns) {
|
|
13
|
+
for (const { pattern, config: patternConfig } of config.patterns) {
|
|
14
|
+
const regexPattern = pattern.replace(/\*/g, ".*");
|
|
15
|
+
const patternWithoutWildcards = pattern.replace(/\*/g, "");
|
|
16
|
+
if (patternWithoutWildcards && packageName.includes(patternWithoutWildcards) || new RegExp(regexPattern).test(packageName)) {
|
|
17
|
+
if (patternConfig.enable === false) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
return patternConfig;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const globalConfig = config.global;
|
|
25
|
+
if (globalConfig?.enable === false) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
return globalConfig;
|
|
29
|
+
};
|
|
30
|
+
export const mergeConfig = (cliOptions, configOptions) => {
|
|
31
|
+
if (!configOptions) return cliOptions;
|
|
32
|
+
return {
|
|
33
|
+
...configOptions,
|
|
34
|
+
...cliOptions
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find monorepo root by looking for package.json with workspaces field
|
|
3
|
+
*/
|
|
4
|
+
export declare const findMonorepoRoot: (cwd?: string) => Promise<string | null>;
|
|
5
|
+
/**
|
|
6
|
+
* Get workspace patterns from package.json
|
|
7
|
+
*/
|
|
8
|
+
export declare const getWorkspacePatterns: (pkg: any) => string[];
|
|
9
|
+
/**
|
|
10
|
+
* Check if package has workspaces
|
|
11
|
+
*/
|
|
12
|
+
export declare const hasWorkspaces: (pkg: any) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve package info for a given path
|
|
15
|
+
*/
|
|
16
|
+
export declare const resolvePackageInfo: (packagePath: string) => Promise<{
|
|
17
|
+
name: string;
|
|
18
|
+
path: string;
|
|
19
|
+
pkg: any;
|
|
20
|
+
} | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Get all workspace packages
|
|
23
|
+
*/
|
|
24
|
+
export declare const getWorkspacePackages: (cwd?: string) => Promise<{
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
pkg: any;
|
|
28
|
+
}[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Filter packages based on ignore patterns or include filter
|
|
31
|
+
*/
|
|
32
|
+
export declare const filterPackages: (packages: {
|
|
33
|
+
name: string;
|
|
34
|
+
path: string;
|
|
35
|
+
pkg: any;
|
|
36
|
+
}[], ignore?: string | string[], filter?: string | string[]) => {
|
|
37
|
+
name: string;
|
|
38
|
+
path: string;
|
|
39
|
+
pkg: any;
|
|
40
|
+
}[];
|
|
41
|
+
/**
|
|
42
|
+
* Load dler.ts configuration using c12
|
|
43
|
+
*
|
|
44
|
+
* c12 automatically handles:
|
|
45
|
+
* - Searching up directory tree for config files
|
|
46
|
+
* - Loading TypeScript/JavaScript config files
|
|
47
|
+
* - Merging multiple config sources (dler.ts, package.json, .dlerrc, etc.)
|
|
48
|
+
* - Environment-specific configurations ($test, $development, $production)
|
|
49
|
+
* - Config extending from remote/local sources
|
|
50
|
+
*
|
|
51
|
+
* Additional c12 features available:
|
|
52
|
+
* - .config/ directory support
|
|
53
|
+
* - RC file support (.dlerrc)
|
|
54
|
+
* - Environment-specific configs ($env: { staging: {...} })
|
|
55
|
+
* - Config watching with auto-reload
|
|
56
|
+
* - Remote config extending (gh:user/repo)
|
|
57
|
+
*/
|
|
58
|
+
export declare const loadDlerConfig: <T extends Record<string, any> = any>(cwd?: string) => Promise<T | null>;
|
|
59
|
+
/**
|
|
60
|
+
* Watch dler.ts configuration for changes (development mode)
|
|
61
|
+
* Uses c12's watchConfig for auto-reload and HMR support
|
|
62
|
+
*/
|
|
63
|
+
export declare const watchDlerConfig: <T extends Record<string, any> = any>(cwd?: string, options?: {
|
|
64
|
+
onUpdate?: (config: T) => void;
|
|
65
|
+
onError?: (error: Error) => void;
|
|
66
|
+
}) => Promise<import("c12").ConfigWatcher<T, import("c12").ConfigLayerMeta>>;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { dirname, resolve } from "node:path";
|
|
2
|
+
import { createIncludeFilter } from "@reliverse/matcha";
|
|
3
|
+
import { readPackageJSON } from "@reliverse/typerso";
|
|
4
|
+
import { loadConfig, watchConfig } from "c12";
|
|
5
|
+
export const findMonorepoRoot = async (cwd) => {
|
|
6
|
+
let currentDir = cwd || process.cwd();
|
|
7
|
+
const maxDepth = 10;
|
|
8
|
+
let depth = 0;
|
|
9
|
+
while (depth < maxDepth) {
|
|
10
|
+
try {
|
|
11
|
+
const pkg = await readPackageJSON(currentDir);
|
|
12
|
+
if (pkg?.workspaces) {
|
|
13
|
+
return currentDir;
|
|
14
|
+
}
|
|
15
|
+
} catch {
|
|
16
|
+
}
|
|
17
|
+
const parentDir = dirname(currentDir);
|
|
18
|
+
if (parentDir === currentDir) {
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
currentDir = parentDir;
|
|
22
|
+
depth++;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
};
|
|
26
|
+
export const getWorkspacePatterns = (pkg) => {
|
|
27
|
+
if (!pkg.workspaces) return [];
|
|
28
|
+
if (Array.isArray(pkg.workspaces)) {
|
|
29
|
+
return pkg.workspaces;
|
|
30
|
+
}
|
|
31
|
+
if (pkg.workspaces.packages) {
|
|
32
|
+
return pkg.workspaces.packages;
|
|
33
|
+
}
|
|
34
|
+
return [];
|
|
35
|
+
};
|
|
36
|
+
export const hasWorkspaces = (pkg) => {
|
|
37
|
+
return !!(pkg.workspaces && (Array.isArray(pkg.workspaces) || typeof pkg.workspaces === "object" && pkg.workspaces.packages));
|
|
38
|
+
};
|
|
39
|
+
export const resolvePackageInfo = async (packagePath) => {
|
|
40
|
+
try {
|
|
41
|
+
const pkg = await readPackageJSON(packagePath);
|
|
42
|
+
if (!pkg || !pkg.name) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
name: pkg.name,
|
|
47
|
+
path: packagePath,
|
|
48
|
+
pkg
|
|
49
|
+
};
|
|
50
|
+
} catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export const getWorkspacePackages = async (cwd) => {
|
|
55
|
+
const monorepoRoot = await findMonorepoRoot(cwd);
|
|
56
|
+
if (!monorepoRoot) {
|
|
57
|
+
const currentDir = cwd || process.cwd();
|
|
58
|
+
const currentPkg = await readPackageJSON(currentDir);
|
|
59
|
+
if (currentPkg?.name) {
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
name: currentPkg.name,
|
|
63
|
+
path: currentDir,
|
|
64
|
+
pkg: currentPkg
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
throw new Error(
|
|
69
|
+
"\u274C No monorepo or valid package found. Ensure package.json has 'workspaces' field or contains a valid 'name' field."
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
const rootPkg = await readPackageJSON(monorepoRoot);
|
|
73
|
+
if (!rootPkg) {
|
|
74
|
+
throw new Error("\u274C Could not read root package.json");
|
|
75
|
+
}
|
|
76
|
+
const patterns = getWorkspacePatterns(rootPkg);
|
|
77
|
+
if (!patterns.length) {
|
|
78
|
+
throw new Error("\u274C No workspace patterns found in package.json");
|
|
79
|
+
}
|
|
80
|
+
const packages = [];
|
|
81
|
+
const seenPaths = /* @__PURE__ */ new Set();
|
|
82
|
+
for (const pattern of patterns) {
|
|
83
|
+
if (pattern.includes("*")) {
|
|
84
|
+
const glob = new Bun.Glob(pattern);
|
|
85
|
+
const matches = glob.scanSync({ cwd: monorepoRoot, onlyFiles: false });
|
|
86
|
+
for (const match of matches) {
|
|
87
|
+
const packagePath = resolve(monorepoRoot, match);
|
|
88
|
+
if (seenPaths.has(packagePath)) continue;
|
|
89
|
+
seenPaths.add(packagePath);
|
|
90
|
+
const pkgInfo = await resolvePackageInfo(packagePath);
|
|
91
|
+
if (pkgInfo) {
|
|
92
|
+
packages.push(pkgInfo);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
const packagePath = resolve(monorepoRoot, pattern);
|
|
97
|
+
if (seenPaths.has(packagePath)) continue;
|
|
98
|
+
seenPaths.add(packagePath);
|
|
99
|
+
const pkgInfo = await resolvePackageInfo(packagePath);
|
|
100
|
+
if (pkgInfo) {
|
|
101
|
+
packages.push(pkgInfo);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const filteredPackages = packages.filter((pkg) => {
|
|
106
|
+
const normalizedPkgPath = resolve(pkg.path);
|
|
107
|
+
const normalizedRootPath = resolve(monorepoRoot);
|
|
108
|
+
return normalizedPkgPath !== normalizedRootPath;
|
|
109
|
+
});
|
|
110
|
+
return filteredPackages;
|
|
111
|
+
};
|
|
112
|
+
export const filterPackages = (packages, ignore, filter) => {
|
|
113
|
+
if (filter) {
|
|
114
|
+
const includeFilter = createIncludeFilter(filter);
|
|
115
|
+
return includeFilter(packages);
|
|
116
|
+
}
|
|
117
|
+
if (!ignore) return packages;
|
|
118
|
+
const ignorePatterns = Array.isArray(ignore) ? ignore : [ignore];
|
|
119
|
+
return packages.filter((pkg) => {
|
|
120
|
+
return !ignorePatterns.some((pattern) => {
|
|
121
|
+
if (pattern.includes("*")) {
|
|
122
|
+
const regex = new RegExp(pattern.replace(/\*/g, ".*"));
|
|
123
|
+
return regex.test(pkg.name);
|
|
124
|
+
}
|
|
125
|
+
return pkg.name === pattern;
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
export const loadDlerConfig = async (cwd) => {
|
|
130
|
+
try {
|
|
131
|
+
const { config } = await loadConfig({
|
|
132
|
+
cwd: cwd || process.cwd(),
|
|
133
|
+
name: "dler",
|
|
134
|
+
configFile: "dler",
|
|
135
|
+
packageJson: "dler",
|
|
136
|
+
// Enable reading from package.json "dler" field
|
|
137
|
+
dotenv: false
|
|
138
|
+
});
|
|
139
|
+
return config || null;
|
|
140
|
+
} catch (_error) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
export const watchDlerConfig = (cwd, options) => {
|
|
145
|
+
return watchConfig({
|
|
146
|
+
cwd: cwd || process.cwd(),
|
|
147
|
+
name: "dler",
|
|
148
|
+
configFile: "dler",
|
|
149
|
+
packageJson: "dler",
|
|
150
|
+
dotenv: false,
|
|
151
|
+
onUpdate: ({ newConfig }) => {
|
|
152
|
+
options?.onUpdate?.(newConfig.config);
|
|
153
|
+
},
|
|
154
|
+
onWatch: (event) => {
|
|
155
|
+
console.log("[dler config watcher]", event.type, event.path);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type BaseConfig } from "./core.js";
|
|
2
|
+
import type { BumpType } from "./types.js";
|
|
3
|
+
export type RegistryType = "npm" | "jsr" | "vercel" | "npm-jsr" | "none";
|
|
4
|
+
export type PackageKind = "library" | "browser-app" | "native-app" | "cli";
|
|
5
|
+
export interface PackagePublishConfig {
|
|
6
|
+
enable?: boolean;
|
|
7
|
+
dryRun?: boolean;
|
|
8
|
+
tag?: string;
|
|
9
|
+
access?: "public" | "restricted";
|
|
10
|
+
otp?: string;
|
|
11
|
+
authType?: "web" | "legacy";
|
|
12
|
+
concurrency?: number;
|
|
13
|
+
verbose?: boolean;
|
|
14
|
+
bump?: BumpType;
|
|
15
|
+
bumpDisable?: boolean;
|
|
16
|
+
registry?: RegistryType;
|
|
17
|
+
kind?: PackageKind;
|
|
18
|
+
bin?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PublishConfig extends BaseConfig {
|
|
21
|
+
global?: PackagePublishConfig;
|
|
22
|
+
packages?: Record<string, PackagePublishConfig>;
|
|
23
|
+
patterns?: Array<{
|
|
24
|
+
pattern: string;
|
|
25
|
+
config: PackagePublishConfig;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get package-specific publish configuration from dler.ts
|
|
30
|
+
*/
|
|
31
|
+
export declare const getPackagePublishConfig: (packageName: string, dlerConfig: {
|
|
32
|
+
publish?: PublishConfig;
|
|
33
|
+
} | null) => PackagePublishConfig | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Merge CLI options with dler.ts configuration
|
|
36
|
+
*/
|
|
37
|
+
export declare const mergePublishOptions: <T extends Record<string, any>>(cliOptions: T, packageName: string, dlerConfig: {
|
|
38
|
+
publish?: PublishConfig;
|
|
39
|
+
} | null) => T;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mergeConfig, resolvePackageConfig } from "./core.js";
|
|
2
|
+
export const getPackagePublishConfig = (packageName, dlerConfig) => {
|
|
3
|
+
return resolvePackageConfig(
|
|
4
|
+
packageName,
|
|
5
|
+
dlerConfig?.publish
|
|
6
|
+
);
|
|
7
|
+
};
|
|
8
|
+
export const mergePublishOptions = (cliOptions, packageName, dlerConfig) => {
|
|
9
|
+
const packageConfig = getPackagePublishConfig(packageName, dlerConfig);
|
|
10
|
+
return mergeConfig(cliOptions, packageConfig);
|
|
11
|
+
};
|
|
File without changes
|
package/dist/mod.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BumpType, VersionInfo } from "./impl/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse and validate a semver version string
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseVersion(version: string): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Bump a version string according to the specified type
|
|
8
|
+
*/
|
|
9
|
+
export declare function bumpVersion(currentVersion: string, type: BumpType): VersionInfo | null;
|
|
10
|
+
/**
|
|
11
|
+
* Get the next version for a given type without bumping
|
|
12
|
+
*/
|
|
13
|
+
export declare function getNextVersion(currentVersion: string, type: BumpType): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a version is a prerelease
|
|
16
|
+
*/
|
|
17
|
+
export declare function isPrerelease(version: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Get the release type of a version (major, minor, patch)
|
|
20
|
+
*/
|
|
21
|
+
export declare function getReleaseType(version: string): "major" | "minor" | "patch" | null;
|
package/dist/mod.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { inc, parse, valid } from "semver";
|
|
2
|
+
export function parseVersion(version) {
|
|
3
|
+
if (!valid(version)) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
return version;
|
|
7
|
+
}
|
|
8
|
+
export function bumpVersion(currentVersion, type) {
|
|
9
|
+
const parsed = parse(currentVersion);
|
|
10
|
+
if (!parsed) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const bumped = inc(parsed, type);
|
|
14
|
+
if (!bumped) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
current: currentVersion,
|
|
19
|
+
bumped,
|
|
20
|
+
type
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function getNextVersion(currentVersion, type) {
|
|
24
|
+
const parsed = parse(currentVersion);
|
|
25
|
+
if (!parsed) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return inc(parsed, type) || null;
|
|
29
|
+
}
|
|
30
|
+
export function isPrerelease(version) {
|
|
31
|
+
if (!version.includes("-")) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const parsed = parse(version);
|
|
35
|
+
return parsed ? parsed.prerelease.length > 0 : false;
|
|
36
|
+
}
|
|
37
|
+
export function getReleaseType(version) {
|
|
38
|
+
const parsed = parse(version);
|
|
39
|
+
if (!parsed) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
if (parsed.major > 0) return "major";
|
|
43
|
+
if (parsed.minor > 0) return "minor";
|
|
44
|
+
return "patch";
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reliverse/config",
|
|
3
|
-
"
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"description": "Configuration utilities for @reliverse/cli",
|
|
6
|
-
"type": "module",
|
|
3
|
+
"description": "Configuration management for Reliverse ecosystem",
|
|
7
4
|
"author": "reliverse",
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/reliverse/cli/issues",
|
|
14
|
-
"email": "blefnk@gmail.com"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"cli",
|
|
18
|
-
"reliverse"
|
|
19
|
-
],
|
|
20
|
-
"main": "./bin/main.js",
|
|
21
|
-
"module": "./bin/main.js",
|
|
5
|
+
"version": "2.2.8",
|
|
6
|
+
"private": false,
|
|
7
|
+
"type": "module",
|
|
22
8
|
"exports": {
|
|
23
|
-
".":
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/mod.d.ts",
|
|
11
|
+
"default": "./dist/mod.js"
|
|
12
|
+
},
|
|
13
|
+
"./impl/*": {
|
|
14
|
+
"types": "./dist/impl/*.d.ts",
|
|
15
|
+
"default": "./dist/impl/*.js"
|
|
16
|
+
}
|
|
24
17
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"c12": "^3.3.3",
|
|
20
|
+
"semver": "^7.7.3",
|
|
21
|
+
"@reliverse/matcha": "2.2.8",
|
|
22
|
+
"@reliverse/typerso": "2.2.8"
|
|
27
23
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
24
|
+
"keywords": [
|
|
25
|
+
"dler",
|
|
26
|
+
"config",
|
|
27
|
+
"build",
|
|
28
|
+
"publish"
|
|
33
29
|
],
|
|
34
30
|
"publishConfig": {
|
|
35
31
|
"access": "public"
|
|
36
32
|
},
|
|
37
|
-
"
|
|
38
|
-
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"package.json"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT"
|
|
39
38
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Nazarii Korniienko
|
|
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.
|
package/README.md
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# @reliverse/cli
|
|
2
|
-
|
|
3
|
-
[📦 NPM](https://npmjs.com/@reliverse/cli) • [💬 Discord Community](https://discord.gg/Pb8uKbwpsJ) • [💖 Support on Patreon](https://patreon.com/blefnk) • [📚 Documentation](https://docs.reliverse.org/cli)
|
|
4
|
-
|
|
5
|
-
## Quick Start
|
|
6
|
-
|
|
7
|
-
_Prerequisites: [Git](https://git-scm.com/downloads), [Node.js](https://nodejs.org), [Bun](https://bun.sh)_
|
|
8
|
-
|
|
9
|
-
1️⃣ **Install**: `bun i -g @reliverse/cli` (or `reliverse update`) • 2️⃣ **Use**: `reliverse cli`
|
|
10
|
-
|
|
11
|
-
## Introduction
|
|
12
|
-
|
|
13
|
-
**Reliverse CLI** is your all-in-one command-line companion for _setting up_ and _enhancing_ web projects. Starting fresh or upgrading an existing app? This tool helps you:
|
|
14
|
-
|
|
15
|
-
- **Effortlessly create projects**: Spin up new web apps or import existing templates in a flash.
|
|
16
|
-
- **Apply powerful codemods**: Safely refactor code and integrate popular libraries.
|
|
17
|
-
- **Automate configuration**: Set up ESLint, Biome, env files, and more.
|
|
18
|
-
- **Support multiple frameworks**: Enjoy seamless compatibility with Next.js and beyond.
|
|
19
|
-
- **Customize with templates**: Clone pre-built templates and merge them conflict-free.
|
|
20
|
-
- **Automate GitHub & deployments**: Quickly create GitHub repositories, push commits, and deploy to Vercel.
|
|
21
|
-
- **Reliverse Addons**: `🔬 Open manual builder mode` to enable even more features and integrations.
|
|
22
|
-
|
|
23
|
-
## Commands
|
|
24
|
-
|
|
25
|
-
- `reliverse cli`
|
|
26
|
-
Start the interactive wizard to create or configure a project.
|
|
27
|
-
|
|
28
|
-
- `reliverse login` / `reliverse logout`
|
|
29
|
-
Log in or out of Reliverse services.
|
|
30
|
-
|
|
31
|
-
- `reliverse studio`
|
|
32
|
-
Launch the Reliverse Studio interface.
|
|
33
|
-
|
|
34
|
-
- `reliverse --help`
|
|
35
|
-
Display all available commands and usage info.
|
|
36
|
-
|
|
37
|
-
## Configuration
|
|
38
|
-
|
|
39
|
-
When you run `reliverse cli`, a `reliverse.jsonc` or `reliverse.ts` file is created in your project root. You can edit it at any time to customize your CLI behavior. Simply restart the CLI to apply changes.
|
|
40
|
-
|
|
41
|
-
## Installing Other Templates
|
|
42
|
-
|
|
43
|
-
Use `reliverse cli` to clone any public GitHub repository:
|
|
44
|
-
|
|
45
|
-
1️⃣ Choose “Clone an existing repository” • 3️⃣ Provide the repository link • 4️⃣ Reliverse will clone and configure it automatically.
|
|
46
|
-
|
|
47
|
-
## Collaborate & Contribute
|
|
48
|
-
|
|
49
|
-
We love community input! Check out our [Contributing Guide](https://docs.reliverse.org/intro/contributing/) for how to get involved or propose new features.
|
|
50
|
-
|
|
51
|
-
If you’re interested in deeper collaboration or partnership, [join our Discord community](https://discord.gg/Pb8uKbwpsJ) to chat with us directly.
|
|
52
|
-
|
|
53
|
-
## Support
|
|
54
|
-
|
|
55
|
-
If Reliverse saves you time and effort, please consider supporting its development:
|
|
56
|
-
|
|
57
|
-
- [GitHub Sponsors](https://github.com/sponsors/blefnk)
|
|
58
|
-
- [Patreon](https://patreon.com/blefnk)
|
|
59
|
-
- [PayPal](https://paypal.me/blefony)
|
|
60
|
-
|
|
61
|
-
Even a simple ⭐ on [GitHub](https://github.com/reliverse/cli) shows your love!
|
|
62
|
-
|
|
63
|
-
Thanks! Happy Reliversing!
|
|
64
|
-
|
|
65
|
-
## License
|
|
66
|
-
|
|
67
|
-
[MIT](LICENSE) © 2025 [blefnk Nazarii Korniienko](https://github.com/blefnk)
|
package/bin/main.d.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { type Static } from "@sinclair/typebox";
|
|
2
|
-
export declare const reliverseConfigSchema: import("@sinclair/typebox").TObject<{
|
|
3
|
-
$schema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"https://reliverse.org/schema.json">, import("@sinclair/typebox").TLiteral<"./schema.json">]>;
|
|
4
|
-
projectName: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"unknown">, import("@sinclair/typebox").TString]>;
|
|
5
|
-
projectAuthor: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"unknown">, import("@sinclair/typebox").TString]>;
|
|
6
|
-
projectDescription: import("@sinclair/typebox").TString;
|
|
7
|
-
version: import("@sinclair/typebox").TString;
|
|
8
|
-
projectLicense: import("@sinclair/typebox").TString;
|
|
9
|
-
projectRepository: import("@sinclair/typebox").TString;
|
|
10
|
-
projectDomain: import("@sinclair/typebox").TString;
|
|
11
|
-
projectGitService: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"github">, import("@sinclair/typebox").TLiteral<"gitlab">, import("@sinclair/typebox").TLiteral<"bitbucket">, import("@sinclair/typebox").TLiteral<"none">]>;
|
|
12
|
-
projectDeployService: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"vercel">, import("@sinclair/typebox").TLiteral<"netlify">, import("@sinclair/typebox").TLiteral<"railway">, import("@sinclair/typebox").TLiteral<"deno">, import("@sinclair/typebox").TLiteral<"none">]>;
|
|
13
|
-
projectPackageManager: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"npm">, import("@sinclair/typebox").TLiteral<"pnpm">, import("@sinclair/typebox").TLiteral<"yarn">, import("@sinclair/typebox").TLiteral<"bun">]>;
|
|
14
|
-
projectState: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"creating">, import("@sinclair/typebox").TLiteral<"created">]>;
|
|
15
|
-
projectCategory: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"unknown">, import("@sinclair/typebox").TLiteral<"website">, import("@sinclair/typebox").TLiteral<"vscode">, import("@sinclair/typebox").TLiteral<"browser">, import("@sinclair/typebox").TLiteral<"cli">, import("@sinclair/typebox").TLiteral<"library">]>;
|
|
16
|
-
projectSubcategory: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"unknown">, import("@sinclair/typebox").TLiteral<"e-commerce">, import("@sinclair/typebox").TLiteral<"tool">]>;
|
|
17
|
-
projectFramework: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"unknown">, import("@sinclair/typebox").TLiteral<"nextjs">, import("@sinclair/typebox").TLiteral<"vite">, import("@sinclair/typebox").TLiteral<"svelte">, import("@sinclair/typebox").TLiteral<"vue">, import("@sinclair/typebox").TLiteral<"astro">, import("@sinclair/typebox").TLiteral<"npm-jsr">, import("@sinclair/typebox").TLiteral<"wxt">, import("@sinclair/typebox").TLiteral<"vscode">]>;
|
|
18
|
-
projectTemplate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"unknown">, import("@sinclair/typebox").TLiteral<"blefnk/relivator-nextjs-template">, import("@sinclair/typebox").TLiteral<"blefnk/relivator-docker-template">, import("@sinclair/typebox").TLiteral<"blefnk/next-react-ts-src-minimal">, import("@sinclair/typebox").TLiteral<"blefnk/all-in-one-nextjs-template">, import("@sinclair/typebox").TLiteral<"blefnk/create-t3-app">, import("@sinclair/typebox").TLiteral<"blefnk/create-next-app">, import("@sinclair/typebox").TLiteral<"blefnk/astro-starlight-template">, import("@sinclair/typebox").TLiteral<"blefnk/versator-nextjs-template">, import("@sinclair/typebox").TLiteral<"reliverse/template-browser-extension">, import("@sinclair/typebox").TLiteral<"microsoft/vscode-extension-samples">, import("@sinclair/typebox").TLiteral<"microsoft/vscode-extension-template">, import("@sinclair/typebox").TLiteral<"reliverse/cli-starter-template">, import("@sinclair/typebox").TLiteral<"blefnk/deno-cli-tutorial">]>;
|
|
19
|
-
projectTemplateDate: import("@sinclair/typebox").TString;
|
|
20
|
-
features: import("@sinclair/typebox").TObject<{
|
|
21
|
-
i18n: import("@sinclair/typebox").TBoolean;
|
|
22
|
-
analytics: import("@sinclair/typebox").TBoolean;
|
|
23
|
-
themeMode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"dark">, import("@sinclair/typebox").TLiteral<"dark-light">]>;
|
|
24
|
-
authentication: import("@sinclair/typebox").TBoolean;
|
|
25
|
-
api: import("@sinclair/typebox").TBoolean;
|
|
26
|
-
database: import("@sinclair/typebox").TBoolean;
|
|
27
|
-
testing: import("@sinclair/typebox").TBoolean;
|
|
28
|
-
docker: import("@sinclair/typebox").TBoolean;
|
|
29
|
-
ci: import("@sinclair/typebox").TBoolean;
|
|
30
|
-
commands: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
31
|
-
webview: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
32
|
-
language: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
33
|
-
themes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
34
|
-
}>;
|
|
35
|
-
preferredLibraries: import("@sinclair/typebox").TObject<{
|
|
36
|
-
stateManagement: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"zustand">, import("@sinclair/typebox").TLiteral<"jotai">, import("@sinclair/typebox").TLiteral<"redux-toolkit">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
37
|
-
formManagement: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"react-hook-form">, import("@sinclair/typebox").TLiteral<"formik">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
38
|
-
styling: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tailwind">, import("@sinclair/typebox").TLiteral<"styled-components">, import("@sinclair/typebox").TLiteral<"css-modules">, import("@sinclair/typebox").TLiteral<"sass">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
39
|
-
uiComponents: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"shadcn-ui">, import("@sinclair/typebox").TLiteral<"chakra-ui">, import("@sinclair/typebox").TLiteral<"material-ui">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
40
|
-
testing: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"bun">, import("@sinclair/typebox").TLiteral<"vitest">, import("@sinclair/typebox").TLiteral<"jest">, import("@sinclair/typebox").TLiteral<"playwright">, import("@sinclair/typebox").TLiteral<"cypress">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
41
|
-
authentication: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"better-auth">, import("@sinclair/typebox").TLiteral<"clerk">, import("@sinclair/typebox").TLiteral<"next-auth">, import("@sinclair/typebox").TLiteral<"supabase-auth">, import("@sinclair/typebox").TLiteral<"auth0">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
42
|
-
databaseLibrary: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"drizzle">, import("@sinclair/typebox").TLiteral<"prisma">, import("@sinclair/typebox").TLiteral<"supabase">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
43
|
-
databaseProvider: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"pg">, import("@sinclair/typebox").TLiteral<"mysql">, import("@sinclair/typebox").TLiteral<"sqlite">, import("@sinclair/typebox").TLiteral<"mongodb">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
44
|
-
api: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"hono">, import("@sinclair/typebox").TLiteral<"trpc">, import("@sinclair/typebox").TLiteral<"graphql">, import("@sinclair/typebox").TLiteral<"rest">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
45
|
-
linting: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eslint">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
46
|
-
formatting: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"biome">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
47
|
-
payment: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"stripe">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
48
|
-
analytics: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"vercel">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
49
|
-
monitoring: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sentry">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
50
|
-
logging: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"axiom">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
51
|
-
forms: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"react-hook-form">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
52
|
-
notifications: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"sonner">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
53
|
-
search: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"algolia">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
54
|
-
uploads: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"uploadthing">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
55
|
-
validation: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"zod">, import("@sinclair/typebox").TLiteral<"typebox">, import("@sinclair/typebox").TLiteral<"valibot">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
56
|
-
documentation: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"starlight">, import("@sinclair/typebox").TLiteral<"nextra">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
57
|
-
icons: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lucide">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
58
|
-
mail: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"resend">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
59
|
-
cache: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"redis">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
60
|
-
storage: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"cloudflare">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
61
|
-
cdn: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"cloudflare">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
62
|
-
cms: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"contentlayer">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
63
|
-
i18n: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"next-intl">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
64
|
-
seo: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"next-seo">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
65
|
-
motion: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"framer">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
66
|
-
charts: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"recharts">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
67
|
-
dates: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"dayjs">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
68
|
-
markdown: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"mdx">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
69
|
-
security: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"auth">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
70
|
-
routing: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"next">, import("@sinclair/typebox").TLiteral<"react-router">, import("@sinclair/typebox").TLiteral<"tanstack-router">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
71
|
-
}>;
|
|
72
|
-
codeStyle: import("@sinclair/typebox").TObject<{
|
|
73
|
-
lineWidth: import("@sinclair/typebox").TNumber;
|
|
74
|
-
indentSize: import("@sinclair/typebox").TNumber;
|
|
75
|
-
indentStyle: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"space">, import("@sinclair/typebox").TLiteral<"tab">]>;
|
|
76
|
-
quoteMark: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"single">, import("@sinclair/typebox").TLiteral<"double">]>;
|
|
77
|
-
semicolons: import("@sinclair/typebox").TBoolean;
|
|
78
|
-
trailingComma: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"es5">, import("@sinclair/typebox").TLiteral<"all">]>;
|
|
79
|
-
bracketSpacing: import("@sinclair/typebox").TBoolean;
|
|
80
|
-
arrowParens: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"always">, import("@sinclair/typebox").TLiteral<"avoid">]>;
|
|
81
|
-
tabWidth: import("@sinclair/typebox").TNumber;
|
|
82
|
-
jsToTs: import("@sinclair/typebox").TBoolean;
|
|
83
|
-
dontRemoveComments: import("@sinclair/typebox").TBoolean;
|
|
84
|
-
shouldAddComments: import("@sinclair/typebox").TBoolean;
|
|
85
|
-
typeOrInterface: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"type">, import("@sinclair/typebox").TLiteral<"interface">, import("@sinclair/typebox").TLiteral<"mixed">]>;
|
|
86
|
-
importOrRequire: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"import">, import("@sinclair/typebox").TLiteral<"require">, import("@sinclair/typebox").TLiteral<"mixed">]>;
|
|
87
|
-
cjsToEsm: import("@sinclair/typebox").TBoolean;
|
|
88
|
-
modernize: import("@sinclair/typebox").TObject<{
|
|
89
|
-
replaceFs: import("@sinclair/typebox").TBoolean;
|
|
90
|
-
replacePath: import("@sinclair/typebox").TBoolean;
|
|
91
|
-
replaceHttp: import("@sinclair/typebox").TBoolean;
|
|
92
|
-
replaceProcess: import("@sinclair/typebox").TBoolean;
|
|
93
|
-
replaceConsole: import("@sinclair/typebox").TBoolean;
|
|
94
|
-
replaceEvents: import("@sinclair/typebox").TBoolean;
|
|
95
|
-
}>;
|
|
96
|
-
importSymbol: import("@sinclair/typebox").TString;
|
|
97
|
-
}>;
|
|
98
|
-
monorepo: import("@sinclair/typebox").TObject<{
|
|
99
|
-
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"turborepo">, import("@sinclair/typebox").TLiteral<"nx">, import("@sinclair/typebox").TLiteral<"pnpm">, import("@sinclair/typebox").TLiteral<"bun">]>;
|
|
100
|
-
packages: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
101
|
-
sharedPackages: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
102
|
-
}>;
|
|
103
|
-
ignoreDependencies: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
104
|
-
customRules: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
105
|
-
multipleRepoCloneMode: import("@sinclair/typebox").TBoolean;
|
|
106
|
-
customUserFocusedRepos: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
107
|
-
customDevsFocusedRepos: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
108
|
-
hideRepoSuggestions: import("@sinclair/typebox").TBoolean;
|
|
109
|
-
customReposOnNewProject: import("@sinclair/typebox").TBoolean;
|
|
110
|
-
envComposerOpenBrowser: import("@sinclair/typebox").TBoolean;
|
|
111
|
-
repoBranch: import("@sinclair/typebox").TString;
|
|
112
|
-
repoPrivacy: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"unknown">, import("@sinclair/typebox").TLiteral<"public">, import("@sinclair/typebox").TLiteral<"private">]>;
|
|
113
|
-
projectArchitecture: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"unknown">, import("@sinclair/typebox").TLiteral<"fullstack">, import("@sinclair/typebox").TLiteral<"separated">]>;
|
|
114
|
-
projectRuntime: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"bun">, import("@sinclair/typebox").TLiteral<"deno">, import("@sinclair/typebox").TLiteral<"edge-light">, import("@sinclair/typebox").TLiteral<"fastly">, import("@sinclair/typebox").TLiteral<"netlify">, import("@sinclair/typebox").TLiteral<"node">, import("@sinclair/typebox").TLiteral<"workerd">]>;
|
|
115
|
-
skipPromptsUseAutoBehavior: import("@sinclair/typebox").TBoolean;
|
|
116
|
-
deployBehavior: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"prompt">, import("@sinclair/typebox").TLiteral<"autoYes">, import("@sinclair/typebox").TLiteral<"autoNo">]>;
|
|
117
|
-
depsBehavior: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"prompt">, import("@sinclair/typebox").TLiteral<"autoYes">, import("@sinclair/typebox").TLiteral<"autoNo">]>;
|
|
118
|
-
gitBehavior: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"prompt">, import("@sinclair/typebox").TLiteral<"autoYes">, import("@sinclair/typebox").TLiteral<"autoNo">]>;
|
|
119
|
-
i18nBehavior: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"prompt">, import("@sinclair/typebox").TLiteral<"autoYes">, import("@sinclair/typebox").TLiteral<"autoNo">]>;
|
|
120
|
-
scriptsBehavior: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"prompt">, import("@sinclair/typebox").TLiteral<"autoYes">, import("@sinclair/typebox").TLiteral<"autoNo">]>;
|
|
121
|
-
existingRepoBehavior: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"prompt">, import("@sinclair/typebox").TLiteral<"autoYes">, import("@sinclair/typebox").TLiteral<"autoYesSkipCommit">, import("@sinclair/typebox").TLiteral<"autoNo">]>;
|
|
122
|
-
}>;
|
|
123
|
-
export type ReliverseConfig = Static<typeof reliverseConfigSchema>;
|
|
124
|
-
export type ProjectCategory = Exclude<ReliverseConfig["projectCategory"], undefined>;
|
|
125
|
-
export type ProjectSubcategory = Exclude<ReliverseConfig["projectSubcategory"], undefined>;
|
|
126
|
-
export type ProjectFramework = Exclude<ReliverseConfig["projectFramework"], undefined>;
|
|
127
|
-
export type ProjectArchitecture = Exclude<ReliverseConfig["projectArchitecture"], undefined>;
|
|
128
|
-
/**
|
|
129
|
-
* Generates a JSON schema file from the TypeBox schema
|
|
130
|
-
*/
|
|
131
|
-
export declare function generateJsonSchema(outputPath: string): Promise<void>;
|
|
132
|
-
/**
|
|
133
|
-
* Generates the schema.json in the project root
|
|
134
|
-
*/
|
|
135
|
-
export declare function generateSchemaFile(): Promise<void>;
|
|
136
|
-
/**
|
|
137
|
-
* A helper to define a Reliverse configuration in the reliverse.ts file
|
|
138
|
-
*/
|
|
139
|
-
export declare function defineConfig<T extends ReliverseConfig>(config: T): T;
|
package/bin/main.js
DELETED
|
@@ -1,417 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import fs from "fs-extra";
|
|
3
|
-
import path from "pathe";
|
|
4
|
-
const UNKNOWN_VALUE = "unknown";
|
|
5
|
-
const reliverseOrgBase = "reliverse.org";
|
|
6
|
-
const reliverseOrgRoot = `https://${reliverseOrgBase}`;
|
|
7
|
-
const cliDomainRoot = `https://docs.${reliverseOrgBase}`;
|
|
8
|
-
const cliDomainDocs = `${cliDomainRoot}/cli`;
|
|
9
|
-
const RELIVERSE_SCHEMA_DEV = "./schema.json";
|
|
10
|
-
const RELIVERSE_SCHEMA_URL = `${reliverseOrgRoot}/schema.json`;
|
|
11
|
-
const unknownLiteral = Type.Literal("unknown");
|
|
12
|
-
const featuresSchema = Type.Object({
|
|
13
|
-
i18n: Type.Boolean(),
|
|
14
|
-
analytics: Type.Boolean(),
|
|
15
|
-
themeMode: Type.Union([
|
|
16
|
-
Type.Literal("light"),
|
|
17
|
-
Type.Literal("dark"),
|
|
18
|
-
Type.Literal("dark-light")
|
|
19
|
-
]),
|
|
20
|
-
authentication: Type.Boolean(),
|
|
21
|
-
api: Type.Boolean(),
|
|
22
|
-
database: Type.Boolean(),
|
|
23
|
-
testing: Type.Boolean(),
|
|
24
|
-
docker: Type.Boolean(),
|
|
25
|
-
ci: Type.Boolean(),
|
|
26
|
-
commands: Type.Array(Type.String()),
|
|
27
|
-
webview: Type.Array(Type.String()),
|
|
28
|
-
language: Type.Array(Type.String()),
|
|
29
|
-
themes: Type.Array(Type.String())
|
|
30
|
-
});
|
|
31
|
-
const codeStyleSchema = Type.Object({
|
|
32
|
-
lineWidth: Type.Number(),
|
|
33
|
-
indentSize: Type.Number(),
|
|
34
|
-
indentStyle: Type.Union([Type.Literal("space"), Type.Literal("tab")]),
|
|
35
|
-
quoteMark: Type.Union([Type.Literal("single"), Type.Literal("double")]),
|
|
36
|
-
semicolons: Type.Boolean(),
|
|
37
|
-
trailingComma: Type.Union([
|
|
38
|
-
Type.Literal("none"),
|
|
39
|
-
Type.Literal("es5"),
|
|
40
|
-
Type.Literal("all")
|
|
41
|
-
]),
|
|
42
|
-
bracketSpacing: Type.Boolean(),
|
|
43
|
-
arrowParens: Type.Union([Type.Literal("always"), Type.Literal("avoid")]),
|
|
44
|
-
tabWidth: Type.Number(),
|
|
45
|
-
jsToTs: Type.Boolean(),
|
|
46
|
-
dontRemoveComments: Type.Boolean(),
|
|
47
|
-
shouldAddComments: Type.Boolean(),
|
|
48
|
-
typeOrInterface: Type.Union([
|
|
49
|
-
Type.Literal("type"),
|
|
50
|
-
Type.Literal("interface"),
|
|
51
|
-
Type.Literal("mixed")
|
|
52
|
-
]),
|
|
53
|
-
importOrRequire: Type.Union([
|
|
54
|
-
Type.Literal("import"),
|
|
55
|
-
Type.Literal("require"),
|
|
56
|
-
Type.Literal("mixed")
|
|
57
|
-
]),
|
|
58
|
-
cjsToEsm: Type.Boolean(),
|
|
59
|
-
modernize: Type.Object({
|
|
60
|
-
replaceFs: Type.Boolean(),
|
|
61
|
-
replacePath: Type.Boolean(),
|
|
62
|
-
replaceHttp: Type.Boolean(),
|
|
63
|
-
replaceProcess: Type.Boolean(),
|
|
64
|
-
replaceConsole: Type.Boolean(),
|
|
65
|
-
replaceEvents: Type.Boolean()
|
|
66
|
-
}),
|
|
67
|
-
importSymbol: Type.String()
|
|
68
|
-
});
|
|
69
|
-
const monorepoSchema = Type.Object({
|
|
70
|
-
type: Type.Union([
|
|
71
|
-
Type.Literal("none"),
|
|
72
|
-
Type.Literal("turborepo"),
|
|
73
|
-
Type.Literal("nx"),
|
|
74
|
-
Type.Literal("pnpm"),
|
|
75
|
-
Type.Literal("bun")
|
|
76
|
-
]),
|
|
77
|
-
packages: Type.Array(Type.String()),
|
|
78
|
-
sharedPackages: Type.Array(Type.String())
|
|
79
|
-
});
|
|
80
|
-
const preferredLibrariesSchema = Type.Object({
|
|
81
|
-
stateManagement: Type.Union([
|
|
82
|
-
Type.Literal("zustand"),
|
|
83
|
-
Type.Literal("jotai"),
|
|
84
|
-
Type.Literal("redux-toolkit"),
|
|
85
|
-
unknownLiteral
|
|
86
|
-
]),
|
|
87
|
-
formManagement: Type.Union([
|
|
88
|
-
Type.Literal("react-hook-form"),
|
|
89
|
-
Type.Literal("formik"),
|
|
90
|
-
unknownLiteral
|
|
91
|
-
]),
|
|
92
|
-
styling: Type.Union([
|
|
93
|
-
Type.Literal("tailwind"),
|
|
94
|
-
Type.Literal("styled-components"),
|
|
95
|
-
Type.Literal("css-modules"),
|
|
96
|
-
Type.Literal("sass"),
|
|
97
|
-
unknownLiteral
|
|
98
|
-
]),
|
|
99
|
-
uiComponents: Type.Union([
|
|
100
|
-
Type.Literal("shadcn-ui"),
|
|
101
|
-
Type.Literal("chakra-ui"),
|
|
102
|
-
Type.Literal("material-ui"),
|
|
103
|
-
unknownLiteral
|
|
104
|
-
]),
|
|
105
|
-
testing: Type.Union([
|
|
106
|
-
Type.Literal("bun"),
|
|
107
|
-
Type.Literal("vitest"),
|
|
108
|
-
Type.Literal("jest"),
|
|
109
|
-
Type.Literal("playwright"),
|
|
110
|
-
Type.Literal("cypress"),
|
|
111
|
-
unknownLiteral
|
|
112
|
-
]),
|
|
113
|
-
authentication: Type.Union([
|
|
114
|
-
Type.Literal("better-auth"),
|
|
115
|
-
Type.Literal("clerk"),
|
|
116
|
-
Type.Literal("next-auth"),
|
|
117
|
-
Type.Literal("supabase-auth"),
|
|
118
|
-
Type.Literal("auth0"),
|
|
119
|
-
unknownLiteral
|
|
120
|
-
]),
|
|
121
|
-
databaseLibrary: Type.Union([
|
|
122
|
-
Type.Literal("drizzle"),
|
|
123
|
-
Type.Literal("prisma"),
|
|
124
|
-
Type.Literal("supabase"),
|
|
125
|
-
unknownLiteral
|
|
126
|
-
]),
|
|
127
|
-
databaseProvider: Type.Union([
|
|
128
|
-
Type.Literal("pg"),
|
|
129
|
-
Type.Literal("mysql"),
|
|
130
|
-
Type.Literal("sqlite"),
|
|
131
|
-
Type.Literal("mongodb"),
|
|
132
|
-
unknownLiteral
|
|
133
|
-
]),
|
|
134
|
-
api: Type.Union([
|
|
135
|
-
Type.Literal("hono"),
|
|
136
|
-
Type.Literal("trpc"),
|
|
137
|
-
Type.Literal("graphql"),
|
|
138
|
-
Type.Literal("rest"),
|
|
139
|
-
unknownLiteral
|
|
140
|
-
]),
|
|
141
|
-
linting: Type.Union([Type.Literal("eslint"), unknownLiteral]),
|
|
142
|
-
formatting: Type.Union([Type.Literal("biome"), unknownLiteral]),
|
|
143
|
-
payment: Type.Union([Type.Literal("stripe"), unknownLiteral]),
|
|
144
|
-
analytics: Type.Union([Type.Literal("vercel"), unknownLiteral]),
|
|
145
|
-
monitoring: Type.Union([Type.Literal("sentry"), unknownLiteral]),
|
|
146
|
-
logging: Type.Union([Type.Literal("axiom"), unknownLiteral]),
|
|
147
|
-
forms: Type.Union([Type.Literal("react-hook-form"), unknownLiteral]),
|
|
148
|
-
notifications: Type.Union([Type.Literal("sonner"), unknownLiteral]),
|
|
149
|
-
search: Type.Union([Type.Literal("algolia"), unknownLiteral]),
|
|
150
|
-
uploads: Type.Union([Type.Literal("uploadthing"), unknownLiteral]),
|
|
151
|
-
validation: Type.Union([
|
|
152
|
-
Type.Literal("zod"),
|
|
153
|
-
Type.Literal("typebox"),
|
|
154
|
-
Type.Literal("valibot"),
|
|
155
|
-
unknownLiteral
|
|
156
|
-
]),
|
|
157
|
-
documentation: Type.Union([
|
|
158
|
-
Type.Literal("starlight"),
|
|
159
|
-
Type.Literal("nextra"),
|
|
160
|
-
unknownLiteral
|
|
161
|
-
]),
|
|
162
|
-
icons: Type.Union([Type.Literal("lucide"), unknownLiteral]),
|
|
163
|
-
mail: Type.Union([Type.Literal("resend"), unknownLiteral]),
|
|
164
|
-
cache: Type.Union([Type.Literal("redis"), unknownLiteral]),
|
|
165
|
-
storage: Type.Union([Type.Literal("cloudflare"), unknownLiteral]),
|
|
166
|
-
cdn: Type.Union([Type.Literal("cloudflare"), unknownLiteral]),
|
|
167
|
-
cms: Type.Union([Type.Literal("contentlayer"), unknownLiteral]),
|
|
168
|
-
i18n: Type.Union([Type.Literal("next-intl"), unknownLiteral]),
|
|
169
|
-
seo: Type.Union([Type.Literal("next-seo"), unknownLiteral]),
|
|
170
|
-
motion: Type.Union([Type.Literal("framer"), unknownLiteral]),
|
|
171
|
-
charts: Type.Union([Type.Literal("recharts"), unknownLiteral]),
|
|
172
|
-
dates: Type.Union([Type.Literal("dayjs"), unknownLiteral]),
|
|
173
|
-
markdown: Type.Union([Type.Literal("mdx"), unknownLiteral]),
|
|
174
|
-
security: Type.Union([Type.Literal("auth"), unknownLiteral]),
|
|
175
|
-
routing: Type.Union([
|
|
176
|
-
Type.Literal("next"),
|
|
177
|
-
Type.Literal("react-router"),
|
|
178
|
-
Type.Literal("tanstack-router"),
|
|
179
|
-
unknownLiteral
|
|
180
|
-
])
|
|
181
|
-
});
|
|
182
|
-
export const reliverseConfigSchema = Type.Object({
|
|
183
|
-
// Reliverse config schema
|
|
184
|
-
$schema: Type.Union([
|
|
185
|
-
Type.Literal(RELIVERSE_SCHEMA_URL),
|
|
186
|
-
Type.Literal(RELIVERSE_SCHEMA_DEV)
|
|
187
|
-
]),
|
|
188
|
-
// General project information
|
|
189
|
-
projectName: Type.Union([
|
|
190
|
-
Type.Literal(UNKNOWN_VALUE),
|
|
191
|
-
Type.String({ minLength: 1 })
|
|
192
|
-
]),
|
|
193
|
-
projectAuthor: Type.Union([
|
|
194
|
-
Type.Literal(UNKNOWN_VALUE),
|
|
195
|
-
Type.String({ minLength: 1 })
|
|
196
|
-
]),
|
|
197
|
-
projectDescription: Type.String(),
|
|
198
|
-
version: Type.String(),
|
|
199
|
-
projectLicense: Type.String(),
|
|
200
|
-
projectRepository: Type.String(),
|
|
201
|
-
projectDomain: Type.String(),
|
|
202
|
-
projectGitService: Type.Union([
|
|
203
|
-
Type.Literal("github"),
|
|
204
|
-
Type.Literal("gitlab"),
|
|
205
|
-
Type.Literal("bitbucket"),
|
|
206
|
-
Type.Literal("none")
|
|
207
|
-
]),
|
|
208
|
-
projectDeployService: Type.Union([
|
|
209
|
-
Type.Literal("vercel"),
|
|
210
|
-
Type.Literal("netlify"),
|
|
211
|
-
Type.Literal("railway"),
|
|
212
|
-
Type.Literal("deno"),
|
|
213
|
-
Type.Literal("none")
|
|
214
|
-
]),
|
|
215
|
-
projectPackageManager: Type.Union([
|
|
216
|
-
Type.Literal("npm"),
|
|
217
|
-
Type.Literal("pnpm"),
|
|
218
|
-
Type.Literal("yarn"),
|
|
219
|
-
Type.Literal("bun")
|
|
220
|
-
]),
|
|
221
|
-
projectState: Type.Union([Type.Literal("creating"), Type.Literal("created")]),
|
|
222
|
-
projectCategory: Type.Union([
|
|
223
|
-
Type.Literal(UNKNOWN_VALUE),
|
|
224
|
-
Type.Literal("website"),
|
|
225
|
-
Type.Literal("vscode"),
|
|
226
|
-
Type.Literal("browser"),
|
|
227
|
-
Type.Literal("cli"),
|
|
228
|
-
Type.Literal("library")
|
|
229
|
-
]),
|
|
230
|
-
projectSubcategory: Type.Union([
|
|
231
|
-
Type.Literal(UNKNOWN_VALUE),
|
|
232
|
-
Type.Literal("e-commerce"),
|
|
233
|
-
Type.Literal("tool")
|
|
234
|
-
]),
|
|
235
|
-
projectFramework: Type.Union([
|
|
236
|
-
Type.Literal(UNKNOWN_VALUE),
|
|
237
|
-
// web app frameworks
|
|
238
|
-
Type.Literal("nextjs"),
|
|
239
|
-
Type.Literal("vite"),
|
|
240
|
-
Type.Literal("svelte"),
|
|
241
|
-
Type.Literal("vue"),
|
|
242
|
-
Type.Literal("astro"),
|
|
243
|
-
// library frameworks
|
|
244
|
-
Type.Literal("npm-jsr"),
|
|
245
|
-
// browser extension frameworks
|
|
246
|
-
Type.Literal("wxt"),
|
|
247
|
-
// vscode extension frameworks
|
|
248
|
-
Type.Literal("vscode")
|
|
249
|
-
]),
|
|
250
|
-
projectTemplate: Type.Union([
|
|
251
|
-
Type.Literal(UNKNOWN_VALUE),
|
|
252
|
-
Type.Literal("blefnk/relivator-nextjs-template"),
|
|
253
|
-
Type.Literal("blefnk/relivator-docker-template"),
|
|
254
|
-
Type.Literal("blefnk/next-react-ts-src-minimal"),
|
|
255
|
-
Type.Literal("blefnk/all-in-one-nextjs-template"),
|
|
256
|
-
Type.Literal("blefnk/create-t3-app"),
|
|
257
|
-
Type.Literal("blefnk/create-next-app"),
|
|
258
|
-
Type.Literal("blefnk/astro-starlight-template"),
|
|
259
|
-
Type.Literal("blefnk/versator-nextjs-template"),
|
|
260
|
-
Type.Literal("reliverse/template-browser-extension"),
|
|
261
|
-
Type.Literal("microsoft/vscode-extension-samples"),
|
|
262
|
-
Type.Literal("microsoft/vscode-extension-template"),
|
|
263
|
-
Type.Literal("reliverse/cli-starter-template"),
|
|
264
|
-
Type.Literal("blefnk/deno-cli-tutorial")
|
|
265
|
-
]),
|
|
266
|
-
projectTemplateDate: Type.String(),
|
|
267
|
-
features: featuresSchema,
|
|
268
|
-
preferredLibraries: preferredLibrariesSchema,
|
|
269
|
-
codeStyle: codeStyleSchema,
|
|
270
|
-
monorepo: monorepoSchema,
|
|
271
|
-
ignoreDependencies: Type.Array(Type.String()),
|
|
272
|
-
customRules: Type.Record(Type.String(), Type.Unknown()),
|
|
273
|
-
// Custom repos configuration
|
|
274
|
-
multipleRepoCloneMode: Type.Boolean(),
|
|
275
|
-
customUserFocusedRepos: Type.Optional(Type.Array(Type.String())),
|
|
276
|
-
customDevsFocusedRepos: Type.Optional(Type.Array(Type.String())),
|
|
277
|
-
hideRepoSuggestions: Type.Boolean(),
|
|
278
|
-
customReposOnNewProject: Type.Boolean(),
|
|
279
|
-
envComposerOpenBrowser: Type.Boolean(),
|
|
280
|
-
repoBranch: Type.String(),
|
|
281
|
-
repoPrivacy: Type.Union([
|
|
282
|
-
unknownLiteral,
|
|
283
|
-
Type.Literal("public"),
|
|
284
|
-
Type.Literal("private")
|
|
285
|
-
]),
|
|
286
|
-
projectArchitecture: Type.Union([
|
|
287
|
-
unknownLiteral,
|
|
288
|
-
Type.Literal("fullstack"),
|
|
289
|
-
Type.Literal("separated")
|
|
290
|
-
]),
|
|
291
|
-
projectRuntime: Type.Union([
|
|
292
|
-
Type.Literal("bun"),
|
|
293
|
-
Type.Literal("deno"),
|
|
294
|
-
Type.Literal("edge-light"),
|
|
295
|
-
Type.Literal("fastly"),
|
|
296
|
-
Type.Literal("netlify"),
|
|
297
|
-
Type.Literal("node"),
|
|
298
|
-
Type.Literal("workerd")
|
|
299
|
-
]),
|
|
300
|
-
skipPromptsUseAutoBehavior: Type.Boolean(),
|
|
301
|
-
deployBehavior: Type.Union([
|
|
302
|
-
Type.Literal("prompt"),
|
|
303
|
-
Type.Literal("autoYes"),
|
|
304
|
-
Type.Literal("autoNo")
|
|
305
|
-
]),
|
|
306
|
-
depsBehavior: Type.Union([
|
|
307
|
-
Type.Literal("prompt"),
|
|
308
|
-
Type.Literal("autoYes"),
|
|
309
|
-
Type.Literal("autoNo")
|
|
310
|
-
]),
|
|
311
|
-
gitBehavior: Type.Union([
|
|
312
|
-
Type.Literal("prompt"),
|
|
313
|
-
Type.Literal("autoYes"),
|
|
314
|
-
Type.Literal("autoNo")
|
|
315
|
-
]),
|
|
316
|
-
i18nBehavior: Type.Union([
|
|
317
|
-
Type.Literal("prompt"),
|
|
318
|
-
Type.Literal("autoYes"),
|
|
319
|
-
Type.Literal("autoNo")
|
|
320
|
-
]),
|
|
321
|
-
scriptsBehavior: Type.Union([
|
|
322
|
-
Type.Literal("prompt"),
|
|
323
|
-
Type.Literal("autoYes"),
|
|
324
|
-
Type.Literal("autoNo")
|
|
325
|
-
]),
|
|
326
|
-
existingRepoBehavior: Type.Union([
|
|
327
|
-
Type.Literal("prompt"),
|
|
328
|
-
Type.Literal("autoYes"),
|
|
329
|
-
Type.Literal("autoYesSkipCommit"),
|
|
330
|
-
Type.Literal("autoNo")
|
|
331
|
-
])
|
|
332
|
-
});
|
|
333
|
-
function convertTypeBoxToJsonSchema(schema) {
|
|
334
|
-
if (!schema || typeof schema !== "object") return schema;
|
|
335
|
-
if (schema.type === "string" && schema.enum) {
|
|
336
|
-
return {
|
|
337
|
-
type: "string",
|
|
338
|
-
enum: schema.enum
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
if (schema.anyOf || schema.allOf || schema.oneOf) {
|
|
342
|
-
const variants = schema.anyOf || schema.allOf || schema.oneOf;
|
|
343
|
-
const allLiterals = variants.every((v) => v.const !== void 0);
|
|
344
|
-
if (allLiterals) {
|
|
345
|
-
return {
|
|
346
|
-
type: "string",
|
|
347
|
-
enum: variants.map((v) => v.const)
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
if (schema.type === "object") {
|
|
352
|
-
const result = {
|
|
353
|
-
type: "object",
|
|
354
|
-
properties: {}
|
|
355
|
-
};
|
|
356
|
-
if (schema.required) {
|
|
357
|
-
result.required = schema.required;
|
|
358
|
-
}
|
|
359
|
-
if (schema.properties) {
|
|
360
|
-
for (const [key, value] of Object.entries(schema.properties)) {
|
|
361
|
-
result.properties[key] = convertTypeBoxToJsonSchema(value);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
if (schema.additionalProperties) {
|
|
365
|
-
result.additionalProperties = convertTypeBoxToJsonSchema(
|
|
366
|
-
schema.additionalProperties
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
if (schema.patternProperties) {
|
|
370
|
-
result.patternProperties = {};
|
|
371
|
-
for (const [pattern, value] of Object.entries(schema.patternProperties)) {
|
|
372
|
-
result.patternProperties[pattern] = convertTypeBoxToJsonSchema(value);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return result;
|
|
376
|
-
}
|
|
377
|
-
if (schema.type === "array") {
|
|
378
|
-
return {
|
|
379
|
-
type: "array",
|
|
380
|
-
items: convertTypeBoxToJsonSchema(schema.items)
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
if (schema.type) {
|
|
384
|
-
const result = { type: schema.type };
|
|
385
|
-
if (schema.minimum !== void 0) result.minimum = schema.minimum;
|
|
386
|
-
if (schema.maximum !== void 0) result.maximum = schema.maximum;
|
|
387
|
-
if (schema.minLength !== void 0) result.minLength = schema.minLength;
|
|
388
|
-
if (schema.maxLength !== void 0) result.maxLength = schema.maxLength;
|
|
389
|
-
if (schema.pattern !== void 0) result.pattern = schema.pattern;
|
|
390
|
-
if (schema.format !== void 0) result.format = schema.format;
|
|
391
|
-
if (schema.default !== void 0) result.default = schema.default;
|
|
392
|
-
return result;
|
|
393
|
-
}
|
|
394
|
-
return schema;
|
|
395
|
-
}
|
|
396
|
-
export async function generateJsonSchema(outputPath) {
|
|
397
|
-
const converted = convertTypeBoxToJsonSchema(reliverseConfigSchema);
|
|
398
|
-
const schema = {
|
|
399
|
-
$schema: "http://json-schema.org/draft-07/schema#",
|
|
400
|
-
title: "Reliverse Configuration Schema",
|
|
401
|
-
description: cliDomainDocs,
|
|
402
|
-
type: "object",
|
|
403
|
-
properties: converted.properties,
|
|
404
|
-
required: converted.required
|
|
405
|
-
};
|
|
406
|
-
await fs.writeFile(outputPath, JSON.stringify(schema, null, 2));
|
|
407
|
-
}
|
|
408
|
-
export async function generateSchemaFile() {
|
|
409
|
-
const schemaPath = path.join(process.cwd(), "schema.json");
|
|
410
|
-
if (fs.existsSync(schemaPath)) {
|
|
411
|
-
await fs.remove(schemaPath);
|
|
412
|
-
}
|
|
413
|
-
await generateJsonSchema(schemaPath);
|
|
414
|
-
}
|
|
415
|
-
export function defineConfig(config) {
|
|
416
|
-
return config;
|
|
417
|
-
}
|