You're probably aware of this, but since this repo is referenced in the backstage.io tutorials documentation, I thought I'd point out that there are a number of compilation errors after bumping versions. I ran into this when I was trying to follow steps to build my own starting with create-app and used this example for, e.g. apis.ts which caused this compile error:
$ tsc
packages/app/src/App.tsx:32:3 - error TS2741: Property '[Symbol.iterator]' is missing in type '(config: ConfigApi) => ApiRegistry' but required in type 'Iterable<ApiFactory<unknown, unknown, { [x: string]: unknown; }>>'.
32 apis,
~~~~
node_modules/typescript/lib/lib.es2015.iterable.d.ts:51:5
51 [Symbol.iterator](): Iterator<T>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'[Symbol.iterator]' is declared here.
Found 1 error.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
So I'm wondering if this repo should even be referenced anymore, and if so, needs updating, or just point people at the example app in the backstage.io repo?
Steps to reproduce:
Edit package.json to upgrade backstage-cli to add the versions:bump command (and allow node 14):
yarn install and then yarn tsc throws quite a number of errors, most of which can be resolved by seeing the individual package or plugin READMEs to see what's changed....
simple-backstage-app$ yarn tsc
yarn run v1.22.10
$ tsc
packages/app/src/apis.ts:34:10 - error TS2305: Module '"../../../node_modules/@backstage/plugin-tech-radar/dist"' has no exported member 'techRadarApiRef'.
34 import { techRadarApiRef, TechRadar } from '@backstage/plugin-tech-radar';
~~~~~~~~~~~~~~~
packages/app/src/apis.ts:34:27 - error TS2305: Module '"../../../node_modules/@backstage/plugin-tech-radar/dist"' has no exported member 'TechRadar'.
34 import { techRadarApiRef, TechRadar } from '@backstage/plugin-tech-radar';
~~~~~~~~~
packages/app/src/apis.ts:84:21 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'Options'.
84 new CircleCIApi(`${backendUrl}/proxy/circleci/api`),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/app/src/App.tsx:15:3 - error TS2741: Property '[Symbol.iterator]' is missing in type '(config: ConfigApi) => ApiRegistry' but required in type 'Iterable<ApiFactory<unknown, unknown, { [x: string]: unknown; }>>'.
15 apis,
~~~~
node_modules/typescript/lib/lib.es2015.iterable.d.ts:51:5
51 [Symbol.iterator](): Iterator<T>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'[Symbol.iterator]' is declared here.
packages/app/src/App.tsx:48:10 - error TS2604: JSX element type 'AppRoutes' does not have any construct or call signatures.
48 <AppRoutes />
~~~~~~~~~
packages/app/src/sidebar.tsx:15:3 - error TS2305: Module '"../../../node_modules/@backstage/core/dist"' has no exported member 'SidebarUserSettings'.
15 SidebarUserSettings,
~~~~~~~~~~~~~~~~~~~
packages/app/src/sidebar.tsx:16:3 - error TS2305: Module '"../../../node_modules/@backstage/core/dist"' has no exported member 'SidebarThemeToggle'.
16 SidebarThemeToggle,
~~~~~~~~~~~~~~~~~~
packages/app/src/sidebar.tsx:17:3 - error TS2305: Module '"../../../node_modules/@backstage/core/dist"' has no exported member 'SidebarPinButton'.
17 SidebarPinButton,
~~~~~~~~~~~~~~~~
packages/app/src/sidebar.tsx:18:3 - error TS2305: Module '"../../../node_modules/@backstage/core/dist"' has no exported member 'DefaultProviderSettings'.
18 DefaultProviderSettings,
~~~~~~~~~~~~~~~~~~~~~~~
packages/backend/src/index.ts:38:22 - error TS2322: Type 'import("/Users/alan/src/simple-backstage-app/node_modules/knex/types/index")<any, unknown[]>' is not assignable to type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/knex/types/index")<any, unknown[]>'.
Types of property 'raw' are incompatible.
Type 'import("/Users/alan/src/simple-backstage-app/node_modules/knex/types/index").RawBuilder<any, any>' is not assignable to type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/knex/types/index").RawBuilder<any, any>'.
Types of parameters 'value' and 'value' are incompatible.
Type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/knex/types/index").Value' is not assignable to type 'import("/Users/alan/src/simple-backstage-app/node_modules/knex/types/index").Value'.
Type 'Raw<any>' is not assignable to type 'Value'.
Type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/knex/types/index").Raw<any>' is not assignable to type 'import("/Users/alan/src/simple-backstage-app/node_modules/knex/types/index").Raw<any>'.
The types of 'toSQL().bindings' are incompatible between these types.
Type 'readonly import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/knex/types/index").Value[]' is not assignable to type 'readonly import("/Users/alan/src/simple-backstage-app/node_modules/knex/types/index").Value[]'.
Type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/knex/types/index").Value' is not assignable to type 'import("/Users/alan/src/simple-backstage-app/node_modules/knex/types/index").Value'.
Type 'Raw<any>' is not assignable to type 'Value'.
38 return { logger, database, config };
~~~~~~~~
packages/backend/src/types.ts:7:3
7 database: Knex;
~~~~~~~~
The expected type comes from property 'database' which is declared here on type 'PluginEnvironment'
packages/backend/src/index.ts:43:25 - error TS2554: Expected 1 arguments, but got 0.
43 const configs = await loadBackendConfig();
~~~~~~~~~~~~~~~~~~~
node_modules/@backstage/backend-common/dist/index.d.ts:19:36
19 declare function loadBackendConfig(options: Options): Promise<Config>;
~~~~~~~~~~~~~~~~
An argument for 'options' was not provided.
packages/backend/src/index.ts:44:49 - error TS2345: Argument of type 'Config' is not assignable to parameter of type 'AppConfig[]'.
Type 'Config' is missing the following properties from type 'AppConfig[]': length, pop, push, concat, and 27 more.
44 const configReader = ConfigReader.fromConfigs(configs);
~~~~~~~
packages/backend/src/index.ts:45:35 - error TS2345: Argument of type 'Config' is not assignable to parameter of type 'AppConfig[]'.
45 const createEnv = makeCreateEnv(configs);
~~~~~~~
packages/backend/src/plugins/auth.ts:9:47 - error TS2741: Property 'getClient' is missing in type 'Knex<any, unknown[]>' but required in type 'PluginDatabaseManager'.
9 return await createRouter({ logger, config, database });
~~~~~~~~
node_modules/@backstage/backend-common/dist/index.d.ts:48:5
48 getClient(): Promise<knex>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~
'getClient' is declared here.
node_modules/@backstage/plugin-auth-backend/dist/index.d.ts:179:5
179 database: PluginDatabaseManager;
~~~~~~~~
The expected type comes from property 'database' which is declared here on type 'RouterOptions'
packages/backend/src/plugins/catalog.ts:18:46 - error TS2345: Argument of type '{ logger: winston.Logger; config: Config; }' is not assignable to parameter of type 'Options'.
Type '{ logger: Logger; config: Config; }' is missing the following properties from type 'Options': reader, processors, rulesEnforcer, policy
18 const locationReader = new LocationReaders({ logger, config });
~~~~~~~~~~~~~~~~~~
packages/backend/src/plugins/catalog.ts:20:51 - error TS2345: Argument of type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/knex/types/index")<any, unknown[]>' is not assignable to parameter of type 'import("/Users/alan/src/simple-backstage-app/node_modules/knex/types/index")<any, unknown[]>'.
Type 'Knex<any, unknown[]>' is missing the following properties from type 'Knex<any, unknown[]>': userParams, withUserParams, clear, onConflict
20 const db = await DatabaseManager.createDatabase(database, { logger });
~~~~~~~~
packages/backend/src/plugins/catalog.ts:21:27 - error TS2554: Expected 2 arguments, but got 1.
21 const entitiesCatalog = new DatabaseEntitiesCatalog(db);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@backstage/plugin-catalog-backend/dist/index.d.ts:242:37
242 constructor(database: Database, logger: Logger);
~~~~~~~~~~~~~~
An argument for 'logger' was not provided.
packages/backend/src/plugins/proxy.ts:9:47 - error TS2345: Argument of type '{ logger: winston.Logger; config: Config; pathPrefix: string; }' is not assignable to parameter of type 'RouterOptions'.
Object literal may only specify known properties, and 'pathPrefix' does not exist in type 'RouterOptions'.
9 return await createRouter({ logger, config, pathPrefix });
~~~~~~~~~~
packages/backend/src/plugins/scaffolder.ts:30:41 - error TS2345: Argument of type '{ client: { [x: string]: any; } & { [x: string]: any; } & Octokit & void & { paginate: PaginateInterface; } & RestEndpointMethods; }' is not assignable to parameter of type 'GithubPublisherParams'.
Type '{ client: { [x: string]: any; } & { [x: string]: any; } & Octokit & void & { paginate: PaginateInterface; } & RestEndpointMethods; }' is missing the following properties from type 'GithubPublisherParams': token, repoVisibility
30 const publisher = new GithubPublisher({ client: githubClient });
~~~~~~~~~~~~~~~~~~~~~~~~
packages/backend/src/plugins/scaffolder.ts:38:5 - error TS2322: Type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/@types/dockerode/index")' is not assignable to type 'import("/Users/alan/src/simple-backstage-app/node_modules/@types/dockerode/index")'.
The types returned by 'getService(...)' are incompatible between these types.
Property 'ID' is missing in type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/@types/dockerode/index").Service' but required in type 'import("/Users/alan/src/simple-backstage-app/node_modules/@types/dockerode/index").Service'.
38 dockerClient,
~~~~~~~~~~~~
node_modules/@types/dockerode/index.d.ts:1317:9
1317 ID: string;
~~
'ID' is declared here.
node_modules/@backstage/plugin-scaffolder-backend/dist/index.d.ts:323:5
323 dockerClient: Docker;
~~~~~~~~~~~~
The expected type comes from property 'dockerClient' which is declared here on type 'RouterOptions'
packages/backend/src/plugins/techdocs.ts:4:3 - error TS2305: Module '"../../../../node_modules/@backstage/plugin-techdocs-backend/dist"' has no exported member 'GithubPreparer'.
4 GithubPreparer,
~~~~~~~~~~~~~~
packages/backend/src/plugins/techdocs.ts:7:3 - error TS2305: Module '"../../../../node_modules/@backstage/plugin-techdocs-backend/dist"' has no exported member 'LocalPublish'.
7 LocalPublish,
~~~~~~~~~~~~
packages/backend/src/plugins/techdocs.ts:18:29 - error TS2554: Expected 2 arguments, but got 1.
18 const techdocsGenerator = new TechdocsGenerator(logger);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@backstage/techdocs-common/dist/index.d.ts:76:33
76 constructor(logger: Logger, config: Config);
~~~~~~~~~~~~~~
An argument for 'config' was not provided.
packages/backend/src/plugins/techdocs.ts:37:5 - error TS2322: Type 'import("/Users/alan/src/simple-backstage-app/packages/backend/node_modules/@types/dockerode/index")' is not assignable to type 'import("/Users/alan/src/simple-backstage-app/node_modules/@types/dockerode/index")'.
37 dockerClient,
~~~~~~~~~~~~
node_modules/@backstage/plugin-techdocs-backend/dist/index.d.ts:18:5
18 dockerClient: Docker;
~~~~~~~~~~~~
The expected type comes from property 'dockerClient' which is declared here on type 'RouterOptions'
Found 24 errors.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
simple-backstage-app$
Summary & Context
You're probably aware of this, but since this repo is referenced in the backstage.io tutorials documentation, I thought I'd point out that there are a number of compilation errors after bumping versions. I ran into this when I was trying to follow steps to build my own starting with
create-app
and used this example for, e.g.apis.ts
which caused this compile error:So I'm wondering if this repo should even be referenced anymore, and if so, needs updating, or just point people at the example app in the backstage.io repo?
Steps to reproduce:
Edit package.json to upgrade backstage-cli to add the versions:bump command (and allow node 14):
yarn install
to install it and thenyarn backstage-cli versions:bump
This results in a bunch of updated packages:
yarn install
and thenyarn tsc
throws quite a number of errors, most of which can be resolved by seeing the individual package or plugin READMEs to see what's changed....