Skip to content

Commit 1a29b41

Browse files
authored
docs(devs-infra): remove ESM docs for 26.5 documentation (#2334)
1 parent 3d3e0b4 commit 1a29b41

File tree

8 files changed

+28
-119
lines changed

8 files changed

+28
-119
lines changed

website/docs/getting-started/installation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ npm install --save-dev jest typescript ts-jest
1919
yarn add --dev jest typescript ts-jest
2020
```
2121

22-
> Tip: If you get an error with the following `npm` commands such as `npx: command not found`, you can replace `npx XXX` with `node node_modules/.bin/XXX` from the root of your project.
22+
:::tip
23+
24+
Tip: If you get an error with the following `npm` commands such as `npx: command not found`, you can replace `npx XXX` with `node node_modules/.bin/XXX` from the root of your project.
25+
26+
:::
2327

2428
### Jest config file
2529

website/docs/introduction.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ slug: /
99

1010
It supports all features of TypeScript including type-checking. [Read more about Babel7 + `preset-typescript` **vs** TypeScript (and `ts-jest`)](babel7-or-ts).
1111

12-
| We are not doing semantic versioning and `23.10` is a re-write, run `npm i -D ts-jest@"<23.10.0"` to go back to the previous version |
13-
| ------------------------------------------------------------------------------------------------------------------------------------ |
12+
:::important
13+
14+
We are not doing semantic versioning and \*\*23.10 is a re-write, run `npm i -D ts-jest@"<23.10.0"` to go back to the previous version
15+
16+
:::

website/versioned_docs/version-26.5/getting-started/installation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ npm install --save-dev jest typescript ts-jest
1919
yarn add --dev jest typescript ts-jest
2020
```
2121

22-
> Tip: If you get an error with the following `npm` commands such as `npx: command not found`, you can replace `npx XXX` with `node node_modules/.bin/XXX` from the root of your project.
22+
:::tip
23+
24+
Tip: If you get an error with the following `npm` commands such as `npx: command not found`, you can replace `npx XXX` with `node node_modules/.bin/XXX` from the root of your project.
25+
26+
:::
2327

2428
### Jest config file
2529

website/versioned_docs/version-26.5/getting-started/options.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ All options have default values which should fit most of the projects. Click on
6565
| [**`diagnostics`**][diagnostics] | [Diagnostics related configuration.][diagnostics] | `boolean`\|`object` | _enabled_ |
6666
| [**`babelConfig`**][babelconfig] | [Babel(Jest) related configuration.][babelconfig] | `boolean`\|`string`\|`object` | _disabled_ |
6767
| [**`stringifyContentPathRegex`**][stringifycontentpathregex] | [Files which will become modules returning self content.][stringifycontentpathregex] | `string`\|`RegExp` | _disabled_ |
68-
| [**`useESM`**][useesm] | [Enable ESM support][useesm] | `boolean` | _auto_ |
6968

7069
[compiler]: options/compiler
7170
[tsconfig]: options/tsconfig
@@ -75,4 +74,3 @@ All options have default values which should fit most of the projects. Click on
7574
[diagnostics]: options/diagnostics
7675
[babelconfig]: options/babelConfig
7776
[stringifycontentpathregex]: options/stringifyContentPathRegex
78-
[useesm]: options/useESM

website/versioned_docs/version-26.5/getting-started/options/useESM.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

website/versioned_docs/version-26.5/getting-started/presets.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ title: Presets
77

88
`ts-jest` comes with several presets, covering most of the project's base configuration:
99

10-
| Preset name | Description |
11-
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
12-
| `ts-jest/presets/default`<br/>or `ts-jest` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to **CommonJS** syntax, leaving JavaScript files (`.js`, `jsx`) as-is. |
13-
| `ts-jest/presets/default-esm`<br/> | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to **ESM** syntax, leaving JavaScript files (`.js`, `jsx`) as-is. |
14-
| `ts-jest/presets/js-with-ts` | TypeScript and JavaScript files (`.ts`, `.tsx`, `.js`, `.jsx`) will be transformed by `ts-jest` to **CommonJS** syntax.<br/>You'll need to set `allowJs` to `true` in your `tsconfig.json` file. |
15-
| `ts-jest/presets/js-with-ts-esm` | TypeScript and JavaScript files (`.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`) will be transformed by `ts-jest` to **ESM** syntax.<br/>You'll need to set `allowJs` to `true` in your `tsconfig.json` file. |
16-
| `ts-jest/presets/js-with-babel` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to **CommonJS** syntax, and JavaScript files (`.js`, `jsx`) will be transformed by `babel-jest`. |
17-
| `ts-jest/presets/js-with-babel-esm` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to **ESM** syntax, and JavaScript files (`.js`, `jsx`, `.mjs`) will be transformed by `babel-jest`. |
10+
| Preset name | Description |
11+
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
12+
| `ts-jest/presets/default`<br/>or `ts-jest` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to **CommonJS** syntax, leaving JavaScript files (`.js`, `jsx`) as-is. |
13+
| `ts-jest/presets/js-with-ts` | TypeScript and JavaScript files (`.ts`, `.tsx`, `.js`, `.jsx`) will be transformed by `ts-jest` to **CommonJS** syntax.<br/>You'll need to set `allowJs` to `true` in your `tsconfig.json` file. |
14+
| `ts-jest/presets/js-with-babel` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to **CommonJS** syntax, and JavaScript files (`.js`, `jsx`) will be transformed by `babel-jest`. |
1815

1916
### Basic usage
2017

@@ -53,11 +50,8 @@ In this case you'll need to use the JavaScript version of Jest config (comment/u
5350
```js
5451
// jest.config.js
5552
const { defaults: tsjPreset } = require('ts-jest/presets')
56-
// const { defaultsESM: tsjPreset } = require('ts-jest/presets');
5753
// const { jsWithTs: tsjPreset } = require('ts-jest/presets');
58-
// const { jsWithTsESM: tsjPreset } = require('ts-jest/presets');
5954
// const { jsWithBabel: tsjPreset } = require('ts-jest/presets');
60-
// const { jsWithBabelESM: tsjPreset } = require('ts-jest/presets');
6155

6256
module.exports = {
6357
// [...]

website/versioned_docs/version-26.5/guides/esm-support.md

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3,70 +3,8 @@ id: esm-support
33
title: ESM Support
44
---
55

6-
To use `ts-jest` with ESM support, you'll first need to check [ESM Jest documentation](https://jestjs.io/docs/en/ecmascript-modules).
6+
:::important
77

8-
`ts-jest` supports ESM via a config option [useESM](../getting-started/options/useESM) in combination with jest config option [extensionsToTreatAsEsm](https://jestjs.io/docs/en/next/configuration#extensionstotreatasesm-arraystring).
8+
ESM support is only available in **v27**
99

10-
There are also [3 presets](../getting-started/presets.md) to work with ESM.
11-
12-
### Examples
13-
14-
#### Manual configuration
15-
16-
```js
17-
// jest.config.js
18-
module.exports = {
19-
// [...]
20-
extensionsToTreatAsEsm: ['.ts'],
21-
globals: {
22-
'ts-jest': {
23-
useESM: true,
24-
},
25-
},
26-
}
27-
```
28-
29-
```json
30-
// OR package.json
31-
{
32-
// [...]
33-
"jest": {
34-
"extensionsToTreatAsEsm": [".ts"],
35-
"globals": {
36-
"ts-jest": {
37-
"useESM": true
38-
}
39-
}
40-
}
41-
}
42-
```
43-
44-
#### Use ESM presets
45-
46-
```js
47-
// jest.config.js
48-
module.exports = {
49-
// [...]
50-
preset: 'ts-jest/presets/default-esm', // or other ESM presets
51-
globals: {
52-
'ts-jest': {
53-
useESM: true,
54-
},
55-
},
56-
}
57-
```
58-
59-
```json
60-
// OR package.json
61-
{
62-
// [...]
63-
"jest": {
64-
"preset": "ts-jest/presets/default-esm", // or other ESM presets,
65-
"globals": {
66-
"ts-jest": {
67-
"useESM": true
68-
}
69-
}
70-
}
71-
}
72-
```
10+
:::

website/versioned_docs/version-26.5/introduction.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ slug: /
99

1010
It supports all features of TypeScript including type-checking. [Read more about Babel7 + `preset-typescript` **vs** TypeScript (and `ts-jest`)](babel7-or-ts).
1111

12-
| We are not doing semantic versioning and `23.10` is a re-write, run `npm i -D ts-jest@"<23.10.0"` to go back to the previous version |
13-
| ------------------------------------------------------------------------------------------------------------------------------------ |
12+
:::important
13+
14+
We are not doing semantic versioning and `23.10` is a re-write, run `npm i -D ts-jest@"<23.10.0"` to go back to the previous version
15+
16+
:::

0 commit comments

Comments
 (0)