@darajs/core 1.20.1-alpha.9 → 1.20.2

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.
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom/vitest';
2
+ //# sourceMappingURL=vitest-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest-setup.d.ts","sourceRoot":"","sources":["../js/vitest-setup.ts"],"names":[],"mappings":"AAEA,OAAO,kCAAkC,CAAC"}
@@ -1,18 +1,29 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies
3
- import '@testing-library/jest-dom';
3
+ import '@testing-library/jest-dom/vitest';
4
+ import * as React from 'react';
4
5
  import { RecoilEnv } from 'recoil';
5
6
  // @ts-expect-error typescript is not happy but this works
6
- import { fetch as fetchImpl } from 'whatwg-fetch';
7
+ import { fetch as fetchPolyfill } from 'whatwg-fetch';
8
+ // Make React available globally for tests (required for classic JSX runtime)
9
+ global.React = React;
7
10
  // disable duplicate atom key checking in tests, as we clear the registries between tests
8
11
  // but recoil does not provide a way to clear the atoms in their internals, so the warnings are false positives
9
12
  RecoilEnv.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED = false;
13
+ // explicitly polyfill fetch
10
14
  // Override global fetch to always include credentials
11
15
  // This simplifies the tests as we don't have to pass credentials: 'include' to every request
12
16
  // In reality in a browser we're always dealing with same-origin in Dara so this is fine
13
17
  global.fetch = (input, info) => {
14
18
  const init = info || {};
15
19
  init.credentials = 'include';
16
- return fetchImpl(input, init);
20
+ return fetchPolyfill(input, init);
17
21
  };
18
- //# sourceMappingURL=jest-setup.js.map
22
+ // Simulate Jest for waitFor()
23
+ // see https://github.com/testing-library/dom-testing-library/blob/0ce0c7054dfa64d1cd65053790246aed151bda9d/src/helpers.ts#L5
24
+ // and https://github.com/testing-library/dom-testing-library/blob/0ce0c7054dfa64d1cd65053790246aed151bda9d/src/wait-for.js#L53
25
+ global.jest = {
26
+ // @ts-expect-error vi is globally available
27
+ advanceTimersByTime: (ms) => vi.advanceTimersByTime(ms),
28
+ };
29
+ //# sourceMappingURL=vitest-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest-setup.js","sourceRoot":"","sources":["../js/vitest-setup.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,6DAA6D;AAC7D,OAAO,kCAAkC,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,0DAA0D;AAC1D,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtD,6EAA6E;AAC7E,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;AAErB,yFAAyF;AACzF,+GAA+G;AAC/G,SAAS,CAAC,0CAA0C,GAAG,KAAK,CAAC;AAE7D,4BAA4B;AAE5B,sDAAsD;AACtD,6FAA6F;AAC7F,wFAAwF;AACxF,MAAM,CAAC,KAAK,GAAG,CAAC,KAAK,EAAE,IAAK,EAAE,EAAE;IAC5B,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAC7B,OAAO,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,8BAA8B;AAC9B,6HAA6H;AAC7H,+HAA+H;AAC/H,MAAM,CAAC,IAAI,GAAG;IACV,4CAA4C;IAC5C,mBAAmB,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC;CAC3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darajs/core",
3
- "version": "1.20.1-alpha.9",
3
+ "version": "1.20.2",
4
4
  "description": "Dara Framework core",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -28,8 +28,8 @@
28
28
  "format:check": "prettier js --check",
29
29
  "lint:fix": "tsc --noemit && eslint js tests cypress --ext .tsx,.ts --max-warnings 0 --fix && stylelint --fix './js/**/*.tsx'",
30
30
  "package": "yarn build && yarn publish --no-git-tag-version",
31
- "test-watch": "jest --watch",
32
- "test": "jest",
31
+ "test-watch": "vitest",
32
+ "test": "vitest --run",
33
33
  "test:e2e": "start-server-and-test 'poetry run dara start --config cypress.dara.main:config' http://127.0.0.1:8000/static/index.js 'cypress run'"
34
34
  },
35
35
  "prettier": "@darajs/prettier-config",
