deslop-js 0.0.15 → 0.0.16-dev.474ed8f

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/index.cjs CHANGED
@@ -3694,7 +3694,7 @@ const toPosixPath = (filePath) => filePath.replace(/\\/g, "/");
3694
3694
  const collectSourceFiles = async (config) => {
3695
3695
  const extensions = config.includeExtensions.length > 0 ? config.includeExtensions : DEFAULT_EXTENSIONS;
3696
3696
  const extensionGlob = extensions.length === 1 ? `**/*${extensions[0]}` : `**/*{${extensions.join(",")}}`;
3697
- const ignorePatterns = [...DEFAULT_EXCLUSIONS, ...config.ignorePatterns];
3697
+ const ignorePatterns = [...DEFAULT_EXCLUSIONS, ...config.ignorePatterns].map(toPosixPath);
3698
3698
  const absoluteRoot = (0, node_path.resolve)(config.rootDir);
3699
3699
  const mainFiles = await (0, fast_glob.default)(extensionGlob, {
3700
3700
  cwd: absoluteRoot,
@@ -3711,7 +3711,7 @@ const collectSourceFiles = async (config) => {
3711
3711
  dot: true,
3712
3712
  onlyFiles: true
3713
3713
  }) : [];
3714
- return [...mainFiles, ...hiddenFiles].sort().map((filePath, fileIndex) => ({
3714
+ return [...new Set([...mainFiles, ...hiddenFiles].map(toPosixPath))].sort().map((filePath, fileIndex) => ({
3715
3715
  index: fileIndex,
3716
3716
  path: filePath
3717
3717
  }));
@@ -7001,9 +7001,16 @@ const isConfigFile = (filePath) => {
7001
7001
  //#endregion
7002
7002
  //#region src/linker/build.ts
7003
7003
  const buildDependencyGraph = (inputs) => {
7004
+ const normalizedInputs = inputs.map((input) => ({
7005
+ ...input,
7006
+ fileId: {
7007
+ ...input.fileId,
7008
+ path: toPosixPath(input.fileId.path)
7009
+ }
7010
+ }));
7004
7011
  const fileIdMap = /* @__PURE__ */ new Map();
7005
- for (const input of inputs) fileIdMap.set(toPosixPath(input.fileId.path), input.fileId.index);
7006
- const modules = inputs.map((input) => ({
7012
+ for (const input of normalizedInputs) fileIdMap.set(input.fileId.path, input.fileId.index);
7013
+ const modules = normalizedInputs.map((input) => ({
7007
7014
  fileId: input.fileId,
7008
7015
  imports: input.parsed.imports,
7009
7016
  exports: input.parsed.exports,
@@ -7041,7 +7048,7 @@ const buildDependencyGraph = (inputs) => {
7041
7048
  if (!existingReverseEdges.includes(sourceIndex)) existingReverseEdges.push(sourceIndex);
7042
7049
  } else reverseEdges.set(targetIndex, [sourceIndex]);
7043
7050
  };
7044
- for (const input of inputs) {
7051
+ for (const input of normalizedInputs) {
7045
7052
  const sourceIndex = input.fileId.index;
7046
7053
  for (const importInfo of input.parsed.imports) {
7047
7054
  if (importInfo.isGlob) {
package/dist/index.mjs CHANGED
@@ -3663,7 +3663,7 @@ const toPosixPath = (filePath) => filePath.replace(/\\/g, "/");
3663
3663
  const collectSourceFiles = async (config) => {
3664
3664
  const extensions = config.includeExtensions.length > 0 ? config.includeExtensions : DEFAULT_EXTENSIONS;
3665
3665
  const extensionGlob = extensions.length === 1 ? `**/*${extensions[0]}` : `**/*{${extensions.join(",")}}`;
3666
- const ignorePatterns = [...DEFAULT_EXCLUSIONS, ...config.ignorePatterns];
3666
+ const ignorePatterns = [...DEFAULT_EXCLUSIONS, ...config.ignorePatterns].map(toPosixPath);
3667
3667
  const absoluteRoot = resolve(config.rootDir);
3668
3668
  const mainFiles = await fg(extensionGlob, {
3669
3669
  cwd: absoluteRoot,
@@ -3680,7 +3680,7 @@ const collectSourceFiles = async (config) => {
3680
3680
  dot: true,
3681
3681
  onlyFiles: true
3682
3682
  }) : [];
3683
- return [...mainFiles, ...hiddenFiles].sort().map((filePath, fileIndex) => ({
3683
+ return [...new Set([...mainFiles, ...hiddenFiles].map(toPosixPath))].sort().map((filePath, fileIndex) => ({
3684
3684
  index: fileIndex,
3685
3685
  path: filePath
3686
3686
  }));
@@ -6970,9 +6970,16 @@ const isConfigFile = (filePath) => {
6970
6970
  //#endregion
6971
6971
  //#region src/linker/build.ts
6972
6972
  const buildDependencyGraph = (inputs) => {
6973
+ const normalizedInputs = inputs.map((input) => ({
6974
+ ...input,
6975
+ fileId: {
6976
+ ...input.fileId,
6977
+ path: toPosixPath(input.fileId.path)
6978
+ }
6979
+ }));
6973
6980
  const fileIdMap = /* @__PURE__ */ new Map();
6974
- for (const input of inputs) fileIdMap.set(toPosixPath(input.fileId.path), input.fileId.index);
6975
- const modules = inputs.map((input) => ({
6981
+ for (const input of normalizedInputs) fileIdMap.set(input.fileId.path, input.fileId.index);
6982
+ const modules = normalizedInputs.map((input) => ({
6976
6983
  fileId: input.fileId,
6977
6984
  imports: input.parsed.imports,
6978
6985
  exports: input.parsed.exports,
@@ -7010,7 +7017,7 @@ const buildDependencyGraph = (inputs) => {
7010
7017
  if (!existingReverseEdges.includes(sourceIndex)) existingReverseEdges.push(sourceIndex);
7011
7018
  } else reverseEdges.set(targetIndex, [sourceIndex]);
7012
7019
  };
7013
- for (const input of inputs) {
7020
+ for (const input of normalizedInputs) {
7014
7021
  const sourceIndex = input.fileId.index;
7015
7022
  for (const importInfo of input.parsed.imports) {
7016
7023
  if (importInfo.isGlob) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deslop-js",
3
- "version": "0.0.15",
3
+ "version": "0.0.16-dev.474ed8f",
4
4
  "description": "Deslop JavaScript code",
5
5
  "keywords": [
6
6
  "dead-code",