tshy 4.0.0 → 4.1.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/README.md CHANGED
@@ -11,11 +11,12 @@ formats](https://twitter.com/atcb/status/1702069237710479608).
11
11
 
12
12
  > > [!NOTICE]
13
13
  >
14
- > ## Upgrading from v3 to v4
14
+ > ## Upgrading from v3 to v4 and v5
15
15
  >
16
- > Version 4 switches from TypeScript 5 to TypeScript 6. (Note: you
17
- > can already preview TypeScript 7 by setting `"compiler": "tsgo"`
18
- > in your tshy options.)
16
+ > Version 4 switches from TypeScript 5 to TypeScript 6 by
17
+ > default. (Note: you can already preview TypeScript 7 by setting
18
+ > `"compiler": "tsgo"` in your tshy options, or any other version
19
+ > by specify `typescript` as a `devDependency` in your project.)
19
20
  >
20
21
  > This may cause problems upgrading, because tshy will only
21
22
  > create a new `tsconfig.json` file if the file is missing
@@ -280,6 +281,10 @@ CommonJS and `./dist/esm` for ESM.
280
281
  There is very little configuration for this, but a lot of things
281
282
  _can_ be configured.
282
283
 
284
+ ### How to Configure Tshy
285
+
286
+ Set options in the `tshy` field in `package.json`.
287
+
283
288
  ### `exports`
284
289
 
285
290
  By default, if there is a `src/index.ts` file, then that will be
@@ -770,7 +775,9 @@ builds entirely, you can add an `exclude` `string[]` field to the
770
775
  If you have any other dialects that you'd like to support, you
771
776
  can list them as either `commonjsDialects` or `esmDialects`,
772
777
  depending on whether you want them to be built as CommonJS or
773
- ESM.
778
+ ESM. As of version 4.1, it is possible to have a dialect in both
779
+ types, and it'll build to both `dist/commonjs/${name}` and
780
+ `dist/esm/${name}`, as appropriate.
774
781
 
775
782
  Note that each added dialect you create will result in another
776
783
  build in the `./dist` folder, so you may wish to use sparingly if
@@ -796,23 +803,23 @@ Will result in:
796
803
  {
797
804
  "exports": {
798
805
  ".": {
799
- "deno": {
800
- "types": "./dist/deno/index.d.ts",
801
- "default": "./dist/deno/index.js"
802
- },
803
- "browser": {
804
- "types": "./dist/browser/index.d.ts",
805
- "default": "./dist/browser/index.js"
806
- },
807
- "webpack": {
808
- "types": "./dist/webpack/index.d.ts",
809
- "default": "./dist/webpack/index.js"
810
- },
811
806
  "require": {
807
+ "webpack": {
808
+ "types": "./dist/commonjs/webpack/index.d.ts",
809
+ "default": "./dist/commonjs/webpack/index.js"
810
+ },
812
811
  "types": "./dist/commonjs/index.d.ts",
813
812
  "default": "./dist/commonjs/index.js"
814
813
  },
815
814
  "import": {
815
+ "deno": {
816
+ "types": "./dist/esm/deno/index.d.ts",
817
+ "default": "./dist/esm/deno/index.js"
818
+ },
819
+ "browser": {
820
+ "types": "./dist/esm/browser/index.d.ts",
821
+ "default": "./dist/esm/browser/index.js"
822
+ },
816
823
  "types": "./dist/esm/index.d.ts",
817
824
  "default": "./dist/esm/index.js"
818
825
  }
@@ -838,39 +845,6 @@ src/index-deno.mts # esm variant for deno
838
845
  src/index-webpack.cts # cjs variant for webpack
839
846
  ```
840
847
 
841
- If dialect overrides are used, then the `"source"` export
842
- condition will refer to the original source for the override. For
843
- example:
844
-
845
- ```json
846
- {
847
- "exports": {
848
- ".": {
849
- "deno": {
850
- "types": "./dist/deno/index.d.ts",
851
- "default": "./dist/deno/index.js"
852
- },
853
- "browser": {
854
- "types": "./dist/browser/index.d.ts",
855
- "default": "./dist/browser/index.js"
856
- },
857
- "webpack": {
858
- "types": "./dist/webpack/index.d.ts",
859
- "default": "./dist/webpack/index.js"
860
- },
861
- "require": {
862
- "types": "./dist/commonjs/index.d.ts",
863
- "default": "./dist/commonjs/index.js"
864
- },
865
- "import": {
866
- "types": "./dist/esm/index.d.ts",
867
- "default": "./dist/esm/index.js"
868
- }
869
- }
870
- }
871
- }
872
- ```
873
-
874
848
  Note that the `commonjs` override uses the abbreviated `cjs`
875
849
  name (historical reasons, it was originally the only override
876
850
  supported), and that the file extension must be `cts` or `mts`