@@ -38,17 +38,16 @@
38
38
  "@babel/preset-env": "^7.23.0",
39
39
  "@babel/preset-react": "^7.22.15",
40
40
  "@babel/preset-typescript": "^7.23.0",
41
- "@darajs/eslint-config": "1.20.1-alpha.9",
42
- "@darajs/prettier-config": "1.20.1-alpha.9",
43
- "@darajs/stylelint-config": "1.20.1-alpha.9",
41
+ "@darajs/eslint-config": "1.20.2",
42
+ "@darajs/prettier-config": "1.20.2",
43
+ "@darajs/stylelint-config": "1.20.2",
44
44
  "@rollup/plugin-inject": "^4.0.4",
45
45
  "@testing-library/dom": "^9.3.0",
46
- "@testing-library/jest-dom": "^5.16.5",
46
+ "@testing-library/jest-dom": "^6.0.0",
47
47
  "@testing-library/react": "^14.0.0",
48
48
  "@testing-library/user-event": "^14.5.2",
49
49
  "@types/file-saver": "^2.0.5",
50
50
  "@types/history": "^4.7.0",
51
- "@types/jest": "^29.5.1",
52
51
  "@types/lodash": "^4.14.178",
53
52
  "@types/node": "^18.15.3",
54
53
  "@types/react": "^18.2.6",
@@ -61,14 +60,9 @@
61
60
  "@types/styled-components": "^5.1.23",
62
61
  "@types/whatwg-fetch": "^0.0.33",
63
62
  "@vitejs/plugin-react": "4.6.0",
64
- "babel-jest": "^29.5.0",
65
63
  "concurrently": "^8.0.1",
66
64
  "cypress": "9.5.3",
67
- "jest": "^29.5.0",
68
- "jest-css-modules": "^2.1.0",
69
- "jest-environment-jsdom": "^29.5.0",
70
- "jest-websocket-mock": "^2.5.0",
71
- "msw": "1.0.1",
65
+ "msw": "^2.10.5",
72
66
  "postcss": "^8.4.35",
73
67
  "prettier": "^3.0.0",
74
68
  "react-test-renderer": "^17.0.2",
@@ -77,18 +71,20 @@
77
71
  "stylelint": "^15.0.0",
78
72
  "tsc-alias": "^1.8.5",
79
73
  "vite": "7.0.4",
80
- "whatwg-fetch": "^3.6.2"
74
+ "vitest": "^3.2.4",
75
+ "vitest-websocket-mock": "^0.5.0",
76
+ "whatwg-fetch": "^3.6.20"
81
77
  },
82
78
  "dependencies": {
83
- "@darajs/styled-components": "1.20.1-alpha.9",
84
- "@darajs/ui-components": "1.20.1-alpha.9",
85
- "@darajs/ui-notifications": "1.20.1-alpha.9",
86
- "@darajs/ui-utils": "1.20.1-alpha.9",
79
+ "@darajs/styled-components": "1.20.2",
80
+ "@darajs/ui-components": "1.20.2",
81
+ "@darajs/ui-notifications": "1.20.2",
82
+ "@darajs/ui-utils": "1.20.2",
87
83
  "@fortawesome/fontawesome-free": "~6.4.0",
88
84
  "@recoiljs/refine": "^0.1.1",
89
85
  "@tanstack/query-core": "^4.40.0",
90
86
  "@tanstack/react-query": "^4.40.1",
91
- "date-fns": "2.9.0",
87
+ "date-fns": "2.30.0",
92
88
  "exceljs": "^4.3.0",
93
89
  "fast-json-patch": "^3.1.1",
94
90
  "file-saver": "^2.0.5",
@@ -121,5 +117,5 @@
121
117
  "engines": {
122
118
  "node": ">=20.19.0"
123
119
  },
124
- "gitHead": "1dcf447c6fff350461d83ac5e0ae359f376f7e34"
120
+ "gitHead": "7dced05fc8a8e74fb2fffc71511afcce227ee37e"
125
121
  }
