qat-cli 0.3.5 → 0.3.6
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/dist/cli.js +127 -55
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +5 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2994,6 +2994,8 @@ ${this.compressSourceCode(req.context, 3e3, importPathRewrites)}
|
|
|
2994
2994
|
if (srcDirMatch) {
|
|
2995
2995
|
variations.add(`@/${srcDirMatch[1]}`);
|
|
2996
2996
|
variations.add(`@/${srcDirMatch[1].replace(/\.(ts|js|tsx|jsx)$/, "")}`);
|
|
2997
|
+
variations.add(`#/${srcDirMatch[1]}`);
|
|
2998
|
+
variations.add(`#/${srcDirMatch[1].replace(/\.(ts|js|tsx|jsx)$/, "")}`);
|
|
2997
2999
|
}
|
|
2998
3000
|
const pathParts = targetPath.replace(/^\.\//, "").split("/");
|
|
2999
3001
|
const fileName = pathParts[pathParts.length - 1];
|
|
@@ -4151,7 +4153,7 @@ function extractImports(content) {
|
|
|
4151
4153
|
function analyzeImportSignatures(imports, baseDir) {
|
|
4152
4154
|
const signatures = [];
|
|
4153
4155
|
for (const imp of imports) {
|
|
4154
|
-
if (!imp.source.startsWith(".") && !imp.source.startsWith("@/") && !imp.source.startsWith("~")) {
|
|
4156
|
+
if (!imp.source.startsWith(".") && !imp.source.startsWith("@/") && !imp.source.startsWith("#/") && !imp.source.startsWith("~")) {
|
|
4155
4157
|
continue;
|
|
4156
4158
|
}
|
|
4157
4159
|
const resolvedPath = resolveImportPath2(imp.source, baseDir);
|
|
@@ -4193,8 +4195,8 @@ function analyzeImportSignatures(imports, baseDir) {
|
|
|
4193
4195
|
}
|
|
4194
4196
|
function resolveImportPath2(importSource, baseDir) {
|
|
4195
4197
|
let resolved;
|
|
4196
|
-
if (importSource.startsWith("@/") || importSource.startsWith("~")) {
|
|
4197
|
-
const relativePath = importSource.replace(/^[
|
|
4198
|
+
if (importSource.startsWith("@/") || importSource.startsWith("#/") || importSource.startsWith("~")) {
|
|
4199
|
+
const relativePath = importSource.replace(/^[@#~]\//, "src/");
|
|
4198
4200
|
resolved = import_node_path10.default.resolve(process.cwd(), relativePath);
|
|
4199
4201
|
} else if (importSource.startsWith(".")) {
|
|
4200
4202
|
resolved = import_node_path10.default.resolve(baseDir, importSource);
|