@reliverse/dler 1.7.43 → 1.7.45
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/impl.js +2 -1
- package/bin/app/build/postbuild.js +2 -1
- package/bin/app/pack/cmd.js +16 -15
- package/bin/libs/cfg/cfg-impl/rse-config/rse-impl/rse-define.d.ts +11 -11
- package/bin/libs/sdk/sdk-impl/config/info.js +1 -1
- package/bin/libs/sdk/sdk-impl/magic/ms-apply.js +22 -8
- package/bin/libs/sdk/sdk-impl/utils/utils-clean.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-clean.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 🧬 dler (prev. relidler) • build/publish/improve ts/js libs/cli/apps
|
|
2
2
|
|
|
3
3
|
[sponsor](https://github.com/sponsors/blefnk) — [discord](https://discord.gg/pb8ukbwpsj) — [github](https://github.com/reliverse/dler) — [npm](https://npmjs.com/@reliverse/dler)
|
|
4
4
|
|
package/bin/app/build/impl.js
CHANGED
|
@@ -24,7 +24,8 @@ export async function dlerBuild(isDev, config, debugOnlyCopyNonBuildFiles, debug
|
|
|
24
24
|
effectiveConfig.distNpmDirName,
|
|
25
25
|
effectiveConfig.distJsrDirName,
|
|
26
26
|
effectiveConfig.libsDirDist,
|
|
27
|
-
effectiveConfig.libsList
|
|
27
|
+
effectiveConfig.libsList,
|
|
28
|
+
"dist-tmp"
|
|
28
29
|
);
|
|
29
30
|
if (debugOnlyCopyNonBuildFiles) {
|
|
30
31
|
if (debugDontCopyNonBuildFiles) {
|
|
@@ -35,7 +35,8 @@ export async function dlerPostBuild(isDev, debugDontCopyNonBuildFiles) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
const distJsrPath = path.join(PROJECT_ROOT, config.distJsrDirName);
|
|
38
|
-
|
|
38
|
+
const distJsrBinPath = path.join(distJsrPath, "bin");
|
|
39
|
+
if (await directoryExists(distJsrPath) && await directoryExists(distJsrBinPath)) {
|
|
39
40
|
await compareFileStructures(path.join(PROJECT_ROOT, config.coreEntrySrcDir), distJsrPath);
|
|
40
41
|
}
|
|
41
42
|
}
|
package/bin/app/pack/cmd.js
CHANGED
|
@@ -105,30 +105,29 @@ export default defineCommand({
|
|
|
105
105
|
try {
|
|
106
106
|
await fs.access(path.join(outDir, typesFile));
|
|
107
107
|
} catch {
|
|
108
|
-
const typesContent = `export
|
|
109
|
-
export
|
|
110
|
-
export type FileMetadata = {
|
|
108
|
+
const typesContent = `export interface FileContent extends string | Record<string, unknown> {}
|
|
109
|
+
export interface FileMetadata {
|
|
111
110
|
updatedAt?: string;
|
|
112
111
|
updatedHash?: string;
|
|
113
|
-
}
|
|
114
|
-
export
|
|
112
|
+
}
|
|
113
|
+
export interface TemplatesFileContent {
|
|
115
114
|
content: FileContent;
|
|
116
|
-
type:
|
|
115
|
+
type: "text" | "json" | "binary";
|
|
117
116
|
hasError?: boolean;
|
|
118
117
|
jsonComments?: Record<number, string>;
|
|
119
118
|
binaryHash?: string;
|
|
120
119
|
metadata?: FileMetadata;
|
|
121
|
-
}
|
|
122
|
-
export
|
|
120
|
+
}
|
|
121
|
+
export interface TemplateConfig {
|
|
123
122
|
files: Record<string, TemplatesFileContent>;
|
|
124
|
-
}
|
|
125
|
-
export
|
|
123
|
+
}
|
|
124
|
+
export interface Template {
|
|
126
125
|
name: string;
|
|
127
126
|
description: string;
|
|
128
127
|
config: TemplateConfig;
|
|
129
128
|
updatedAt?: string;
|
|
130
|
-
}
|
|
131
|
-
export
|
|
129
|
+
}
|
|
130
|
+
export interface Templates extends Record<string, Template> {}
|
|
132
131
|
`;
|
|
133
132
|
await fs.writeFile(path.join(outDir, typesFile), typesContent);
|
|
134
133
|
}
|
|
@@ -250,7 +249,7 @@ export type Templates = Record<string, Template>;
|
|
|
250
249
|
).split("\n").map((line, i) => {
|
|
251
250
|
if (i === 0) return line;
|
|
252
251
|
return " " + line.replace(/"([a-zA-Z0-9_]+)":/g, "$1:");
|
|
253
|
-
}).join("\n").replace(/}
|
|
252
|
+
}).join("\n").replace(/},?\s*$/, "},");
|
|
254
253
|
code.push(` content: ${jsonStr}${sat},`);
|
|
255
254
|
code.push(' type: "json",');
|
|
256
255
|
}
|
|
@@ -291,9 +290,11 @@ export type Templates = Record<string, Template>;
|
|
|
291
290
|
const mod = [
|
|
292
291
|
...aggregatedImports,
|
|
293
292
|
"",
|
|
294
|
-
`
|
|
293
|
+
`const ${WL}_TEMPLATES_OBJ = {`,
|
|
295
294
|
...aggregatedEntries,
|
|
296
|
-
"}
|
|
295
|
+
"};",
|
|
296
|
+
"",
|
|
297
|
+
`export const ${WL}_TEMPLATES = ${WL}_TEMPLATES_OBJ as const;`,
|
|
297
298
|
"",
|
|
298
299
|
`export type ${WL}_TEMPLATE_NAMES = keyof typeof ${WL}_TEMPLATES;`,
|
|
299
300
|
"",
|
|
@@ -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?: "
|
|
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?: "
|
|
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?: {
|
|
@@ -39,13 +39,13 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
39
39
|
analytics?: "unknown" | "vercel" | undefined;
|
|
40
40
|
authentication?: "unknown" | "better-auth" | "clerk" | "next-auth" | "supabase-auth" | "auth0" | undefined;
|
|
41
41
|
api?: "rest" | "unknown" | "hono" | "trpc" | "graphql" | undefined;
|
|
42
|
-
testing?: "bun" | "
|
|
42
|
+
testing?: "bun" | "unknown" | "vitest" | "jest" | "playwright" | "cypress" | undefined;
|
|
43
43
|
stateManagement?: "unknown" | "zustand" | "jotai" | "redux-toolkit" | undefined;
|
|
44
44
|
formManagement?: "unknown" | "react-hook-form" | "formik" | undefined;
|
|
45
|
-
styling?: "
|
|
45
|
+
styling?: "unknown" | "tailwind" | "styled-components" | "css-modules" | "sass" | undefined;
|
|
46
46
|
uiComponents?: "unknown" | "shadcn-ui" | "chakra-ui" | "material-ui" | undefined;
|
|
47
47
|
databaseLibrary?: "unknown" | "drizzle" | "prisma" | "supabase" | undefined;
|
|
48
|
-
databaseProvider?: "
|
|
48
|
+
databaseProvider?: "unknown" | "pg" | "mysql" | "sqlite" | "mongodb" | undefined;
|
|
49
49
|
linting?: "eslint" | "unknown" | undefined;
|
|
50
50
|
formatting?: "biome" | "unknown" | undefined;
|
|
51
51
|
payment?: "unknown" | "stripe" | undefined;
|
|
@@ -58,7 +58,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
58
58
|
documentation?: "unknown" | "starlight" | "nextra" | undefined;
|
|
59
59
|
icons?: "unknown" | "lucide" | undefined;
|
|
60
60
|
mail?: "unknown" | "resend" | undefined;
|
|
61
|
-
cache?: "
|
|
61
|
+
cache?: "unknown" | "redis" | undefined;
|
|
62
62
|
storage?: "unknown" | "cloudflare" | undefined;
|
|
63
63
|
cms?: "unknown" | "contentlayer" | undefined;
|
|
64
64
|
seo?: "unknown" | "next-seo" | undefined;
|
|
@@ -67,7 +67,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
67
67
|
dates?: "unknown" | "dayjs" | undefined;
|
|
68
68
|
markdown?: "unknown" | "mdx" | undefined;
|
|
69
69
|
security?: "unknown" | "auth" | undefined;
|
|
70
|
-
routing?: "
|
|
70
|
+
routing?: "unknown" | "next" | "react-router" | "tanstack-router" | undefined;
|
|
71
71
|
} | undefined;
|
|
72
72
|
codeStyle?: {
|
|
73
73
|
lineWidth?: number | 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?: "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?: "
|
|
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?: "
|
|
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?: "
|
|
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;
|
|
@@ -24,53 +24,67 @@ function validateTargets(targets, customOutputPaths) {
|
|
|
24
24
|
const outputDirs = /* @__PURE__ */ new Set();
|
|
25
25
|
const specificLibs = /* @__PURE__ */ new Set();
|
|
26
26
|
const customTargets = /* @__PURE__ */ new Set();
|
|
27
|
+
const validTargets = [];
|
|
27
28
|
const allOutputPaths = { ...DEFAULT_OUTPUT_PATHS, ...customOutputPaths };
|
|
28
29
|
for (const target of targets) {
|
|
29
30
|
const [outputDir, lib] = target.split("/");
|
|
30
31
|
if (!outputDir) {
|
|
31
|
-
|
|
32
|
+
relinka("warn", `Skipping invalid output target: ${target}`);
|
|
33
|
+
continue;
|
|
32
34
|
}
|
|
33
35
|
const outputPath = allOutputPaths[outputDir] || outputDir;
|
|
34
36
|
const fullPath = path.isAbsolute(outputPath) ? outputPath : path.join(process.cwd(), outputPath);
|
|
35
37
|
if (!fs.existsSync(fullPath)) {
|
|
36
|
-
|
|
38
|
+
relinka("warn", `Skipping non-existent output directory: ${outputPath}`);
|
|
39
|
+
continue;
|
|
37
40
|
}
|
|
38
41
|
const isCustomTarget = !["dist-npm", "dist-jsr", "dist-libs"].includes(outputDir);
|
|
39
42
|
if (isCustomTarget) {
|
|
40
43
|
if (customTargets.has(outputDir)) {
|
|
41
|
-
|
|
44
|
+
relinka("warn", `Skipping duplicate custom target: ${outputDir}`);
|
|
45
|
+
continue;
|
|
42
46
|
}
|
|
43
47
|
customTargets.add(outputDir);
|
|
48
|
+
validTargets.push(target);
|
|
44
49
|
continue;
|
|
45
50
|
}
|
|
46
51
|
if (outputDir === "dist-libs") {
|
|
47
52
|
if (lib) {
|
|
48
53
|
if (specificLibs.has(lib)) {
|
|
49
|
-
|
|
54
|
+
relinka("warn", `Skipping duplicate library target: ${target}`);
|
|
55
|
+
continue;
|
|
50
56
|
}
|
|
51
57
|
specificLibs.add(lib);
|
|
52
58
|
} else {
|
|
53
59
|
if (outputDirs.has("dist-libs") || specificLibs.size > 0) {
|
|
54
|
-
|
|
60
|
+
relinka("warn", "Skipping 'dist-libs' as it conflicts with specific library targets");
|
|
61
|
+
continue;
|
|
55
62
|
}
|
|
56
63
|
outputDirs.add("dist-libs");
|
|
57
64
|
}
|
|
58
65
|
} else {
|
|
59
66
|
if (outputDirs.has(outputDir)) {
|
|
60
|
-
|
|
67
|
+
relinka("warn", `Skipping duplicate output target: ${outputDir}`);
|
|
68
|
+
continue;
|
|
61
69
|
}
|
|
62
70
|
outputDirs.add(outputDir);
|
|
63
71
|
}
|
|
72
|
+
validTargets.push(target);
|
|
64
73
|
}
|
|
74
|
+
return validTargets;
|
|
65
75
|
}
|
|
66
76
|
export async function applyMagicSpells(targets, options = {}) {
|
|
67
77
|
const result = {
|
|
68
78
|
processedFiles: []
|
|
69
79
|
};
|
|
70
80
|
try {
|
|
71
|
-
validateTargets(targets, options.customOutputPaths);
|
|
81
|
+
const validTargets = validateTargets(targets, options.customOutputPaths);
|
|
82
|
+
if (validTargets.length === 0) {
|
|
83
|
+
relinka("warn", "No valid targets found to process");
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
72
86
|
await pMap(
|
|
73
|
-
|
|
87
|
+
validTargets,
|
|
74
88
|
async (target) => {
|
|
75
89
|
const [outputDir, lib] = target.split("/");
|
|
76
90
|
if (outputDir && !["dist-npm", "dist-jsr", "dist-libs"].includes(outputDir)) {
|
|
@@ -2,7 +2,7 @@ import type { LibConfig } from "../config/types.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Recursively removes any existing distribution folders.
|
|
4
4
|
*/
|
|
5
|
-
export declare function removeDistFolders(distNpmDirName: string, distJsrDirName: string, libsDirDist: string, libsList: Record<string, LibConfig
|
|
5
|
+
export declare function removeDistFolders(distNpmDirName: string, distJsrDirName: string, libsDirDist: string, libsList: Record<string, LibConfig>, distTmpDirName?: string): Promise<boolean>;
|
|
6
6
|
/**
|
|
7
7
|
* Removes logInternal and relinka "internal" calls from TypeScript/JavaScript files
|
|
8
8
|
* @param targetDir Directory to process recursively
|
|
@@ -3,10 +3,13 @@ import fs from "@reliverse/relifso";
|
|
|
3
3
|
import { relinka } from "@reliverse/relinka";
|
|
4
4
|
import pMap from "p-map";
|
|
5
5
|
import { CONCURRENCY_DEFAULT, PROJECT_ROOT } from "./utils-consts.js";
|
|
6
|
-
export async function removeDistFolders(distNpmDirName, distJsrDirName, libsDirDist, libsList) {
|
|
6
|
+
export async function removeDistFolders(distNpmDirName, distJsrDirName, libsDirDist, libsList, distTmpDirName = "") {
|
|
7
7
|
const foldersToRemove = [];
|
|
8
|
+
foldersToRemove.push(distTmpDirName);
|
|
8
9
|
foldersToRemove.push(distNpmDirName);
|
|
9
|
-
|
|
10
|
+
if (distJsrDirName) {
|
|
11
|
+
foldersToRemove.push(distJsrDirName);
|
|
12
|
+
}
|
|
10
13
|
if (libsList && Object.keys(libsList).length > 0) {
|
|
11
14
|
foldersToRemove.push(libsDirDist);
|
|
12
15
|
}
|