Version Packages

This commit is contained in:
github-actions[bot]
2022-09-20 11:52:02 +00:00
parent 2a7a21e9c5
commit 30882884a4
520 changed files with 9779 additions and 5672 deletions
+192
View File
@@ -1,5 +1,197 @@
# @backstage/create-app
## 0.4.31
### Patch Changes
- 6ff94d60d5: Removed usage of the deprecated `diff` command in the root `package.json`.
To make this change in an existing app, make the following change in the root `package.json`:
```diff
- "diff": "lerna run diff --",
```
- c1f1a4c760: The Backstage packages and plugins have all been updated to support React Router v6 stable. The `create-app` template has not been migrated yet, but if you want to migrate your own app or plugins, check out the [migration guide](https://backstage.io/docs/tutorials/react-router-stable-migration).
- e83de28e36: Fix typo in the documentation
- 7d47def9c4: Removed dependency on `@types/jest`.
- 208d6780c9: The `packages/backend/Dockerfile` received a couple of updates, it now looks as follows:
```Dockerfile
FROM node:16-bullseye-slim
# Install sqlite3 dependencies. You can skip this if you don't use sqlite3 in the image,
# in which case you should also move better-sqlite3 to "devDependencies" in package.json.
RUN apt-get update && \
apt-get install -y --no-install-recommends libsqlite3-dev python3 build-essential && \
rm -rf /var/lib/apt/lists/* && \
yarn config set python /usr/bin/python3
# From here on we use the least-privileged `node` user to run the backend.
USER node
WORKDIR /app
# This switches many Node.js dependencies to production mode.
ENV NODE_ENV production
# Copy repo skeleton first, to avoid unnecessary docker cache invalidation.
# The skeleton contains the package.json of each package in the monorepo,
# and along with yarn.lock and the root package.json, that's enough to run yarn install.
COPY --chown=node:node yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
# Then copy the rest of the backend bundle, along with any other files we might want.
COPY --chown=node:node packages/backend/dist/bundle.tar.gz app-config*.yaml ./
RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
```
The two notable changes are that a `USER node` instruction has been added and the ordering of instructions has been changed accordingly. This means that the app will now be running using the least-privileged `node` user. In order for this to work we now need to make sure that all app files are owned by the `node` user, which we do by adding the `--chown=node:node` option to the `COPY` instructions.
The second change is the addition of `ENV NODE_ENV production`, which ensured that all Node.js modules run in production mode. If you apply this change to an existing app, note that one of the more significant changes is that this switches the log formatting to use the default production format, JSON. Rather than your log lines looking like this:
```log
2022-08-10T11:36:05.478Z catalog info Performing database migration type=plugin
```
They will now look like this:
```log
{"level":"info","message":"Performing database migration","plugin":"catalog","service":"backstage","type":"plugin"}
```
If you wish to keep the existing format, you can override this change by applying the following change to `packages/backend/src/index.ts`:
```diff
getRootLogger,
+ setRootLogger,
+ createRootLogger,
+ coloredFormat,
useHotMemoize,
...
ServerTokenManager,
} from '@backstage/backend-common';
...
async function main() {
+ setRootLogger(createRootLogger({ format: coloredFormat }));
+
const config = await loadBackendConfig({
```
- 49416194e8: Adds `IdentityApi` configuration to `create-app` scaffolding templates.
To migrate to the new `IdentityApi`, edit the `packages/backend/src/index.ts` adding the following import:
```typescript
import { DefaultIdentityClient } from '@backstage/plugin-auth-node';
```
Use the factory function to create an `IdentityApi` in the `makeCreateEnv` function and return it from the
function as follows:
```typescript
function makeCreateEnv(config: Config) {
...
const identity = DefaultIdentityClient.create({
discovery,
});
...
return {
...,
identity
}
}
```
Backend plugins can be upgraded to work with this new `IdentityApi`.
Add `identity` to the `RouterOptions` type.
```typescript
export interface RouterOptions {
...
identity: IdentityApi;
}
```
Then you can use the `IdentityApi` from the plugin.
```typescript
export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {
const { identity } = options;
router.get('/user', async (req, res) => {
const user = await identity.getIdentity({ request: req });
...
```
- 8d886dd33e: Added `yarn new` as one of the scripts installed by default, which calls `backstage-cli new`. This script replaces `create-plugin`, which you can now remove if you want to. It is kept in the `create-app` template for backwards compatibility.
The `remove-plugin` command has been removed, as it has been removed from the Backstage CLI.
To apply these changes to an existing app, make the following change to the root `package.json`:
```diff
- "remove-plugin": "backstage-cli remove-plugin"
+ "new": "backstage-cli new --scope internal"
```
- c3c90280be: The options part of `DatabaseManager.fromConfig` now accepts an optional logger
field. You may want to supply that logger in your backend initialization code to
ensure that you can get relevant logging data when things happen related to the
connection pool.
In `packages/backend/src/index.ts`:
```diff
function makeCreateEnv(config: Config) {
const root = getRootLogger();
...
- const databaseManager = DatabaseManager.fromConfig(config);
+ const databaseManager = DatabaseManager.fromConfig(config, { logger: root });
```
- a578558180: Updated the root `package.json` to use the new `backstage-cli repo clean` command.
To apply this change to an existing project, make the following change to the root `package.json`:
```diff
- "clean": "backstage-cli clean && lerna run clean",
+ "clean": "backstage-cli repo clean",
```
- c0a08fd08c: Added `EntityLinksCard` to the system `EntityPage`.
For an existing installation where you want to display the links card for entity pages of kind `system` you should make the following adjustment to `packages/app/src/components/catalog/EntityPage.tsx`
```diff
const systemPage = (
...
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
+ <Grid item md={4} xs={12}>
+ <EntityLinksCard />
+ </Grid>
- <Grid item md={6}>
+ <Grid item md={8}>
<EntityHasComponentsCard variant="gridItem" />
</Grid>
...
);
```
- Updated dependencies
- @backstage/cli-common@0.1.10
## 0.4.31-next.3
### Patch Changes
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/create-app",
"description": "A CLI that helps you create your own Backstage app",
"version": "0.4.31-next.3",
"version": "0.4.31",
"publishConfig": {
"access": "public"
},
@@ -32,7 +32,7 @@
"start": "nodemon --"
},
"dependencies": {
"@backstage/cli-common": "^0.1.10-next.0",
"@backstage/cli-common": "^0.1.10",
"chalk": "^4.0.0",
"commander": "^9.1.0",
"fs-extra": "10.1.0",
@@ -42,7 +42,7 @@
"recursive-readdir": "^2.2.2"
},
"devDependencies": {
"@backstage/cli": "^0.19.0-next.3",
"@backstage/cli": "^0.19.0",
"@types/fs-extra": "^9.0.1",
"@types/inquirer": "^8.1.3",
"@types/node": "^16.11.26",