@amedia/jest-config 1.0.3 → 2.1.0
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/CHANGELOG.md +80 -0
- package/README.md +36 -0
- package/{index.cjs → index.js} +3 -3
- package/package.json +11 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
# @amedia/jest-config
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 326dc56: Declare `engines.node: ">=22"` on every published package. Matches the
|
|
8
|
+
constraint already set at the repository root. Consumers on older Node versions
|
|
9
|
+
will see an `npm WARN` on install (or an error with `engine-strict=true`).
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7577d72: Rewrite all package READMEs to a consistent `# Title / tagline / Install / Use
|
|
14
|
+
/ Notes` shape. Drops stale `.eslintrc.js` / CJS examples, removes redundant
|
|
15
|
+
"install plugin X yourself" instructions for plugins that are now bundled,
|
|
16
|
+
and adds READMEs for the eight packages that previously had none
|
|
17
|
+
(`biome-config`, `browserslist-config`, `jest-config`, `kragl-eslint`,
|
|
18
|
+
`kragl-lockfile-lint`, `kragl-ls-lint`, `kragl-utils`).
|
|
19
|
+
|
|
20
|
+
The `@amedia/eslint-config-react` README now documents its temporary freeze
|
|
21
|
+
on the previous major.
|
|
22
|
+
|
|
23
|
+
## 2.0.0
|
|
24
|
+
|
|
25
|
+
### Major Changes
|
|
26
|
+
|
|
27
|
+
- d6346cc: Kragl 4.x
|
|
28
|
+
|
|
29
|
+
_Get ready: This release breaks the world._
|
|
30
|
+
|
|
31
|
+
ESLint 9 introduces a new configuration format (flat config files)[^1]
|
|
32
|
+
so as we move to ESLint 9 we need to re-do all the ESLint configuration
|
|
33
|
+
both in this package, and in downstream repos.
|
|
34
|
+
|
|
35
|
+
See the configuration docs for how to setup kragl for your project.
|
|
36
|
+
|
|
37
|
+
[^1]: https://eslint.org/docs/latest/use/configure/configuration-files
|
|
38
|
+
|
|
39
|
+
We are all-in on ECMAScript Modules at Amedia, but have been held back
|
|
40
|
+
in this repo due to the tools we depend on have lagged behind. Now the
|
|
41
|
+
world is ready, and we are making the move.
|
|
42
|
+
|
|
43
|
+
Changes that hit the consumer are things like `.prettierrc.cjs` will not
|
|
44
|
+
work with the `@amedia/prettier-config` package and the consumer needs
|
|
45
|
+
to move to `prettier.config.js` with ESM syntax.
|
|
46
|
+
|
|
47
|
+
`@amedia/eslint-config` exports an helper function that generates an
|
|
48
|
+
ESLint configuration that complies with our standards, it supports both
|
|
49
|
+
toggling options and full-on custom configuration.
|
|
50
|
+
|
|
51
|
+
For example, a TypeScript + Svelte project:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
import eslintConfig from '@amedia/eslint-config';
|
|
55
|
+
|
|
56
|
+
export default eslintConfig({
|
|
57
|
+
typescript: true,
|
|
58
|
+
svelte: true,
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
We have had a long-standing issue of the LSP hanging when interacting
|
|
63
|
+
with our Prettier configuration. This was likely due to our Prettier
|
|
64
|
+
configuration dynamically loading the Svelte plugin if it was necessary.
|
|
65
|
+
Some versions of Prettier struggle with that, so for kragl 4.x the
|
|
66
|
+
consumer manually decides if the standard or svelte prettier
|
|
67
|
+
configuration should be used.
|
|
68
|
+
|
|
69
|
+
Standard:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
// prettier.config.js
|
|
73
|
+
export { default } from '@amedia/prettier-config';
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Svelte:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
// prettier.config.js
|
|
80
|
+
export { svelte as default } from '@amedia/prettier-config';
|
|
81
|
+
```
|
|
82
|
+
|
|
3
83
|
## 1.0.3
|
|
4
84
|
|
|
5
85
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @amedia/jest-config
|
|
2
|
+
|
|
3
|
+
Amedia's shared Jest base configuration. Sensible defaults for coverage,
|
|
4
|
+
test environment, and verbosity.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install --save-dev @amedia/jest-config jest
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Use
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
// jest.config.js
|
|
16
|
+
import base from '@amedia/jest-config';
|
|
17
|
+
|
|
18
|
+
export default base;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or extend it with project-specific options:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
// jest.config.js
|
|
25
|
+
import base from '@amedia/jest-config';
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
...base,
|
|
29
|
+
setupFilesAfterEach: ['<rootDir>/jest.setup.js'],
|
|
30
|
+
};
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
|
|
35
|
+
Requires Node 22+. Run Jest through [`@amedia/kragl-jest`](../kragl-jest) for
|
|
36
|
+
the standard kragl pipeline.
|
package/{index.cjs → index.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { cwd } from 'node:process';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default {
|
|
5
5
|
rootDir: join(cwd()),
|
|
6
6
|
cache: false,
|
|
7
7
|
collectCoverage: true,
|
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amedia/jest-config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Jest config for Amedia",
|
|
5
|
-
"type": "
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
7
12
|
"author": "",
|
|
8
13
|
"license": "ISC",
|
|
9
|
-
"devDependencies": {
|
|
10
|
-
"jest": "28.1.3"
|
|
11
|
-
},
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"jest": "28.x"
|
|
14
|
-
},
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=22"
|
|
17
19
|
}
|
|
18
20
|
}
|