@backstage/core-components 0.13.9-next.0 → 0.13.9-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.13.9-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e8f2acef80: Added a new `/testUtils` sub-path that initially exports a `mockBreakpoint` helper.
8
+ - 07dfdf3702: Updated dependency `linkifyjs` to `4.1.3`.
9
+ - a518c5a25b: Updated dependency `@react-hookz/web` to `^23.0.0`.
10
+ - f291757e70: Update `linkify-react` to version `4.1.3`
11
+ - Updated dependencies
12
+ - @backstage/core-plugin-api@1.8.1-next.1
13
+ - @backstage/config@1.1.1
14
+ - @backstage/errors@1.2.3
15
+ - @backstage/theme@0.5.0-next.0
16
+ - @backstage/version-bridge@1.0.7
17
+
3
18
  ## 0.13.9-next.0
4
19
 
5
20
  ### Patch Changes
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This is a mocking method suggested in the Jest docs, as it is not implemented in JSDOM yet.
3
+ * It can be used to mock values for the Material UI `useMediaQuery` hook if it is used in a tested component.
4
+ *
5
+ * For issues checkout the documentation:
6
+ * https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
7
+ *
8
+ * If there are any updates from Material UI React on testing `useMediaQuery` this mock should be replaced
9
+ * https://mui.com/material-ui/react-use-media-query/#testing
10
+ *
11
+ * @public
12
+ */
13
+ declare function mockBreakpoint(options: {
14
+ matches: boolean;
15
+ }): void;
16
+
17
+ export { mockBreakpoint };
@@ -0,0 +1,23 @@
1
+ function mockBreakpoint(options) {
2
+ Object.defineProperty(window, "matchMedia", {
3
+ writable: true,
4
+ value: jest.fn().mockImplementation((query) => {
5
+ var _a;
6
+ return {
7
+ matches: (_a = options.matches) != null ? _a : false,
8
+ media: query,
9
+ onchange: null,
10
+ addListener: jest.fn(),
11
+ // deprecated
12
+ removeListener: jest.fn(),
13
+ // deprecated
14
+ addEventListener: jest.fn(),
15
+ removeEventListener: jest.fn(),
16
+ dispatchEvent: jest.fn()
17
+ };
18
+ })
19
+ });
20
+ }
21
+
22
+ export { mockBreakpoint };
23
+ //# sourceMappingURL=testUtils.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testUtils.esm.js","sources":["../src/testUtils.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This is a mocking method suggested in the Jest docs, as it is not implemented in JSDOM yet.\n * It can be used to mock values for the Material UI `useMediaQuery` hook if it is used in a tested component.\n *\n * For issues checkout the documentation:\n * https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom\n *\n * If there are any updates from Material UI React on testing `useMediaQuery` this mock should be replaced\n * https://mui.com/material-ui/react-use-media-query/#testing\n *\n * @public\n */\nexport function mockBreakpoint(options: { matches: boolean }) {\n Object.defineProperty(window, 'matchMedia', {\n writable: true,\n value: jest.fn().mockImplementation(query => ({\n matches: options.matches ?? false,\n media: query,\n onchange: null,\n addListener: jest.fn(), // deprecated\n removeListener: jest.fn(), // deprecated\n addEventListener: jest.fn(),\n removeEventListener: jest.fn(),\n dispatchEvent: jest.fn(),\n })),\n });\n}\n"],"names":[],"mappings":"AA4BO,SAAS,eAAe,OAA+B,EAAA;AAC5D,EAAO,MAAA,CAAA,cAAA,CAAe,QAAQ,YAAc,EAAA;AAAA,IAC1C,QAAU,EAAA,IAAA;AAAA,IACV,KAAO,EAAA,IAAA,CAAK,EAAG,EAAA,CAAE,mBAAmB,CAAM,KAAA,KAAA;AA/B9C,MAAA,IAAA,EAAA,CAAA;AA+BkD,MAAA,OAAA;AAAA,QAC5C,OAAA,EAAA,CAAS,EAAQ,GAAA,OAAA,CAAA,OAAA,KAAR,IAAmB,GAAA,EAAA,GAAA,KAAA;AAAA,QAC5B,KAAO,EAAA,KAAA;AAAA,QACP,QAAU,EAAA,IAAA;AAAA,QACV,WAAA,EAAa,KAAK,EAAG,EAAA;AAAA;AAAA,QACrB,cAAA,EAAgB,KAAK,EAAG,EAAA;AAAA;AAAA,QACxB,gBAAA,EAAkB,KAAK,EAAG,EAAA;AAAA,QAC1B,mBAAA,EAAqB,KAAK,EAAG,EAAA;AAAA,QAC7B,aAAA,EAAe,KAAK,EAAG,EAAA;AAAA,OACzB,CAAA;AAAA,KAAE,CAAA;AAAA,GACH,CAAA,CAAA;AACH;;;;"}
package/package.json CHANGED
@@ -1,11 +1,9 @@
1
1
  {
2
2
  "name": "@backstage/core-components",
3
3
  "description": "Core components used by Backstage plugins and apps",
4
- "version": "0.13.9-next.0",
4
+ "version": "0.13.9-next.1",
5
5
  "publishConfig": {
6
- "access": "public",
7
- "main": "dist/index.esm.js",
8
- "types": "dist/index.d.ts"
6
+ "access": "public"
9
7
  },
10
8
  "backstage": {
11
9
  "role": "web-library"
@@ -20,8 +18,21 @@
20
18
  "backstage"
21
19
  ],
22
20
  "license": "Apache-2.0",
23
- "main": "dist/index.esm.js",
24
- "types": "dist/index.d.ts",
21
+ "main": "./dist/index.esm.js",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "import": "./dist/index.esm.js",
26
+ "types": "./dist/index.d.ts",
27
+ "default": "./dist/index.esm.js"
28
+ },
29
+ "./testUtils": {
30
+ "import": "./dist/testUtils.esm.js",
31
+ "types": "./dist/testUtils.d.ts",
32
+ "default": "./dist/testUtils.esm.js"
33
+ },
34
+ "./package.json": "./package.json"
35
+ },
25
36
  "sideEffects": false,
