Skip to content

Conversation

@rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Nov 7, 2025

When a submodule is exported from a file in a directory, we look for .jsiirc.json in the same directory.

That was only intended for exporting a directory/index.ts as a submodule, and is wrong when submodules are exported from files in the same directory. Consider:

- root.ts                 export * as submodule from './submodule';
- submodule
    +-- index.ts          export * as subsubmodule from './subsubmodule';
    +-- subsubmodule.ts
    +-- .jsiirc.json     // <-- gets used for both submodules!

Instead, only use the directory-level .jsiirc.json if the exported file is index.ts. Otherwise, for submodules read the jsii config from subsubmodule.jsiirc.json.

Also adds a validation for multiple submodules not accidentally sharing the same Python module name (or Go, or Java, ...)


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When a submodule is exported from a file in a directory, we look for
`.jsiirc.json` in the same directory.

That was only intended for exporting a `directory/index.ts` as
a submodule, and is wrong when submodules are exported from files
in the same directory. Consider:

```
- root.ts                 export * from './submodule';
- submodule
    +-- index.ts          export * from './subsubmodule';
    +-- subsubmodule.ts
    +-- .jsiirc.json     // <-- gets used for both submodules!
```

Instead, only use the directory-level `.jsiirc.json` if the exported
file is `index.ts`. Otherwise, for submodules read the jsii config from
`subsubmodule.jsiirc.json`.
@rix0rrr rix0rrr requested a review from a team November 7, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant