@reliverse/dler 1.7.21 → 1.7.23
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/app/agg/impl.js +1 -1
- package/bin/app/cmds.d.ts +1 -1
- package/bin/app/cmds.js +1 -1
- package/bin/app/inject/cmd.d.ts +0 -24
- package/bin/app/inject/cmd.js +0 -47
- package/bin/app/{spell → magic}/cmd.d.ts +2 -0
- package/bin/app/magic/cmd.js +101 -0
- package/bin/app/pub/impl.js +4 -2
- package/bin/libs/cfg/cfg-mod.d.ts +24 -195
- package/bin/libs/cfg/cfg-mod.js +71 -66
- package/bin/libs/cfg/constants.d.ts +68 -0
- package/bin/libs/cfg/constants.js +60 -0
- package/bin/libs/cfg/rse/rse-impl/rse-create.js +1 -1
- package/bin/libs/cfg/rse/rse-impl/rse-define.d.ts +11 -11
- package/bin/libs/cfg/rse/rse-mod.d.ts +1 -1
- package/bin/libs/cfg/rse/rse-mod.js +1 -1
- package/bin/libs/sdk/sdk-impl/cmds/inject/inject-impl-mod.d.ts +63 -0
- package/bin/libs/sdk/sdk-impl/cmds/inject/inject-impl-mod.js +237 -0
- package/bin/libs/sdk/sdk-impl/config/info.js +1 -3
- package/bin/libs/sdk/sdk-impl/magic/apply.d.ts +63 -0
- package/bin/libs/sdk/sdk-impl/{spell/applyMagicSpells.js → magic/apply.js} +223 -70
- package/bin/libs/sdk/sdk-impl/{spell → magic}/spells.d.ts +16 -1
- package/bin/libs/sdk/sdk-impl/{spell → magic}/spells.js +41 -1
- package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/deps-types.d.ts +1 -1
- package/bin/libs/sdk/sdk-mod.d.ts +93 -42
- package/bin/libs/sdk/sdk-mod.js +119 -27
- package/package.json +2 -2
- package/bin/app/inject/impl.d.ts +0 -5
- package/bin/app/inject/impl.js +0 -159
- package/bin/app/spell/cmd.js +0 -47
- package/bin/libs/sdk/sdk-impl/spell/applyMagicSpells.d.ts +0 -38
- /package/bin/app/{spell → magic}/old.d.ts +0 -0
- /package/bin/app/{spell → magic}/old.js +0 -0
- /package/bin/libs/cfg/rse/rse-impl/{rse-inject.d.ts → rse-comments.d.ts} +0 -0
- /package/bin/libs/cfg/rse/rse-impl/{rse-inject.js → rse-comments.js} +0 -0
|
@@ -1,42 +1,93 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
1
|
+
export type { LibraryBuildOptions } from "./sdk-impl/build/build-library.js";
|
|
2
|
+
export { library_buildLibrary } from "./sdk-impl/build/build-library.js";
|
|
3
|
+
export { regular_buildJsrDist, regular_buildNpmDist } from "./sdk-impl/build/build-regular.js";
|
|
4
|
+
export { definePreset, autoPreset } from "./sdk-impl/build/bundlers/unified/auto.js";
|
|
5
|
+
export { unifiedBuild } from "./sdk-impl/build/bundlers/unified/build.js";
|
|
6
|
+
export { copyBuild } from "./sdk-impl/build/bundlers/unified/copy/copy-mod.js";
|
|
7
|
+
export { createLoader } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loader.js";
|
|
8
|
+
export { jsLoader } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/js.js";
|
|
9
|
+
export { defaultLoaders, resolveLoader, resolveLoaders, } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/loaders-mod.js";
|
|
10
|
+
export type { PostcssLoaderOptions } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/postcss.js";
|
|
11
|
+
export { postcssLoader } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/postcss.js";
|
|
12
|
+
export { sassLoader } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/sass.js";
|
|
13
|
+
export type { DefineVueLoaderOptions, VueBlock, VueBlockLoader, DefaultBlockLoaderOptions, } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/vue.js";
|
|
14
|
+
export { fallbackVueLoader, vueLoader, } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/vue.js";
|
|
15
|
+
export { mkdist } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.js";
|
|
16
|
+
export type { DeclarationOutput } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/dts.js";
|
|
17
|
+
export { normalizeCompilerOptions, getDeclarations, extractDeclarations, augmentWithDiagnostics, } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/dts.js";
|
|
18
|
+
export { copyFileWithStream } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/fs.js";
|
|
19
|
+
export { useSpinner } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/spinner.js";
|
|
20
|
+
export { getVueDeclarations } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/vue-dts.js";
|
|
21
|
+
export { mkdistBuild } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-mod.js";
|
|
22
|
+
export { rollupBuild } from "./sdk-impl/build/bundlers/unified/rollup/build.js";
|
|
23
|
+
export { getRollupOptions } from "./sdk-impl/build/bundlers/unified/rollup/config.js";
|
|
24
|
+
export { cjsPlugin, fixCJSExportTypePlugin, } from "./sdk-impl/build/bundlers/unified/rollup/plugins/cjs.js";
|
|
25
|
+
export { esbuild } from "./sdk-impl/build/bundlers/unified/rollup/plugins/esbuild.js";
|
|
26
|
+
export { JSONPlugin } from "./sdk-impl/build/bundlers/unified/rollup/plugins/json.js";
|
|
27
|
+
export { rawPlugin } from "./sdk-impl/build/bundlers/unified/rollup/plugins/raw.js";
|
|
28
|
+
export { getShebang, makeExecutable, removeShebangPlugin, shebangPlugin, } from "./sdk-impl/build/bundlers/unified/rollup/plugins/shebang.js";
|
|
29
|
+
export { rollupStub } from "./sdk-impl/build/bundlers/unified/rollup/stub.js";
|
|
30
|
+
export { DEFAULT_EXTENSIONS, getChunkFilename, resolveAliases, } from "./sdk-impl/build/bundlers/unified/rollup/utils.js";
|
|
31
|
+
export { rollupWatch } from "./sdk-impl/build/bundlers/unified/rollup/watch.js";
|
|
32
|
+
export { typesBuild } from "./sdk-impl/build/bundlers/unified/untyped/untyped-mod.js";
|
|
33
|
+
export { arrayIncludes, dumpObject, extractExportFilenames, getpkg, inferPkgExternals, listRecursively, removeExtension, resolvePreset, rmdir, symlink, warn, withTrailingSlash, } from "./sdk-impl/build/bundlers/unified/utils.js";
|
|
34
|
+
export { validateDependencies, validatePackage, } from "./sdk-impl/build/bundlers/unified/validate.js";
|
|
35
|
+
export { DEFAULT_CONFIG_DLER, defineConfigDler } from "./sdk-impl/config/default.js";
|
|
36
|
+
export { showStartPrompt, showEndPrompt } from "./sdk-impl/config/info.js";
|
|
37
|
+
export { ensureDlerConfig } from "./sdk-impl/config/init.js";
|
|
38
|
+
export { getConfigDler } from "./sdk-impl/config/load.js";
|
|
39
|
+
export type { DlerConfig, BumpMode, BundlerName, NpmOutExt, LibConfig, Esbuild, transpileFormat, Sourcemap, transpileTarget, } from "./sdk-impl/config/types.js";
|
|
40
|
+
export { IGNORE_PATTERNS } from "./sdk-impl/constants.js";
|
|
41
|
+
export { processLibraryFlow, libraries_buildPublish } from "./sdk-impl/library-flow.js";
|
|
42
|
+
export { library_publishLibrary } from "./sdk-impl/pub/pub-library.js";
|
|
43
|
+
export { regular_pubToJsr, regular_pubToNpm } from "./sdk-impl/pub/pub-regular.js";
|
|
44
|
+
export { processRegularFlow } from "./sdk-impl/regular-flow.js";
|
|
45
|
+
export { checkDlerConfigHealth } from "./sdk-impl/rules/reliverse/dler-config-health/dler-config-health.js";
|
|
46
|
+
export { checkFileExtensions } from "./sdk-impl/rules/reliverse/file-extensions/file-extensions.js";
|
|
47
|
+
export { analyzeDependencies } from "./sdk-impl/rules/reliverse/missing-deps/analyzer.js";
|
|
48
|
+
export { checkMissingDependencies } from "./sdk-impl/rules/reliverse/missing-deps/deps-mod.js";
|
|
49
|
+
export type { MissingDepsFileType, PackageJson, FinderOptions, DependencyResult, } from "./sdk-impl/rules/reliverse/missing-deps/deps-types.js";
|
|
50
|
+
export { findSourceFiles, readFile, readPackageJson, } from "./sdk-impl/rules/reliverse/missing-deps/filesystem.js";
|
|
51
|
+
export { formatOutput } from "./sdk-impl/rules/reliverse/missing-deps/formatter.js";
|
|
52
|
+
export { extractPackageNames, normalizePackageName, getListedDependencies, getBuiltinModules, } from "./sdk-impl/rules/reliverse/missing-deps/parser.js";
|
|
53
|
+
export { checkNoIndexFiles } from "./sdk-impl/rules/reliverse/no-index-files/no-index-files.js";
|
|
54
|
+
export { checkPackageJsonHealth } from "./sdk-impl/rules/reliverse/package-json-health/package-json-health.js";
|
|
55
|
+
export { checkPathExtensions } from "./sdk-impl/rules/reliverse/path-extensions/path-extensions.js";
|
|
56
|
+
export { checkSelfInclude } from "./sdk-impl/rules/reliverse/self-include/self-include.js";
|
|
57
|
+
export { checkTsConfigHealth } from "./sdk-impl/rules/reliverse/tsconfig-health/tsconfig-health.js";
|
|
58
|
+
export type { AllowedFileExtensionsType } from "./sdk-impl/rules/rules-consts.js";
|
|
59
|
+
export { ALLOWED_FILE_EXTENSIONS, STRICT_FILE_EXTENSIONS, ALLOWED_IMPORT_EXTENSIONS, STRICT_IMPORT_EXTENSIONS, } from "./sdk-impl/rules/rules-consts.js";
|
|
60
|
+
export { displayCheckResults } from "./sdk-impl/rules/rules-mod.js";
|
|
61
|
+
export { shouldIgnoreFile, getAllFiles, getLineNumber } from "./sdk-impl/rules/rules-utils.js";
|
|
62
|
+
export type { ApplyMagicSpellsOptions, ApplyMagicSpellsResult, } from "./sdk-impl/magic/apply.js";
|
|
63
|
+
export { applyMagicSpells, getAllAvailableRegistries } from "./sdk-impl/magic/apply.js";
|
|
64
|
+
export type { SpellEvaluationContext, SpellOutcome, SpellDirective, } from "./sdk-impl/magic/spells.js";
|
|
65
|
+
export { evaluateMagicDirective } from "./sdk-impl/magic/spells.js";
|
|
66
|
+
export { BINARY_EXTS, BINARY_SET } from "./sdk-impl/utils/b-exts.js";
|
|
67
|
+
export { isBinaryExt } from "./sdk-impl/utils/binary.js";
|
|
68
|
+
export type { CommentStyle, FileExtension, CommentMapping } from "./sdk-impl/utils/comments.js";
|
|
69
|
+
export { DEFAULT_COMMENT, COMMENT_MAP, getCommentPrefix } from "./sdk-impl/utils/comments.js";
|
|
70
|
+
export { detectFileType, detectBufferType, detectStreamType, isBinary, getMimeType, } from "./sdk-impl/utils/file-type.js";
|
|
71
|
+
export { finalizeBuildPub } from "./sdk-impl/utils/finalize.js";
|
|
72
|
+
export { WHITELABEL_DEFAULT, JSON_EXTS, TEMPLATE_VAR, TPLS_DIR, BINARIES_DIR, isJsonExt, } from "./sdk-impl/utils/pack-unpack/pu-constants.js";
|
|
73
|
+
export { walkDir, readFileForTemplate, escapeTemplateString, } from "./sdk-impl/utils/pack-unpack/pu-file-utils.js";
|
|
74
|
+
export type { FileContent, FileType, FileMetadata, TemplatesFileContent, TemplateConfig, Template, Templates, } from "./sdk-impl/utils/pack-unpack/pu-types.js";
|
|
75
|
+
export { extractJsonComments, stripComments } from "./sdk-impl/utils/pack-unpack/pub-json-utils.js";
|
|
76
|
+
export { resolveCrossLibs, resolveAllCrossLibs } from "./sdk-impl/utils/resolve-cross-libs.js";
|
|
77
|
+
export { useAggregator } from "./sdk-impl/utils/tools-agg.js";
|
|
78
|
+
export { printUsage } from "./sdk-impl/utils/tools-impl.js";
|
|
79
|
+
export { getBunSourcemapOption, getUnifiedSourcemapOption, renameEntryFile, } from "./sdk-impl/utils/utils-build.js";
|
|
80
|
+
export { removeDistFolders, removeLogInternalCalls } from "./sdk-impl/utils/utils-clean.js";
|
|
81
|
+
export { PROJECT_ROOT, CONCURRENCY_DEFAULT, tsconfigJson, cliDomainDocs, validExtensions, SHOW_VERBOSE, } from "./sdk-impl/utils/utils-consts.js";
|
|
82
|
+
export { filterDeps } from "./sdk-impl/utils/utils-deps.js";
|
|
83
|
+
export { determineDistName } from "./sdk-impl/utils/utils-determine.js";
|
|
84
|
+
export { handleDlerError, withWorkingDirectory, validateDevCwd, formatError, } from "./sdk-impl/utils/utils-error-cwd.js";
|
|
85
|
+
export { copyRootFile, getDirectorySize, outDirBinFilesCount, deleteSpecificFiles, readFileSafe, writeFileSafe, copyInsteadOfBuild, } from "./sdk-impl/utils/utils-fs.js";
|
|
86
|
+
export { createJsrJSON, renameTsxFiles } from "./sdk-impl/utils/utils-jsr-json.js";
|
|
87
|
+
export { extractPackageName } from "./sdk-impl/utils/utils-misc.js";
|
|
88
|
+
export { library_createPackageJSON, library_createJsrConfig, } from "./sdk-impl/utils/utils-package-json-libraries.js";
|
|
89
|
+
export { regular_createPackageJSON } from "./sdk-impl/utils/utils-package-json-regular.js";
|
|
90
|
+
export { createPerfTimer, getElapsedPerfTime, pausePerfTimer, resumePerfTimer, } from "./sdk-impl/utils/utils-perf.js";
|
|
91
|
+
export { setFileSizeLimits, ALLOWED_FILE_TYPES, validatePath, validateFileType, validateContent, sanitizeInput, checkPermissions, checkFileSize, handleError, validateTemplate, validateMergeOperation, validateDirectory, validateFileExists, } from "./sdk-impl/utils/utils-security.js";
|
|
92
|
+
export { createTSConfig } from "./sdk-impl/utils/utils-tsconfig.js";
|
|
93
|
+
export type { DistDirs, DistDirsAll, CopyBuildEntry, CopyHooks, MkdistBuildEntry, MkdistHooks, RollupBuildEntry, EsbuildOptions, RollupBuildOptions, RollupHooks, RollupOptions, UntypedBuildEntry, UntypedHooks, UntypedOutput, UntypedOutputs, BaseBuildEntry, BuildContext, BuildEntry, BuildHooks, BuildOptions, BuildPreset, UnifiedBuildConfig, PerfTimer, RulesCheckOptions, CheckIssue, CheckResult, InputFile, OutputFile, LoaderResult, LoadFile, LoaderContext, Loader, CreateLoaderOptions, MkdistOptions, } from "./sdk-types.js";
|
package/bin/libs/sdk/sdk-mod.js
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
export * from "./sdk-types.js";
|
|
2
1
|
export { library_buildLibrary } from "./sdk-impl/build/build-library.js";
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
regular_buildNpmDist
|
|
6
|
-
} from "./sdk-impl/build/build-regular.js";
|
|
7
|
-
export { autoPreset } from "./sdk-impl/build/bundlers/unified/auto.js";
|
|
2
|
+
export { regular_buildJsrDist, regular_buildNpmDist } from "./sdk-impl/build/build-regular.js";
|
|
3
|
+
export { definePreset, autoPreset } from "./sdk-impl/build/bundlers/unified/auto.js";
|
|
8
4
|
export { unifiedBuild } from "./sdk-impl/build/bundlers/unified/build.js";
|
|
9
5
|
export { copyBuild } from "./sdk-impl/build/bundlers/unified/copy/copy-mod.js";
|
|
6
|
+
export { createLoader } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loader.js";
|
|
7
|
+
export { jsLoader } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/js.js";
|
|
8
|
+
export {
|
|
9
|
+
defaultLoaders,
|
|
10
|
+
resolveLoader,
|
|
11
|
+
resolveLoaders
|
|
12
|
+
} from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/loaders-mod.js";
|
|
13
|
+
export { postcssLoader } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/postcss.js";
|
|
14
|
+
export { sassLoader } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/sass.js";
|
|
15
|
+
export {
|
|
16
|
+
fallbackVueLoader,
|
|
17
|
+
vueLoader
|
|
18
|
+
} from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/vue.js";
|
|
19
|
+
export { mkdist } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.js";
|
|
20
|
+
export {
|
|
21
|
+
normalizeCompilerOptions,
|
|
22
|
+
getDeclarations,
|
|
23
|
+
extractDeclarations,
|
|
24
|
+
augmentWithDiagnostics
|
|
25
|
+
} from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/dts.js";
|
|
26
|
+
export { copyFileWithStream } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/fs.js";
|
|
27
|
+
export { useSpinner } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/spinner.js";
|
|
28
|
+
export { getVueDeclarations } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/vue-dts.js";
|
|
10
29
|
export { mkdistBuild } from "./sdk-impl/build/bundlers/unified/mkdist/mkdist-mod.js";
|
|
11
30
|
export { rollupBuild } from "./sdk-impl/build/bundlers/unified/rollup/build.js";
|
|
12
31
|
export { getRollupOptions } from "./sdk-impl/build/bundlers/unified/rollup/config.js";
|
|
@@ -49,16 +68,72 @@ export {
|
|
|
49
68
|
validateDependencies,
|
|
50
69
|
validatePackage
|
|
51
70
|
} from "./sdk-impl/build/bundlers/unified/validate.js";
|
|
52
|
-
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} from "./sdk-impl/
|
|
71
|
+
export { DEFAULT_CONFIG_DLER, defineConfigDler } from "./sdk-impl/config/default.js";
|
|
72
|
+
export { showStartPrompt, showEndPrompt } from "./sdk-impl/config/info.js";
|
|
73
|
+
export { ensureDlerConfig } from "./sdk-impl/config/init.js";
|
|
74
|
+
export { getConfigDler } from "./sdk-impl/config/load.js";
|
|
75
|
+
export { IGNORE_PATTERNS } from "./sdk-impl/constants.js";
|
|
76
|
+
export { processLibraryFlow, libraries_buildPublish } from "./sdk-impl/library-flow.js";
|
|
56
77
|
export { library_publishLibrary } from "./sdk-impl/pub/pub-library.js";
|
|
57
|
-
export {
|
|
58
|
-
regular_pubToJsr,
|
|
59
|
-
regular_pubToNpm
|
|
60
|
-
} from "./sdk-impl/pub/pub-regular.js";
|
|
78
|
+
export { regular_pubToJsr, regular_pubToNpm } from "./sdk-impl/pub/pub-regular.js";
|
|
61
79
|
export { processRegularFlow } from "./sdk-impl/regular-flow.js";
|
|
80
|
+
export { checkDlerConfigHealth } from "./sdk-impl/rules/reliverse/dler-config-health/dler-config-health.js";
|
|
81
|
+
export { checkFileExtensions } from "./sdk-impl/rules/reliverse/file-extensions/file-extensions.js";
|
|
82
|
+
export { analyzeDependencies } from "./sdk-impl/rules/reliverse/missing-deps/analyzer.js";
|
|
83
|
+
export { checkMissingDependencies } from "./sdk-impl/rules/reliverse/missing-deps/deps-mod.js";
|
|
84
|
+
export {
|
|
85
|
+
findSourceFiles,
|
|
86
|
+
readFile,
|
|
87
|
+
readPackageJson
|
|
88
|
+
} from "./sdk-impl/rules/reliverse/missing-deps/filesystem.js";
|
|
89
|
+
export { formatOutput } from "./sdk-impl/rules/reliverse/missing-deps/formatter.js";
|
|
90
|
+
export {
|
|
91
|
+
extractPackageNames,
|
|
92
|
+
normalizePackageName,
|
|
93
|
+
getListedDependencies,
|
|
94
|
+
getBuiltinModules
|
|
95
|
+
} from "./sdk-impl/rules/reliverse/missing-deps/parser.js";
|
|
96
|
+
export { checkNoIndexFiles } from "./sdk-impl/rules/reliverse/no-index-files/no-index-files.js";
|
|
97
|
+
export { checkPackageJsonHealth } from "./sdk-impl/rules/reliverse/package-json-health/package-json-health.js";
|
|
98
|
+
export { checkPathExtensions } from "./sdk-impl/rules/reliverse/path-extensions/path-extensions.js";
|
|
99
|
+
export { checkSelfInclude } from "./sdk-impl/rules/reliverse/self-include/self-include.js";
|
|
100
|
+
export { checkTsConfigHealth } from "./sdk-impl/rules/reliverse/tsconfig-health/tsconfig-health.js";
|
|
101
|
+
export {
|
|
102
|
+
ALLOWED_FILE_EXTENSIONS,
|
|
103
|
+
STRICT_FILE_EXTENSIONS,
|
|
104
|
+
ALLOWED_IMPORT_EXTENSIONS,
|
|
105
|
+
STRICT_IMPORT_EXTENSIONS
|
|
106
|
+
} from "./sdk-impl/rules/rules-consts.js";
|
|
107
|
+
export { displayCheckResults } from "./sdk-impl/rules/rules-mod.js";
|
|
108
|
+
export { shouldIgnoreFile, getAllFiles, getLineNumber } from "./sdk-impl/rules/rules-utils.js";
|
|
109
|
+
export { applyMagicSpells, getAllAvailableRegistries } from "./sdk-impl/magic/apply.js";
|
|
110
|
+
export { evaluateMagicDirective } from "./sdk-impl/magic/spells.js";
|
|
111
|
+
export { BINARY_EXTS, BINARY_SET } from "./sdk-impl/utils/b-exts.js";
|
|
112
|
+
export { isBinaryExt } from "./sdk-impl/utils/binary.js";
|
|
113
|
+
export { DEFAULT_COMMENT, COMMENT_MAP, getCommentPrefix } from "./sdk-impl/utils/comments.js";
|
|
114
|
+
export {
|
|
115
|
+
detectFileType,
|
|
116
|
+
detectBufferType,
|
|
117
|
+
detectStreamType,
|
|
118
|
+
isBinary,
|
|
119
|
+
getMimeType
|
|
120
|
+
} from "./sdk-impl/utils/file-type.js";
|
|
121
|
+
export { finalizeBuildPub } from "./sdk-impl/utils/finalize.js";
|
|
122
|
+
export {
|
|
123
|
+
WHITELABEL_DEFAULT,
|
|
124
|
+
JSON_EXTS,
|
|
125
|
+
TEMPLATE_VAR,
|
|
126
|
+
TPLS_DIR,
|
|
127
|
+
BINARIES_DIR,
|
|
128
|
+
isJsonExt
|
|
129
|
+
} from "./sdk-impl/utils/pack-unpack/pu-constants.js";
|
|
130
|
+
export {
|
|
131
|
+
walkDir,
|
|
132
|
+
readFileForTemplate,
|
|
133
|
+
escapeTemplateString
|
|
134
|
+
} from "./sdk-impl/utils/pack-unpack/pu-file-utils.js";
|
|
135
|
+
export { extractJsonComments, stripComments } from "./sdk-impl/utils/pack-unpack/pub-json-utils.js";
|
|
136
|
+
export { resolveCrossLibs, resolveAllCrossLibs } from "./sdk-impl/utils/resolve-cross-libs.js";
|
|
62
137
|
export { useAggregator } from "./sdk-impl/utils/tools-agg.js";
|
|
63
138
|
export { printUsage } from "./sdk-impl/utils/tools-impl.js";
|
|
64
139
|
export {
|
|
@@ -66,41 +141,58 @@ export {
|
|
|
66
141
|
getUnifiedSourcemapOption,
|
|
67
142
|
renameEntryFile
|
|
68
143
|
} from "./sdk-impl/utils/utils-build.js";
|
|
69
|
-
export { removeDistFolders } from "./sdk-impl/utils/utils-clean.js";
|
|
144
|
+
export { removeDistFolders, removeLogInternalCalls } from "./sdk-impl/utils/utils-clean.js";
|
|
70
145
|
export {
|
|
71
146
|
PROJECT_ROOT,
|
|
72
147
|
CONCURRENCY_DEFAULT,
|
|
148
|
+
tsconfigJson,
|
|
73
149
|
cliDomainDocs,
|
|
74
150
|
validExtensions,
|
|
75
151
|
SHOW_VERBOSE
|
|
76
152
|
} from "./sdk-impl/utils/utils-consts.js";
|
|
153
|
+
export { filterDeps } from "./sdk-impl/utils/utils-deps.js";
|
|
154
|
+
export { determineDistName } from "./sdk-impl/utils/utils-determine.js";
|
|
77
155
|
export {
|
|
156
|
+
handleDlerError,
|
|
157
|
+
withWorkingDirectory,
|
|
78
158
|
validateDevCwd,
|
|
79
|
-
|
|
159
|
+
formatError
|
|
80
160
|
} from "./sdk-impl/utils/utils-error-cwd.js";
|
|
81
|
-
export { filterDeps } from "./sdk-impl/utils/utils-deps.js";
|
|
82
|
-
export { determineDistName } from "./sdk-impl/utils/utils-determine.js";
|
|
83
|
-
export { handleDlerError } from "./sdk-impl/utils/utils-error-cwd.js";
|
|
84
161
|
export {
|
|
85
162
|
copyRootFile,
|
|
86
163
|
getDirectorySize,
|
|
87
164
|
outDirBinFilesCount,
|
|
88
165
|
deleteSpecificFiles,
|
|
89
166
|
readFileSafe,
|
|
90
|
-
writeFileSafe
|
|
167
|
+
writeFileSafe,
|
|
168
|
+
copyInsteadOfBuild
|
|
91
169
|
} from "./sdk-impl/utils/utils-fs.js";
|
|
92
|
-
export {
|
|
93
|
-
export {
|
|
94
|
-
createJsrJSON,
|
|
95
|
-
renameTsxFiles
|
|
96
|
-
} from "./sdk-impl/utils/utils-jsr-json.js";
|
|
170
|
+
export { createJsrJSON, renameTsxFiles } from "./sdk-impl/utils/utils-jsr-json.js";
|
|
97
171
|
export { extractPackageName } from "./sdk-impl/utils/utils-misc.js";
|
|
172
|
+
export {
|
|
173
|
+
library_createPackageJSON,
|
|
174
|
+
library_createJsrConfig
|
|
175
|
+
} from "./sdk-impl/utils/utils-package-json-libraries.js";
|
|
176
|
+
export { regular_createPackageJSON } from "./sdk-impl/utils/utils-package-json-regular.js";
|
|
98
177
|
export {
|
|
99
178
|
createPerfTimer,
|
|
100
179
|
getElapsedPerfTime,
|
|
101
180
|
pausePerfTimer,
|
|
102
181
|
resumePerfTimer
|
|
103
182
|
} from "./sdk-impl/utils/utils-perf.js";
|
|
104
|
-
export {
|
|
105
|
-
|
|
183
|
+
export {
|
|
184
|
+
setFileSizeLimits,
|
|
185
|
+
ALLOWED_FILE_TYPES,
|
|
186
|
+
validatePath,
|
|
187
|
+
validateFileType,
|
|
188
|
+
validateContent,
|
|
189
|
+
sanitizeInput,
|
|
190
|
+
checkPermissions,
|
|
191
|
+
checkFileSize,
|
|
192
|
+
handleError,
|
|
193
|
+
validateTemplate,
|
|
194
|
+
validateMergeOperation,
|
|
195
|
+
validateDirectory,
|
|
196
|
+
validateFileExists
|
|
197
|
+
} from "./sdk-impl/utils/utils-security.js";
|
|
106
198
|
export { createTSConfig } from "./sdk-impl/utils/utils-tsconfig.js";
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"postcss-nested": "^7.0.2",
|
|
40
40
|
"pretty-bytes": "^7.0.0",
|
|
41
41
|
"pretty-ms": "^9.2.0",
|
|
42
|
-
"rollup": "^4.
|
|
42
|
+
"rollup": "^4.43.0",
|
|
43
43
|
"rollup-plugin-dts": "^6.2.1",
|
|
44
44
|
"scule": "^1.3.0",
|
|
45
45
|
"semver": "^7.7.2",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"license": "MIT",
|
|
53
53
|
"name": "@reliverse/dler",
|
|
54
54
|
"type": "module",
|
|
55
|
-
"version": "1.7.
|
|
55
|
+
"version": "1.7.23",
|
|
56
56
|
"keywords": [
|
|
57
57
|
"reliverse",
|
|
58
58
|
"cli",
|
package/bin/app/inject/impl.d.ts
DELETED
package/bin/app/inject/impl.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import path from "@reliverse/pathkit";
|
|
2
|
-
import fs from "@reliverse/relifso";
|
|
3
|
-
import { relinka } from "@reliverse/relinka";
|
|
4
|
-
import { execa } from "execa";
|
|
5
|
-
function parseCommand(command) {
|
|
6
|
-
const regex = /"([^"]+)"|'([^']+)'|(\S+)/g;
|
|
7
|
-
const args = [];
|
|
8
|
-
let match;
|
|
9
|
-
while (regex.exec(command) !== null) {
|
|
10
|
-
match = regex.exec(command);
|
|
11
|
-
if (match) {
|
|
12
|
-
const value = match[1] ?? match[2] ?? match[3];
|
|
13
|
-
if (value) {
|
|
14
|
-
args.push(value);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
const cmd = args.shift() ?? "";
|
|
19
|
-
return { cmd, args };
|
|
20
|
-
}
|
|
21
|
-
async function parseLinesFile(linesFile) {
|
|
22
|
-
const fileContents = await fs.readFile(linesFile, "utf8");
|
|
23
|
-
const splitted = fileContents.split(/\r?\n/);
|
|
24
|
-
const results = [];
|
|
25
|
-
for (const rawLine of splitted) {
|
|
26
|
-
const trimmed = rawLine.trim();
|
|
27
|
-
if (!trimmed) continue;
|
|
28
|
-
const firstMatch = trimmed.match(/^(\d+)\s+(.+?):(\d+)$/);
|
|
29
|
-
if (firstMatch?.[2] && firstMatch?.[3]) {
|
|
30
|
-
results.push({
|
|
31
|
-
filePath: firstMatch[2],
|
|
32
|
-
lineNumber: Number.parseInt(firstMatch[3], 10)
|
|
33
|
-
});
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
const secondMatch = trimmed.match(/^(.+?):(\d+)$/);
|
|
37
|
-
if (secondMatch?.[1] && secondMatch?.[2]) {
|
|
38
|
-
results.push({
|
|
39
|
-
filePath: secondMatch[1],
|
|
40
|
-
lineNumber: Number.parseInt(secondMatch[2], 10)
|
|
41
|
-
});
|
|
42
|
-
} else {
|
|
43
|
-
relinka("warn", `Line doesn't match expected format: ${trimmed}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return results;
|
|
47
|
-
}
|
|
48
|
-
async function runTscAndParseErrors(tscCommand, tscPaths) {
|
|
49
|
-
try {
|
|
50
|
-
const { cmd, args: cmdArgs } = parseCommand(tscCommand);
|
|
51
|
-
if (tscPaths?.length) {
|
|
52
|
-
cmdArgs.push(...tscPaths);
|
|
53
|
-
}
|
|
54
|
-
const subprocess = await execa(cmd, cmdArgs, { all: true, reject: false });
|
|
55
|
-
const combinedOutput = subprocess.all ?? "";
|
|
56
|
-
return parseErrorOutput(combinedOutput);
|
|
57
|
-
} catch (error) {
|
|
58
|
-
if (error && typeof error === "object" && "all" in error) {
|
|
59
|
-
const combined = error.all ?? "";
|
|
60
|
-
if (!combined) {
|
|
61
|
-
relinka("log", "TSC returned no error lines. Possibly no TS errors?");
|
|
62
|
-
return [];
|
|
63
|
-
}
|
|
64
|
-
return parseErrorOutput(combined);
|
|
65
|
-
}
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function parseErrorOutput(output) {
|
|
70
|
-
const results = [];
|
|
71
|
-
const splitted = output.split(/\r?\n/);
|
|
72
|
-
const regex = /^(.+?)\((\d+),(\d+)\): error TS\d+: /;
|
|
73
|
-
for (const line of splitted) {
|
|
74
|
-
const match = line.trim().match(regex);
|
|
75
|
-
if (match?.[1] && match?.[2]) {
|
|
76
|
-
const file = match[1].replace(/\\/g, "/");
|
|
77
|
-
const row = Number.parseInt(match[2], 10);
|
|
78
|
-
if (row > 0) {
|
|
79
|
-
results.push({ filePath: file, lineNumber: row });
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return results;
|
|
84
|
-
}
|
|
85
|
-
function isWithin(filePath, dirs) {
|
|
86
|
-
const absFile = path.resolve(filePath);
|
|
87
|
-
return dirs.some((dir) => {
|
|
88
|
-
const absDir = path.resolve(dir);
|
|
89
|
-
const normalizedDir = absDir.endsWith(path.sep) ? absDir : absDir + path.sep;
|
|
90
|
-
return absFile.startsWith(normalizedDir);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
async function injectCommentIntoFiles(linesRecords, commentText) {
|
|
94
|
-
const byFile = /* @__PURE__ */ new Map();
|
|
95
|
-
for (const rec of linesRecords) {
|
|
96
|
-
const lines = byFile.get(rec.filePath) ?? [];
|
|
97
|
-
lines.push(rec.lineNumber);
|
|
98
|
-
byFile.set(rec.filePath, lines);
|
|
99
|
-
}
|
|
100
|
-
for (const [filePath, lineNums] of byFile.entries()) {
|
|
101
|
-
lineNums.sort((a, b) => b - a);
|
|
102
|
-
const absPath = path.resolve(filePath);
|
|
103
|
-
relinka("log", `Injecting into ${absPath} at lines: ${lineNums.join(", ")}`);
|
|
104
|
-
try {
|
|
105
|
-
const original = await fs.readFile(absPath, "utf8");
|
|
106
|
-
const splitted = original.split(/\r?\n/);
|
|
107
|
-
for (const ln of lineNums) {
|
|
108
|
-
if (ln <= splitted.length) {
|
|
109
|
-
splitted.splice(ln - 1, 0, commentText);
|
|
110
|
-
} else {
|
|
111
|
-
relinka("warn", `Line ${ln} exceeds file length for ${absPath}`);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const newContent = splitted.join("\n");
|
|
115
|
-
await fs.writeFile(absPath, newContent, "utf8");
|
|
116
|
-
} catch (error) {
|
|
117
|
-
relinka("error", `Failed editing ${filePath}: ${error}`);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
export async function useTsExpectError(args) {
|
|
122
|
-
const finalComment = args.comment ?? "// @ts-expect-error TODO: fix ts";
|
|
123
|
-
const tscCommand = "tsc --project ./tsconfig.json --noEmit";
|
|
124
|
-
const lines = [];
|
|
125
|
-
const usedAuto = args.files.some((item) => item.toLowerCase() === "auto");
|
|
126
|
-
if (usedAuto) {
|
|
127
|
-
relinka("log", "Running TSC to discover error lines...");
|
|
128
|
-
try {
|
|
129
|
-
const discovered = await runTscAndParseErrors(tscCommand, args.tscPaths);
|
|
130
|
-
if (args.tscPaths?.length) {
|
|
131
|
-
const filtered = discovered.filter(
|
|
132
|
-
(rec) => args.tscPaths ? isWithin(rec.filePath, args.tscPaths) : true
|
|
133
|
-
);
|
|
134
|
-
lines.push(...filtered);
|
|
135
|
-
} else {
|
|
136
|
-
lines.push(...discovered);
|
|
137
|
-
}
|
|
138
|
-
} catch (error) {
|
|
139
|
-
relinka("error", `Failed running tsc: ${error}`);
|
|
140
|
-
process.exit(1);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
for (const item of args.files) {
|
|
144
|
-
if (item.toLowerCase() === "auto") continue;
|
|
145
|
-
try {
|
|
146
|
-
const recs = await parseLinesFile(item);
|
|
147
|
-
lines.push(...recs);
|
|
148
|
-
} catch (error) {
|
|
149
|
-
relinka("error", `Failed reading lines file ${item}: ${error}`);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
if (lines.length === 0) {
|
|
153
|
-
relinka("error", "No references found. Nothing to do.");
|
|
154
|
-
relinka("error", "Lines: ", JSON.stringify(lines));
|
|
155
|
-
process.exit(1);
|
|
156
|
-
}
|
|
157
|
-
await injectCommentIntoFiles(lines, finalComment);
|
|
158
|
-
relinka("success", "All lines processed successfully.");
|
|
159
|
-
}
|
package/bin/app/spell/cmd.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { defineArgs, defineCommand } from "@reliverse/rempts";
|
|
2
|
-
import { applyMagicSpells } from "../../libs/sdk/sdk-impl/spell/applyMagicSpells.js";
|
|
3
|
-
import { formatError } from "../../libs/sdk/sdk-impl/utils/utils-error-cwd.js";
|
|
4
|
-
export default defineCommand({
|
|
5
|
-
args: defineArgs({
|
|
6
|
-
targets: {
|
|
7
|
-
type: "array",
|
|
8
|
-
description: "Distribution types to process",
|
|
9
|
-
required: true
|
|
10
|
-
},
|
|
11
|
-
lib: {
|
|
12
|
-
type: "string",
|
|
13
|
-
description: "Library to process (e.g. cfg, sdk, etc) (for usage with `dist-libs`)"
|
|
14
|
-
},
|
|
15
|
-
concurrency: {
|
|
16
|
-
type: "number",
|
|
17
|
-
description: "Number of files to process in parallel"
|
|
18
|
-
},
|
|
19
|
-
batchSize: {
|
|
20
|
-
type: "number",
|
|
21
|
-
description: "Number of files to process in each batch"
|
|
22
|
-
},
|
|
23
|
-
stopOnError: {
|
|
24
|
-
type: "boolean",
|
|
25
|
-
description: "Stop processing on first error",
|
|
26
|
-
default: true
|
|
27
|
-
}
|
|
28
|
-
}),
|
|
29
|
-
async run({ args }) {
|
|
30
|
-
const { targets, lib, concurrency, batchSize, stopOnError } = args;
|
|
31
|
-
if (lib && !targets?.includes("dist-libs")) {
|
|
32
|
-
throw new Error("The 'lib' parameter can only be used with 'dist-libs' target");
|
|
33
|
-
}
|
|
34
|
-
try {
|
|
35
|
-
const finalTargets = targets?.map(
|
|
36
|
-
(target) => target === "dist-libs" && lib ? `${target}/${lib}` : target
|
|
37
|
-
) ?? [];
|
|
38
|
-
await applyMagicSpells(finalTargets, {
|
|
39
|
-
concurrency,
|
|
40
|
-
batchSize,
|
|
41
|
-
stopOnError
|
|
42
|
-
});
|
|
43
|
-
} catch (error) {
|
|
44
|
-
throw new Error(`\u274C Processing failed: ${formatError(error)}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spell runner – walks a directory tree, finds
|
|
3
|
-
* magic-comment directives and executes them.
|
|
4
|
-
*
|
|
5
|
-
* Usage example:
|
|
6
|
-
* await applyMagicSpells(["dist-jsr"]);
|
|
7
|
-
* await applyMagicSpells(["dist-libs/sdk"]);
|
|
8
|
-
* await applyMagicSpells(["dist-npm", "dist-jsr", "dist-libs"]);
|
|
9
|
-
*/
|
|
10
|
-
export interface ApplyMagicSpellsOptions {
|
|
11
|
-
/** Absolute or cwd-relative root directory to process */
|
|
12
|
-
dir: string;
|
|
13
|
-
/** Number of files to process in parallel */
|
|
14
|
-
concurrency?: number;
|
|
15
|
-
/** Number of files to process in each batch */
|
|
16
|
-
batchSize?: number;
|
|
17
|
-
/** Whether to stop on first error */
|
|
18
|
-
stopOnError?: boolean;
|
|
19
|
-
/** Whether to copy files from src before processing */
|
|
20
|
-
copyFileWithDirectivesFromSrcBeforeProcessing?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface ApplyMagicSpellsResult {
|
|
23
|
-
/** All processed files */
|
|
24
|
-
processedFiles: string[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Processes files in specified distribution directories by applying magic directives
|
|
28
|
-
* First scans src directory for files with magic directives, then processes corresponding dist files
|
|
29
|
-
* @param targets Array of distribution targets in format "dist-npm", "dist-jsr", "dist-libs" or "dist-libs/lib-name"
|
|
30
|
-
* @param options Configuration options for processing
|
|
31
|
-
* @returns Object containing arrays of processed files and processed .d.ts files
|
|
32
|
-
*/
|
|
33
|
-
export declare function applyMagicSpells(targets: string[], options?: Partial<ApplyMagicSpellsOptions>): Promise<ApplyMagicSpellsResult>;
|
|
34
|
-
/**
|
|
35
|
-
* Gets all available registries across all libraries
|
|
36
|
-
* @returns Array of unique registry names found across all libraries
|
|
37
|
-
*/
|
|
38
|
-
export declare function getAllAvailableRegistries(): Promise<string[]>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|