Version Packages (next)

This commit is contained in:
github-actions[bot]
2022-08-23 10:29:17 +00:00
parent 6ae6a77dd5
commit 18ab337f96
324 changed files with 5358 additions and 1170 deletions
+69
View File
@@ -1,5 +1,74 @@
# @backstage/cli
## 0.18.2-next.0
### Patch Changes
- 6ae0f6a719: Switch out `sucrase` for `swc` for transpilation.
`sucrase` is a little more relaxed when it comes to supporting the ways of mocking in `jest`. You might have to make some changes to your tests to meet the `jest` standard and spec if your tests seems to start failing.
Mocks that look like this are invalid, and they will throw a reference error in line with the `jest` documentation [here on example 3](https://jestjs.io/docs/es6-class-mocks#calling-jestmock-with-the-module-factory-parameter)
```ts
const mockCommandExists = jest.fn();
jest.mock('command-exists', () => mockCommandExists);
```
You might need to update these mocks to look a little like the following to defer the call to the `jest.fn()` spy until the mock is called.
```ts
const mockCommandExists = jest.fn();
jest.mock(
'command-exists',
() =>
(...args: any[]) =>
commandExists(...args),
);
```
Also, imports are immutable. So it means that you might get some errors when trying to use `jest.spyOn` with starred imports. You might see an error like this:
```log
TypeError: Cannot redefine property: executeFrameHandlerStrategy
at Function.defineProperty (<anonymous>)
20 | import { AuthResolverContext } from '../types';
21 |
> 22 | const mockFrameHandler = jest.spyOn(
| ^
23 | helpers,
24 | 'executeFrameHandlerStrategy',
25 | ) as unknown as jest.MockedFunction<
```
This happens when you try to do `import * as something from './something'` and then `jest.spyOn(something, 'test)`. You will need to add a `jest.mock` call to mock out the required starred import to return `jest.fn()` functions from the start. Something like this fixes the above test:
```ts
jest.mock('../../helpers', () => ({
executeFrameHandlerStrategy: jest.fn(),
}));
```
You can also remove any occurrence of `hot(App)` and any import of `react-hot-loader` if you're using the that package locally, as all this has now been replaced with [React Refresh](https://www.npmjs.com/package/react-refresh) which you will get out of the box with the new CLI.
**Note** If you're experiencing difficulties with running tests after the migration, please reach out to us on Discord to see if we can help, or raise an issue. But in the meantime you can switch back to the existing behaviour by using the following config in your root `package.json`.
```json
"jest": {
"transform": {
"\\.(js|jsx|ts|tsx|mjs|cjs)$": "@backstage/cli/config/jestSucraseTransform.js",
"\\.(bmp|gif|jpg|jpeg|png|frag|xml|svg|eot|woff|woff2|ttf)$": "@backstage/cli/config/jestFileTransform.js",
"\\.(yaml)$": "jest-transform-yaml"
}
}
```
- bf5e9030eb: Updated dependency `msw` to `^0.45.0`.
- Updated dependencies
- @backstage/config-loader@1.1.4-next.0
- @backstage/release-manifests@0.0.6-next.0
## 0.18.1
### Patch Changes
+9 -9
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/cli",
"description": "CLI for developing Backstage plugins and apps",
"version": "0.18.1",
"version": "0.18.2-next.0",
"private": false,
"publishConfig": {
"access": "public"
@@ -33,9 +33,9 @@
"dependencies": {
"@backstage/cli-common": "^0.1.9",
"@backstage/config": "^1.0.1",
"@backstage/config-loader": "^1.1.3",
"@backstage/config-loader": "^1.1.4-next.0",
"@backstage/errors": "^1.1.0",
"@backstage/release-manifests": "^0.0.5",
"@backstage/release-manifests": "^0.0.6-next.0",
"@backstage/types": "^1.0.0",
"@manypkg/get-packages": "^1.1.3",
"@octokit/request": "^6.0.0",
@@ -129,13 +129,13 @@
"zod": "^3.11.6"
},
"devDependencies": {
"@backstage/backend-common": "^0.15.0",
"@backstage/backend-common": "^0.15.1-next.0",
"@backstage/config": "^1.0.1",
"@backstage/core-app-api": "^1.0.5",
"@backstage/core-components": "^0.11.0",
"@backstage/core-plugin-api": "^1.0.5",
"@backstage/dev-utils": "^1.0.5",
"@backstage/test-utils": "^1.1.3",
"@backstage/core-app-api": "^1.0.6-next.0",
"@backstage/core-components": "^0.11.1-next.0",
"@backstage/core-plugin-api": "^1.0.6-next.0",
"@backstage/dev-utils": "^1.0.6-next.0",
"@backstage/test-utils": "^1.1.4-next.0",
"@backstage/theme": "^0.2.16",
"@types/diff": "^5.0.0",
"@types/express": "^4.17.6",