26
37
  "scripts": {
27
38
  "build": "backstage-cli package build",
@@ -34,7 +45,7 @@
34
45
  },
35
46
  "dependencies": {
36
47
  "@backstage/config": "^1.1.1",
37
- "@backstage/core-plugin-api": "^1.8.1-next.0",
48
+ "@backstage/core-plugin-api": "^1.8.1-next.1",
38
49
  "@backstage/errors": "^1.2.3",
39
50
  "@backstage/theme": "^0.5.0-next.0",
40
51
  "@backstage/version-bridge": "^1.0.7",
@@ -43,7 +54,7 @@
43
54
  "@material-ui/core": "^4.12.2",
44
55
  "@material-ui/icons": "^4.9.1",
45
56
  "@material-ui/lab": "4.0.0-alpha.61",
46
- "@react-hookz/web": "^20.0.0",
57
+ "@react-hookz/web": "^23.0.0",
47
58
  "@types/react": "^16.13.1 || ^17.0.0",
48
59
  "@types/react-sparklines": "^1.7.0",
49
60
  "@types/react-text-truncate": "^0.14.0",
@@ -55,8 +66,8 @@
55
66
  "dagre": "^0.8.5",
56
67
  "history": "^5.0.0",
57
68
  "immer": "^9.0.1",
58
- "linkify-react": "4.1.2",
59
- "linkifyjs": "4.1.2",
69
+ "linkify-react": "4.1.3",
70
+ "linkifyjs": "4.1.3",
60
71
  "lodash": "^4.17.21",
61
72
  "pluralize": "^8.0.0",
62
73
  "qs": "^6.9.4",
@@ -81,9 +92,9 @@
81
92
  "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
82
93
  },
83
94
  "devDependencies": {
84
- "@backstage/cli": "^0.24.1-next.0",
85
- "@backstage/core-app-api": "^1.11.2-next.0",
86
- "@backstage/test-utils": "^1.4.6-next.0",
95
+ "@backstage/cli": "^0.25.0-next.1",
96
+ "@backstage/core-app-api": "^1.11.2-next.1",
97
+ "@backstage/test-utils": "^1.4.6-next.1",
87
98
  "@testing-library/dom": "^9.0.0",
88
99
  "@testing-library/jest-dom": "^6.0.0",
89
100
  "@testing-library/react": "^14.0.0",
@@ -105,7 +116,8 @@
105
116
  },
106
117
  "files": [
107
118
  "dist",
108
- "config.d.ts"
119
+ "config.d.ts",
120
+ "testUtils"
109
121
  ],
110
122
  "configSchema": "config.d.ts",
111
123
  "module": "./dist/index.esm.js"
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@backstage/core-components",
3
+ "version": "0.13.9-next.1",
4
+ "main": "../dist/testUtils.esm.js",
5
+ "module": "../dist/testUtils.esm.js",
6
+ "types": "../dist/testUtils.d.ts"
7
+ }