@reliverse/dler 1.4.0 → 1.4.1
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 -0
- package/bin/app/deps/impl/analyzer.d.ts +1 -1
- package/bin/app/deps/impl/filesystem.d.ts +1 -1
- package/bin/app/deps/impl/formatter.d.ts +1 -1
- package/bin/app/deps/impl/parser.d.ts +1 -1
- package/bin/app/relifso/init/cmd.js +2 -2
- package/bin/app/relifso/init/{impl/mod.d.ts → init-impl.d.ts} +6 -1
- package/bin/app/relifso/init/{impl/mod.js → init-impl.js} +4 -2
- package/bin/app/relifso/init/{impl/types.d.ts → init-types.d.ts} +1 -1
- package/bin/default.d.ts +1 -1
- package/bin/default.js +2 -1
- package/bin/impl.js +4 -2
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/auto.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/auto.js +3 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/copy/copy.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/build.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/config.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/cjs.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/esbuild.d.ts +1 -11
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/stub.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/utils.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/watch.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/untyped/index.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/utils.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/validate.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-bump.d.ts +83 -9
- package/bin/libs/sdk/sdk-impl/utils/utils-bump.js +389 -32
- package/bin/libs/sdk/sdk-impl/utils/utils-clean.d.ts +1 -1
- package/bin/libs/sdk/sdk-mod.d.ts +1 -7
- package/bin/libs/sdk/sdk-mod.js +0 -4
- package/bin/libs/sdk/sdk-types.d.ts +328 -12
- package/bin/mod.d.ts +2 -48
- package/package.json +3 -2
- package/bin/app/relifso/init/impl/utils.d.ts +0 -5
- package/bin/app/relifso/init/impl/utils.js +0 -3
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/copy/types.d.ts +0 -9
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/copy/types.js +0 -0
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/types.d.ts +0 -15
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/types.js +0 -0
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/types.d.ts +0 -95
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/types.js +0 -0
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/types.d.ts +0 -176
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/types.js +0 -6
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/untyped/types.d.ts +0 -23
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/untyped/types.js +0 -0
- package/bin/types.d.ts +0 -475
- package/bin/types.js +0 -0
- /package/bin/app/deps/impl/{types.d.ts → deps-types.d.ts} +0 -0
- /package/bin/app/deps/impl/{types.js → deps-types.js} +0 -0
- /package/bin/app/relifso/init/{impl/const.d.ts → init-const.d.ts} +0 -0
- /package/bin/app/relifso/init/{impl/const.js → init-const.js} +0 -0
- /package/bin/app/relifso/init/{impl/types.js → init-types.js} +0 -0
- /package/bin/app/relifso/init/{impl/templates → templates}/t-gitignore.d.ts +0 -0
- /package/bin/app/relifso/init/{impl/templates → templates}/t-gitignore.js +0 -0
- /package/bin/app/relifso/init/{impl/templates → templates}/t-license.d.ts +0 -0
- /package/bin/app/relifso/init/{impl/templates → templates}/t-license.js +0 -0
- /package/bin/app/relifso/init/{impl/templates → templates}/t-readme.d.ts +0 -0
- /package/bin/app/relifso/init/{impl/templates → templates}/t-readme.js +0 -0
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
- 🔌 plugin system with two built-in plugins included
|
|
19
19
|
- 📝 highly configurable flow via a configuration file
|
|
20
20
|
- 🔜 `libraries` plugin —> dler monorepo implementation
|
|
21
|
+
- 🧼 cleans up your internal logs from the build dist
|
|
21
22
|
- 🪄 magic spells (built-in plugin)
|
|
22
23
|
|
|
23
24
|
### supported bundlers
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DependencyResult, FinderOptions } from "./types.js";
|
|
1
|
+
import type { DependencyResult, FinderOptions } from "./deps-types.js";
|
|
2
2
|
export declare const analyzeDependencies: (options: FinderOptions) => Promise<DependencyResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PackageJson } from "./types.js";
|
|
1
|
+
import type { PackageJson } from "./deps-types.js";
|
|
2
2
|
export declare const findSourceFiles: (directory: string, ignorePatterns: string[]) => Promise<string[]>;
|
|
3
3
|
export declare const readFile: (filePath: string) => Promise<string>;
|
|
4
4
|
export declare const readPackageJson: (directory: string) => Promise<PackageJson>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DependencyResult, FinderOptions } from "./types.js";
|
|
1
|
+
import type { DependencyResult, FinderOptions } from "./deps-types.js";
|
|
2
2
|
export declare const formatOutput: (result: DependencyResult, options: FinderOptions) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PackageJson } from "./types.js";
|
|
1
|
+
import type { PackageJson } from "./deps-types.js";
|
|
2
2
|
export declare const extractPackageNames: (fileContent: string) => Set<string>;
|
|
3
3
|
export declare const normalizePackageName: (importPath: string) => string | null;
|
|
4
4
|
export declare const getListedDependencies: (packageJson: PackageJson) => Set<string>;
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
multiselectPrompt,
|
|
5
5
|
selectPrompt
|
|
6
6
|
} from "@reliverse/rempts";
|
|
7
|
-
import { FILE_TYPES } from "./
|
|
8
|
-
import { initFile, initFiles } from "./impl
|
|
7
|
+
import { FILE_TYPES } from "./init-const.js";
|
|
8
|
+
import { initFile, initFiles } from "./init-impl.js";
|
|
9
9
|
export default defineCommand({
|
|
10
10
|
meta: {
|
|
11
11
|
name: "init",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileType, InitFileRequest, InitFileResult, ReinitUserConfig } from "./types.js";
|
|
1
|
+
import type { FileType, InitFileRequest, InitFileResult, ReinitUserConfig } from "./init-types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Creates a file from scratch, including parent directories,
|
|
4
4
|
* basing the file content on the fileType.
|
|
@@ -15,3 +15,8 @@ export declare function initFiles(items: InitFileRequest[], options?: {
|
|
|
15
15
|
parallel?: boolean;
|
|
16
16
|
concurrency?: number;
|
|
17
17
|
}, userCfg?: Partial<ReinitUserConfig>): Promise<InitFileResult[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Escapes custom markdown code blocks (''' → ```).
|
|
20
|
+
* Useful for safely embedding markdown in template literals.
|
|
21
|
+
*/
|
|
22
|
+
export declare function escapeMarkdownCodeBlocks(input: string): string;
|
|
@@ -3,11 +3,10 @@ import fs from "@reliverse/relifso";
|
|
|
3
3
|
import { relinka } from "@reliverse/relinka";
|
|
4
4
|
import { selectPrompt } from "@reliverse/rempts";
|
|
5
5
|
import pMap from "p-map";
|
|
6
|
-
import { FILE_TYPES } from "./const.js";
|
|
6
|
+
import { FILE_TYPES } from "./init-const.js";
|
|
7
7
|
import { gitignoreTemplate } from "./templates/t-gitignore.js";
|
|
8
8
|
import { licenseTemplate } from "./templates/t-license.js";
|
|
9
9
|
import { readmeTemplate } from "./templates/t-readme.js";
|
|
10
|
-
import { escapeMarkdownCodeBlocks } from "./utils.js";
|
|
11
10
|
const DEFAULT_CONFIG = {
|
|
12
11
|
defaultInitBehaviour: "create",
|
|
13
12
|
defaultDestFileExistsBehaviour: "prompt",
|
|
@@ -246,3 +245,6 @@ async function attachIndex(originalPath) {
|
|
|
246
245
|
} while (await checkFileExists(newPath));
|
|
247
246
|
return newPath;
|
|
248
247
|
}
|
|
248
|
+
export function escapeMarkdownCodeBlocks(input) {
|
|
249
|
+
return input.replace(/'''/g, "```");
|
|
250
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DEST_FILE_EXISTS_BEHAVIOURS, FILE_TYPES, INIT_BEHAVIOURS } from "./const.js";
|
|
1
|
+
import type { DEST_FILE_EXISTS_BEHAVIOURS, FILE_TYPES, INIT_BEHAVIOURS } from "./init-const.js";
|
|
2
2
|
export type FileType = (typeof FILE_TYPES)[number]["type"];
|
|
3
3
|
export type InitBehaviour = (typeof INIT_BEHAVIOURS)[number];
|
|
4
4
|
export type DestFileExistsBehaviour = (typeof DEST_FILE_EXISTS_BEHAVIOURS)[number];
|
package/bin/default.d.ts
CHANGED
package/bin/default.js
CHANGED
package/bin/impl.js
CHANGED
|
@@ -28,7 +28,8 @@ export async function dlerBuild(isDev) {
|
|
|
28
28
|
config.bumpMode,
|
|
29
29
|
config.bumpDisable,
|
|
30
30
|
pausePublishing,
|
|
31
|
-
config.bumpFilter
|
|
31
|
+
config.bumpFilter,
|
|
32
|
+
config.bumpSet
|
|
32
33
|
);
|
|
33
34
|
}
|
|
34
35
|
await processRegularFlow(
|
|
@@ -124,7 +125,8 @@ export async function dlerPub(isDev) {
|
|
|
124
125
|
config.bumpMode,
|
|
125
126
|
config.bumpDisable,
|
|
126
127
|
config.commonPubPause,
|
|
127
|
-
config.bumpFilter
|
|
128
|
+
config.bumpFilter,
|
|
129
|
+
config.bumpSet
|
|
128
130
|
);
|
|
129
131
|
}
|
|
130
132
|
await processRegularFlow(
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { join, normalize, resolve } from "@reliverse/pathkit";
|
|
2
2
|
import { relinka } from "@reliverse/relinka";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
|
-
import { definePreset } from "./types.js";
|
|
5
4
|
import { extractExportFilenames, listRecursively, warn } from "./utils.js";
|
|
5
|
+
export function definePreset(preset) {
|
|
6
|
+
return preset;
|
|
7
|
+
}
|
|
6
8
|
export const autoPreset = definePreset(() => {
|
|
7
9
|
return {
|
|
8
10
|
hooks: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UnifiedBuildConfig } from "
|
|
1
|
+
import type { UnifiedBuildConfig } from "../../../../sdk-types.js";
|
|
2
2
|
export declare function unifiedBuild(isLib: boolean, rootDir: string, inputConfig: UnifiedBuildConfig & {
|
|
3
3
|
config?: string;
|
|
4
4
|
showOutLog?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BuildContext } from "
|
|
1
|
+
import type { BuildContext } from "../../../../../sdk-types.js";
|
|
2
2
|
export declare function copyBuild(ctx: BuildContext): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BuildContext } from "
|
|
1
|
+
import type { BuildContext } from "../../../../../sdk-types.js";
|
|
2
2
|
export declare function mkdistBuild(ctx: BuildContext): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BuildContext } from "
|
|
1
|
+
import type { BuildContext } from "../../../../../sdk-types.js";
|
|
2
2
|
export declare function rollupBuild(ctx: BuildContext): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BuildContext, RollupOptions } from "
|
|
1
|
+
import type { BuildContext, RollupOptions } from "../../../../../sdk-types.js";
|
|
2
2
|
export declare function getRollupOptions(ctx: BuildContext): RollupOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Plugin } from "rollup";
|
|
2
|
-
import type { BuildContext } from "
|
|
2
|
+
import type { BuildContext } from "../../../../../../sdk-types.js";
|
|
3
3
|
export declare function cjsPlugin(): Plugin;
|
|
4
4
|
export declare function fixCJSExportTypePlugin(ctx: BuildContext): Plugin;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import type { FilterPattern } from "@rollup/pluginutils";
|
|
2
|
-
import type { CommonOptions, Loader } from "esbuild";
|
|
3
1
|
import type { Plugin } from "rollup";
|
|
4
|
-
|
|
5
|
-
exclude?: FilterPattern;
|
|
6
|
-
include?: FilterPattern;
|
|
7
|
-
/**
|
|
8
|
-
* Map extension to transpileEsbuild loader
|
|
9
|
-
* Note that each entry (the extension) needs to start with a dot
|
|
10
|
-
*/
|
|
11
|
-
loaders?: Record<string, false | Loader>;
|
|
12
|
-
};
|
|
2
|
+
import type { EsbuildOptions } from "../../../../../../sdk-types.js";
|
|
13
3
|
export declare function esbuild(options: EsbuildOptions): Plugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BuildContext } from "
|
|
1
|
+
import type { BuildContext } from "../../../../../sdk-types.js";
|
|
2
2
|
export declare function rollupStub(ctx: BuildContext): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PreRenderedChunk } from "rollup";
|
|
2
|
-
import type { BuildContext } from "
|
|
2
|
+
import type { BuildContext } from "../../../../../sdk-types.js";
|
|
3
3
|
export declare const DEFAULT_EXTENSIONS: string[];
|
|
4
4
|
export declare function getChunkFilename(ctx: BuildContext, chunk: PreRenderedChunk, ext: string): string;
|
|
5
5
|
export declare function resolveAliases(ctx: BuildContext): Record<string, string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RollupOptions } from "
|
|
1
|
+
import type { RollupOptions } from "../../../../../sdk-types.js";
|
|
2
2
|
export declare function rollupWatch(rollupOptions: RollupOptions): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BuildContext } from "
|
|
1
|
+
import type { BuildContext } from "../../../../../sdk-types.js";
|
|
2
2
|
export declare function typesBuild(ctx: BuildContext): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PackageJson } from "pkg-types";
|
|
2
|
-
import type { BuildContext, BuildPreset, UnifiedBuildConfig } from "
|
|
2
|
+
import type { BuildContext, BuildPreset, UnifiedBuildConfig } from "../../../../sdk-types.js";
|
|
3
3
|
type OutputDescriptor = {
|
|
4
4
|
file: string;
|
|
5
5
|
type?: "cjs" | "esm";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PackageJson } from "pkg-types";
|
|
2
|
-
import type { BuildContext } from "
|
|
2
|
+
import type { BuildContext } from "../../../../sdk-types.js";
|
|
3
3
|
export declare function validateDependencies(ctx: BuildContext): void;
|
|
4
4
|
export declare function validatePackage(pkg: PackageJson, rootDir: string, ctx: BuildContext): void;
|
|
@@ -1,14 +1,88 @@
|
|
|
1
|
-
import type { BumpMode } from "../../sdk-types.js";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @param mainFile - Optional source file for version (defaults to package.json)
|
|
2
|
+
* Supported bump modes for versioning:
|
|
3
|
+
* - patch: 1.2.3 → 1.2.4 (backwards-compatible bug fixes)
|
|
4
|
+
* - minor: 1.2.3 → 1.3.0 (new backwards-compatible features)
|
|
5
|
+
* - major: 1.2.3 → 2.0.0 (breaking changes)
|
|
6
|
+
* - auto: Automatically determine bump type
|
|
7
|
+
* - manual: Set a specific version (requires bumpSet to be set)
|
|
10
8
|
*/
|
|
11
|
-
export
|
|
9
|
+
export type BumpMode = "patch" | "minor" | "major" | "auto" | "manual";
|
|
10
|
+
export type FileType = "package.json" | "typescript" | "unknown";
|
|
11
|
+
export type BumpOptions = {
|
|
12
|
+
dryRun?: boolean;
|
|
13
|
+
verbose?: boolean;
|
|
14
|
+
customVersion?: string;
|
|
15
|
+
};
|
|
16
|
+
export type FileAnalysis = {
|
|
17
|
+
file: string;
|
|
18
|
+
supported: boolean;
|
|
19
|
+
detectedVersion: string | null;
|
|
20
|
+
versionMismatch: boolean;
|
|
21
|
+
reason: string;
|
|
22
|
+
fileType: FileType;
|
|
23
|
+
};
|
|
24
|
+
export type VersionInfo = {
|
|
25
|
+
version: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
author?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const isValidSemver: (version: string) => boolean;
|
|
30
|
+
export declare const parseSemver: (version: string) => [number, number, number];
|
|
31
|
+
export declare const calculateNewVersion: (current: string, bumpType: BumpMode, customVersion?: string, bumpSet?: string) => string;
|
|
32
|
+
export declare const readFileInfo: (filePath: string) => Promise<VersionInfo | null>;
|
|
33
|
+
export declare const getCurrentVersion: (filePath?: string, field?: string) => Promise<string>;
|
|
34
|
+
export declare const getPackageName: (filePath?: string, field?: string) => Promise<string>;
|
|
35
|
+
export declare const getPackageAuthor: (filePath?: string, field?: string) => Promise<string>;
|
|
36
|
+
export declare const analyzeFiles: (files: string[], referenceVersion: string) => Promise<FileAnalysis[]>;
|
|
37
|
+
export type DlerConfig = {
|
|
38
|
+
bumpDisable?: boolean;
|
|
39
|
+
bumpFilter?: string[];
|
|
40
|
+
bumpMode?: BumpMode;
|
|
41
|
+
bumpSet?: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const getConfigFromDler: () => Promise<{
|
|
44
|
+
files: string[];
|
|
45
|
+
bumpDisable?: boolean;
|
|
46
|
+
bumpMode?: BumpMode;
|
|
47
|
+
bumpSet?: string;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const getFilesFromConfigOrDefault: () => Promise<string[]>;
|
|
50
|
+
export declare const bumpVersion: (bumpType: BumpMode, files?: string[], options?: BumpOptions, globs?: string[], bumpSet?: string) => Promise<void>;
|
|
51
|
+
export declare const bumpVersionWithAnalysis: (bumpType: BumpMode, files?: string[], options?: BumpOptions, bumpSet?: string) => Promise<void>;
|
|
52
|
+
export declare const compareVersions: (version1: string, version2: string) => number;
|
|
53
|
+
export declare const getLatestVersion: (versions: string[]) => string | null;
|
|
54
|
+
export declare const isPrerelease: (version: string) => boolean;
|
|
55
|
+
export declare const satisfiesRange: (version: string, range: string) => boolean;
|
|
56
|
+
export type BumpConfig = {
|
|
57
|
+
bumpType: BumpMode;
|
|
58
|
+
customVersion?: string;
|
|
59
|
+
dryRun?: boolean;
|
|
60
|
+
verbose?: boolean;
|
|
61
|
+
};
|
|
62
|
+
export type SessionConfig = {
|
|
63
|
+
isCI: boolean;
|
|
64
|
+
isNonInteractive: boolean;
|
|
65
|
+
mainFile: string;
|
|
66
|
+
filesToBump: string[];
|
|
67
|
+
options: {
|
|
68
|
+
dryRun: boolean;
|
|
69
|
+
verbose: boolean;
|
|
70
|
+
customVersion?: string;
|
|
71
|
+
};
|
|
72
|
+
bumpType: BumpMode;
|
|
73
|
+
};
|
|
74
|
+
export declare function validateBumpConfig(bumpType: BumpMode, customVersion?: string): void;
|
|
75
|
+
export declare function getDefaultBumpMode(isCI: boolean, isNonInteractive: boolean): BumpMode;
|
|
76
|
+
export declare function handleNonInteractiveSession(config: SessionConfig): Promise<void>;
|
|
77
|
+
export declare function handleInteractiveSession(config: SessionConfig, projectVersion: string): Promise<{
|
|
78
|
+
supportedFiles: FileAnalysis[];
|
|
79
|
+
mismatchedFiles: FileAnalysis[];
|
|
80
|
+
fileAnalysis: FileAnalysis[];
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Handles version bumping using @reliverse/bleump
|
|
84
|
+
*/
|
|
85
|
+
export declare function bumpHandler(bumpMode: BumpMode, bumpDisable: boolean, commonPubPause: boolean, bumpFilter: string[], bumpSet?: string): Promise<void>;
|
|
12
86
|
/**
|
|
13
87
|
* Updates the "bumpDisable" flag in the build configuration file.
|
|
14
88
|
*/
|