@stream44.studio/encapsulate 0.4.0-rc.22 → 0.4.0-rc.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream44.studio/encapsulate",
3
- "version": "0.4.0-rc.22",
3
+ "version": "0.4.0-rc.23",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,8 +28,11 @@ function safeCapsuleName(name: string) {
28
28
  * @returns The cache file path to use
29
29
  */
30
30
  async function constructCacheFilePath(moduleFilepath: string, importStackLine: number, spineFilesystemRoot: string): Promise<string> {
31
- if (moduleFilepath.startsWith('../')) {
32
- // External module - construct npm URI
31
+ const isExternal = moduleFilepath.startsWith('../')
32
+ const hasNodeModules = moduleFilepath.includes('node_modules/')
33
+
34
+ if (isExternal || hasNodeModules) {
35
+ // External module or node_modules path - construct npm URI
33
36
  const absoluteFilepath = join(spineFilesystemRoot, moduleFilepath)
34
37
  const npmUri = await constructNpmUriForCache(absoluteFilepath, spineFilesystemRoot)
35
38
  if (npmUri) {
@@ -241,8 +241,11 @@ export function StaticAnalyzer({
241
241
 
242
242
  // Determine the cache file path based on whether the module is external or internal
243
243
  let cacheFilePath: string
244
- if (encapsulateOptions.moduleFilepath.startsWith('../')) {
245
- // External module - construct npm URI
244
+ const isExternal = encapsulateOptions.moduleFilepath.startsWith('../')
245
+ const hasNodeModules = encapsulateOptions.moduleFilepath.includes('node_modules/')
246
+
247
+ if (isExternal || hasNodeModules) {
248
+ // External module or node_modules path - construct npm URI
246
249
  const npmUri = await constructNpmUri(moduleFilepath, spineOptions.spineFilesystemRoot)
247
250
  if (npmUri) {
248
251
  // Prefix with o/npmjs.com/node_modules/ for external modules
package/tsconfig.json CHANGED
@@ -1,5 +1,4 @@
1
1
  {
2
- "extends": "../../../tsconfig.paths.json",
3
2
  "compilerOptions": {
4
3
  "target": "ES2020",
5
4
  "module": "esnext",
@@ -27,4 +26,4 @@
27
26
  "exclude": [
28
27
  "node_modules"
29
28
  ]
30
- }
29
+ }