@@ -1,7 +0,0 @@
1
- interface DotsProps {
2
- className?: string;
3
- style?: React.CSSProperties;
4
- }
5
- declare function Dots(props: DotsProps): JSX.Element;
6
- export default Dots;
7
- //# sourceMappingURL=dots.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dots.d.ts","sourceRoot":"","sources":["../../../js/components/fallback/dots.tsx"],"names":[],"mappings":"AA2EA,UAAU,SAAS;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B;AAED,iBAAS,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAM3C;AAED,eAAe,IAAI,CAAC"}
@@ -1,78 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import styled from '@darajs/styled-components';
3
- const Wrapper = styled.div `
4
- display: flex;
5
- align-items: center;
6
- justify-content: center;
7
-
8
- width: 100%;
9
- height: 100%;
10
- `;
11
- const FlashingDots = styled.div `
12
- position: relative;
13
-
14
- width: 10px;
15
- height: 10px;
16
-
17
- color: ${(props) => props.theme.colors.grey4};
18
-
19
- background-color: ${(props) => props.theme.colors.grey4};
20
- border-radius: 5px;
21
-
22
- animation: dot-flashing 1s infinite linear alternate;
23
- animation-delay: 0.5s;
24
-
25
- &::before,
26
- &::after {
27
- content: '';
28
- position: absolute;
29
- top: 0;
30
- display: inline-block;
31
- }
32
-
33
- &::before {
34
- left: -15px;
35
-
36
- width: 10px;
37
- height: 10px;
38
-
39
- color: ${(props) => props.theme.colors.grey4};
40
-
41
- background-color: ${(props) => props.theme.colors.grey4};
42
- border-radius: 5px;
43
-
44
- animation: dot-flashing 1s infinite alternate;
45
- animation-delay: 0s;
46
- }
47
-
48
- &::after {
49
- left: 15px;
50
-
51
- width: 10px;
52
- height: 10px;
53
-
54
- color: ${(props) => props.theme.colors.grey4};
55
-
56
- background-color: ${(props) => props.theme.colors.grey4};
57
- border-radius: 5px;
58
-
59
- animation: dot-flashing 1s infinite alternate;
60
- animation-delay: 1s;
61
- }
62
-
63
- @keyframes dot-flashing {
64
- 0% {
65
- background-color: ${(props) => props.theme.colors.grey4};
66
- }
67
-
68
- 50%,
69
- 100% {
70
- background-color: ${(props) => props.theme.colors.grey3};
71
- }
72
- }
73
- `;
74
- function Dots(props) {
75
- return (_jsx(Wrapper, { className: props.className, style: props.style, children: _jsx(FlashingDots, { "data-testid": "LOADING" }) }));
76
- }
77
- export default Dots;
78
- //# sourceMappingURL=dots.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dots.js","sourceRoot":"","sources":["../../../js/components/fallback/dots.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOzB,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;aAMlB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;wBAExB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;iBAoB1C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;4BAExB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;;;;;;;;;;iBAa9C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;4BAExB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;;;;;;gCAS/B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;;gCAKnC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;CAGlE,CAAC;AAOF,SAAS,IAAI,CAAC,KAAgB;IAC1B,OAAO,CACH,KAAC,OAAO,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,YACnD,KAAC,YAAY,mBAAa,SAAS,GAAG,GAChC,CACb,CAAC;AACN,CAAC;AAED,eAAe,IAAI,CAAC"}
@@ -1,2 +0,0 @@
1
- import '@testing-library/jest-dom';
2
- //# sourceMappingURL=jest-setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jest-setup.d.ts","sourceRoot":"","sources":["../js/jest-setup.ts"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jest-setup.js","sourceRoot":"","sources":["../js/jest-setup.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,6DAA6D;AAC7D,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,0DAA0D;AAC1D,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AAElD,yFAAyF;AACzF,+GAA+G;AAC/G,SAAS,CAAC,0CAA0C,GAAG,KAAK,CAAC;AAE7D,sDAAsD;AACtD,6FAA6F;AAC7F,wFAAwF;AACxF,MAAM,CAAC,KAAK,GAAG,CAAC,KAAK,EAAE,IAAK,EAAE,EAAE;IAC5B,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAC7B,OAAO,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC,CAAC"}