@reliverse/dler 1.7.29 → 1.7.30

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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  ### 🚀 core power
10
10
 
11
- - **drop-in replacement** for `unjs/unbuild` seamless migration with enhanced capabilities
11
+ - **`unjs/unbuild` drop-in** with different powerful capabilities like publishing
12
12
  - **automated publishing** to npm/jsr registries with intelligent workflow management
13
13
  - **reliable builds** with comprehensive typescript/javascript support and error handling
14
14
  - **smart versioning** with automatic version bumps and semantic release integration
@@ -3,5 +3,13 @@ declare const _default: import("@reliverse/rempts").Command<{
3
3
  type: "boolean";
4
4
  description: string;
5
5
  };
6
+ debugOnlyCopyNonBuildFiles: {
7
+ type: "boolean";
8
+ description: string;
9
+ };
10
+ debugDontCopyNonBuildFiles: {
11
+ type: "boolean";
12
+ description: string;
13
+ };
6
14
  }>;
7
15
  export default _default;
@@ -12,12 +12,25 @@ export default defineCommand({
12
12
  dev: {
13
13
  type: "boolean",
14
14
  description: "Runs the CLI in dev mode"
15
+ },
16
+ debugOnlyCopyNonBuildFiles: {
17
+ type: "boolean",
18
+ description: "Only copy non-build files to dist directories"
19
+ },
20
+ debugDontCopyNonBuildFiles: {
21
+ type: "boolean",
22
+ description: "Don't copy non-build files to dist directories, only build buildPreExtensions files"
15
23
  }
16
24
  }),
17
25
  async run({ args }) {
18
26
  await ensureDlerConfig(args.dev);
19
27
  const config = await getConfigDler();
20
- const { timer } = await dlerBuild(args.dev, config);
28
+ const { timer } = await dlerBuild(
29
+ args.dev,
30
+ config,
31
+ args.debugOnlyCopyNonBuildFiles,
32
+ args.debugDontCopyNonBuildFiles
33
+ );
21
34
  await finalizeBuild(timer, false, "build");
22
35
  }
23
36
  });
@@ -4,7 +4,7 @@ import type { DlerConfig } from "../../libs/sdk/sdk-impl/config/types.js";
4
4
  * Handles building for both main project and libraries.
5
5
  * @see `src/app/pub/impl.ts` for pub main function implementation.
6
6
  */
