@reliverse/dler 1.7.27 → 1.7.28

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/cli.js CHANGED
@@ -61,7 +61,7 @@ Available interactive commands: ${INTERACTIVE_CMDS.join(", ")}`
61
61
  const options = [
62
62
  { value: "build", label: "build project" },
63
63
  { value: "pub", label: "publish project" },
64
- { value: "agg", label: "aggregate files" },
64
+ { value: "agg", label: "aggregate libs" },
65
65
  { separator: true },
66
66
  { value: "utils", label: re.bold("UTILS"), disabled: true },
67
67
  { separator: true },
@@ -10,11 +10,11 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
10
10
  projectDomain?: string | undefined;
11
11
  projectGitService?: "none" | "github" | "gitlab" | "bitbucket" | undefined;
12
12
  projectDeployService?: "none" | "vercel" | "netlify" | "railway" | "deno" | undefined;
13
- projectPackageManager?: "bun" | "npm" | "yarn" | "pnpm" | undefined;
13
+ projectPackageManager?: "npm" | "bun" | "yarn" | "pnpm" | undefined;
14
14
  projectState?: "created" | "creating" | undefined;
15
15
  projectCategory?: "browser" | "cli" | "unknown" | "website" | "vscode" | "library" | "mobile" | undefined;
16
16
  projectSubcategory?: "unknown" | "e-commerce" | "tool" | undefined;
17
- projectFramework?: "npm-jsr" | "rempts" | "unknown" | "vscode" | "nextjs" | "vite" | "svelte" | "remix" | "astro" | "nuxt" | "solid" | "qwik" | "vue" | "wxt" | "lynx" | "react-native" | "expo" | "capacitor" | "ionic" | "electron" | "tauri" | "neutralino" | "citty" | "commander" | "cac" | "meow" | "yargs" | "webextension" | "browser-extension" | undefined;
17
+ projectFramework?: "rempts" | "npm-jsr" | "unknown" | "vscode" | "nextjs" | "vite" | "svelte" | "remix" | "astro" | "nuxt" | "solid" | "qwik" | "vue" | "wxt" | "lynx" | "react-native" | "expo" | "capacitor" | "ionic" | "electron" | "tauri" | "neutralino" | "citty" | "commander" | "cac" | "meow" | "yargs" | "webextension" | "browser-extension" | undefined;
18
18
  projectTemplate?: "unknown" | "blefnk/relivator-nextjs-template" | "blefnk/relivator-docker-template" | "blefnk/next-react-ts-src-minimal" | "blefnk/all-in-one-nextjs-template" | "blefnk/create-t3-app" | "blefnk/create-next-app" | "blefnk/astro-starlight-template" | "blefnk/versator-nextjs-template" | "blefnk/relivator-lynxjs-template" | "blefnk/relivator-react-native-template" | "reliverse/template-browser-extension" | "microsoft/vscode-extension-samples" | "microsoft/vscode-extension-template" | "rsetarter-template" | "blefnk/deno-cli-tutorial" | undefined;
19
19
  projectTemplateDate?: string | undefined;
20
20
  features?: {
@@ -44,7 +44,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
44
44
  styling?: "unknown" | "tailwind" | "styled-components" | "css-modules" | "sass" | undefined;
45
45
  uiComponents?: "unknown" | "shadcn-ui" | "chakra-ui" | "material-ui" | undefined;
46
46
  databaseLibrary?: "unknown" | "drizzle" | "prisma" | "supabase" | undefined;
47
- databaseProvider?: "sqlite" | "unknown" | "pg" | "mysql" | "mongodb" | undefined;
47
+ databaseProvider?: "unknown" | "pg" | "mysql" | "sqlite" | "mongodb" | undefined;
48
48
  linting?: "eslint" | "unknown" | undefined;
49
49
  formatting?: "biome" | "unknown" | undefined;
50
50
  payment?: "unknown" | "stripe" | undefined;
@@ -75,7 +75,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
75
75
  indentStyle?: "space" | "tab" | undefined;
76
76
  quoteMark?: "single" | "double" | undefined;
77
77
  semicolons?: boolean | undefined;
78
- trailingComma?: "all" | "none" | "es5" | undefined;
78
+ trailingComma?: "none" | "all" | "es5" | undefined;
79
79
  bracketSpacing?: boolean | undefined;
80
80
  arrowParens?: "always" | "avoid" | undefined;
81
81
  tabWidth?: number | undefined;
@@ -83,7 +83,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
83
83
  dontRemoveComments?: boolean | undefined;
84
84
  shouldAddComments?: boolean | undefined;
85
85
  typeOrInterface?: "type" | "interface" | "mixed" | undefined;
86
- importOrRequire?: "require" | "mixed" | "import" | undefined;
86
+ importOrRequire?: "mixed" | "import" | "require" | undefined;
87
87
  cjsToEsm?: boolean | undefined;
88
88
  modernize?: {
89
89
  replaceFs?: boolean | undefined;
@@ -96,7 +96,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
96
96
  importSymbol?: string | undefined;
97
97
  } | undefined;
98
98
  monorepo?: {
99
- type?: "bun" | "pnpm" | "none" | "turborepo" | "nx" | undefined;
99
+ type?: "none" | "bun" | "pnpm" | "turborepo" | "nx" | undefined;
100
100
  packages?: string[] | undefined;
101
101
  sharedPackages?: string[] | undefined;
102
102
  } | 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?: "bun" | "node" | "deno" | undefined;
116
+ projectRuntime?: "node" | "bun" | "deno" | undefined;
117
117
  skipPromptsUseAutoBehavior?: boolean | undefined;
118
118
  deployBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
119
119
  depsBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
@@ -14,11 +14,7 @@ import {
14
14
  PROJECT_ROOT,
15
15
  validExtensions
16
16
  } from "../utils/utils-consts.js";
17
- import {
18
- copyInsteadOfBuild,
19
- copyRootFile,
20
- deleteSpecificFiles
21
- } from "../utils/utils-fs.js";
17
+ import { copyRootFile, deleteSpecificFiles } from "../utils/utils-fs.js";
22
18
  import { createJsrJSON, renameTsxFiles } from "../utils/utils-jsr-json.js";
23
19
  import { regular_createPackageJSON } from "../utils/utils-package-json-regular.js";
24
20
  import { getElapsedPerfTime } from "../utils/utils-perf.js";
@@ -73,12 +69,6 @@ export async function regular_buildJsrDist(isDev, isJsr, coreIsCLI, coreEntrySrc
73
69
  // libName (not needed for regular builds)
74
70
  config.coreDescription
75
71
  );
76
- if (coreIsCLI.enabled) {
77
- await copyInsteadOfBuild(path.join(PROJECT_ROOT, coreEntrySrcDir), outDirBin, [
78
- `${config.distNpmDirName}/**/templates`,
79
- `${config.distJsrDirName}/**/templates`
80
- ]);
81
- }
82
72
  await renameTsxFiles(outDirBin);
83
73
  if (config.commonPubPause) {
84
74
  const duration = getElapsedPerfTime(timer);
@@ -130,12 +120,6 @@ export async function regular_buildNpmDist(isDev, coreIsCLI, coreEntrySrcDir, di
130
120
  coreDescription: config.coreDescription,
131
121
  coreBuildOutDir: config.coreBuildOutDir
132
122
  });
133
- if (coreIsCLI.enabled) {
134
- await copyInsteadOfBuild(path.join(PROJECT_ROOT, coreEntrySrcDir), outDirBin, [
135
- `${config.distNpmDirName}/**/templates`,
136
- `${config.distJsrDirName}/**/templates`
137
- ]);
138
- }
139
123
  if (config.commonPubPause) {
140
124
  const duration = getElapsedPerfTime(timer);
141
125
  const transpileFormattedDuration = prettyMilliseconds(duration, {
@@ -204,7 +204,7 @@ export async function mkdist(options = {}) {
204
204
  };
205
205
  },
206
206
  {
207
- text: "Starting mkdist build...",
207
+ text: "Building using mkdist...",
208
208
  color: "cyan",
209
209
  successText: "Build completed successfully!",
210
210
  failText: "Build failed!"
@@ -67,7 +67,10 @@ export const DEFAULT_CONFIG_DLER = {
67
67
  "dist-jsr": [],
68
68
  "dist-npm": [],
69
69
  "dist-libs": {}
70
- }
70
+ },
71
+ // Build file handling configuration
72
+ buildPreExtensions: ["ts", "js"],
73
+ buildTemplatesDir: "templates"
71
74
  };
72
75
  export const defineConfigDler = (userConfig = {}) => {
73
76
  return { ...DEFAULT_CONFIG_DLER, ...userConfig };
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.27";
2
+ const version = "1.7.28";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -476,6 +476,19 @@ export interface DlerConfig {
476
476
  npm: string[];
477
477
  }>;
478
478
  };
479
+ /**
480
+ * File extensions that should be copied to temporary build directories during pre-build.
481
+ * These files will be processed by the bundlers.
482
+ * All other files will be copied as-is to final dist directories during post-build.
483
+ * @default ["ts", "js"]
484
+ */
485
+ buildPreExtensions: string[];
486
+ /**
487
+ * Directory name for templates that should be excluded from pre-build processing.
488
+ * Files in this directory will be copied as-is during post-build.
489
+ * @default "templates"
490
+ */
491
+ buildTemplatesDir: string;
479
492
  }
480
493
  export type BumpMode = "patch" | "minor" | "major" | "auto" | "manual";
481
494
  /**
@@ -6,6 +6,7 @@ import { library_publishLibrary } from "./pub/pub-library.js";
6
6
  import { CONCURRENCY_DEFAULT, PROJECT_ROOT } from "./utils/utils-consts.js";
7
7
  import { resumePerfTimer } from "./utils/utils-perf.js";
8
8
  export async function library_buildFlow(timer, isDev, config) {
9
+ relinka("info", "\u2014 \u2014 \u2014 library_buildFlow \u2014 \u2014 \u2014");
9
10
  if (config.libsActMode !== "libs-only" && config.libsActMode !== "main-and-libs") {
10
11
  relinka("verbose", "Skipping libs build as libsActMode is set to 'main-project-only'");
11
12
  return;
@@ -35,6 +36,7 @@ export async function library_buildFlow(timer, isDev, config) {
35
36
  );
36
37
  }
37
38
  export async function library_pubFlow(timer, isDev, config) {
39
+ relinka("info", "\u2014 \u2014 \u2014 library_pubFlow \u2014 \u2014 \u2014");
38
40
  if (config.libsActMode !== "libs-only" && config.libsActMode !== "main-and-libs") {
39
41
  relinka("verbose", "Skipping libs publish as libsActMode is set to 'main-project-only'");
40
42
  return;
@@ -4,6 +4,7 @@ import { regular_buildJsrDist, regular_buildNpmDist } from "./build/build-regula
4
4
  import { regular_pubToJsr, regular_pubToNpm } from "./pub/pub-regular.js";
5
5
  import { CONCURRENCY_DEFAULT } from "./utils/utils-consts.js";
6
6
  export async function regular_buildFlow(timer, isDev, config) {
7
+ relinka("info", "\u2014 \u2014 \u2014 regular_buildFlow \u2014 \u2014 \u2014");
7
8
  if (config.libsActMode === "libs-only") {
8
9
  relinka("log", "Skipping main project build as libsActMode is set to 'libs-only'");
9
10
  return;
@@ -112,6 +113,7 @@ export async function regular_buildFlow(timer, isDev, config) {
112
113
  }
113
114
  }
114
115
  export async function regular_pubFlow(timer, isDev, config) {
116
+ relinka("info", "\u2014 \u2014 \u2014 regular_pubFlow \u2014 \u2014 \u2014");
115
117
  if (config.libsActMode === "libs-only") {
116
118
  relinka("log", "Skipping main project publish as libsActMode is set to 'libs-only'");
117
119
  return;
@@ -22,40 +22,4 @@ export declare function readFileSafe(filePath: string, isJsr: "" | boolean, reas
22
22
  * Writes content to a file safely.
23
23
  */
24
24
  export declare function writeFileSafe(filePath: string, content: string, reason: string): Promise<void>;
25
- /**
26
- * Copies files and directories that should not be built to the output directory.
27
- * This function is called after all build steps have completed to ensure copied assets
28
- * are not accidentally wiped by the clean step inside `_build`.
29
- *
30
- * Features:
31
- * - Directory copying with all contents (recursive)
32
- * - Windows path compatibility
33
- * - Retries on busy files
34
- * - Batch processing to manage memory
35
- * - Security checks for sensitive patterns
36
- *
37
- * @param rootDir - The root directory to copy from
38
- * @param outDir - The output directory to copy to
39
- * @param patterns - Array of glob patterns to match files/directories to copy
40
- *
41
- * @example
42
- * ```ts
43
- * **🔥 IMPORTANT**: IGNORE SPACES BETWEEN SLASHES IN THIS EXAMPLE;
44
- * WE USE SPACES BECAUSE VSCODE JSDOC INCORRECTLY PARSES TWO STARS AND A SLASH
45
- *
46
- * // Copy a directory and its contents:
47
- * await copyInsteadOfBuild(rootDir, outDir, ["** / templates"]);
48
- * // Copy multiple directories:
49
- * await copyInsteadOfBuild(rootDir, outDir, ["** / templates", "** / assets"]);
50
- * // Copy file types:
51
- * await copyInsteadOfBuild(rootDir, outDir, ["** / *.json", "** / *.md"]);
52
- * ```
53
- *
54
- * Notes:
55
- * - Use `** /` prefix to match directories at any depth
56
- * - Patterns are processed in batches to manage memory
57
- * - Sensitive patterns (node_modules, .git, etc.) are automatically filtered
58
- * - The function will retry on busy files up to 3 times
59
- */
60
- export declare function copyInsteadOfBuild(rootDir: string, outDir: string, patterns: string[]): Promise<void>;
61
25
  export declare function validateDirectory(dir: string): Promise<boolean>;
@@ -173,121 +173,6 @@ export async function writeFileSafe(filePath, content, reason) {
173
173
  throw error;
174
174
  }
175
175
  }
176
- export async function copyInsteadOfBuild(rootDir, outDir, patterns) {
177
- if (!patterns.length) return;
178
- const normalizedRootDir = path.normalize(rootDir);
179
- const sourcePatterns = patterns.map(
180
- (pattern) => pattern.replace(/^(dist-npm|dist-jsr)\/\*\*\/?/, "").replace(/^(dist-npm|dist-jsr)\//, "").replace(/^bin\//, "")
181
- );
182
- const allMatches = await Promise.all(
183
- sourcePatterns.map(
184
- (pattern) => glob(pattern, {
185
- cwd: normalizedRootDir,
186
- dot: true,
187
- absolute: true,
188
- onlyFiles: false,
189
- followSymbolicLinks: false,
190
- ignore: ["**/node_modules/**", "**/.git/**", "node_modules/**", ".git/**"]
191
- })
192
- )
193
- );
194
- if (!allMatches.some((matches) => matches.length > 0)) {
195
- relinka("verbose", "No matching files found for any of the provided patterns");
196
- return;
197
- }
198
- relinka("info", "Copying files/folders that should not be built...");
199
- const normalizedOutDir = path.normalize(outDir);
200
- relinka("verbose", "Cleaning up existing files/folders before copying...");
201
- for (const pattern of patterns) {
202
- const destPattern = pattern.replace(/^\*\*\/|\/\*\*\/|\/\*\*$/g, "**/").replace(/^(dist-npm|dist-jsr)\/\*\*\/?/, "**/").replace(/^(dist-npm|dist-jsr)\//, "").replace(/^bin\//, "");
203
- const exactPath = path.join(normalizedOutDir, destPattern.replace(/\*\*/g, ""));
204
- if (await fs.pathExists(exactPath)) {
205
- try {
206
- relinka("verbose", `Deleting exact path: ${exactPath}`);
207
- await fs.remove(exactPath);
208
- } catch (error) {
209
- relinka("error", `Failed to delete exact path: ${exactPath}`, error);
210
- throw error;
211
- }
212
- }
213
- const matches = await glob(destPattern, {
214
- cwd: normalizedOutDir,
215
- dot: true,
216
- absolute: true,
217
- onlyFiles: false,
218
- followSymbolicLinks: false,
219
- ignore: ["**/node_modules/**", "**/.git/**", "node_modules/**", ".git/**"]
220
- });
221
- for (const match of matches) {
222
- try {
223
- const relativePath = path.relative(normalizedOutDir, match);
224
- relinka("verbose", `Deleting existing: ${relativePath}`);
225
- await fs.remove(match);
226
- } catch (error) {
227
- relinka("error", `Failed to delete existing file/folder: ${match}`, error);
228
- throw error;
229
- }
230
- }
231
- }
232
- const BATCH_SIZE = 50;
233
- const BATCH_DELAY = 100;
234
- for (let i = 0; i < patterns.length; i += BATCH_SIZE) {
235
- const batchPatterns = patterns.slice(i, i + BATCH_SIZE);
236
- const batchCopyTasks = [];
237
- for (const pattern of batchPatterns) {
238
- const sourcePattern = pattern.replace(/^(dist-npm|dist-jsr)\/\*\*\/?/, "").replace(/^(dist-npm|dist-jsr)\//, "").replace(/^bin\//, "");
239
- const matches = await glob(sourcePattern, {
240
- cwd: normalizedRootDir,
241
- dot: true,
242
- absolute: true,
243
- onlyFiles: false,
244
- followSymbolicLinks: false,
245
- ignore: ["**/node_modules/**", "**/.git/**", "node_modules/**", ".git/**"]
246
- });
247
- for (const match of matches) {
248
- const relativePath = path.relative(normalizedRootDir, match);
249
- const cleanRelativePath = relativePath.replace(/^(dist-npm|dist-jsr)\/\*\*\/?/, "").replace(/^(dist-npm|dist-jsr)\//, "").replace(/^bin\//, "");
250
- const destPath = path.resolve(normalizedOutDir, cleanRelativePath);
251
- await fs.ensureDir(path.dirname(destPath));
252
- if (!await fs.pathExists(match)) {
253
- throw new Error(`Source not accessible: ${relativePath}`);
254
- }
255
- if (await fs.pathExists(destPath)) {
256
- await fs.remove(destPath);
257
- }
258
- const stats = await fs.stat(match);
259
- if (stats.isDirectory()) {
260
- await fs.copy(match, destPath, {
261
- recursive: true,
262
- dereference: true,
263
- overwrite: true,
264
- errorOnExist: true
265
- });
266
- } else {
267
- await fs.copy(match, destPath, {
268
- overwrite: true,
269
- errorOnExist: true
270
- });
271
- }
272
- }
273
- }
274
- if (batchCopyTasks.length > 0) {
275
- await Promise.all(batchCopyTasks);
276
- }
277
- if (i + BATCH_SIZE < patterns.length) {
278
- await new Promise((resolve) => setTimeout(resolve, BATCH_DELAY));
279
- }
280
- const progress = Math.min(
281
- 100,
282
- Math.round((i + batchPatterns.length) / patterns.length * 100)
283
- );
284
- relinka(
285
- "verbose",
286
- `Copy progress: ${progress}% (${i + batchPatterns.length}/${patterns.length} patterns)`
287
- );
288
- }
289
- relinka("info", "[isCLI] Completed copying files/folders that should not be built:", patterns);
290
- }
291
176
  export async function validateDirectory(dir) {
292
177
  try {
293
178
  const stat = await fs.stat(dir);
@@ -88,7 +88,7 @@ export { PROJECT_ROOT, CONCURRENCY_DEFAULT, tsconfigJson, cliDomainDocs, validEx
88
88
  export { filterDeps } from "./sdk-impl/utils/utils-deps.js";
89
89
  export { determineDistName } from "./sdk-impl/utils/utils-determine.js";
90
90
  export { handleDlerError, withWorkingDirectory, validateDevCwd, formatError, } from "./sdk-impl/utils/utils-error-cwd.js";
91
- export { copyRootFile, getDirectorySize, outDirBinFilesCount, deleteSpecificFiles, readFileSafe, writeFileSafe, copyInsteadOfBuild, validateDirectory, } from "./sdk-impl/utils/utils-fs.js";
91
+ export { copyRootFile, getDirectorySize, outDirBinFilesCount, deleteSpecificFiles, readFileSafe, writeFileSafe, validateDirectory, } from "./sdk-impl/utils/utils-fs.js";
92
92
  export { createJsrJSON, renameTsxFiles } from "./sdk-impl/utils/utils-jsr-json.js";
93
93
  export { extractPackageName } from "./sdk-impl/utils/utils-misc.js";
94
94
  export { library_createPackageJSON, library_createJsrConfig, } from "./sdk-impl/utils/utils-package-json-libraries.js";
@@ -211,7 +211,6 @@ export {
211
211
  deleteSpecificFiles,
212
212
  readFileSafe,
213
213
  writeFileSafe,
214
- copyInsteadOfBuild,
215
214
  validateDirectory
216
215
  } from "./sdk-impl/utils/utils-fs.js";
217
216
  export { createJsrJSON, renameTsxFiles } from "./sdk-impl/utils/utils-jsr-json.js";
package/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  "license": "MIT",
54
54
  "name": "@reliverse/dler",
55
55
  "type": "module",
56
- "version": "1.7.27",
56
+ "version": "1.7.28",
57
57
  "keywords": [
58
58
  "reliverse",
59
59
  "cli",