@reliverse/dler 1.7.51 → 1.7.52

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.
@@ -35,7 +35,7 @@ async function isCommandInPackageJson(command) {
35
35
  const packageName = COMMAND_TO_PACKAGE[command];
36
36
  if (!packageName) return false;
37
37
  return packageName in (packageJson.dependencies || {}) || packageName in (packageJson.devDependencies || {});
38
- } catch (error) {
38
+ } catch (_error) {
39
39
  return false;
40
40
  }
41
41
  }
@@ -211,20 +211,38 @@ export default defineCommand({
211
211
  required: true,
212
212
  description: "Input directory (pack) or aggregator file (unpack)"
213
213
  },
214
- output: { type: "string", default: "my-templates", description: "Output dir" },
215
- whitelabel: { type: "string", default: WHITELABEL_DEFAULT, description: "Rename DLER" },
214
+ output: {
215
+ type: "string",
216
+ default: "my-templates",
217
+ description: "Output dir"
218
+ },
219
+ whitelabel: {
220
+ type: "string",
221
+ default: WHITELABEL_DEFAULT,
222
+ description: "Rename DLER"
223
+ },
216
224
  cdn: {
217
225
  type: "string",
218
226
  description: "Remote CDN for binary assets upload (not yet implemented)"
219
227
  },
220
- force: { type: "boolean", default: false, description: "Force overwrite existing files" },
228
+ force: {
229
+ type: "boolean",
230
+ default: false,
231
+ description: "Force overwrite existing files"
232
+ },
221
233
  update: {
222
234
  type: "boolean",
223
235
  default: true,
224
236
  description: "Update existing templates and add new ones (pack mode only)"
225
237
  },
226
- files: { type: "string", description: "Comma-separated list of specific files to update" },
227
- lastUpdate: { type: "string", description: "Override lastUpdate timestamp (pack mode only)" },
238
+ files: {
239
+ type: "string",
240
+ description: "Comma-separated list of specific files to update"
241
+ },
242
+ lastUpdate: {
243
+ type: "string",
244
+ description: "Override lastUpdate timestamp (pack mode only)"
245
+ },
228
246
  unpack: {
229
247
  type: "boolean",
230
248
  default: false,
@@ -321,7 +339,7 @@ export default defineCommand({
321
339
  const fileMetadata = await getFileMetadata(absFile);
322
340
  const existingFile = existingFiles[rel];
323
341
  const existingMetadata = existingFile?.metadata;
324
- if (existingMetadata && existingMetadata.updatedHash && fileMetadata.updatedHash && (existingMetadata.updatedHash === fileMetadata.updatedHash || fileMetadata.updatedAt && existingMetadata.updatedAt && fileMetadata.updatedAt <= existingMetadata.updatedAt)) {
342
+ if (existingMetadata?.updatedHash && fileMetadata.updatedHash && (existingMetadata.updatedHash === fileMetadata.updatedHash || fileMetadata.updatedAt && existingMetadata.updatedAt && fileMetadata.updatedAt <= existingMetadata.updatedAt)) {
325
343
  filesRecord[rel] = existingFile;
326
344
  continue;
327
345
  }
@@ -358,10 +376,11 @@ export default defineCommand({
358
376
  }
359
377
  const varName = TEMPLATE_VAR(tplName, args.whitelabel);
360
378
  const code = [];
361
- const hasPackageJson = Object.values(filesRecord).some(
379
+ const hasPackageJson = Object.keys(filesRecord).some((rel) => rel.endsWith("package.json")) || Object.values(filesRecord).some(
362
380
  (f) => f.type === "json" && f.content && typeof f.content === "object" && "name" in f.content
363
381
  );
364
- const hasTSConfig = Object.values(filesRecord).some(
382
+ const tsconfigPathRe = /(?:^|\/)tsconfig(?:\.[^/]+)?\.json$/;
383
+ const hasTSConfig = Object.keys(filesRecord).some((rel) => tsconfigPathRe.test(rel)) || Object.values(filesRecord).some(
365
384
  (f) => f.type === "json" && f.content && typeof f.content === "object" && "compilerOptions" in f.content
366
385
  );
367
386
  if (hasPackageJson || hasTSConfig) {
@@ -387,7 +406,7 @@ export default defineCommand({
387
406
  if (meta.jsonComments)
388
407
  code.push(` jsonComments: ${JSON.stringify(meta.jsonComments, null, 2)},`);
389
408
  if (meta.metadata) {
390
- const metadataStr = JSON.stringify(meta.metadata, null, 2).replace(/^/gm, " ").replace(/^ {7} {/m, " {").replace(/^ {8}}/m, " }").replace(/"([a-zA-Z0-9_]+)":/g, "$1:").replace(/}$/m, "},");
409
+ const metadataStr = JSON.stringify(meta.metadata, null, 2).replace(/^/gm, " ").replace(/^ {7} {/m, " {").replace(/^ {8}}/m, " }").replace(/"([a-zA-Z0-9_]+)":/g, "$1:").replace(/\n(\s*)}/, ",\n$1}").replace(/}$/m, "},");
391
410
  code.push(` metadata:${metadataStr}`);
392
411
  }
393
412
  if (meta.type === "binary") {
@@ -404,7 +423,7 @@ export default defineCommand({
404
423
  clone = JSON.parse(JSON.stringify(meta.content));
405
424
  if (rel.endsWith("package.json")) {
406
425
  sat = " satisfies PackageJson";
407
- } else if (rel.endsWith("tsconfig.json")) {
426
+ } else if (tsconfigPathRe.test(rel)) {
408
427
  sat = " satisfies TSConfig";
409
428
  }
410
429
  } catch (error) {
@@ -413,8 +432,8 @@ export default defineCommand({
413
432
  }
414
433
  const jsonStr = JSON.stringify(clone, null, 2).split("\n").map((line, i) => {
415
434
  if (i === 0) return line;
416
- return " " + line.replace(/"([a-zA-Z0-9_]+)":/g, "$1:");
417
- }).join("\n").replace(/,?\s*}(\s*)$/, "}$1").replace(/,\s*,/g, ",");
435
+ return ` ${line.replace(/"([a-zA-Z0-9_]+)":/g, "$1:")}`;
436
+ }).join("\n").replace(/\n(\s*)}/, ",\n$1}").replace(/,\s*,/g, ",");
418
437
  code.push(` content: ${jsonStr}${sat},`);
419
438
  code.push(' type: "json",');
420
439
  }
@@ -33,25 +33,25 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
33
33
  themes?: string[] | undefined;
34
34
  } | undefined;
35
35
  preferredLibraries?: {
36
+ search?: "unknown" | "algolia" | undefined;
36
37
  i18n?: "unknown" | "next-intl" | undefined;
37
38
  analytics?: "unknown" | "vercel" | undefined;
38
39
  authentication?: "unknown" | "better-auth" | "clerk" | "next-auth" | "supabase-auth" | "auth0" | undefined;
39
- api?: "unknown" | "hono" | "trpc" | "graphql" | "rest" | undefined;
40
+ api?: "rest" | "unknown" | "hono" | "trpc" | "graphql" | undefined;
40
41
  testing?: "unknown" | "bun" | "vitest" | "jest" | "playwright" | "cypress" | undefined;
41
42
  stateManagement?: "unknown" | "zustand" | "jotai" | "redux-toolkit" | undefined;
42
43
  formManagement?: "unknown" | "react-hook-form" | "formik" | undefined;
43
44
  styling?: "unknown" | "tailwind" | "styled-components" | "css-modules" | "sass" | undefined;
44
45
  uiComponents?: "unknown" | "shadcn-ui" | "chakra-ui" | "material-ui" | undefined;
45
46
  databaseLibrary?: "unknown" | "drizzle" | "prisma" | "supabase" | undefined;
46
- databaseProvider?: "unknown" | "pg" | "mysql" | "sqlite" | "mongodb" | undefined;
47
- linting?: "eslint" | "unknown" | undefined;
48
- formatting?: "biome" | "unknown" | undefined;
47
+ databaseProvider?: "sqlite" | "unknown" | "pg" | "mysql" | "mongodb" | undefined;
48
+ linting?: "unknown" | "eslint" | undefined;
49
+ formatting?: "unknown" | "biome" | undefined;
49
50
  payment?: "unknown" | "stripe" | undefined;
50
51
  monitoring?: "unknown" | "sentry" | undefined;
51
52
  logging?: "unknown" | "axiom" | undefined;
52
53
  forms?: "unknown" | "react-hook-form" | undefined;
53
54
  notifications?: "unknown" | "sonner" | undefined;
54
- search?: "unknown" | "algolia" | undefined;
55
55
  uploads?: "unknown" | "uploadthing" | undefined;
56
56
  validation?: "unknown" | "zod" | "typebox" | "valibot" | undefined;
57
57
  documentation?: "unknown" | "starlight" | "nextra" | undefined;
@@ -113,7 +113,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
113
113
  repoBranch?: string | undefined;
114
114
  repoPrivacy?: "unknown" | "public" | "private" | undefined;
115
115
  projectArchitecture?: "unknown" | "fullstack" | "separated" | undefined;
116
- projectRuntime?: "node" | "bun" | "deno" | undefined;
116
+ projectRuntime?: "bun" | "deno" | "node" | undefined;
117
117
  skipPromptsUseAutoBehavior?: boolean | undefined;
118
118
  deployBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
119
119
  depsBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
@@ -12,7 +12,7 @@ export function repairAndParseJSON(raw) {
12
12
  try {
13
13
  const repaired = jsonrepair(raw);
14
14
  return JSON.parse(repaired);
15
- } catch (error) {
15
+ } catch (_error) {
16
16
  return null;
17
17
  }
18
18
  }
@@ -10,7 +10,7 @@ import { getBackupAndTempPaths } from "./rse-utils.js";
10
10
  function deepMerge(target, source) {
11
11
  const result = { ...target };
12
12
  for (const key in source) {
13
- if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
13
+ if (!Object.hasOwn(source, key)) continue;
14
14
  const sourceValue = source[key];
15
15
  const targetValue = target[key];
16
16
  if (sourceValue !== void 0) {
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.51";
2
+ const version = "1.7.52";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -9,7 +9,7 @@ export async function ensureDlerConfig(isDev) {
9
9
  const configExists = await fs.pathExists(configPath);
10
10
  if (configExists) return;
11
11
  try {
12
- let pkgDescription = void 0;
12
+ let pkgDescription;
13
13
  try {
14
14
  const pkg = await readPackageJSON();
15
15
  if (pkg && typeof pkg.description === "string" && pkg.description.trim()) {
package/package.json CHANGED
@@ -9,11 +9,11 @@
9
9
  "@reliverse/rempts": "^1.7.28",
10
10
  "@reliverse/runtime": "^1.0.3",
11
11
  "@rollup/plugin-alias": "^5.1.1",
12
- "@rollup/plugin-commonjs": "^28.0.5",
12
+ "@rollup/plugin-commonjs": "^28.0.6",
13
13
  "@rollup/plugin-json": "^6.1.0",
14
14
  "@rollup/plugin-node-resolve": "^16.0.1",
15
15
  "@rollup/plugin-replace": "^6.0.2",
16
- "@rollup/pluginutils": "^5.1.4",
16
+ "@rollup/pluginutils": "^5.2.0",
17
17
  "@sinclair/typebox": "^0.34.35",
18
18
  "autoprefixer": "^10.4.21",
19
19
  "c12": "^3.0.4",
@@ -54,7 +54,7 @@
54
54
  "license": "MIT",
55
55
  "name": "@reliverse/dler",
56
56
  "type": "module",
57
- "version": "1.7.51",
57
+ "version": "1.7.52",
58
58
  "keywords": [
59
59
  "reliverse",
60
60
  "cli",