@suss/adapter-typescript 0.21.0 → 0.21.1

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
@@ -1958,6 +1958,20 @@ function importedFilePathsOf(project, filePath) {
1958
1958
  cache.set(filePath, paths);
1959
1959
  return paths;
1960
1960
  }
1961
+ function resolutionCacheFor(project, options) {
1962
+ const existing = resolutionCachesByProject.get(project);
1963
+ if (existing !== void 0) {
1964
+ return existing;
1965
+ }
1966
+ const fresh = import_ts_morph10.ts.createModuleResolutionCache(
1967
+ project.getFileSystem().getCurrentDirectory(),
1968
+ (name) => name,
1969
+ options
1970
+ );
1971
+ resolutionCachesByProject.set(project, fresh);
1972
+ return fresh;
1973
+ }
1974
+ var resolutionCachesByProject = /* @__PURE__ */ new WeakMap();
1961
1975
  function specifierCacheFor(project) {
1962
1976
  const existing = specifiersByProject.get(project);
1963
1977
  if (existing !== void 0) {
@@ -1984,13 +1998,15 @@ function readSpecifierPaths(project, filePath, options, host) {
1984
1998
  return [];
1985
1999
  }
1986
2000
  const scanned = import_ts_morph10.ts.preProcessFile(text, true, true);
2001
+ const cache = resolutionCacheFor(project, options);
1987
2002
  const paths = [];
1988
2003
  for (const imported of scanned.importedFiles) {
1989
2004
  const resolved = import_ts_morph10.ts.resolveModuleName(
1990
2005
  imported.fileName,
1991
2006
  filePath,
1992
2007
  options,
1993
- host
2008
+ host,
2009
+ cache
1994
2010
  ).resolvedModule?.resolvedFileName;
1995
2011
  if (resolved !== void 0 && !resolved.includes("/node_modules/")) {
1996
2012
  paths.push(resolved);
package/dist/index.js CHANGED
@@ -1915,6 +1915,20 @@ function importedFilePathsOf(project, filePath) {
1915
1915
  cache.set(filePath, paths);
1916
1916
  return paths;
1917
1917
  }
1918
+ function resolutionCacheFor(project, options) {
1919
+ const existing = resolutionCachesByProject.get(project);
1920
+ if (existing !== void 0) {
1921
+ return existing;
1922
+ }
1923
+ const fresh = ts.createModuleResolutionCache(
1924
+ project.getFileSystem().getCurrentDirectory(),
1925
+ (name) => name,
1926
+ options
1927
+ );
1928
+ resolutionCachesByProject.set(project, fresh);
1929
+ return fresh;
1930
+ }
1931
+ var resolutionCachesByProject = /* @__PURE__ */ new WeakMap();
1918
1932
  function specifierCacheFor(project) {
1919
1933
  const existing = specifiersByProject.get(project);
1920
1934
  if (existing !== void 0) {
@@ -1941,13 +1955,15 @@ function readSpecifierPaths(project, filePath, options, host) {
1941
1955
  return [];
1942
1956
  }
1943
1957
  const scanned = ts.preProcessFile(text, true, true);
1958
+ const cache = resolutionCacheFor(project, options);
1944
1959
  const paths = [];
1945
1960
  for (const imported of scanned.importedFiles) {
1946
1961
  const resolved = ts.resolveModuleName(
1947
1962
  imported.fileName,
1948
1963
  filePath,
1949
1964
  options,
1950
- host
1965
+ host,
1966
+ cache
1951
1967
  ).resolvedModule?.resolvedFileName;
1952
1968
  if (resolved !== void 0 && !resolved.includes("/node_modules/")) {
1953
1969
  paths.push(resolved);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/adapter-typescript",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "type": "module",
5
5
  "description": "TypeScript adapter for suss — walks source files with ts-morph and emits raw extractions for the suss pipeline.",
6
6
  "keywords": [
@@ -46,10 +46,10 @@
46
46
  "typecheck": "tsc --noEmit"
47
47
  },
48
48
  "dependencies": {
49
- "@suss/behavioral-ir": "0.21.0",
50
- "@suss/datalog": "0.21.0",
51
- "@suss/extractor": "0.21.0",
52
- "@suss/resolution": "0.21.0",
49
+ "@suss/behavioral-ir": "0.21.1",
50
+ "@suss/datalog": "0.21.1",
51
+ "@suss/extractor": "0.21.1",
52
+ "@suss/resolution": "0.21.1",
53
53
  "graphql": "^16.8.0",
54
54
  "picomatch": "^4.0.4",
55
55
  "ts-morph": "^23.0.0",