@reliverse/dler 1.7.121 → 1.7.123
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/build/binary-flow.js +24 -4
- package/bin/impl/build/build-regular.js +12 -9
- package/bin/impl/build/impl.d.ts +1 -1
- package/bin/impl/build/impl.js +23 -7
- package/bin/impl/build/library-flow.js +49 -2
- package/bin/impl/build/providers/build.js +13 -13
- package/bin/impl/build/providers/mkdist/mkdist-impl/make.js +1 -1
- package/bin/impl/build/providers/mkdist/mkdist-mod.js +1 -1
- package/bin/impl/build/regular-flow.js +130 -57
- package/bin/impl/config/create.js +18 -1
- package/bin/impl/config/prepare.js +1 -7
- package/bin/impl/config/repair.d.ts +1 -2
- package/bin/impl/config/repair.js +18 -54
- package/bin/impl/init/use-template/cp-impl.js +1 -1
- package/bin/impl/init/use-template/cp-modules/cli-main-modules/cli-menu-items/showCloneProjectMenu.js +1 -1
- 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/init/use-template/cp-modules/git-deploy-prompts/gdp-mod.js +1 -1
- package/bin/impl/init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-create.js +1 -1
- package/bin/impl/init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-deploy.js +1 -1
- package/bin/impl/merge/mod.js +71 -49
- package/bin/impl/migrate/codemods/anything-bun.js +1 -1
- package/bin/impl/providers/better-t-stack/types.d.ts +6 -6
- package/bin/impl/pub/impl.d.ts +1 -1
- package/bin/impl/pub/impl.js +31 -11
- package/bin/impl/rules/reliverse/missing-deps/formatter.js +1 -1
- package/bin/impl/schema/utils.d.ts +15 -0
- package/bin/impl/schema/utils.js +33 -0
- package/bin/impl/utils/downloading/downloadRepo.js +58 -8
- package/bin/impl/utils/finalize.d.ts +2 -2
- package/bin/impl/utils/finalize.js +10 -11
- package/bin/impl/utils/init/init-tmpl.d.ts +1 -1
- package/bin/impl/utils/init/init-tmpl.js +2 -2
- 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/impl/utils/spinner.d.ts +243 -15
- package/bin/impl/utils/spinner.js +362 -46
- package/bin/mod.d.ts +7 -7
- package/bin/mod.js +28 -16
- package/package.json +5 -6
- package/bin/impl/config/impl/typebox.d.ts +0 -8
- package/bin/impl/config/impl/typebox.js +0 -82
package/bin/impl/pub/impl.js
CHANGED
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import { bumpHandler, isBumpDisabled, setBumpDisabledValueTo } from "@reliverse/bleump";
|
|
2
|
+
import { relinka } from "@reliverse/relinka";
|
|
3
|
+
import prettyMilliseconds from "pretty-ms";
|
|
2
4
|
import { dlerBuild } from "../build/impl.js";
|
|
3
5
|
import { library_pubFlow } from "../build/library-flow.js";
|
|
4
6
|
import { regular_pubFlow } from "../build/regular-flow.js";
|
|
5
7
|
import { getConfigDler } from "../config/load.js";
|
|
6
8
|
import { finalizeBuild, finalizePub } from "../utils/finalize.js";
|
|
7
|
-
import {
|
|
9
|
+
import { createMultiStepSpinner } from "../utils/spinner.js";
|
|
8
10
|
import { handleDlerError } from "../utils/utils-error-cwd.js";
|
|
11
|
+
import { getElapsedPerfTime } from "../utils/utils-perf.js";
|
|
9
12
|
export async function dlerPub(timer, isDev, config) {
|
|
10
13
|
let effectiveConfig = config;
|
|
11
14
|
let shouldShowSpinner = false;
|
|
12
|
-
let
|
|
15
|
+
let multiStepSpinner = null;
|
|
13
16
|
try {
|
|
14
17
|
if (!effectiveConfig) {
|
|
15
18
|
effectiveConfig = await getConfigDler();
|
|
16
19
|
}
|
|
17
20
|
shouldShowSpinner = effectiveConfig.displayBuildPubLogs === false;
|
|
18
|
-
|
|
21
|
+
const pubSteps = effectiveConfig.commonPubPause ? ["Loading configuration", "Version bumping", "Building project", "Finalizing"] : [
|
|
22
|
+
"Loading configuration",
|
|
23
|
+
"Version bumping",
|
|
24
|
+
"Building project",
|
|
25
|
+
"Publishing",
|
|
26
|
+
"Finalizing"
|
|
27
|
+
];
|
|
28
|
+
multiStepSpinner = shouldShowSpinner ? createMultiStepSpinner("Build and Publish Process", pubSteps, { color: "cyan" }) : null;
|
|
29
|
+
if (multiStepSpinner) multiStepSpinner.nextStep();
|
|
19
30
|
const bumpIsDisabled = await isBumpDisabled();
|
|
20
31
|
if (!bumpIsDisabled && !effectiveConfig.commonPubPause) {
|
|
21
32
|
try {
|
|
@@ -30,6 +41,7 @@ export async function dlerPub(timer, isDev, config) {
|
|
|
30
41
|
throw new Error("[reliverse.ts] Failed to set bumpDisable to true");
|
|
31
42
|
}
|
|
32
43
|
}
|
|
44
|
+
if (multiStepSpinner) multiStepSpinner.nextStep();
|
|
33
45
|
const { effectiveConfig: buildConfig } = await dlerBuild(
|
|
34
46
|
timer,
|
|
35
47
|
isDev,
|
|
@@ -39,28 +51,36 @@ export async function dlerPub(timer, isDev, config) {
|
|
|
39
51
|
shouldShowSpinner
|
|
40
52
|
// disable build's spinner if pub is showing one
|
|
41
53
|
);
|
|
54
|
+
if (multiStepSpinner) multiStepSpinner.nextStep();
|
|
42
55
|
if (effectiveConfig.commonPubPause) {
|
|
43
|
-
await finalizeBuild(timer, effectiveConfig.commonPubPause, "pub");
|
|
44
|
-
if (
|
|
45
|
-
|
|
56
|
+
await finalizeBuild(shouldShowSpinner, timer, effectiveConfig.commonPubPause, "pub");
|
|
57
|
+
if (multiStepSpinner) {
|
|
58
|
+
multiStepSpinner.complete("Build completed successfully");
|
|
46
59
|
}
|
|
47
60
|
} else {
|
|
48
61
|
await regular_pubFlow(timer, isDev, buildConfig);
|
|
49
62
|
await library_pubFlow(timer, isDev, buildConfig);
|
|
63
|
+
if (multiStepSpinner) multiStepSpinner.nextStep();
|
|
50
64
|
await finalizePub(
|
|
51
|
-
timer,
|
|
52
65
|
buildConfig.libsList,
|
|
53
66
|
buildConfig.distNpmDirName,
|
|
54
67
|
buildConfig.distJsrDirName,
|
|
55
68
|
buildConfig.libsDirDist
|
|
56
69
|
);
|
|
57
|
-
|
|
58
|
-
|
|
70
|
+
const elapsedTime = getElapsedPerfTime(timer);
|
|
71
|
+
const formattedPerfTime = prettyMilliseconds(elapsedTime, { verbose: true });
|
|
72
|
+
if (multiStepSpinner) {
|
|
73
|
+
multiStepSpinner.complete(
|
|
74
|
+
`Build and publish completed successfully in ${formattedPerfTime}`
|
|
75
|
+
);
|
|
76
|
+
} else {
|
|
77
|
+
relinka("success", `\u2705 Build and publish completed successfully in ${formattedPerfTime}`);
|
|
59
78
|
}
|
|
60
79
|
}
|
|
61
80
|
} catch (error) {
|
|
62
|
-
if (
|
|
63
|
-
|
|
81
|
+
if (multiStepSpinner) {
|
|
82
|
+
const currentStep = multiStepSpinner.getCurrentStep();
|
|
83
|
+
multiStepSpinner.error(error, currentStep);
|
|
64
84
|
}
|
|
65
85
|
handleDlerError(error);
|
|
66
86
|
}
|
|
@@ -60,7 +60,7 @@ export const formatOutput = (result, options) => {
|
|
|
60
60
|
output += re.cyan(`npm install ${result.missingDependencies.join(" ")}
|
|
61
61
|
`);
|
|
62
62
|
} else {
|
|
63
|
-
output += re.greenBright("No missing dependencies found! \
|
|
63
|
+
output += re.greenBright("No missing dependencies found! \u2705\n\n");
|
|
64
64
|
}
|
|
65
65
|
if (options.builtins && result.builtinModules.length > 0) {
|
|
66
66
|
output += re.blueBright("Node.js Built-in Modules Used:\n");
|
|
@@ -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
|
+
}
|
|
@@ -13,6 +13,11 @@ import { promisify } from "util";
|
|
|
13
13
|
import { cliConfigJsonc, cliConfigTs, cliHomeRepos } from "../../config/constants.js";
|
|
14
14
|
import { getReliverseConfigPath } from "../../config/path.js";
|
|
15
15
|
import { initGitDir } from "../../init/use-template/cp-modules/git-deploy-prompts/git.js";
|
|
16
|
+
import {
|
|
17
|
+
createFileProgressSpinner,
|
|
18
|
+
createTransferSpinner,
|
|
19
|
+
withEnhancedSpinner
|
|
20
|
+
} from "../spinner.js";
|
|
16
21
|
const execAsync = promisify(exec);
|
|
17
22
|
async function getFolderSize(directory, skipDirs = []) {
|
|
18
23
|
let totalSize = 0;
|
|
@@ -106,11 +111,12 @@ async function getCommitHash(repoUrl, ref) {
|
|
|
106
111
|
}
|
|
107
112
|
return hash;
|
|
108
113
|
}
|
|
109
|
-
function downloadTarball(url, dest) {
|
|
114
|
+
function downloadTarball(url, dest, showProgress = false) {
|
|
110
115
|
return new Promise((resolve, reject) => {
|
|
111
116
|
const file = fs.createWriteStream(dest);
|
|
112
117
|
const proxy = process.env.https_proxy;
|
|
113
118
|
const options = proxy ? { agent: new HttpsProxyAgent(proxy) } : {};
|
|
119
|
+
let transferSpinner = null;
|
|
114
120
|
https.get(url, options, (response) => {
|
|
115
121
|
if (response.statusCode && response.statusCode >= 400) {
|
|
116
122
|
reject(
|
|
@@ -120,11 +126,34 @@ function downloadTarball(url, dest) {
|
|
|
120
126
|
);
|
|
121
127
|
return;
|
|
122
128
|
}
|
|
129
|
+
const totalBytes = parseInt(response.headers["content-length"] || "0", 10);
|
|
130
|
+
let downloadedBytes = 0;
|
|
131
|
+
if (showProgress && totalBytes > 0) {
|
|
132
|
+
transferSpinner = createTransferSpinner("Downloading repository", {
|
|
133
|
+
totalBytes,
|
|
134
|
+
showRate: true,
|
|
135
|
+
color: "blue"
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
response.on("data", (chunk) => {
|
|
139
|
+
downloadedBytes += chunk.length;
|
|
140
|
+
if (transferSpinner) {
|
|
141
|
+
transferSpinner.updateBytes(downloadedBytes, path.basename(dest));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
123
144
|
response.pipe(file);
|
|
124
145
|
file.on("finish", () => {
|
|
125
|
-
file.close(() =>
|
|
146
|
+
file.close(() => {
|
|
147
|
+
if (transferSpinner) {
|
|
148
|
+
transferSpinner.complete("Repository downloaded", totalBytes);
|
|
149
|
+
}
|
|
150
|
+
resolve();
|
|
151
|
+
});
|
|
126
152
|
});
|
|
127
153
|
}).on("error", (err) => {
|
|
154
|
+
if (transferSpinner) {
|
|
155
|
+
transferSpinner.error(err);
|
|
156
|
+
}
|
|
128
157
|
fs.unlink(dest).catch((unlinkErr) => console.error("Failed to unlink:", unlinkErr));
|
|
129
158
|
reject(err);
|
|
130
159
|
});
|
|
@@ -239,10 +268,16 @@ export async function downloadRepo({
|
|
|
239
268
|
tarUrl = `${repoInfo.gitUrl.replace(".git", "")}/archive/${commitHash}.tar.gz`;
|
|
240
269
|
}
|
|
241
270
|
relinka("verbose", `Downloading tarball from ${tarUrl}`);
|
|
242
|
-
await downloadTarball(tarUrl, tarballFile);
|
|
271
|
+
await downloadTarball(tarUrl, tarballFile, true);
|
|
243
272
|
}
|
|
273
|
+
const extractSpinner = createFileProgressSpinner("Extracting repository", {
|
|
274
|
+
color: "yellow"
|
|
275
|
+
});
|
|
276
|
+
const tarballStats = await fs.stat(tarballFile);
|
|
277
|
+
extractSpinner.updateProgress(tarballStats.size, path.basename(tarballFile));
|
|
244
278
|
relinka("verbose", `Extracting tarball to ${projectPath}`);
|
|
245
279
|
await extractTarball(tarballFile, projectPath, repoInfo.subdir);
|
|
280
|
+
extractSpinner.complete("Repository extracted successfully");
|
|
246
281
|
const durationSeconds2 = (Date.now() - startTime) / 1e3;
|
|
247
282
|
const result2 = { source: repoURL, dir: projectPath };
|
|
248
283
|
if (returnTime) result2.time = durationSeconds2;
|
|
@@ -341,11 +376,26 @@ export async function downloadRepo({
|
|
|
341
376
|
});
|
|
342
377
|
}
|
|
343
378
|
if (install) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
379
|
+
await withEnhancedSpinner(
|
|
380
|
+
{
|
|
381
|
+
text: "Installing dependencies",
|
|
382
|
+
showTiming: true,
|
|
383
|
+
successText: "Dependencies installed successfully",
|
|
384
|
+
failText: "Failed to install dependencies",
|
|
385
|
+
color: "green"
|
|
386
|
+
},
|
|
387
|
+
async (spinner) => {
|
|
388
|
+
spinner.updateText("Analyzing package.json");
|
|
389
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
390
|
+
spinner.updateText("Downloading packages");
|
|
391
|
+
await installDependencies({
|
|
392
|
+
cwd: projectPath,
|
|
393
|
+
silent: true
|
|
394
|
+
// Use spinner instead of npm logs
|
|
395
|
+
});
|
|
396
|
+
return "installation complete";
|
|
397
|
+
}
|
|
398
|
+
);
|
|
349
399
|
}
|
|
350
400
|
relinka("verbose", "Repository downloaded successfully!");
|
|
351
401
|
const durationSeconds = (Date.now() - startTime) / 1e3;
|
|
@@ -3,8 +3,8 @@ import type { PerfTimer } from "../types/mod.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Finalizes the build process and reports completion.
|
|
5
5
|
*/
|
|
6
|
-
export declare function finalizeBuild(timer: PerfTimer, commonPubPause: boolean, usedMode: "build" | "pub"): Promise<void>;
|
|
6
|
+
export declare function finalizeBuild(shouldShowSpinner: boolean, timer: PerfTimer, commonPubPause: boolean, usedMode: "build" | "pub"): Promise<void>;
|
|
7
7
|
/**
|
|
8
8
|
* Finalizes the publish process, cleans up, and reports completion.
|
|
9
9
|
*/
|
|
10
|
-
export declare function finalizePub(
|
|
10
|
+
export declare function finalizePub(libsList: Record<string, LibConfig>, distNpmDirName: string, distJsrDirName: string, libsDirDist: string): Promise<void>;
|
|
@@ -8,27 +8,26 @@ function providePublishGuidance(usedMode, commonPubPause) {
|
|
|
8
8
|
relinka("info", "\u{1F4DD} Publishing is paused in your config (commonPubPause=true)");
|
|
9
9
|
relinka(
|
|
10
10
|
"info",
|
|
11
|
-
usedMode === "pub" ? "\u{1F4A1} To enable publishing: set commonPubPause=false in your config" : "\u{1F4A1} To publish: set commonPubPause=false, then run
|
|
11
|
+
usedMode === "pub" ? "\u{1F4A1} To enable publishing: set commonPubPause=false in your config" : "\u{1F4A1} To publish: set commonPubPause=false, then run: rse publish"
|
|
12
12
|
);
|
|
13
13
|
} else {
|
|
14
|
-
relinka("info", "
|
|
14
|
+
relinka("info", "For publishing to NPM/JSR, use: rse publish");
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
export async function finalizeBuild(timer, commonPubPause, usedMode) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
export async function finalizeBuild(shouldShowSpinner, timer, commonPubPause, usedMode) {
|
|
18
|
+
if (!shouldShowSpinner) {
|
|
19
|
+
const elapsedTime = getElapsedPerfTime(timer);
|
|
20
|
+
const formattedPerfTime = prettyMilliseconds(elapsedTime, { verbose: true });
|
|
21
|
+
console.log("\n" + "=".repeat(60));
|
|
22
|
+
relinka("verbose", `\u2705 Build completed successfully in ${formattedPerfTime}`);
|
|
23
|
+
}
|
|
22
24
|
providePublishGuidance(usedMode, commonPubPause);
|
|
23
25
|
}
|
|
24
|
-
export async function finalizePub(
|
|
25
|
-
const elapsedTime = getElapsedPerfTime(timer);
|
|
26
|
-
const formattedPerfTime = prettyMilliseconds(elapsedTime, { verbose: true });
|
|
26
|
+
export async function finalizePub(libsList, distNpmDirName, distJsrDirName, libsDirDist) {
|
|
27
27
|
await removeDistFolders(distNpmDirName, distJsrDirName, libsDirDist, libsList);
|
|
28
28
|
try {
|
|
29
29
|
await setBumpDisabledValueTo(false);
|
|
30
30
|
} catch {
|
|
31
31
|
throw new Error("[reliverse.ts] Failed to set bumpDisable to false");
|
|
32
32
|
}
|
|
33
|
-
relinka("success", `\u{1F389} Build and publish completed successfully in ${formattedPerfTime}`);
|
|
34
33
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const gitignoreTemplate = "*.log\n.env\n.DS_Store\n.eslintcache\nnode_modules\ndist-jsr\ndist-libs\ndist-npm\n";
|
|
2
|
-
export declare const readmeTemplate = "# \uD83D\uDE80 Project Name\n\nWelcome! This project was bootstrapped with [@reliverse/reinit](https://www.npmjs.com/package/@reliverse/reinit). \nIt's already got the basics \u2014 now it's your turn to make it awesome \u2728\n\n## \uD83D\uDD27 Tech Stack\n\n- \u2699\uFE0F Framework: _<Add your framework here>_\n- \uD83D\uDEE0\uFE0F Tools: _<Add your tooling, CLIs, etc>_\n- \uD83E\uDDEA Tests: _<Vitest, Jest, or something else?>_\n- \uD83E\uDDE0 Linting: _ESLint, Biome, etc_\n- \uD83C\uDF10 Deployment: _<Vercel, Netlify, Railway?>_\n\n## \uD83D\uDE80 Getting Started\n\nClone the repo and install dependencies:\n\n'''bash\nbun install\nbun dev\n'''\n\nOr if you're using another package manager:\n\n'''bash\nnpm install && npm run dev\n# or\npnpm i && pnpm dev\n'''\n\n## \uD83D\uDDC2\uFE0F Project Structure\n\n'''bash\nsrc/\n\u251C\u2500\u2500 components/\n\u251C\u2500\u2500 pages/\n\u251C\u2500\u2500 lib/\n\u2514\u2500\u2500 styles/\n'''\n\nFeel free to tweak the structure to your liking.\n\n## \uD83E\uDDE9 Customize it\n\nThis project is just a starting point. You can add:\n\n- \uD83E\uDDD9\u200D\u2642\uFE0F Your own components and UI\n- \uD83D\uDCE6 APIs, auth, i18n, analytics,
|
|
2
|
+
export declare const readmeTemplate = "# \uD83D\uDE80 Project Name\n\nWelcome! This project was bootstrapped with [@reliverse/reinit](https://www.npmjs.com/package/@reliverse/reinit). \nIt's already got the basics \u2014 now it's your turn to make it awesome \u2728\n\n## \uD83D\uDD27 Tech Stack\n\n- \u2699\uFE0F Framework: _<Add your framework here>_\n- \uD83D\uDEE0\uFE0F Tools: _<Add your tooling, CLIs, etc>_\n- \uD83E\uDDEA Tests: _<Vitest, Jest, or something else?>_\n- \uD83E\uDDE0 Linting: _ESLint, Biome, etc_\n- \uD83C\uDF10 Deployment: _<Vercel, Netlify, Railway?>_\n\n## \uD83D\uDE80 Getting Started\n\nClone the repo and install dependencies:\n\n'''bash\nbun install\nbun dev\n'''\n\nOr if you're using another package manager:\n\n'''bash\nnpm install && npm run dev\n# or\npnpm i && pnpm dev\n'''\n\n## \uD83D\uDDC2\uFE0F Project Structure\n\n'''bash\nsrc/\n\u251C\u2500\u2500 components/\n\u251C\u2500\u2500 pages/\n\u251C\u2500\u2500 lib/\n\u2514\u2500\u2500 styles/\n'''\n\nFeel free to tweak the structure to your liking.\n\n## \uD83E\uDDE9 Customize it\n\nThis project is just a starting point. You can add:\n\n- \uD83E\uDDD9\u200D\u2642\uFE0F Your own components and UI\n- \uD83D\uDCE6 APIs, auth, i18n, analytics, etc.\n- \uD83E\uDD16 Whatever you need\n\n## \uD83E\uDEF6 Credits\n\nMade with \u2764\uFE0F using [@reliverse/reinit](https://reliverse.org) \nNeed help? [Join the Discord](https://discord.gg/Pb8uKbwpsJ)\n\n## \uD83D\uDCC4 License\n\nMIT \u00A9 YourNameHere\n";
|
|
3
3
|
export declare const licenseTemplate = "# MIT License\n\nCopyright (c) Nazar Kornienko (blefnk), Reliverse\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n";
|
|
@@ -40,8 +40,8 @@ Feel free to tweak the structure to your liking.
|
|
|
40
40
|
## \u{1F9E9} Customize it
|
|
41
41
|
This project is just a starting point. You can add:
|
|
42
42
|
- \u{1F9D9}\u200D\u2642\uFE0F Your own components and UI
|
|
43
|
-
- \u{1F4E6} APIs, auth, i18n, analytics,
|
|
44
|
-
- \u{1F916}
|
|
43
|
+
- \u{1F4E6} APIs, auth, i18n, analytics, etc.
|
|
44
|
+
- \u{1F916} Whatever you need
|
|
45
45
|
## \u{1FAF6} Credits
|
|
46
46
|
Made with \u2764\uFE0F using [@reliverse/reinit](https://reliverse.org)
|
|
47
47
|
Need help? [Join the Discord](https://discord.gg/Pb8uKbwpsJ)
|
|
@@ -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>;
|