@reliverse/dler 1.7.103 → 1.7.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/app/add/add-local/core/templates.js +3 -3
- package/bin/app/add/cmd.js +1 -1
- package/bin/app/ai/cmd.js +2 -2
- package/bin/app/check/cmd.js +2 -2
- package/bin/app/cli/cmd.js +1 -1
- package/bin/app/cli/impl.js +1 -1
- package/bin/app/config/cmd.d.ts +6 -0
- package/bin/app/config/cmd.js +22 -8
- package/bin/app/config/constants.d.ts +1 -1
- package/bin/app/config/constants.js +1 -1
- package/bin/app/config/{cfg-core.js → core-cfg.js} +5 -5
- package/bin/app/config/{cfg-create.js → create.js} +14 -14
- package/bin/app/config/{cfg-def-utils.js → def-utils.js} +3 -7
- package/bin/app/config/{cfg-detect.js → detect.js} +4 -4
- package/bin/app/config/{cfg-gen-cfg.js → gen-cfg.js} +2 -2
- package/bin/app/config/{cfg-migrate.js → migrate.js} +1 -1
- package/bin/app/config/{cfg-path.js → path.js} +1 -1
- package/bin/app/config/prepare.d.ts +3 -2
- package/bin/app/config/prepare.js +647 -150
- package/bin/app/config/{cfg-read.js → read.js} +5 -5
- package/bin/app/config/{cfg-reltypes-content.js → reltypes-content.js} +1 -1
- package/bin/app/config/{cfg-reltypes-utils.js → reltypes-utils.js} +3 -3
- package/bin/app/config/{cfg-repair.js → repair.js} +4 -4
- package/bin/app/config/{cfg-unstable.js → unstable.js} +2 -2
- package/bin/app/config/{cfg-update.js → update.js} +5 -5
- package/bin/app/env/env-impl.js +1 -1
- package/bin/app/init/cmd-2.js +1 -1
- package/bin/app/init/init-utils/init-impl.js +1 -1
- package/bin/app/init/init-utils/init-utils.d.ts +1 -1
- package/bin/app/init/init-utils/init-utils.js +3 -3
- package/bin/app/init/init-utils/mm-deprecated/editor-menu.js +1 -1
- package/bin/app/init/use-template/cp-mod.js +3 -3
- package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/getMainMenuOptions.js +1 -1
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-repo-exists.js +1 -1
- package/bin/app/invoke/cmd.js +1 -1
- package/bin/app/mkdist/cmd.js +2 -2
- package/bin/app/mrse/cmd.js +1 -1
- package/bin/app/mrse/mrse-impl.js +1 -1
- package/bin/app/providers/better-t-stack/types.d.ts +6 -6
- package/bin/app/providers/reliverse-stack/reliverse-stack-mod.js +1 -1
- package/bin/app/pub/cmd.js +2 -2
- package/bin/app/schema/cmd.js +1 -1
- package/bin/app/schema/schema-impl.js +1 -1
- package/bin/app/toolbox/cmd.js +1 -1
- package/bin/app/types/mod.d.ts +1 -1
- package/bin/app/utils/downloading/downloadRepo.js +1 -1
- package/bin/app/utils/handlers/handleCleanup.js +1 -1
- package/bin/app/utils/projectRepository.d.ts +1 -1
- package/bin/app/utils/prompts/askUsernameFrontend.js +1 -1
- package/bin/app/utils/schemaMemory.d.ts +1 -1
- package/bin/dler.js +3 -3
- package/bin/mod.d.ts +20 -20
- package/bin/mod.js +53 -53
- package/package.json +1 -1
- package/bin/app/config/cfg-prepare.d.ts +0 -2
- package/bin/app/config/cfg-prepare.js +0 -302
- /package/bin/app/config/{cfg-biome.d.ts → biome.d.ts} +0 -0
- /package/bin/app/config/{cfg-biome.js → biome.js} +0 -0
- /package/bin/app/config/{cfg-comments.d.ts → comments.d.ts} +0 -0
- /package/bin/app/config/{cfg-comments.js → comments.js} +0 -0
- /package/bin/app/config/{cfg-content.d.ts → content.d.ts} +0 -0
- /package/bin/app/config/{cfg-content.js → content.js} +0 -0
- /package/bin/app/config/{cfg-core.d.ts → core-cfg.d.ts} +0 -0
- /package/bin/app/config/{cfg-create.d.ts → create.d.ts} +0 -0
- /package/bin/app/config/{cfg-def-utils.d.ts → def-utils.d.ts} +0 -0
- /package/bin/app/config/{cfg-default.d.ts → default-cfg.d.ts} +0 -0
- /package/bin/app/config/{cfg-default.js → default-cfg.js} +0 -0
- /package/bin/app/config/{cfg-detect.d.ts → detect.d.ts} +0 -0
- /package/bin/app/config/{cfg-gen-cfg.d.ts → gen-cfg.d.ts} +0 -0
- /package/bin/app/config/{cfg-migrate.d.ts → migrate.d.ts} +0 -0
- /package/bin/app/config/{cfg-path.d.ts → path.d.ts} +0 -0
- /package/bin/app/config/{cfg-prompts.d.ts → prompts.d.ts} +0 -0
- /package/bin/app/config/{cfg-prompts.js → prompts.js} +0 -0
- /package/bin/app/config/{cfg-read.d.ts → read.d.ts} +0 -0
- /package/bin/app/config/{cfg-reltypes-content.d.ts → reltypes-content.d.ts} +0 -0
- /package/bin/app/config/{cfg-reltypes-utils.d.ts → reltypes-utils.d.ts} +0 -0
- /package/bin/app/config/{cfg-repair.d.ts → repair.d.ts} +0 -0
- /package/bin/app/config/{cfg-schema.d.ts → schema.d.ts} +0 -0
- /package/bin/app/config/{cfg-schema.js → schema.js} +0 -0
- /package/bin/app/config/{cfg-unstable.d.ts → unstable.d.ts} +0 -0
- /package/bin/app/config/{cfg-update.d.ts → update.d.ts} +0 -0
- /package/bin/app/config/{cfg-utils.d.ts → utils.d.ts} +0 -0
- /package/bin/app/config/{cfg-utils.js → utils.js} +0 -0
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import path from "@reliverse/pathkit";
|
|
2
|
-
import fs from "@reliverse/relifso";
|
|
3
|
-
import { relinka } from "@reliverse/relinka";
|
|
4
|
-
import { readPackageJSON } from "pkg-types";
|
|
5
|
-
const CONFIG_FILENAME = "reliverse.ts";
|
|
6
|
-
export async function ensureRseConfig(isDev) {
|
|
7
|
-
const configPath = path.resolve(process.cwd(), CONFIG_FILENAME);
|
|
8
|
-
const configExists = await fs.pathExists(configPath);
|
|
9
|
-
if (configExists) return;
|
|
10
|
-
try {
|
|
11
|
-
let pkgDescription;
|
|
12
|
-
try {
|
|
13
|
-
const pkg = await readPackageJSON();
|
|
14
|
-
if (pkg && typeof pkg.description === "string" && pkg.description.trim()) {
|
|
15
|
-
pkgDescription = pkg.description.trim();
|
|
16
|
-
}
|
|
17
|
-
} catch {
|
|
18
|
-
}
|
|
19
|
-
const configContent = generateConfig(isDev, pkgDescription);
|
|
20
|
-
await fs.outputFile(configPath, configContent, { encoding: "utf8" });
|
|
21
|
-
relinka("success", `Config was created at ${configPath}`);
|
|
22
|
-
relinka("log", "Edit this file to customize build and publish settings");
|
|
23
|
-
if (!isDev) {
|
|
24
|
-
relinka("log", "Please note: commonPubPause is set to true by default");
|
|
25
|
-
relinka("log", "When you're ready, run `rse pub` to build and publish");
|
|
26
|
-
} else {
|
|
27
|
-
relinka("log", "When you're ready, run `bun pub` to build and publish");
|
|
28
|
-
}
|
|
29
|
-
process.exit(0);
|
|
30
|
-
} catch (error) {
|
|
31
|
-
relinka(
|
|
32
|
-
"error",
|
|
33
|
-
`Error creating configuration file: ${error instanceof Error ? error.message : String(error)}`
|
|
34
|
-
);
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
export async function prepareRseEnvironment(isDev) {
|
|
39
|
-
await ensureRseConfig(isDev);
|
|
40
|
-
const cwd = process.cwd();
|
|
41
|
-
const gitDir = path.resolve(cwd, ".git");
|
|
42
|
-
if (await fs.pathExists(gitDir)) {
|
|
43
|
-
await ensureGitignoreEntries(cwd);
|
|
44
|
-
}
|
|
45
|
-
const tsconfigPath = path.resolve(cwd, "tsconfig.json");
|
|
46
|
-
if (await fs.pathExists(tsconfigPath)) {
|
|
47
|
-
await ensureTsconfigIncludes(tsconfigPath);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async function ensureGitignoreEntries(cwd) {
|
|
51
|
-
const gitignorePath = path.resolve(cwd, ".gitignore");
|
|
52
|
-
let gitignoreContent = "";
|
|
53
|
-
if (await fs.pathExists(gitignorePath)) {
|
|
54
|
-
gitignoreContent = await fs.readFile(gitignorePath, "utf8");
|
|
55
|
-
}
|
|
56
|
-
const requiredEntries = ["dist", "dist*", "logs"];
|
|
57
|
-
const lines = gitignoreContent.split("\n");
|
|
58
|
-
let modified = false;
|
|
59
|
-
for (const entry of requiredEntries) {
|
|
60
|
-
const hasEntry = lines.some((line) => {
|
|
61
|
-
const trimmedLine = line.trim();
|
|
62
|
-
return trimmedLine === entry || entry === "dist*" && (trimmedLine === "dist*" || trimmedLine.startsWith("dist"));
|
|
63
|
-
});
|
|
64
|
-
if (!hasEntry) {
|
|
65
|
-
if (gitignoreContent && !gitignoreContent.endsWith("\n")) {
|
|
66
|
-
gitignoreContent += "\n";
|
|
67
|
-
}
|
|
68
|
-
gitignoreContent += entry + "\n";
|
|
69
|
-
modified = true;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (modified) {
|
|
73
|
-
await fs.writeFile(gitignorePath, gitignoreContent, "utf8");
|
|
74
|
-
relinka("success", `Updated .gitignore with required entries`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async function ensureTsconfigIncludes(tsconfigPath) {
|
|
78
|
-
try {
|
|
79
|
-
const tsconfigContent = await fs.readFile(tsconfigPath, "utf8");
|
|
80
|
-
const tsconfig = JSON.parse(tsconfigContent);
|
|
81
|
-
if (!tsconfig.include) {
|
|
82
|
-
tsconfig.include = [];
|
|
83
|
-
}
|
|
84
|
-
const requiredInclude = "**/*.ts";
|
|
85
|
-
const hasConfigInclude = tsconfig.include.includes(requiredInclude);
|
|
86
|
-
if (!hasConfigInclude) {
|
|
87
|
-
tsconfig.include.push(requiredInclude);
|
|
88
|
-
await fs.writeFile(tsconfigPath, JSON.stringify(tsconfig, null, 2), "utf8");
|
|
89
|
-
relinka("success", `Added "**/*.ts" to tsconfig.json includes`);
|
|
90
|
-
}
|
|
91
|
-
} catch (error) {
|
|
92
|
-
relinka(
|
|
93
|
-
"warn",
|
|
94
|
-
`Could not update tsconfig.json: ${error instanceof Error ? error.message : String(error)}`
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function generateConfig(isDev, pkgDescription) {
|
|
99
|
-
const description = pkgDescription || "Your project description";
|
|
100
|
-
return `import { defineConfig } from "../types/mod.js";
|
|
101
|
-
/**
|
|
102
|
-
* Reliverse Bundler Configuration
|
|
103
|
-
* Hover over a field to see more details
|
|
104
|
-
* @see https://github.com/reliverse/dler
|
|
105
|
-
*/
|
|
106
|
-
export default defineConfig({
|
|
107
|
-
// General project information
|
|
108
|
-
projectName: "your-project-name",
|
|
109
|
-
projectAuthor: "your-name",
|
|
110
|
-
projectDescription: "${description}",
|
|
111
|
-
version: "0.0.0",
|
|
112
|
-
projectLicense: "MIT",
|
|
113
|
-
// Bump configuration
|
|
114
|
-
bumpDisable: false,
|
|
115
|
-
bumpFilter: ["package.json", "reliverse.ts"],
|
|
116
|
-
bumpMode: "patch",
|
|
117
|
-
// Common configuration
|
|
118
|
-
commonPubPause: ${!isDev},
|
|
119
|
-
commonPubRegistry: "npm",
|
|
120
|
-
commonVerbose: false,
|
|
121
|
-
// Core configuration
|
|
122
|
-
coreBuildOutDir: "bin",
|
|
123
|
-
coreDeclarations: true,
|
|
124
|
-
coreDescription: "${description}",
|
|
125
|
-
coreEntryFile: "mod.ts",
|
|
126
|
-
coreEntrySrcDir: "src",
|
|
127
|
-
coreIsCLI: { enabled: false, scripts: {} },
|
|
128
|
-
// Logs
|
|
129
|
-
displayBuildPubLogs: true,
|
|
130
|
-
// JSR-only config
|
|
131
|
-
distJsrAllowDirty: true,
|
|
132
|
-
distJsrBuilder: "jsr",
|
|
133
|
-
distJsrDirName: "dist-jsr",
|
|
134
|
-
distJsrDryRun: false,
|
|
135
|
-
distJsrFailOnWarn: false,
|
|
136
|
-
distJsrGenTsconfig: false,
|
|
137
|
-
distJsrOutFilesExt: "ts",
|
|
138
|
-
distJsrSlowTypes: true,
|
|
139
|
-
// NPM-only config
|
|
140
|
-
distNpmBuilder: "mkdist",
|
|
141
|
-
distNpmDirName: "dist-npm",
|
|
142
|
-
distNpmOutFilesExt: "js",
|
|
143
|
-
// Project configuration
|
|
144
|
-
projectState: "creating",
|
|
145
|
-
projectRepository: "",
|
|
146
|
-
projectDomain: "",
|
|
147
|
-
projectCategory: "unknown",
|
|
148
|
-
projectSubcategory: "unknown",
|
|
149
|
-
projectTemplate: "unknown",
|
|
150
|
-
projectTemplateDate: "unknown",
|
|
151
|
-
projectArchitecture: "unknown",
|
|
152
|
-
repoPrivacy: "unknown",
|
|
153
|
-
projectGitService: "github",
|
|
154
|
-
projectDeployService: "unknown",
|
|
155
|
-
repoBranch: "main",
|
|
156
|
-
// Primary tech stack/framework
|
|
157
|
-
projectFramework: "unknown",
|
|
158
|
-
projectPackageManager: "bun",
|
|
159
|
-
projectRuntime: "bun",
|
|
160
|
-
preferredLibraries: {
|
|
161
|
-
stateManagement: "unknown",
|
|
162
|
-
formManagement: "unknown",
|
|
163
|
-
styling: "unknown",
|
|
164
|
-
uiComponents: "unknown",
|
|
165
|
-
testing: "unknown",
|
|
166
|
-
authentication: "unknown",
|
|
167
|
-
databaseLibrary: "unknown",
|
|
168
|
-
databaseProvider: "unknown",
|
|
169
|
-
api: "unknown",
|
|
170
|
-
linting: "unknown",
|
|
171
|
-
formatting: "unknown",
|
|
172
|
-
payment: "unknown",
|
|
173
|
-
analytics: "unknown",
|
|
174
|
-
monitoring: "unknown",
|
|
175
|
-
logging: "unknown",
|
|
176
|
-
forms: "unknown",
|
|
177
|
-
notifications: "unknown",
|
|
178
|
-
search: "unknown",
|
|
179
|
-
uploads: "unknown",
|
|
180
|
-
validation: "unknown",
|
|
181
|
-
documentation: "unknown",
|
|
182
|
-
},
|
|
183
|
-
// Build setup
|
|
184
|
-
transpileFailOnWarn: false,
|
|
185
|
-
transpileEsbuild: "es2023",
|
|
186
|
-
transpileFormat: "esm",
|
|
187
|
-
transpileMinify: true,
|
|
188
|
-
transpilePublicPath: "/",
|
|
189
|
-
transpileSourcemap: "none",
|
|
190
|
-
transpileSplitting: false,
|
|
191
|
-
transpileStub: false,
|
|
192
|
-
transpileTarget: "node",
|
|
193
|
-
transpileWatch: false,
|
|
194
|
-
// Dependency filtering
|
|
195
|
-
filterDepsPatterns: {
|
|
196
|
-
global: ["@types", "biome", "eslint", "knip", "prettier", "typescript", "@reliverse/dler"],
|
|
197
|
-
"dist-npm": [],
|
|
198
|
-
"dist-jsr": [],
|
|
199
|
-
"dist-libs": {},
|
|
200
|
-
},
|
|
201
|
-
// Code quality tools
|
|
202
|
-
runBeforeBuild: [],
|
|
203
|
-
runAfterBuild: [],
|
|
204
|
-
// Build hooks
|
|
205
|
-
hooksBeforeBuild: [],
|
|
206
|
-
hooksAfterBuild: [],
|
|
207
|
-
postBuildSettings: {
|
|
208
|
-
deleteDistTmpAfterBuild: true,
|
|
209
|
-
},
|
|
210
|
-
// Publish artifacts configuration
|
|
211
|
-
publishArtifacts: {
|
|
212
|
-
global: ["package.json", "README.md", "LICENSE"],
|
|
213
|
-
"dist-jsr": [],
|
|
214
|
-
"dist-npm": [],
|
|
215
|
-
"dist-libs": {},
|
|
216
|
-
},
|
|
217
|
-
// Files with these extensions will be built
|
|
218
|
-
buildPreExtensions: ["ts", "js"],
|
|
219
|
-
buildTemplatesDir: "templates",
|
|
220
|
-
// Libraries configuration
|
|
221
|
-
libsActMode: "main-project-only",
|
|
222
|
-
libsDirDist: "dist-libs",
|
|
223
|
-
libsDirSrc: "src/libs",
|
|
224
|
-
libsList: {},
|
|
225
|
-
// Logs configuration
|
|
226
|
-
logsFileName: ".logs/relinka.log",
|
|
227
|
-
logsFreshFile: true,
|
|
228
|
-
// Integrated relinka logger configuration
|
|
229
|
-
relinka: {
|
|
230
|
-
verbose: false,
|
|
231
|
-
dirs: {
|
|
232
|
-
maxLogFiles: 5,
|
|
233
|
-
},
|
|
234
|
-
disableColors: false,
|
|
235
|
-
logFile: {
|
|
236
|
-
outputPath: "logs.log",
|
|
237
|
-
nameWithDate: "disable",
|
|
238
|
-
freshLogFile: true,
|
|
239
|
-
},
|
|
240
|
-
saveLogsToFile: true,
|
|
241
|
-
timestamp: {
|
|
242
|
-
enabled: false,
|
|
243
|
-
format: "HH:mm:ss",
|
|
244
|
-
},
|
|
245
|
-
cleanupInterval: 10_000,
|
|
246
|
-
bufferSize: 4096,
|
|
247
|
-
maxBufferAge: 5000,
|
|
248
|
-
levels: {
|
|
249
|
-
success: {
|
|
250
|
-
symbol: "\u2713",
|
|
251
|
-
fallbackSymbol: "[OK]",
|
|
252
|
-
color: "greenBright",
|
|
253
|
-
spacing: 3,
|
|
254
|
-
},
|
|
255
|
-
info: {
|
|
256
|
-
symbol: "i",
|
|
257
|
-
fallbackSymbol: "[i]",
|
|
258
|
-
color: "cyanBright",
|
|
259
|
-
spacing: 3,
|
|
260
|
-
},
|
|
261
|
-
error: {
|
|
262
|
-
symbol: "\u2716",
|
|
263
|
-
fallbackSymbol: "[ERR]",
|
|
264
|
-
color: "redBright",
|
|
265
|
-
spacing: 3,
|
|
266
|
-
},
|
|
267
|
-
warn: {
|
|
268
|
-
symbol: "\u26A0",
|
|
269
|
-
fallbackSymbol: "[WARN]",
|
|
270
|
-
color: "yellowBright",
|
|
271
|
-
spacing: 3,
|
|
272
|
-
},
|
|
273
|
-
fatal: {
|
|
274
|
-
symbol: "\u203C",
|
|
275
|
-
fallbackSymbol: "[FATAL]",
|
|
276
|
-
color: "redBright",
|
|
277
|
-
spacing: 3,
|
|
278
|
-
},
|
|
279
|
-
verbose: {
|
|
280
|
-
symbol: "\u2727",
|
|
281
|
-
fallbackSymbol: "[VERBOSE]",
|
|
282
|
-
color: "gray",
|
|
283
|
-
spacing: 3,
|
|
284
|
-
},
|
|
285
|
-
internal: {
|
|
286
|
-
symbol: "\u2699",
|
|
287
|
-
fallbackSymbol: "[INTERNAL]",
|
|
288
|
-
color: "magentaBright",
|
|
289
|
-
spacing: 3,
|
|
290
|
-
},
|
|
291
|
-
log: { symbol: "\u2502", fallbackSymbol: "|", color: "dim", spacing: 3 },
|
|
292
|
-
message: {
|
|
293
|
-
symbol: "\u{1F7A0}",
|
|
294
|
-
fallbackSymbol: "[MSG]",
|
|
295
|
-
color: "cyan",
|
|
296
|
-
spacing: 3,
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
});
|
|
301
|
-
`;
|
|
302
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|