silgi 0.36.17 → 0.36.18
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/cli/build.mjs +6 -2
- package/dist/cli/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli/build.mjs
CHANGED
|
@@ -725,6 +725,9 @@ async function verifyDirectoryCaseSensitivity(directoryPath, rootDirectory) {
|
|
|
725
725
|
} catch {
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
+
function stripCommentsAndStrings(code) {
|
|
729
|
+
return code.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/.*$/gm, "").replace(/"([^"\\]|\\.)*"/g, '""').replace(/'([^'\\]|\\.)*'/g, "''").replace(/`([^`\\]|\\.)*`/g, "``");
|
|
730
|
+
}
|
|
728
731
|
async function scanSilgiExports(path, packageName, silgiInstance = useSilgiCLI()) {
|
|
729
732
|
const processedFilePaths = /* @__PURE__ */ new Set();
|
|
730
733
|
const alreadyScannedPaths = [];
|
|
@@ -756,14 +759,15 @@ async function scanSilgiExports(path, packageName, silgiInstance = useSilgiCLI()
|
|
|
756
759
|
}
|
|
757
760
|
try {
|
|
758
761
|
const fileContent = await readFile(absoluteFilePath, "utf-8");
|
|
762
|
+
const cleanedContent = stripCommentsAndStrings(fileContent);
|
|
759
763
|
const typeDeclarationExports = extractExportMatches(
|
|
760
764
|
TYPE_DECLARATION_EXPORT_REGEX,
|
|
761
|
-
|
|
765
|
+
cleanedContent,
|
|
762
766
|
{ type: "declaration" }
|
|
763
767
|
);
|
|
764
768
|
const functionVariableExports = extractExportMatches(
|
|
765
769
|
FUNCTION_VARIABLE_EXPORT_REGEX,
|
|
766
|
-
|
|
770
|
+
cleanedContent,
|
|
767
771
|
{ type: "variable" }
|
|
768
772
|
);
|
|
769
773
|
const allExportedEntities = [...typeDeclarationExports, ...functionVariableExports];
|
package/dist/cli/index.mjs
CHANGED