@amedia/jest-config 1.0.2 → 2.0.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 +82 -0
- package/index.js +3 -3
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,87 @@
|
|
|
1
1
|
# @amedia/jest-config
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- d6346cc: Kragl 4.x
|
|
8
|
+
|
|
9
|
+
_Get ready: This release breaks the world._
|
|
10
|
+
|
|
11
|
+
ESLint 9 introduces a new configuration format (flat config files)[^1]
|
|
12
|
+
so as we move to ESLint 9 we need to re-do all the ESLint configuration
|
|
13
|
+
both in this package, and in downstream repos.
|
|
14
|
+
|
|
15
|
+
See the configuration docs for how to setup kragl for your project.
|
|
16
|
+
|
|
17
|
+
[^1]: https://eslint.org/docs/latest/use/configure/configuration-files
|
|
18
|
+
|
|
19
|
+
We are all-in on ECMAScript Modules at Amedia, but have been held back
|
|
20
|
+
in this repo due to the tools we depend on have lagged behind. Now the
|
|
21
|
+
world is ready, and we are making the move.
|
|
22
|
+
|
|
23
|
+
Changes that hit the consumer are things like `.prettierrc.cjs` will not
|
|
24
|
+
work with the `@amedia/prettier-config` package and the consumer needs
|
|
25
|
+
to move to `prettier.config.js` with ESM syntax.
|
|
26
|
+
|
|
27
|
+
`@amedia/eslint-config` exports an helper function that generates an
|
|
28
|
+
ESLint configuration that complies with our standards, it supports both
|
|
29
|
+
toggling options and full-on custom configuration.
|
|
30
|
+
|
|
31
|
+
For example, a TypeScript + Svelte project:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
import eslintConfig from '@amedia/eslint-config';
|
|
35
|
+
|
|
36
|
+
export default eslintConfig({
|
|
37
|
+
typescript: true,
|
|
38
|
+
svelte: true,
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
We have had a long-standing issue of the LSP hanging when interacting
|
|
43
|
+
with our Prettier configuration. This was likely due to our Prettier
|
|
44
|
+
configuration dynamically loading the Svelte plugin if it was necessary.
|
|
45
|
+
Some versions of Prettier struggle with that, so for kragl 4.x the
|
|
46
|
+
consumer manually decides if the standard or svelte prettier
|
|
47
|
+
configuration should be used.
|
|
48
|
+
|
|
49
|
+
Standard:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
// prettier.config.js
|
|
53
|
+
export { default } from '@amedia/prettier-config';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Svelte:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
// prettier.config.js
|
|
60
|
+
export { svelte as default } from '@amedia/prettier-config';
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 1.0.3
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- dbb3437: add two new rules to eslint-base
|
|
68
|
+
|
|
69
|
+
Adding rules may cause previously linted code to fail, though these two
|
|
70
|
+
rules may be automatically fixed, so running `kragl lint --fix` should
|
|
71
|
+
resolve the simple cases automatically.
|
|
72
|
+
|
|
73
|
+
The reason for adding a requirement for the `node:` protocol prefix is
|
|
74
|
+
to make it absolutely clear that this is an internal node module. This
|
|
75
|
+
makes it easier for the reader to, as one example, immediately spot any
|
|
76
|
+
node modules that may need polyfill for the browser.
|
|
77
|
+
|
|
78
|
+
The second rules pushes us to use ESM everywhere it is expected by
|
|
79
|
+
default. All CommonJS code needs to be moved to `.cjs` files, regardless
|
|
80
|
+
if the module type is "module" or not.
|
|
81
|
+
|
|
82
|
+
This also serves to help us move to a pure ESM based ecosystem for
|
|
83
|
+
our internal codebase.
|
|
84
|
+
|
|
3
85
|
## 1.0.2
|
|
4
86
|
|
|
5
87
|
### Patch Changes
|
package/index.js
CHANGED
|
@@ -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,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amedia/jest-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.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"
|
|
17
16
|
}
|