7
- export declare function dlerBuild(isDev: boolean, config?: DlerConfig): Promise<{
7
+ export declare function dlerBuild(isDev: boolean, config?: DlerConfig, debugOnlyCopyNonBuildFiles?: boolean, debugDontCopyNonBuildFiles?: boolean): Promise<{
8
8
  timer: any;
9
9
  effectiveConfig: any;
10
10
  } | undefined>;
@@ -1,5 +1,6 @@
1
1
  import path from "@reliverse/pathkit";
2
2
  import fs from "@reliverse/relifso";
3
+ import { relinka } from "@reliverse/relinka";
3
4
  import { getConfigDler } from "../../libs/sdk/sdk-impl/config/load.js";
4
5
  import { library_buildFlow } from "../../libs/sdk/sdk-impl/library-flow.js";
5
6
  import { regular_buildFlow } from "../../libs/sdk/sdk-impl/regular-flow.js";
@@ -7,9 +8,9 @@ import { removeDistFolders } from "../../libs/sdk/sdk-impl/utils/utils-clean.js"
7
8
  import { PROJECT_ROOT } from "../../libs/sdk/sdk-impl/utils/utils-consts.js";
8
9
  import { handleDlerError } from "../../libs/sdk/sdk-impl/utils/utils-error-cwd.js";
9
10
  import { createPerfTimer } from "../../libs/sdk/sdk-impl/utils/utils-perf.js";
10
- import { dlerPostBuild } from "./postbuild.js";
11
+ import { dlerPostBuild, wrapper_CopyNonBuildFiles } from "./postbuild.js";
11
12
  import { dlerPreBuild } from "./prebuild.js";
12
- export async function dlerBuild(isDev, config) {
13
+ export async function dlerBuild(isDev, config, debugOnlyCopyNonBuildFiles, debugDontCopyNonBuildFiles) {
13
14
  const timer = createPerfTimer();
14
15
  let effectiveConfig = config;
15
16
  try {
@@ -25,6 +26,18 @@ export async function dlerBuild(isDev, config) {
25
26
  effectiveConfig.libsDirDist,
26
27
  effectiveConfig.libsList
27
28
  );
29
+ if (debugOnlyCopyNonBuildFiles) {
30
+ if (debugDontCopyNonBuildFiles) {
31
+ relinka(
32
+ "error",
33
+ "\u{1F4DD} debugOnlyCopyNonBuildFiles and debugDontCopyNonBuildFiles cannot be used together"
34
+ );
35
+ process.exit(1);
36
+ }
37
+ await wrapper_CopyNonBuildFiles(effectiveConfig);
38
+ relinka("info", "\u{1F4DD} debugOnlyCopyNonBuildFiles was used, build finished, exiting...");
39
+ process.exit(0);
40
+ }
28
41
  await dlerPreBuild(effectiveConfig);
29
42
  const tempDirs = {
30
43
  npm: "dist-tmp/tmp-npm",
@@ -38,8 +51,10 @@ export async function dlerBuild(isDev, config) {
38
51
  };
39
52
  await regular_buildFlow(timer, isDev, tempConfig);
40
53
  await library_buildFlow(timer, isDev, tempConfig);
41
- await dlerPostBuild(isDev);
42
- await fs.remove(path.join(PROJECT_ROOT, "dist-tmp"));
54
+ await dlerPostBuild(isDev, debugDontCopyNonBuildFiles);
55
+ if (effectiveConfig.postBuildSettings?.cleanupTempDirs) {
56
+ await fs.remove(path.join(PROJECT_ROOT, "dist-tmp"));
57
+ }
43
58
  return { timer, effectiveConfig };
44
59
  } catch (error) {
45
60
  handleDlerError(error);
@@ -1 +1,3 @@
1
- export declare function dlerPostBuild(isDev: boolean): Promise<void>;
1
+ import type { DlerConfig } from "../../libs/sdk/sdk-mod.js";
2
+ export declare function dlerPostBuild(isDev: boolean, debugDontCopyNonBuildFiles?: boolean): Promise<void>;
3
+ export declare function wrapper_CopyNonBuildFiles(config: DlerConfig): Promise<void>;
@@ -65,10 +65,28 @@ async function copyNonBuildFiles(srcDir, distDir, preExtensions, templatesDir) {
65
65
  throw error;
66
66
  }
67
67
  }
68
- export async function dlerPostBuild(isDev) {
68
+ export async function dlerPostBuild(isDev, debugDontCopyNonBuildFiles) {
69
69
  relinka("info", "\u2014 \u2014 \u2014 dlerPostBuild \u2014 \u2014 \u2014");
70
70
  const config = await getConfigDler();
71
71
  await resolveAllCrossLibs();
72
+ if (!debugDontCopyNonBuildFiles) {
73
+ await wrapper_CopyNonBuildFiles(config);
74
+ }
75
+ if (isDev) {
76
+ await applyMagicSpells(["dist-jsr", "dist-npm", "dist-libs"]);
77
+ }
78
+ await processDistDirectories();
79
+ await executeDlerHooks(config?.hooksAfterBuild ?? [], "post-build");
80
+ if (config?.runAfterBuild?.length) {
81
+ const tools = createPostBuildToolRunner();
82
+ const availableTools = config.runAfterBuild.filter((toolName) => toolName in tools).map((toolName) => ({ toolName, ...tools[toolName] }));
83
+ for (const { name, run } of availableTools) {
84
+ relinka("log", `Running ${name}...`);
85
+ await run();
86
+ }
87
+ }
88
+ }
89
+ export async function wrapper_CopyNonBuildFiles(config) {
72
90
  if (config.commonPubRegistry === "npm" || config.commonPubRegistry === "npm-jsr") {
73
91
  await copyNonBuildFiles(
74
92
  path.join(PROJECT_ROOT, config.coreEntrySrcDir),
@@ -93,17 +111,4 @@ export async function dlerPostBuild(isDev) {
93
111
  config.buildTemplatesDir
94
112
  );
95
113
  }
96
- if (isDev) {
97
- await applyMagicSpells(["dist-jsr", "dist-npm", "dist-libs"]);
98
- }
99
- await processDistDirectories();
100
- await executeDlerHooks(config?.hooksAfterBuild ?? [], "post-build");
101
- if (config?.runAfterBuild?.length) {
102
- const tools = createPostBuildToolRunner();
103
- const availableTools = config.runAfterBuild.filter((toolName) => toolName in tools).map((toolName) => ({ toolName, ...tools[toolName] }));
104
- for (const { name, run } of availableTools) {
105
- relinka("log", `Running ${name}...`);
106
- await run();
107
- }
108
- }
109
114
  }
@@ -71,4 +71,7 @@ export declare const defineConfigDler: (userConfig?: Partial<DlerConfig>) => {
71
71
  };
72
72
  buildPreExtensions: string[];
73
73
  buildTemplatesDir: string;
74
+ postBuildSettings: {
75
+ cleanupTempDirs: boolean;
76
+ };
74
77
  };
@@ -489,6 +489,14 @@ export interface DlerConfig {
489
489
  * @default "templates"
490
490
  */
491
491
  buildTemplatesDir: string;
492
+ /**
493
+ * When `true`, cleans up the temporary directories after the build process completes.
494
+ *
495
+ * @default true
496
+ */
497
+ postBuildSettings: {
498
+ cleanupTempDirs: boolean;
499
+ };
492
500
  }
493
501
  export type BumpMode = "patch" | "minor" | "major" | "auto" | "manual";
494
502
  /**
@@ -1,20 +1,20 @@
1
1
  import type { RseConfig } from "./rse-types";
2
2
  export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
3
+ version?: string | undefined;
3
4
  $schema?: "./schema.json" | "https://reliverse.org/schema.json" | undefined;
4
5
  projectName?: string | undefined;
5
6
  projectAuthor?: string | undefined;
6
7
  projectDescription?: string | undefined;
7
- version?: string | undefined;
8
8
  projectLicense?: string | undefined;
9
9
  projectRepository?: string | undefined;
10
10
  projectDomain?: string | undefined;
11
11
  projectGitService?: "none" | "github" | "gitlab" | "bitbucket" | undefined;
12
12
  projectDeployService?: "none" | "vercel" | "netlify" | "railway" | "deno" | undefined;
13
13
  projectPackageManager?: "npm" | "bun" | "yarn" | "pnpm" | undefined;
14
- projectState?: "creating" | "created" | undefined;
15
- projectCategory?: "browser" | "cli" | "unknown" | "website" | "vscode" | "library" | "mobile" | undefined;
14
+ projectState?: "created" | "creating" | undefined;
15
+ projectCategory?: "cli" | "unknown" | "website" | "vscode" | "browser" | "library" | "mobile" | undefined;
16
16
  projectSubcategory?: "unknown" | "e-commerce" | "tool" | 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;
17
+ projectFramework?: "rempts" | "vue" | "npm-jsr" | "unknown" | "vscode" | "nextjs" | "vite" | "svelte" | "remix" | "astro" | "nuxt" | "solid" | "qwik" | "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?: {
@@ -33,6 +33,7 @@ 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;
@@ -40,7 +41,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
40
41
  testing?: "bun" | "unknown" | "vitest" | "jest" | "playwright" | "cypress" | undefined;
41
42
  stateManagement?: "unknown" | "zustand" | "jotai" | "redux-toolkit" | undefined;
42
43
  formManagement?: "unknown" | "react-hook-form" | "formik" | undefined;
43
- styling?: "unknown" | "tailwind" | "styled-components" | "css-modules" | "sass" | undefined;
44
+ styling?: "sass" | "unknown" | "tailwind" | "styled-components" | "css-modules" | undefined;
44
45
  uiComponents?: "unknown" | "shadcn-ui" | "chakra-ui" | "material-ui" | undefined;
45
46
  databaseLibrary?: "unknown" | "drizzle" | "prisma" | "supabase" | undefined;
46
47
  databaseProvider?: "unknown" | "pg" | "mysql" | "sqlite" | "mongodb" | undefined;
@@ -51,7 +52,6 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
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;
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.29";
2
+ const version = "1.7.30";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -489,6 +489,14 @@ export interface DlerConfig {
489
489
  * @default "templates"
490
490
  */
491
491
  buildTemplatesDir: string;
492
+ /**
493
+ * When `true`, cleans up the temporary directories after the build process completes.
494
+ *
495
+ * @default true
496
+ */
497
+ postBuildSettings: {
498
+ cleanupTempDirs: boolean;
499
+ };
492
500
  }
493
501
  export type BumpMode = "patch" | "minor" | "major" | "auto" | "manual";
494
502
  /**
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.29",
56
+ "version": "1.7.30",
57
57
  "keywords": [
58
58
  "reliverse",
59
59
  "cli",