@tsmodule/tsmodule 40.0.8 → 40.0.9

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.
Files changed (2) hide show
  1. package/README.md +24 -14
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -25,6 +25,7 @@ modules** that target any platform.
25
25
  * [React component library (using Next.js)](#react-component-library-using-nextjs)
26
26
  - [Footnotes](#footnotes)
27
27
  * [Module configuration](#module-configuration)
28
+ + [Index exports](#index-exports)
28
29
  + [Package.json export](#packagejson-export)
29
30
  - [License](#license)
30
31
 
@@ -200,23 +201,32 @@ type-check and declaration emit:
200
201
  }
201
202
  ```
202
203
 
203
- And conditional exports in package.json will be configured like so, such that
204
- "index modules" at e.g. `src/test/index.ts` will be available at
205
- `my-package/test`:
204
+ #### Index exports
206
205
 
207
- ```json
208
- {
209
- "files": ["dist/"],
210
- "exports": {
211
- "./package.json": "./package.json",
212
- "./": "./dist/index.js",
213
- "./*": "./dist/*/index.js"
214
- },
215
- }
206
+ Conditional exports in package.json are configured such that "index
207
+ exports" are available at a subpath. For example:
208
+
209
+ ```
210
+ src/a/b/c/index.ts
216
211
  ```
217
212
 
218
- This has no restriction on internal imports between files, only the default
219
- configuration for how downstream consumers can import from module subpaths.
213
+ Will be available downstream via:
214
+
215
+ ```ts
216
+ import { c } from "your-package/a/b/c"
217
+ ```
218
+
219
+ **Notes:**
220
+
221
+ - Index exports are the only entry points available for import, are ones located
222
+ at `src/**/index.ts(x?)`.<sup>1</sup>
223
+
224
+ - The default package entry point for `your-package` is `src/index.ts`.
225
+
226
+ <sub><sup>1</sup> This has no restriction on internal imports between files,
227
+ which can import from each other freely, including at runtime.
228
+ However, consumers of your package will only be able to import from index
229
+ exports as shown.<sub>
220
230
 
221
231
  #### Package.json export
222
232
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tsmodule/tsmodule",
3
3
  "platform": "node",
4
4
  "type": "module",
5
- "version": "40.0.8",
5
+ "version": "40.0.9",
6
6
  "repository": "tsmodule/tsmodule",
7
7
  "description": "TypeScript Module loader and compiler",
8
8
  "license": "MIT",