@ifto/mantine-kit 0.2.0 → 0.2.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 +12 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -101,6 +101,18 @@ import { SelectField } from '@ifto/mantine-kit/component/molecule/SelectField/Se
|
|
|
101
101
|
The path is the one of the file inside `src`, without the extension (see [Components](#components)). There is no
|
|
102
102
|
`index` with everything, so you only bundle what you import.
|
|
103
103
|
|
|
104
|
+
### Testing with Jest
|
|
105
|
+
|
|
106
|
+
The library is published only as ESM, and Jest runs the tests in CommonJS, so it has to transform the files of the
|
|
107
|
+
library. Allow them in `transformIgnorePatterns` and keep the transform of your project for `.js` files:
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
// jest.config.js
|
|
111
|
+
module.exports = {
|
|
112
|
+
transformIgnorePatterns: ['/node_modules/(?!@ifto/mantine-kit/)']
|
|
113
|
+
};
|
|
114
|
+
```
|
|
115
|
+
|
|
104
116
|
## Examples
|
|
105
117
|
|
|
106
118
|
### CRUD list page
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifto/mantine-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "General purpose Mantine components for React apps: CRUD tables and forms, layout, ECharts charts, Excel/CSV export, print pages and a REST HTTP client, with i18n (en-US and pt-BR).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "IFTO - Campus Palmas",
|
|
@@ -34,12 +34,14 @@
|
|
|
34
34
|
"README.md",
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
|
+
"//exports": "The default condition of \"./*\" is needed by Jest, which resolves packages with the require and default conditions. Without it, deep imports fail with Cannot find module. The import condition only matches tools that load the package as ESM, while default matches any tool when no previous condition matched. It must stay as the last condition.",
|
|
37
38
|
"exports": {
|
|
38
39
|
"./styles.css": "./dist/styles.css",
|
|
39
40
|
"./print.css": "./dist/styles/print.css",
|
|
40
41
|
"./*": {
|
|
41
42
|
"types": "./dist/*.d.ts",
|
|
42
|
-
"import": "./dist/*.js"
|
|
43
|
+
"import": "./dist/*.js",
|
|
44
|
+
"default": "./dist/*.js"
|
|
43
45
|
},
|
|
44
46
|
"./package.json": "./package.json"
|
|
45
47
|
},
|