@reliverse/dler 1.7.29 → 1.7.31
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 +1 -1
- package/bin/app/build/cmd.d.ts +8 -0
- package/bin/app/build/cmd.js +14 -1
- package/bin/app/build/impl.d.ts +1 -1
- package/bin/app/build/impl.js +19 -4
- package/bin/app/build/postbuild.d.ts +3 -1
- package/bin/app/build/postbuild.js +25 -15
- package/bin/libs/cfg/cfg-impl/cfg-consts.d.ts +3 -0
- package/bin/libs/cfg/cfg-impl/cfg-types.d.ts +8 -0
- package/bin/libs/cfg/cfg-impl/rse-config/rse-impl/rse-define.d.ts +9 -9
- package/bin/libs/sdk/sdk-impl/config/info.js +1 -1
- package/bin/libs/sdk/sdk-impl/config/types.d.ts +8 -0
- package/bin/libs/sdk/sdk-impl/pub/pub-library.js +1 -0
- package/bin/libs/sdk/sdk-impl/pub/pub-regular.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
### 🚀 core power
|
|
10
10
|
|
|
11
|
-
-
|
|
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
|
package/bin/app/build/cmd.d.ts
CHANGED
|
@@ -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;
|
package/bin/app/build/cmd.js
CHANGED
|
@@ -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(
|
|
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
|
});
|
package/bin/app/build/impl.d.ts
CHANGED
|
@@ -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>;
|
package/bin/app/build/impl.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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>;
|
|
@@ -52,7 +52,12 @@ async function copyNonBuildFiles(srcDir, distDir, preExtensions, templatesDir) {
|
|
|
52
52
|
const isInTemplatesDir = file.startsWith(templatesDir);
|
|
53
53
|
if (isInTemplatesDir || !preExtensions.includes(ext)) {
|
|
54
54
|
const srcPath = path.join(srcDir, file);
|
|
55
|
-
|
|
55
|
+
let destPath = path.join(distDir, file);
|
|
56
|
+
if (!isInTemplatesDir && !preExtensions.includes(ext) || isInTemplatesDir) {
|
|
57
|
+
const binDir = path.join(distDir, "bin");
|
|
58
|
+
const relativePath = isInTemplatesDir ? file : path.basename(file);
|
|
59
|
+
destPath = path.join(binDir, relativePath);
|
|
60
|
+
}
|
|
56
61
|
await fs.ensureDir(path.dirname(destPath));
|
|
57
62
|
await fs.copy(srcPath, destPath);
|
|
58
63
|
}
|
|
@@ -65,10 +70,28 @@ async function copyNonBuildFiles(srcDir, distDir, preExtensions, templatesDir) {
|
|
|
65
70
|
throw error;
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
|
-
export async function dlerPostBuild(isDev) {
|
|
73
|
+
export async function dlerPostBuild(isDev, debugDontCopyNonBuildFiles) {
|
|
69
74
|
relinka("info", "\u2014 \u2014 \u2014 dlerPostBuild \u2014 \u2014 \u2014");
|
|
70
75
|
const config = await getConfigDler();
|
|
71
76
|
await resolveAllCrossLibs();
|
|
77
|
+
if (!debugDontCopyNonBuildFiles) {
|
|
78
|
+
await wrapper_CopyNonBuildFiles(config);
|
|
79
|
+
}
|
|
80
|
+
if (isDev) {
|
|
81
|
+
await applyMagicSpells(["dist-jsr", "dist-npm", "dist-libs"]);
|
|
82
|
+
}
|
|
83
|
+
await processDistDirectories();
|
|
84
|
+
await executeDlerHooks(config?.hooksAfterBuild ?? [], "post-build");
|
|
85
|
+
if (config?.runAfterBuild?.length) {
|
|
86
|
+
const tools = createPostBuildToolRunner();
|
|
87
|
+
const availableTools = config.runAfterBuild.filter((toolName) => toolName in tools).map((toolName) => ({ toolName, ...tools[toolName] }));
|
|
88
|
+
for (const { name, run } of availableTools) {
|
|
89
|
+
relinka("log", `Running ${name}...`);
|
|
90
|
+
await run();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export async function wrapper_CopyNonBuildFiles(config) {
|
|
72
95
|
if (config.commonPubRegistry === "npm" || config.commonPubRegistry === "npm-jsr") {
|
|
73
96
|
await copyNonBuildFiles(
|
|
74
97
|
path.join(PROJECT_ROOT, config.coreEntrySrcDir),
|
|
@@ -93,17 +116,4 @@ export async function dlerPostBuild(isDev) {
|
|
|
93
116
|
config.buildTemplatesDir
|
|
94
117
|
);
|
|
95
118
|
}
|
|
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
119
|
}
|
|
@@ -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
|
-
projectPackageManager?: "
|
|
14
|
-
projectState?: "
|
|
13
|
+
projectPackageManager?: "bun" | "npm" | "yarn" | "pnpm" | undefined;
|
|
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?: "
|
|
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;
|
|
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,8 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
33
33
|
themes?: string[] | undefined;
|
|
34
34
|
} | undefined;
|
|
35
35
|
preferredLibraries?: {
|
|
36
|
+
search?: "unknown" | "algolia" | undefined;
|
|
37
|
+
cdn?: "unknown" | "cloudflare" | undefined;
|
|
36
38
|
i18n?: "unknown" | "next-intl" | undefined;
|
|
37
39
|
analytics?: "unknown" | "vercel" | undefined;
|
|
38
40
|
authentication?: "unknown" | "better-auth" | "clerk" | "next-auth" | "supabase-auth" | "auth0" | undefined;
|
|
@@ -51,7 +53,6 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
51
53
|
logging?: "unknown" | "axiom" | undefined;
|
|
52
54
|
forms?: "unknown" | "react-hook-form" | undefined;
|
|
53
55
|
notifications?: "unknown" | "sonner" | undefined;
|
|
54
|
-
search?: "unknown" | "algolia" | undefined;
|
|
55
56
|
uploads?: "unknown" | "uploadthing" | undefined;
|
|
56
57
|
validation?: "unknown" | "zod" | "typebox" | "valibot" | undefined;
|
|
57
58
|
documentation?: "unknown" | "starlight" | "nextra" | undefined;
|
|
@@ -59,7 +60,6 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
59
60
|
mail?: "unknown" | "resend" | undefined;
|
|
60
61
|
cache?: "unknown" | "redis" | undefined;
|
|
61
62
|
storage?: "unknown" | "cloudflare" | undefined;
|
|
62
|
-
cdn?: "unknown" | "cloudflare" | undefined;
|
|
63
63
|
cms?: "unknown" | "contentlayer" | undefined;
|
|
64
64
|
seo?: "unknown" | "next-seo" | undefined;
|
|
65
65
|
motion?: "unknown" | "framer" | 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?: "
|
|
78
|
+
trailingComma?: "all" | "none" | "es5" | undefined;
|
|
79
79
|
bracketSpacing?: boolean | undefined;
|
|
80
80
|
arrowParens?: "always" | "avoid" | undefined;
|
|
81
81
|
tabWidth?: number | 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?: "
|
|
99
|
+
type?: "bun" | "pnpm" | "none" | "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?: "
|
|
116
|
+
projectRuntime?: "bun" | "node" | "deno" | undefined;
|
|
117
117
|
skipPromptsUseAutoBehavior?: boolean | undefined;
|
|
118
118
|
deployBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
119
119
|
depsBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
@@ -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
|
/**
|
|
@@ -72,6 +72,7 @@ async function library_pubToJsr(libOutDir, distJsrDryRun, distJsrFailOnWarn, dis
|
|
|
72
72
|
`Successfully ${distJsrDryRun ? "validated" : "published"} lib ${libName} to JSR registry`
|
|
73
73
|
);
|
|
74
74
|
});
|
|
75
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
75
76
|
if (timer) resumePerfTimer(timer);
|
|
76
77
|
} catch (error) {
|
|
77
78
|
if (timer) resumePerfTimer(timer);
|
|
@@ -23,6 +23,7 @@ export async function regular_pubToJsr(distJsrDryRun, distJsrFailOnWarn, _isDev,
|
|
|
23
23
|
relinka("null", "");
|
|
24
24
|
relinka("log", `Successfully ${distJsrDryRun ? "validated" : "published"} to JSR registry`);
|
|
25
25
|
});
|
|
26
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
26
27
|
if (timer) resumePerfTimer(timer);
|
|
27
28
|
}
|
|
28
29
|
} catch (error) {
|