@adamhl8/configs 0.17.3 → 0.17.4
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/dist/configs/tsdown.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ import * as hookable0 from "hookable";
|
|
|
8
8
|
//#region src/configs/tsdown.d.ts
|
|
9
9
|
declare const tsdownConfig: MergeConfigFn<{
|
|
10
10
|
entry?: rolldown0.InputOption;
|
|
11
|
+
exports?: boolean | tsdown0.ExportsOptions;
|
|
12
|
+
plugins?: rolldown0.RolldownPluginOption<any>;
|
|
11
13
|
external?: rolldown0.ExternalOption;
|
|
12
14
|
noExternal?: (string | RegExp | (string | RegExp)[]) | ((id: string, importer: string | undefined) => boolean | null | undefined | void);
|
|
13
15
|
skipNodeModulesBundle?: boolean;
|
|
@@ -21,7 +23,6 @@ declare const tsdownConfig: MergeConfigFn<{
|
|
|
21
23
|
loader?: tsdown0.ModuleTypes;
|
|
22
24
|
removeNodeProtocol?: boolean;
|
|
23
25
|
nodeProtocol?: "strip" | boolean;
|
|
24
|
-
plugins?: rolldown0.RolldownPluginOption<any>;
|
|
25
26
|
inputOptions?: rolldown0.InputOptions | ((options: rolldown0.InputOptions, format: tsdown0.NormalizedFormat, context: {
|
|
26
27
|
cjsDts: boolean;
|
|
27
28
|
}) => void | rolldown0.InputOptions | Promise<void | rolldown0.InputOptions | null> | null);
|
|
@@ -58,7 +59,6 @@ declare const tsdownConfig: MergeConfigFn<{
|
|
|
58
59
|
attw?: boolean | tsdown0.AttwOptions;
|
|
59
60
|
report?: boolean | tsdown0.ReportOptions;
|
|
60
61
|
globImport?: boolean;
|
|
61
|
-
exports?: boolean | tsdown0.ExportsOptions;
|
|
62
62
|
publicDir?: tsdown0.CopyOptions | tsdown0.CopyOptionsFn;
|
|
63
63
|
copy?: tsdown0.CopyOptions | tsdown0.CopyOptionsFn;
|
|
64
64
|
hooks?: Partial<tsdown0.TsdownHooks> | ((hooks: hookable0.Hookable<tsdown0.TsdownHooks>) => void | Promise<void>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.d.ts","names":[],"sources":["../../src/configs/tsdown.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAyCa;UAAyF,SAAA,CAAA;;;;;;;EAAzF,
|
|
1
|
+
{"version":3,"file":"tsdown.d.ts","names":[],"sources":["../../src/configs/tsdown.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAyCa;UAAyF,SAAA,CAAA;;;;;;;EAAzF,QAAA,CAAA,EAAA,MAAyF,GAAA,OAAA;EAAA,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA,GAAA,KAAA;KAAA,CAAA,QAAA,CAAA,MAAA,EAAA,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA7E,SAAA,MAAA,EAAA,KAAA;EACZ,SAAA,QAAA,EAAwF,SAAA;EAAA,SAAA,MAAA,EAAA,UAAA;WAAA,SAAzE,EAAA,IAAA;WAAA,IAAA,EAAA,KAAA;WAAA,GAAA,EAAA;IAAA,SAAA,UAAA,EAAA,IAAA;;;;;;;;;;cAAf,iBAAe,sBAAA,KAAyE,OAAA,CAAzE,OAAA"}
|
package/dist/ts-import-fix/index
CHANGED
|
@@ -53,8 +53,8 @@ function getPathsMap() {
|
|
|
53
53
|
for (let [alias, [aliasDir]] of Object.entries(tsconfig.config.compilerOptions?.paths ?? {})) {
|
|
54
54
|
if (!alias.endsWith("/*")) continue;
|
|
55
55
|
if (!aliasDir?.endsWith("/*")) continue;
|
|
56
|
-
alias = alias.slice(0, -
|
|
57
|
-
aliasDir = aliasDir.slice(0, -
|
|
56
|
+
alias = alias.slice(0, -1);
|
|
57
|
+
aliasDir = aliasDir.slice(0, -1);
|
|
58
58
|
pathsMap[alias] = aliasDir;
|
|
59
59
|
}
|
|
60
60
|
return pathsMap;
|
|
@@ -66,7 +66,7 @@ function resolveImportPath(importPath, filePath, pathsMap) {
|
|
|
66
66
|
if (!importPath.startsWith(alias)) continue;
|
|
67
67
|
const aliasDir = pathsMap[alias];
|
|
68
68
|
if (!aliasDir) continue;
|
|
69
|
-
const relativePath = importPath.slice(alias.length
|
|
69
|
+
const relativePath = importPath.slice(alias.length);
|
|
70
70
|
return path.resolve(aliasDir, relativePath);
|
|
71
71
|
}
|
|
72
72
|
return path.resolve(fileDir, importPath);
|
|
@@ -109,7 +109,7 @@ function getAliasPathParts(importParts, pathsMap) {
|
|
|
109
109
|
for (const [alias, aliasDir] of Object.entries(pathsMap)) {
|
|
110
110
|
const relativeToAliasDir = path.relative(aliasDir, importPath);
|
|
111
111
|
if (relativeToAliasDir.startsWith("..")) continue;
|
|
112
|
-
return { dir: path.parse(`${alias}
|
|
112
|
+
return { dir: path.parse(`${alias}${relativeToAliasDir}`).dir };
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
async function fixImports(filePaths, { write, importIgnoreStrings, skipAlias }) {
|