@reliverse/dler 1.7.121 → 1.7.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/impl/auth/impl/init.d.ts +2 -2
- package/bin/impl/config/create.js +18 -1
- package/bin/impl/config/repair.d.ts +1 -2
- package/bin/impl/config/repair.js +18 -54
- package/bin/impl/init/use-template/cp-modules/compose-env-file/cef-keys.d.ts +16 -25
- package/bin/impl/init/use-template/cp-modules/compose-env-file/cef-keys.js +0 -60
- package/bin/impl/providers/better-t-stack/types.d.ts +5 -5
- package/bin/impl/providers/reliverse-stack/rs-impl.d.ts +2 -2
- package/bin/impl/schema/utils.d.ts +15 -0
- package/bin/impl/schema/utils.js +33 -0
- package/bin/impl/utils/projectRepository.js +2 -3
- package/bin/impl/utils/replacements/reps-keys.d.ts +14 -17
- package/bin/impl/utils/replacements/reps-keys.js +0 -17
- package/bin/impl/utils/schemaMemory.d.ts +17 -31
- package/bin/impl/utils/schemaMemory.js +0 -16
- package/bin/impl/utils/schemaTemplate.d.ts +24 -49
- package/bin/impl/utils/schemaTemplate.js +65 -84
- package/bin/mod.d.ts +5 -6
- package/bin/mod.js +3 -15
- package/package.json +5 -6
- package/bin/impl/config/impl/typebox.d.ts +0 -8
- package/bin/impl/config/impl/typebox.js +0 -82
|
@@ -146,8 +146,8 @@ export declare const optionsSchema: z.ZodObject<{
|
|
|
146
146
|
cwd: z.ZodString;
|
|
147
147
|
config: z.ZodOptional<z.ZodString>;
|
|
148
148
|
database: z.ZodOptional<z.ZodEnum<{
|
|
149
|
-
mysql: "mysql";
|
|
150
149
|
sqlite: "sqlite";
|
|
150
|
+
mysql: "mysql";
|
|
151
151
|
mongodb: "mongodb";
|
|
152
152
|
postgres: "postgres";
|
|
153
153
|
mssql: "mssql";
|
|
@@ -165,7 +165,7 @@ export declare const optionsSchema: z.ZodObject<{
|
|
|
165
165
|
}, z.core.$strip>;
|
|
166
166
|
export declare const outroText = "\uD83E\uDD73 All Done, Happy Hacking!";
|
|
167
167
|
export declare function getLatestNpmVersion(packageName: string): Promise<string>;
|
|
168
|
-
export declare function getPackageManager(): Promise<"bun" | "npm" | "
|
|
168
|
+
export declare function getPackageManager(): Promise<"bun" | "npm" | "yarn" | "pnpm">;
|
|
169
169
|
export declare function getEnvFiles(cwd: string): Promise<string[]>;
|
|
170
170
|
export declare function updateEnvs({ envs, files, isCommented, }: {
|
|
171
171
|
/**
|
|
@@ -75,7 +75,24 @@ export async function writeReliverseConfig(configPath, config, isDev, skipInstal
|
|
|
75
75
|
}
|
|
76
76
|
const objectLiteral = objectToCodeString(config, 0);
|
|
77
77
|
const objectLiteralWithComments = injectSectionComments(objectLiteral);
|
|
78
|
-
|
|
78
|
+
let defineImport = "./reltypes";
|
|
79
|
+
try {
|
|
80
|
+
const pkgPath = path.join(path.dirname(configPath), "package.json");
|
|
81
|
+
if (await fs.pathExists(pkgPath)) {
|
|
82
|
+
const pkgRaw = await fs.readFile(pkgPath, "utf8");
|
|
83
|
+
const pkg = JSON.parse(pkgRaw);
|
|
84
|
+
if (pkg.name === "@reliverse/dler") {
|
|
85
|
+
defineImport = "./src-ts/mod.ts";
|
|
86
|
+
} else {
|
|
87
|
+
const hasDler = Boolean(
|
|
88
|
+
pkg.dependencies && pkg.dependencies["@reliverse/dler"] || pkg.devDependencies && pkg.devDependencies["@reliverse/dler"]
|
|
89
|
+
);
|
|
90
|
+
if (hasDler) defineImport = "@reliverse/dler";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
const fileContent2 = `import { defineConfig } from "${defineImport}";
|
|
79
96
|
export default defineConfig(${objectLiteralWithComments});
|
|
80
97
|
`;
|
|
81
98
|
await atomicWriteFile(configPath, fileContent2, backupPath2, tempPath2);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { TSchema } from "@sinclair/typebox";
|
|
2
1
|
import type { ReliverseConfig } from "../schema/mod.js";
|
|
3
2
|
export declare function repairAndParseJSON(raw: string): any;
|
|
4
3
|
/**
|
|
5
4
|
* Recursively fixes each property in the object. Returns the fixed config and
|
|
6
5
|
* an array of property paths that were changed.
|
|
7
6
|
*/
|
|
8
|
-
export declare function fixLineByLine(userConfig: unknown, defaultConfig: unknown
|
|
7
|
+
export declare function fixLineByLine(userConfig: unknown, defaultConfig: unknown): {
|
|
9
8
|
fixedConfig: unknown;
|
|
10
9
|
changedKeys: string[];
|
|
11
10
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import fs from "@reliverse/relifso";
|
|
2
2
|
import { relinka } from "@reliverse/relinka";
|
|
3
|
-
import { Type } from "@sinclair/typebox";
|
|
4
|
-
import { Value } from "@sinclair/typebox/value";
|
|
5
3
|
import { parseJSONC } from "confbox";
|
|
6
4
|
import { jsonrepair } from "jsonrepair";
|
|
7
5
|
import { writeReliverseConfig } from "./create.js";
|
|
@@ -15,40 +13,24 @@ export function repairAndParseJSON(raw) {
|
|
|
15
13
|
return null;
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
-
additionalProperties: false,
|
|
21
|
-
required: [key]
|
|
22
|
-
});
|
|
16
|
+
function isPlainObject(value) {
|
|
17
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23
18
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
const testObject = { [propName]: userValue };
|
|
27
|
-
return Value.Check(singlePropertySchema, testObject) ? userValue : defaultValue;
|
|
28
|
-
}
|
|
29
|
-
export function fixLineByLine(userConfig, defaultConfig, schema) {
|
|
30
|
-
const isObjectSchema = schema.type === "object" && schema.properties;
|
|
31
|
-
if (!isObjectSchema || typeof userConfig !== "object" || userConfig === null) {
|
|
32
|
-
const isValid = Value.Check(schema, userConfig);
|
|
19
|
+
export function fixLineByLine(userConfig, defaultConfig) {
|
|
20
|
+
if (!isPlainObject(defaultConfig)) {
|
|
33
21
|
return {
|
|
34
|
-
fixedConfig:
|
|
35
|
-
changedKeys:
|
|
22
|
+
fixedConfig: userConfig === void 0 ? defaultConfig : userConfig,
|
|
23
|
+
changedKeys: userConfig === void 0 ? ["<entire_object>"] : []
|
|
36
24
|
};
|
|
37
25
|
}
|
|
38
|
-
const
|
|
39
|
-
const result = { ...defaultConfig ?? {} };
|
|
26
|
+
const result = { ...defaultConfig };
|
|
40
27
|
const changedKeys = [];
|
|
41
28
|
const missingKeys = [];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const userValue =
|
|
29
|
+
const userObj = isPlainObject(userConfig) ? userConfig : {};
|
|
30
|
+
for (const propName of Object.keys(defaultConfig)) {
|
|
31
|
+
const userValue = userObj[propName];
|
|
45
32
|
const defaultValue = defaultConfig[propName];
|
|
46
|
-
if (!
|
|
47
|
-
result[propName] = defaultValue;
|
|
48
|
-
changedKeys.push(propName);
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
if (userValue === void 0 && !(propName in userConfig)) {
|
|
33
|
+
if (!(propName in userObj)) {
|
|
52
34
|
missingKeys.push(propName);
|
|
53
35
|
result[propName] = defaultValue;
|
|
54
36
|
continue;
|
|
@@ -59,29 +41,15 @@ export function fixLineByLine(userConfig, defaultConfig, schema) {
|
|
|
59
41
|
continue;
|
|
60
42
|
}
|
|
61
43
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
44
|
+
if (isPlainObject(defaultValue)) {
|
|
45
|
+
const { fixedConfig, changedKeys: nested } = fixLineByLine(userValue, defaultValue);
|
|
46
|
+
result[propName] = fixedConfig;
|
|
47
|
+
if (nested.length > 0) changedKeys.push(...nested.map((n) => `${propName}.${n}`));
|
|
48
|
+
} else if (userValue === void 0) {
|
|
66
49
|
result[propName] = defaultValue;
|
|
67
50
|
changedKeys.push(propName);
|
|
68
|
-
} else if (subSchema && typeof subSchema === "object" && "type" in subSchema && subSchema.type === "object") {
|
|
69
|
-
const { fixedConfig, changedKeys: nestedChanges } = fixLineByLine(
|
|
70
|
-
userValue,
|
|
71
|
-
defaultValue,
|
|
72
|
-
subSchema
|
|
73
|
-
);
|
|
74
|
-
result[propName] = fixedConfig;
|
|
75
|
-
if (nestedChanges.length > 0) {
|
|
76
|
-
changedKeys.push(...nestedChanges.map((nc) => `${propName}.${nc}`));
|
|
77
|
-
}
|
|
78
51
|
} else {
|
|
79
|
-
|
|
80
|
-
const validatedValue = fixSingleProperty(subSchema, propName, userValue, defaultValue);
|
|
81
|
-
result[propName] = validatedValue;
|
|
82
|
-
if (originalValue !== void 0 && validatedValue !== originalValue) {
|
|
83
|
-
changedKeys.push(propName);
|
|
84
|
-
}
|
|
52
|
+
result[propName] = userValue;
|
|
85
53
|
}
|
|
86
54
|
}
|
|
87
55
|
if (missingKeys.length > 0) {
|
|
@@ -104,11 +72,7 @@ export async function parseAndFixReliverseConfig(configPath, isDev) {
|
|
|
104
72
|
if (parsed && typeof parsed === "object") {
|
|
105
73
|
const originalErrors = [];
|
|
106
74
|
if (originalErrors.length === 0) return parsed;
|
|
107
|
-
const { fixedConfig, changedKeys } = fixLineByLine(
|
|
108
|
-
parsed,
|
|
109
|
-
DEFAULT_CONFIG_RELIVERSE,
|
|
110
|
-
Type.Any()
|
|
111
|
-
);
|
|
75
|
+
const { fixedConfig, changedKeys } = fixLineByLine(parsed, DEFAULT_CONFIG_RELIVERSE);
|
|
112
76
|
if (fixedConfig && typeof fixedConfig === "object") {
|
|
113
77
|
await writeReliverseConfig(configPath, fixedConfig, isDev);
|
|
114
78
|
const originalInvalidPaths = originalErrors.map((err) => err.path);
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
key: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"NEXT_PUBLIC_APP_URL">, import("@sinclair/typebox").TLiteral<"DATABASE_URL">, import("@sinclair/typebox").TLiteral<"AUTH_SECRET">, import("@sinclair/typebox").TLiteral<"NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY">, import("@sinclair/typebox").TLiteral<"CLERK_SECRET_KEY">, import("@sinclair/typebox").TLiteral<"CLERK_ENCRYPTION_KEY">, import("@sinclair/typebox").TLiteral<"UPLOADTHING_TOKEN">, import("@sinclair/typebox").TLiteral<"UPLOADTHING_SECRET">, import("@sinclair/typebox").TLiteral<"RESEND_API_KEY">, import("@sinclair/typebox").TLiteral<"EMAIL_FROM_ADDRESS">, import("@sinclair/typebox").TLiteral<"NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY">, import("@sinclair/typebox").TLiteral<"STRIPE_API_KEY">, import("@sinclair/typebox").TLiteral<"STRIPE_WEBHOOK_SECRET">, import("@sinclair/typebox").TLiteral<"STRIPE_PRO_MONTHLY_PRICE_ID">]>;
|
|
18
|
-
type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"string">, import("@sinclair/typebox").TLiteral<"email">, import("@sinclair/typebox").TLiteral<"password">, import("@sinclair/typebox").TLiteral<"number">, import("@sinclair/typebox").TLiteral<"boolean">, import("@sinclair/typebox").TLiteral<"database">]>;
|
|
19
|
-
instruction: import("@sinclair/typebox").TString;
|
|
20
|
-
defaultValue: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"http://localhost:3000">, import("@sinclair/typebox").TLiteral<"onboarding@resend.dev">, import("@sinclair/typebox").TLiteral<"pk_test_">, import("@sinclair/typebox").TLiteral<"postgresql://postgres:postgres@localhost:5432/myapp">, import("@sinclair/typebox").TLiteral<"price_">, import("@sinclair/typebox").TLiteral<"re_">, import("@sinclair/typebox").TLiteral<"generate-64-chars">, import("@sinclair/typebox").TLiteral<"replace-me-with-token-from-dashboard">, import("@sinclair/typebox").TLiteral<"sk_live_">, import("@sinclair/typebox").TLiteral<"sk_test_">, import("@sinclair/typebox").TLiteral<"ut_app_">, import("@sinclair/typebox").TLiteral<"whsec_">]>;
|
|
21
|
-
optional: import("@sinclair/typebox").TBoolean;
|
|
22
|
-
}>>;
|
|
23
|
-
}>;
|
|
24
|
-
export type KeyType = Static<typeof keyTypeSchema>;
|
|
25
|
-
export type KnownService = Static<typeof knownServiceSchema>;
|
|
1
|
+
export type KeyType = "string" | "email" | "password" | "number" | "boolean" | "database";
|
|
2
|
+
export type KeyVar = "NEXT_PUBLIC_APP_URL" | "DATABASE_URL" | "AUTH_SECRET" | "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY" | "CLERK_SECRET_KEY" | "CLERK_ENCRYPTION_KEY" | "UPLOADTHING_TOKEN" | "UPLOADTHING_SECRET" | "RESEND_API_KEY" | "EMAIL_FROM_ADDRESS" | "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY" | "STRIPE_API_KEY" | "STRIPE_WEBHOOK_SECRET" | "STRIPE_PRO_MONTHLY_PRICE_ID";
|
|
3
|
+
export type DefaultValue = "http://localhost:3000" | "onboarding@resend.dev" | "pk_test_" | "postgresql://postgres:postgres@localhost:5432/myapp" | "price_" | "re_" | "generate-64-chars" | "replace-me-with-token-from-dashboard" | "sk_live_" | "sk_test_" | "ut_app_" | "whsec_";
|
|
4
|
+
export interface ServiceKey {
|
|
5
|
+
key: KeyVar;
|
|
6
|
+
type: KeyType;
|
|
7
|
+
instruction: string;
|
|
8
|
+
defaultValue: DefaultValue;
|
|
9
|
+
optional?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type DashboardUrl = "none" | "https://clerk.com" | "https://neon.tech" | "https://dashboard.stripe.com" | "https://uploadthing.com/dashboard" | "https://resend.com/api-keys" | "https://dashboard.stripe.com/test/apikeys";
|
|
12
|
+
export interface KnownService {
|
|
13
|
+
name: string;
|
|
14
|
+
dashboardUrl: DashboardUrl;
|
|
15
|
+
keys: ServiceKey[];
|
|
16
|
+
}
|
|
26
17
|
export declare const KNOWN_SERVICES: Record<string, KnownService>;
|
|
@@ -1,63 +1,3 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
export const keyTypeSchema = Type.Union([
|
|
3
|
-
Type.Literal("string"),
|
|
4
|
-
Type.Literal("email"),
|
|
5
|
-
Type.Literal("password"),
|
|
6
|
-
Type.Literal("number"),
|
|
7
|
-
Type.Literal("boolean"),
|
|
8
|
-
Type.Literal("database")
|
|
9
|
-
]);
|
|
10
|
-
export const keyVarsSchema = Type.Union([
|
|
11
|
-
Type.Literal("NEXT_PUBLIC_APP_URL"),
|
|
12
|
-
Type.Literal("DATABASE_URL"),
|
|
13
|
-
Type.Literal("AUTH_SECRET"),
|
|
14
|
-
Type.Literal("NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY"),
|
|
15
|
-
Type.Literal("CLERK_SECRET_KEY"),
|
|
16
|
-
Type.Literal("CLERK_ENCRYPTION_KEY"),
|
|
17
|
-
Type.Literal("UPLOADTHING_TOKEN"),
|
|
18
|
-
Type.Literal("UPLOADTHING_SECRET"),
|
|
19
|
-
Type.Literal("RESEND_API_KEY"),
|
|
20
|
-
Type.Literal("EMAIL_FROM_ADDRESS"),
|
|
21
|
-
Type.Literal("NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY"),
|
|
22
|
-
Type.Literal("STRIPE_API_KEY"),
|
|
23
|
-
Type.Literal("STRIPE_WEBHOOK_SECRET"),
|
|
24
|
-
Type.Literal("STRIPE_PRO_MONTHLY_PRICE_ID")
|
|
25
|
-
]);
|
|
26
|
-
export const defaultValues = Type.Union([
|
|
27
|
-
Type.Literal("http://localhost:3000"),
|
|
28
|
-
Type.Literal("onboarding@resend.dev"),
|
|
29
|
-
Type.Literal("pk_test_"),
|
|
30
|
-
Type.Literal("postgresql://postgres:postgres@localhost:5432/myapp"),
|
|
31
|
-
Type.Literal("price_"),
|
|
32
|
-
Type.Literal("re_"),
|
|
33
|
-
Type.Literal("generate-64-chars"),
|
|
34
|
-
Type.Literal("replace-me-with-token-from-dashboard"),
|
|
35
|
-
Type.Literal("sk_live_"),
|
|
36
|
-
Type.Literal("sk_test_"),
|
|
37
|
-
Type.Literal("ut_app_"),
|
|
38
|
-
Type.Literal("whsec_")
|
|
39
|
-
]);
|
|
40
|
-
export const serviceKeySchema = Type.Object({
|
|
41
|
-
key: keyVarsSchema,
|
|
42
|
-
type: keyTypeSchema,
|
|
43
|
-
instruction: Type.String(),
|
|
44
|
-
defaultValue: defaultValues,
|
|
45
|
-
optional: Type.Boolean({ default: false })
|
|
46
|
-
});
|
|
47
|
-
export const dashboards = Type.Union([
|
|
48
|
-
Type.Literal("none"),
|
|
49
|
-
Type.Literal("https://clerk.com"),
|
|
50
|
-
Type.Literal("https://neon.tech"),
|
|
51
|
-
Type.Literal("https://dashboard.stripe.com"),
|
|
52
|
-
Type.Literal("https://uploadthing.com/dashboard"),
|
|
53
|
-
Type.Literal("https://resend.com/api-keys"),
|
|
54
|
-
Type.Literal("https://dashboard.stripe.com/test/apikeys")
|
|
55
|
-
]);
|
|
56
|
-
export const knownServiceSchema = Type.Object({
|
|
57
|
-
name: Type.String(),
|
|
58
|
-
dashboardUrl: dashboards,
|
|
59
|
-
keys: Type.Array(serviceKeySchema)
|
|
60
|
-
});
|
|
61
1
|
export const KNOWN_SERVICES = {
|
|
62
2
|
GENERAL: {
|
|
63
3
|
name: "General",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const DatabaseSchema: z.ZodEnum<{
|
|
3
|
+
sqlite: "sqlite";
|
|
3
4
|
none: "none";
|
|
4
5
|
mysql: "mysql";
|
|
5
|
-
sqlite: "sqlite";
|
|
6
6
|
mongodb: "mongodb";
|
|
7
7
|
postgres: "postgres";
|
|
8
8
|
}>;
|
|
@@ -18,15 +18,15 @@ export declare const BackendSchema: z.ZodEnum<{
|
|
|
18
18
|
none: "none";
|
|
19
19
|
hono: "hono";
|
|
20
20
|
next: "next";
|
|
21
|
-
convex: "convex";
|
|
22
21
|
express: "express";
|
|
23
22
|
fastify: "fastify";
|
|
24
23
|
elysia: "elysia";
|
|
24
|
+
convex: "convex";
|
|
25
25
|
}>;
|
|
26
26
|
export type Backend = z.infer<typeof BackendSchema>;
|
|
27
27
|
export declare const RuntimeSchema: z.ZodEnum<{
|
|
28
|
-
none: "none";
|
|
29
28
|
bun: "bun";
|
|
29
|
+
none: "none";
|
|
30
30
|
node: "node";
|
|
31
31
|
workers: "workers";
|
|
32
32
|
}>;
|
|
@@ -45,13 +45,13 @@ export declare const FrontendSchema: z.ZodEnum<{
|
|
|
45
45
|
}>;
|
|
46
46
|
export type Frontend = z.infer<typeof FrontendSchema>;
|
|
47
47
|
export declare const AddonsSchema: z.ZodEnum<{
|
|
48
|
+
biome: "biome";
|
|
48
49
|
none: "none";
|
|
49
50
|
tauri: "tauri";
|
|
50
|
-
biome: "biome";
|
|
51
51
|
starlight: "starlight";
|
|
52
52
|
turborepo: "turborepo";
|
|
53
|
-
husky: "husky";
|
|
54
53
|
pwa: "pwa";
|
|
54
|
+
husky: "husky";
|
|
55
55
|
}>;
|
|
56
56
|
export type Addons = z.infer<typeof AddonsSchema>;
|
|
57
57
|
export declare const ExamplesSchema: z.ZodEnum<{
|
|
@@ -14,7 +14,7 @@ export type BrowserRepoOption = "reliverse/template-browser-extension" | "unknow
|
|
|
14
14
|
export declare function configureBrowserExtension(): Promise<{
|
|
15
15
|
displayName: string;
|
|
16
16
|
description: string;
|
|
17
|
-
features: ("
|
|
17
|
+
features: ("commands" | "webview" | "language" | "themes")[];
|
|
18
18
|
activation: "onCommand" | "onLanguage" | "startup";
|
|
19
19
|
publisher: string;
|
|
20
20
|
}>;
|
|
@@ -24,7 +24,7 @@ export declare function configureBrowserExtension(): Promise<{
|
|
|
24
24
|
export declare function configureVSCodeExtension(): Promise<{
|
|
25
25
|
displayName: string;
|
|
26
26
|
description: string;
|
|
27
|
-
features: ("
|
|
27
|
+
features: ("commands" | "webview" | "language" | "themes")[];
|
|
28
28
|
activation: "onCommand" | "onLanguage" | "startup";
|
|
29
29
|
publisher: string;
|
|
30
30
|
}>;
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
export declare function checkIfRegenerationNeeded(reltypesPath: string): Promise<boolean>;
|
|
2
2
|
export declare function ensureReltypesFile(cwd: string): Promise<void>;
|
|
3
|
+
export interface JsonSchemaDocument {
|
|
4
|
+
$schema?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
type?: string | string[];
|
|
8
|
+
properties?: Record<string, unknown>;
|
|
9
|
+
required?: string[];
|
|
10
|
+
additionalProperties?: boolean;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export type SchemaFactory = () => JsonSchemaDocument | Promise<JsonSchemaDocument>;
|
|
14
|
+
export declare function generateSchemaFile({ filePath, schemaOrFactory, }: {
|
|
15
|
+
filePath: string;
|
|
16
|
+
schemaOrFactory: JsonSchemaDocument | SchemaFactory;
|
|
17
|
+
}): Promise<void>;
|
package/bin/impl/schema/utils.js
CHANGED
|
@@ -27,6 +27,20 @@ export async function checkIfRegenerationNeeded(reltypesPath) {
|
|
|
27
27
|
}
|
|
28
28
|
export async function ensureReltypesFile(cwd) {
|
|
29
29
|
const reltypesPath = path.resolve(cwd, "reltypes.ts");
|
|
30
|
+
try {
|
|
31
|
+
const pkgJsonPath = path.resolve(cwd, "package.json");
|
|
32
|
+
if (await fs.pathExists(pkgJsonPath)) {
|
|
33
|
+
const raw = await fs.readFile(pkgJsonPath, "utf8");
|
|
34
|
+
const pkg = JSON.parse(raw);
|
|
35
|
+
const hasDler = Boolean(
|
|
36
|
+
pkg.dependencies && pkg.dependencies["@reliverse/dler"] || pkg.devDependencies && pkg.devDependencies["@reliverse/dler"]
|
|
37
|
+
);
|
|
38
|
+
if (hasDler) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} catch {
|
|
43
|
+
}
|
|
30
44
|
if (await fs.pathExists(reltypesPath)) {
|
|
31
45
|
const needsRegeneration = await checkIfRegenerationNeeded(reltypesPath);
|
|
32
46
|
if (!needsRegeneration) {
|
|
@@ -51,3 +65,22 @@ export async function ensureReltypesFile(cwd) {
|
|
|
51
65
|
);
|
|
52
66
|
}
|
|
53
67
|
}
|
|
68
|
+
export async function generateSchemaFile({
|
|
69
|
+
filePath,
|
|
70
|
+
schemaOrFactory
|
|
71
|
+
}) {
|
|
72
|
+
try {
|
|
73
|
+
const schema = typeof schemaOrFactory === "function" ? await schemaOrFactory() : schemaOrFactory;
|
|
74
|
+
const finalized = {
|
|
75
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
76
|
+
...schema
|
|
77
|
+
};
|
|
78
|
+
await fs.outputFile(filePath, JSON.stringify(finalized, null, 2), { encoding: "utf8" });
|
|
79
|
+
relinka("success", `Generated schema at ${filePath}`);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
relinka(
|
|
82
|
+
"warn",
|
|
83
|
+
`Could not generate schema file: ${error instanceof Error ? error.message : String(error)}`
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -2,7 +2,6 @@ import path from "@reliverse/pathkit";
|
|
|
2
2
|
import { re } from "@reliverse/relico";
|
|
3
3
|
import fs, { ensuredir, setHiddenAttribute } from "@reliverse/relifso";
|
|
4
4
|
import { relinka } from "@reliverse/relinka";
|
|
5
|
-
import { Value } from "@sinclair/typebox/value";
|
|
6
5
|
import { parseJSONC } from "confbox";
|
|
7
6
|
import { ofetch } from "ofetch";
|
|
8
7
|
import { cliHomeRepos } from "../config/constants.js";
|
|
@@ -10,7 +9,7 @@ import { experimental, recommended } from "./badgeNotifiers.js";
|
|
|
10
9
|
import {
|
|
11
10
|
DEFAULT_REPOS_CONFIG,
|
|
12
11
|
generateReposJsonSchema,
|
|
13
|
-
|
|
12
|
+
isReposConfig,
|
|
14
13
|
shouldRegenerateSchema
|
|
15
14
|
} from "./schemaTemplate.js";
|
|
16
15
|
export const REPO_TEMPLATES = [
|
|
@@ -107,7 +106,7 @@ async function readReposConfig() {
|
|
|
107
106
|
try {
|
|
108
107
|
const content = await fs.readFile(configPath, "utf-8");
|
|
109
108
|
const parsed = parseJSONC(content);
|
|
110
|
-
if (
|
|
109
|
+
if (isReposConfig(parsed)) {
|
|
111
110
|
return parsed;
|
|
112
111
|
}
|
|
113
112
|
} catch (error) {
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}>;
|
|
16
|
-
export type Hardcoded = Static<typeof hardcodedSchema>;
|
|
17
|
-
export type UrlPatterns = Static<typeof urlPatternsSchema>;
|
|
1
|
+
export interface Hardcoded {
|
|
2
|
+
RelivatorTitle: "Relivator template is the foundation of your eCommerce platform: Build More Efficient, Engaging, and Profitable Online Stores";
|
|
3
|
+
RelivatorShort: "Relivator";
|
|
4
|
+
RelivatorLower: "relivator";
|
|
5
|
+
RelivatorDomain: "relivator.com";
|
|
6
|
+
DefaultAuthor: "blefnk";
|
|
7
|
+
DefaultEmail: "onboarding@resend.dev";
|
|
8
|
+
GeneralTemplate: "template";
|
|
9
|
+
}
|
|
10
|
+
export interface UrlPatterns {
|
|
11
|
+
githubUrl: (author: string, repo: string) => string;
|
|
12
|
+
vercelUrl: (project: string) => string;
|
|
13
|
+
packageName: (name: string) => string;
|
|
14
|
+
}
|
|
18
15
|
export declare const HardcodedStrings: Hardcoded;
|
|
19
16
|
export declare const CommonPatterns: UrlPatterns;
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
export const hardcodedSchema = Type.Object({
|
|
3
|
-
RelivatorTitle: Type.Literal(
|
|
4
|
-
"Relivator template is the foundation of your eCommerce platform: Build More Efficient, Engaging, and Profitable Online Stores"
|
|
5
|
-
),
|
|
6
|
-
RelivatorShort: Type.Literal("Relivator"),
|
|
7
|
-
RelivatorLower: Type.Literal("relivator"),
|
|
8
|
-
RelivatorDomain: Type.Literal("relivator.com"),
|
|
9
|
-
DefaultAuthor: Type.Literal("blefnk"),
|
|
10
|
-
DefaultEmail: Type.Literal("onboarding@resend.dev"),
|
|
11
|
-
GeneralTemplate: Type.Literal("template")
|
|
12
|
-
});
|
|
13
|
-
export const urlPatternsSchema = Type.Object({
|
|
14
|
-
githubUrl: Type.Function([Type.String(), Type.String()], Type.String()),
|
|
15
|
-
vercelUrl: Type.Function([Type.String()], Type.String()),
|
|
16
|
-
packageName: Type.Function([Type.String()], Type.String())
|
|
17
|
-
});
|
|
18
1
|
export const HardcodedStrings = {
|
|
19
2
|
RelivatorTitle: "Relivator template is the foundation of your eCommerce platform: Build More Efficient, Engaging, and Profitable Online Stores",
|
|
20
3
|
RelivatorShort: "Relivator",
|
|
@@ -1,31 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
key: import("@sinclair/typebox").TString;
|
|
19
|
-
githubKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
20
|
-
vercelKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
21
|
-
openaiKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
22
|
-
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
23
|
-
email: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
24
|
-
githubUsername: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
25
|
-
vercelTeamId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
26
|
-
vercelTeamSlug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
27
|
-
}>;
|
|
28
|
-
export type ReliverseMemory = Static<typeof memorySchema>;
|
|
29
|
-
export type EncryptedDataMemory = keyof Static<typeof encryptedDataSchema>;
|
|
30
|
-
export type UserDataMemory = keyof Static<typeof userDataSchema>;
|
|
31
|
-
export {};
|
|
1
|
+
export interface EncryptedDataMemoryShape {
|
|
2
|
+
code: string;
|
|
3
|
+
key: string;
|
|
4
|
+
githubKey?: string;
|
|
5
|
+
vercelKey?: string;
|
|
6
|
+
openaiKey?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface UserDataMemoryShape {
|
|
9
|
+
name?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
githubUsername?: string;
|
|
12
|
+
vercelTeamId?: string;
|
|
13
|
+
vercelTeamSlug?: string;
|
|
14
|
+
}
|
|
15
|
+
export type ReliverseMemory = EncryptedDataMemoryShape & UserDataMemoryShape;
|
|
16
|
+
export type EncryptedDataMemory = keyof EncryptedDataMemoryShape;
|
|
17
|
+
export type UserDataMemory = keyof UserDataMemoryShape;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
const encryptedDataSchema = Type.Object({
|
|
3
|
-
code: Type.String(),
|
|
4
|
-
key: Type.String(),
|
|
5
|
-
githubKey: Type.Optional(Type.String()),
|
|
6
|
-
vercelKey: Type.Optional(Type.String()),
|
|
7
|
-
openaiKey: Type.Optional(Type.String())
|
|
8
|
-
});
|
|
9
|
-
const userDataSchema = Type.Object({
|
|
10
|
-
name: Type.Optional(Type.String()),
|
|
11
|
-
email: Type.Optional(Type.String()),
|
|
12
|
-
githubUsername: Type.Optional(Type.String()),
|
|
13
|
-
vercelTeamId: Type.Optional(Type.String()),
|
|
14
|
-
vercelTeamSlug: Type.Optional(Type.String())
|
|
15
|
-
});
|
|
16
|
-
export const memorySchema = Type.Composite([encryptedDataSchema, userDataSchema]);
|
|
@@ -1,52 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
repos: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
25
|
-
id: import("@sinclair/typebox").TString;
|
|
26
|
-
author: import("@sinclair/typebox").TString;
|
|
27
|
-
name: import("@sinclair/typebox").TString;
|
|
28
|
-
description: import("@sinclair/typebox").TString;
|
|
29
|
-
category: import("@sinclair/typebox").TString;
|
|
30
|
-
lastUpdated: import("@sinclair/typebox").TString;
|
|
31
|
-
localPath: import("@sinclair/typebox").TString;
|
|
32
|
-
github: import("@sinclair/typebox").TObject<{
|
|
33
|
-
stars: import("@sinclair/typebox").TNumber;
|
|
34
|
-
forks: import("@sinclair/typebox").TNumber;
|
|
35
|
-
watchers: import("@sinclair/typebox").TNumber;
|
|
36
|
-
createdAt: import("@sinclair/typebox").TString;
|
|
37
|
-
updatedAt: import("@sinclair/typebox").TString;
|
|
38
|
-
pushedAt: import("@sinclair/typebox").TString;
|
|
39
|
-
defaultBranch: import("@sinclair/typebox").TString;
|
|
40
|
-
}>;
|
|
41
|
-
}>>;
|
|
42
|
-
}>;
|
|
43
|
-
export type ReposConfig = Static<typeof reposSchema>;
|
|
1
|
+
export interface RepoInfo {
|
|
2
|
+
id: string;
|
|
3
|
+
author: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
category: string;
|
|
7
|
+
lastUpdated: string;
|
|
8
|
+
localPath: string;
|
|
9
|
+
github: {
|
|
10
|
+
stars: number;
|
|
11
|
+
forks: number;
|
|
12
|
+
watchers: number;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
pushedAt: string;
|
|
16
|
+
defaultBranch: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface ReposConfig {
|
|
20
|
+
$schema: string;
|
|
21
|
+
version: string;
|
|
22
|
+
repos: RepoInfo[];
|
|
23
|
+
}
|
|
44
24
|
export declare const DEFAULT_REPOS_CONFIG: ReposConfig;
|
|
45
|
-
|
|
46
|
-
* Generates a JSON schema file for repos
|
|
47
|
-
*/
|
|
25
|
+
export declare function isReposConfig(value: unknown): value is ReposConfig;
|
|
48
26
|
export declare function generateReposJsonSchema(): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Checks if schema needs to be regenerated based on CLI version
|
|
51
|
-
*/
|
|
52
27
|
export declare function shouldRegenerateSchema(): Promise<boolean>;
|
|
@@ -1,102 +1,83 @@
|
|
|
1
1
|
import path from "@reliverse/pathkit";
|
|
2
2
|
import fs, { ensuredir } from "@reliverse/relifso";
|
|
3
|
-
import { Type } from "@sinclair/typebox";
|
|
4
3
|
import { cliHomeRepos, cliVersion } from "../config/constants.js";
|
|
5
|
-
export const repoInfoSchema = Type.Object({
|
|
6
|
-
id: Type.String(),
|
|
7
|
-
author: Type.String(),
|
|
8
|
-
name: Type.String(),
|
|
9
|
-
description: Type.String(),
|
|
10
|
-
category: Type.String(),
|
|
11
|
-
lastUpdated: Type.String(),
|
|
12
|
-
// ISO date string
|
|
13
|
-
localPath: Type.String(),
|
|
14
|
-
// GitHub repository information from ungh
|
|
15
|
-
github: Type.Object({
|
|
16
|
-
stars: Type.Number(),
|
|
17
|
-
forks: Type.Number(),
|
|
18
|
-
watchers: Type.Number(),
|
|
19
|
-
createdAt: Type.String(),
|
|
20
|
-
updatedAt: Type.String(),
|
|
21
|
-
pushedAt: Type.String(),
|
|
22
|
-
defaultBranch: Type.String()
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
export const reposSchema = Type.Object(
|
|
26
|
-
{
|
|
27
|
-
$schema: Type.String(),
|
|
28
|
-
version: Type.String(),
|
|
29
|
-
// CLI version when repos.json was last updated
|
|
30
|
-
repos: Type.Array(repoInfoSchema)
|
|
31
|
-
},
|
|
32
|
-
{ additionalProperties: false }
|
|
33
|
-
);
|
|
34
4
|
export const DEFAULT_REPOS_CONFIG = {
|
|
35
5
|
$schema: "./schema.json",
|
|
36
6
|
version: cliVersion,
|
|
37
7
|
repos: []
|
|
38
8
|
};
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
type: "string",
|
|
53
|
-
enum: variants.map((v) => v.const)
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (schema.type === "object") {
|
|
58
|
-
const result = {
|
|
59
|
-
type: "object",
|
|
60
|
-
properties: {}
|
|
61
|
-
};
|
|
62
|
-
if (schema.required) {
|
|
63
|
-
result.required = schema.required;
|
|
64
|
-
}
|
|
65
|
-
if (schema.properties) {
|
|
66
|
-
for (const [key, value] of Object.entries(schema.properties)) {
|
|
67
|
-
result.properties[key] = convertTypeBoxToJsonSchema(value);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return result;
|
|
71
|
-
}
|
|
72
|
-
if (schema.type === "array") {
|
|
73
|
-
return {
|
|
74
|
-
type: "array",
|
|
75
|
-
items: convertTypeBoxToJsonSchema(schema.items)
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
if (schema.type) {
|
|
79
|
-
const result = { type: schema.type };
|
|
80
|
-
if (schema.minimum !== void 0) result.minimum = schema.minimum;
|
|
81
|
-
if (schema.maximum !== void 0) result.maximum = schema.maximum;
|
|
82
|
-
if (schema.minLength !== void 0) result.minLength = schema.minLength;
|
|
83
|
-
if (schema.maxLength !== void 0) result.maxLength = schema.maxLength;
|
|
84
|
-
if (schema.pattern !== void 0) result.pattern = schema.pattern;
|
|
85
|
-
if (schema.format !== void 0) result.format = schema.format;
|
|
86
|
-
if (schema.default !== void 0) result.default = schema.default;
|
|
87
|
-
return result;
|
|
88
|
-
}
|
|
89
|
-
return schema;
|
|
9
|
+
function isObject(value) {
|
|
10
|
+
return typeof value === "object" && value !== null;
|
|
11
|
+
}
|
|
12
|
+
function isRepoInfo(value) {
|
|
13
|
+
if (!isObject(value)) return false;
|
|
14
|
+
const v = value;
|
|
15
|
+
const github = v.github;
|
|
16
|
+
return typeof v.id === "string" && typeof v.author === "string" && typeof v.name === "string" && typeof v.description === "string" && typeof v.category === "string" && typeof v.lastUpdated === "string" && typeof v.localPath === "string" && isObject(github) && typeof github.stars === "number" && typeof github.forks === "number" && typeof github.watchers === "number" && typeof github.createdAt === "string" && typeof github.updatedAt === "string" && typeof github.pushedAt === "string" && typeof github.defaultBranch === "string";
|
|
17
|
+
}
|
|
18
|
+
export function isReposConfig(value) {
|
|
19
|
+
if (!isObject(value)) return false;
|
|
20
|
+
const v = value;
|
|
21
|
+
return typeof v.$schema === "string" && typeof v.version === "string" && Array.isArray(v.repos) && v.repos.every((r) => isRepoInfo(r));
|
|
90
22
|
}
|
|
91
23
|
export async function generateReposJsonSchema() {
|
|
92
|
-
const converted = convertTypeBoxToJsonSchema(reposSchema);
|
|
93
24
|
const schema = {
|
|
94
25
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
95
26
|
title: "rse Repos Schema",
|
|
96
27
|
description: "Schema for repos.json configuration file",
|
|
97
28
|
type: "object",
|
|
98
|
-
properties:
|
|
99
|
-
|
|
29
|
+
properties: {
|
|
30
|
+
$schema: { type: "string" },
|
|
31
|
+
version: { type: "string" },
|
|
32
|
+
repos: {
|
|
33
|
+
type: "array",
|
|
34
|
+
items: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
id: { type: "string" },
|
|
38
|
+
author: { type: "string" },
|
|
39
|
+
name: { type: "string" },
|
|
40
|
+
description: { type: "string" },
|
|
41
|
+
category: { type: "string" },
|
|
42
|
+
lastUpdated: { type: "string" },
|
|
43
|
+
localPath: { type: "string" },
|
|
44
|
+
github: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
stars: { type: "number" },
|
|
48
|
+
forks: { type: "number" },
|
|
49
|
+
watchers: { type: "number" },
|
|
50
|
+
createdAt: { type: "string" },
|
|
51
|
+
updatedAt: { type: "string" },
|
|
52
|
+
pushedAt: { type: "string" },
|
|
53
|
+
defaultBranch: { type: "string" }
|
|
54
|
+
},
|
|
55
|
+
required: [
|
|
56
|
+
"stars",
|
|
57
|
+
"forks",
|
|
58
|
+
"watchers",
|
|
59
|
+
"createdAt",
|
|
60
|
+
"updatedAt",
|
|
61
|
+
"pushedAt",
|
|
62
|
+
"defaultBranch"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
required: [
|
|
67
|
+
"id",
|
|
68
|
+
"author",
|
|
69
|
+
"name",
|
|
70
|
+
"description",
|
|
71
|
+
"category",
|
|
72
|
+
"lastUpdated",
|
|
73
|
+
"localPath",
|
|
74
|
+
"github"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
required: ["$schema", "version", "repos"],
|
|
80
|
+
additionalProperties: false
|
|
100
81
|
};
|
|
101
82
|
await ensuredir(cliHomeRepos);
|
|
102
83
|
const schemaPath = path.join(cliHomeRepos, "schema.json");
|
package/bin/mod.d.ts
CHANGED
|
@@ -158,8 +158,8 @@ export { createMobileProject, createWebProject } from "./impl/init/use-template/
|
|
|
158
158
|
export { showCloneProjectMenu } from "./impl/init/use-template/cp-modules/cli-main-modules/cli-menu-items/showCloneProjectMenu";
|
|
159
159
|
export { showAnykeyPrompt } from "./impl/init/use-template/cp-modules/cli-main-modules/modules/showAnykeyPrompt";
|
|
160
160
|
export { copyFromExisting, ensureEnvExists, ensureExampleExists, fetchEnvExampleContent, getEnvPath, getLastEnvFilePath, getMissingKeys, promptAndSetMissingValues, saveLastEnvFilePath, } from "./impl/init/use-template/cp-modules/compose-env-file/cef-impl";
|
|
161
|
-
export type { KeyType, KnownService, } from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys";
|
|
162
|
-
export {
|
|
161
|
+
export type { DashboardUrl, DefaultValue, KeyType, KeyVar, KnownService, ServiceKey, } from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys";
|
|
162
|
+
export { KNOWN_SERVICES } from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys";
|
|
163
163
|
export { composeEnvFile } from "./impl/init/use-template/cp-modules/compose-env-file/cef-mod";
|
|
164
164
|
export { deployProject, selectDeploymentService, } from "./impl/init/use-template/cp-modules/git-deploy-prompts/deploy";
|
|
165
165
|
export { configureGithubRepo, handleGitInit, promptGitDeploy, } from "./impl/init/use-template/cp-modules/git-deploy-prompts/gdp-mod";
|
|
@@ -408,13 +408,12 @@ export { getOrCreateReliverseMemory, updateReliverseMemory } from "./impl/utils/
|
|
|
408
408
|
export type { ReplaceConfig } from "./impl/utils/replacements/reps-impl";
|
|
409
409
|
export { extractRepoInfo, replaceStringsInFiles } from "./impl/utils/replacements/reps-impl";
|
|
410
410
|
export type { Hardcoded, UrlPatterns } from "./impl/utils/replacements/reps-keys";
|
|
411
|
-
export { CommonPatterns, HardcodedStrings,
|
|
411
|
+
export { CommonPatterns, HardcodedStrings, } from "./impl/utils/replacements/reps-keys";
|
|
412
412
|
export { handleReplacements } from "./impl/utils/replacements/reps-mod";
|
|
413
413
|
export { resolveAllCrossLibs } from "./impl/utils/resolve-cross-libs";
|
|
414
|
-
export type { EncryptedDataMemory, ReliverseMemory, UserDataMemory, } from "./impl/utils/schemaMemory";
|
|
415
|
-
export { memorySchema } from "./impl/utils/schemaMemory";
|
|
414
|
+
export type { EncryptedDataMemory, EncryptedDataMemoryShape, ReliverseMemory, UserDataMemory, UserDataMemoryShape, } from "./impl/utils/schemaMemory";
|
|
416
415
|
export type { RepoInfo, ReposConfig } from "./impl/utils/schemaTemplate";
|
|
417
|
-
export { DEFAULT_REPOS_CONFIG, generateReposJsonSchema,
|
|
416
|
+
export { DEFAULT_REPOS_CONFIG, generateReposJsonSchema, isReposConfig, shouldRegenerateSchema, } from "./impl/utils/schemaTemplate";
|
|
418
417
|
export { createSpinner, SimpleSpinner } from "./impl/utils/spinner";
|
|
419
418
|
export { getPkgName, getPkgVersion, readPackageJSON, showEndPrompt, showStartPrompt, } from "./impl/utils/startEndPrompts";
|
|
420
419
|
export { cd, getCurrentWorkingDirectory, handleError, pwd, rm, } from "./impl/utils/terminalHelpers";
|
package/bin/mod.js
CHANGED
|
@@ -380,15 +380,7 @@ export {
|
|
|
380
380
|
promptAndSetMissingValues,
|
|
381
381
|
saveLastEnvFilePath
|
|
382
382
|
} from "./impl/init/use-template/cp-modules/compose-env-file/cef-impl.js";
|
|
383
|
-
export {
|
|
384
|
-
dashboards,
|
|
385
|
-
defaultValues,
|
|
386
|
-
KNOWN_SERVICES,
|
|
387
|
-
keyTypeSchema,
|
|
388
|
-
keyVarsSchema,
|
|
389
|
-
knownServiceSchema,
|
|
390
|
-
serviceKeySchema
|
|
391
|
-
} from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys.js";
|
|
383
|
+
export { KNOWN_SERVICES } from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys.js";
|
|
392
384
|
export { composeEnvFile } from "./impl/init/use-template/cp-modules/compose-env-file/cef-mod.js";
|
|
393
385
|
export {
|
|
394
386
|
deployProject,
|
|
@@ -970,18 +962,14 @@ export { getOrCreateReliverseMemory, updateReliverseMemory } from "./impl/utils/
|
|
|
970
962
|
export { extractRepoInfo, replaceStringsInFiles } from "./impl/utils/replacements/reps-impl.js";
|
|
971
963
|
export {
|
|
972
964
|
CommonPatterns,
|
|
973
|
-
HardcodedStrings
|
|
974
|
-
hardcodedSchema,
|
|
975
|
-
urlPatternsSchema
|
|
965
|
+
HardcodedStrings
|
|
976
966
|
} from "./impl/utils/replacements/reps-keys.js";
|
|
977
967
|
export { handleReplacements } from "./impl/utils/replacements/reps-mod.js";
|
|
978
968
|
export { resolveAllCrossLibs } from "./impl/utils/resolve-cross-libs.js";
|
|
979
|
-
export { memorySchema } from "./impl/utils/schemaMemory.js";
|
|
980
969
|
export {
|
|
981
970
|
DEFAULT_REPOS_CONFIG,
|
|
982
971
|
generateReposJsonSchema,
|
|
983
|
-
|
|
984
|
-
reposSchema,
|
|
972
|
+
isReposConfig,
|
|
985
973
|
shouldRegenerateSchema
|
|
986
974
|
} from "./impl/utils/schemaTemplate.js";
|
|
987
975
|
export { createSpinner, SimpleSpinner } from "./impl/utils/spinner.js";
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"@babel/preset-typescript": "^7.27.1",
|
|
6
6
|
"@hookform/resolvers": "^5.2.1",
|
|
7
7
|
"@libsql/client": "^0.15.14",
|
|
8
|
-
"@mendable/firecrawl-js": "^3.
|
|
8
|
+
"@mendable/firecrawl-js": "^3.3.0",
|
|
9
9
|
"@mrleebo/prisma-ast": "^0.13.0",
|
|
10
10
|
"@octokit/plugin-rest-endpoint-methods": "^16.0.0",
|
|
11
11
|
"@octokit/request-error": "^7.0.0",
|
|
@@ -27,13 +27,12 @@
|
|
|
27
27
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
28
28
|
"@rollup/plugin-replace": "^6.0.2",
|
|
29
29
|
"@rollup/pluginutils": "^5.2.0",
|
|
30
|
-
"@sinclair/typebox": "^0.34.40",
|
|
31
30
|
"@uploadcare/upload-client": "^6.17.0",
|
|
32
31
|
"@vercel/sdk": "^1.10.6",
|
|
33
32
|
"@volar/typescript": "^2.4.23",
|
|
34
33
|
"@vue/language-core": "^3.0.6",
|
|
35
34
|
"@vue/language-core2.0": "npm:@vue/language-core@2.0.29",
|
|
36
|
-
"ai": "^5.0.
|
|
35
|
+
"ai": "^5.0.26",
|
|
37
36
|
"async-listen": "^3.1.0",
|
|
38
37
|
"autoprefixer": "^10.4.21",
|
|
39
38
|
"better-auth": "^1.3.7",
|
|
@@ -84,7 +83,7 @@
|
|
|
84
83
|
"postcss": "^8.5.6",
|
|
85
84
|
"postcss-nested": "^7.0.2",
|
|
86
85
|
"postgres": "^3.4.7",
|
|
87
|
-
"posthog-node": "^5.8.
|
|
86
|
+
"posthog-node": "^5.8.1",
|
|
88
87
|
"pretty-bytes": "^7.0.1",
|
|
89
88
|
"pretty-ms": "^9.2.0",
|
|
90
89
|
"querystring": "^0.2.1",
|
|
@@ -94,7 +93,7 @@
|
|
|
94
93
|
"react-hook-form": "^7.62.0",
|
|
95
94
|
"registry-auth-token": "^5.1.0",
|
|
96
95
|
"registry-url": "^7.2.0",
|
|
97
|
-
"rollup": "^4.
|
|
96
|
+
"rollup": "^4.49.0",
|
|
98
97
|
"rollup-plugin-dts": "^6.2.3",
|
|
99
98
|
"sass": "^1.91.0",
|
|
100
99
|
"scule": "^1.3.0",
|
|
@@ -124,7 +123,7 @@
|
|
|
124
123
|
"license": "MIT",
|
|
125
124
|
"name": "@reliverse/dler",
|
|
126
125
|
"type": "module",
|
|
127
|
-
"version": "1.7.
|
|
126
|
+
"version": "1.7.122",
|
|
128
127
|
"author": "reliverse",
|
|
129
128
|
"bugs": {
|
|
130
129
|
"email": "blefnk@gmail.com",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates a JSON schema file from the TypeBox schema
|
|
3
|
-
*/
|
|
4
|
-
export declare function generateJsonSchema(typeboxSchema: any, outputPath: string): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Generates the schema.json in the project root
|
|
7
|
-
*/
|
|
8
|
-
export declare function generateSchemaFile(schema: any): Promise<void>;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import path from "@reliverse/pathkit";
|
|
2
|
-
import fs from "@reliverse/relifso";
|
|
3
|
-
function convertTypeBoxToJsonSchema(schema) {
|
|
4
|
-
if (!schema || typeof schema !== "object") return schema;
|
|
5
|
-
if (schema.type === "string" && schema.enum) {
|
|
6
|
-
return {
|
|
7
|
-
type: "string",
|
|
8
|
-
enum: schema.enum
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
if (schema.anyOf || schema.allOf || schema.oneOf) {
|
|
12
|
-
const variants = schema.anyOf || schema.allOf || schema.oneOf;
|
|
13
|
-
const allLiterals = variants.every((v) => v.const !== void 0);
|
|
14
|
-
if (allLiterals) {
|
|
15
|
-
return {
|
|
16
|
-
type: "string",
|
|
17
|
-
enum: variants.map((v) => v.const)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
if (schema.type === "object") {
|
|
22
|
-
const result = {
|
|
23
|
-
type: "object",
|
|
24
|
-
properties: {}
|
|
25
|
-
};
|
|
26
|
-
if (schema.required) {
|
|
27
|
-
result.required = schema.required;
|
|
28
|
-
}
|
|
29
|
-
if (schema.properties) {
|
|
30
|
-
for (const [key, value] of Object.entries(schema.properties)) {
|
|
31
|
-
result.properties[key] = convertTypeBoxToJsonSchema(value);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (schema.additionalProperties) {
|
|
35
|
-
result.additionalProperties = convertTypeBoxToJsonSchema(schema.additionalProperties);
|
|
36
|
-
}
|
|
37
|
-
if (schema.patternProperties) {
|
|
38
|
-
result.patternProperties = {};
|
|
39
|
-
for (const [pattern, value] of Object.entries(schema.patternProperties)) {
|
|
40
|
-
result.patternProperties[pattern] = convertTypeBoxToJsonSchema(value);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
if (schema.type === "array") {
|
|
46
|
-
return {
|
|
47
|
-
type: "array",
|
|
48
|
-
items: convertTypeBoxToJsonSchema(schema.items)
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
if (schema.type) {
|
|
52
|
-
const result = { type: schema.type };
|
|
53
|
-
if (schema.minimum !== void 0) result.minimum = schema.minimum;
|
|
54
|
-
if (schema.maximum !== void 0) result.maximum = schema.maximum;
|
|
55
|
-
if (schema.minLength !== void 0) result.minLength = schema.minLength;
|
|
56
|
-
if (schema.maxLength !== void 0) result.maxLength = schema.maxLength;
|
|
57
|
-
if (schema.pattern !== void 0) result.pattern = schema.pattern;
|
|
58
|
-
if (schema.format !== void 0) result.format = schema.format;
|
|
59
|
-
if (schema.default !== void 0) result.default = schema.default;
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
return schema;
|
|
63
|
-
}
|
|
64
|
-
export async function generateJsonSchema(typeboxSchema, outputPath) {
|
|
65
|
-
const converted = convertTypeBoxToJsonSchema(typeboxSchema);
|
|
66
|
-
const schema = {
|
|
67
|
-
$schema: "http://json-schema.org/draft-07/schema#",
|
|
68
|
-
title: "rse configuration schema",
|
|
69
|
-
description: "https://docs.reliverse.org",
|
|
70
|
-
type: "object",
|
|
71
|
-
properties: converted.properties,
|
|
72
|
-
required: converted.required
|
|
73
|
-
};
|
|
74
|
-
await fs.writeFile(outputPath, JSON.stringify(schema, null, 2));
|
|
75
|
-
}
|
|
76
|
-
export async function generateSchemaFile(schema) {
|
|
77
|
-
const schemaPath = path.join(process.cwd(), "schema.json");
|
|
78
|
-
if (fs.existsSync(schemaPath)) {
|
|
79
|
-
await fs.remove(schemaPath);
|
|
80
|
-
}
|
|
81
|
-
await generateJsonSchema(schema, schemaPath);
|
|
82
|
-
}
|