@backstage/plugin-scaffolder-backend-module-azure 0.0.0-nightly-20231213021616

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 ADDED
@@ -0,0 +1,31 @@
1
+ # @backstage/plugin-scaffolder-backend-module-azure
2
+
3
+ ## 0.0.0-nightly-20231213021616
4
+
5
+ ### Minor Changes
6
+
7
+ - 219d7f0: Create new scaffolder module for external integrations
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @backstage/backend-common@0.0.0-nightly-20231213021616
13
+ - @backstage/plugin-scaffolder-node@0.0.0-nightly-20231213021616
14
+ - @backstage/integration@0.0.0-nightly-20231213021616
15
+ - @backstage/config@1.1.1
16
+ - @backstage/errors@1.2.3
17
+
18
+ ## 0.1.0-next.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 219d7f0: Create new scaffolder module for external integrations
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+ - @backstage/plugin-scaffolder-node@0.2.9-next.3
28
+ - @backstage/backend-common@0.20.0-next.3
29
+ - @backstage/config@1.1.1
30
+ - @backstage/errors@1.2.3
31
+ - @backstage/integration@1.8.0-next.1
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @backstage/plugin-scaffolder-backend-module-azure
2
+
3
+ The azure module for [@backstage/plugin-scaffolder-backend](https://www.npmjs.com/package/@backstage/plugin-scaffolder-backend).
4
+
5
+ _This plugin was created through the Backstage CLI_
@@ -0,0 +1,213 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var errors = require('@backstage/errors');
6
+ var integration = require('@backstage/integration');
7
+ var pluginScaffolderNode = require('@backstage/plugin-scaffolder-node');
8
+ var azureDevopsNodeApi = require('azure-devops-node-api');
9
+ var yaml = require('yaml');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var yaml__default = /*#__PURE__*/_interopDefaultLegacy(yaml);
14
+
15
+ const examples = [
16
+ {
17
+ description: "Initializes a git repository of the content in the workspace, and publishes it to Azure.",
18
+ example: yaml__default["default"].stringify({
19
+ steps: [
20
+ {
21
+ id: "publish",
22
+ action: "publish:azure",
23
+ name: "Publish to Azure",
24
+ input: {
25
+ repoUrl: "dev.azure.com?organization=organization&owner=project&repo=repo"
26
+ }
27
+ }
28
+ ]
29
+ })
30
+ },
31
+ {
32
+ description: "Add a description.",
33
+ example: yaml__default["default"].stringify({
34
+ steps: [
35
+ {
36
+ id: "publish",
37
+ action: "publish:azure",
38
+ name: "Publish to Azure",
39
+ input: {
40
+ repoUrl: "dev.azure.com?organization=organization&owner=project&repo=repo",
41
+ description: "Initialize a git repository"
42
+ }
43
+ }
44
+ ]
45
+ })
46
+ },
47
+ {
48
+ description: "Change the default branch.",
49
+ example: yaml__default["default"].stringify({
50
+ steps: [
51
+ {
52
+ id: "publish",
53
+ action: "publish:azure",
54
+ name: "Publish to Azure",
55
+ input: {
56
+ repoUrl: "dev.azure.com?organization=organization&owner=project&repo=repo",
57
+ description: "Initialize a git repository",
58
+ defaultBranch: "main"
59
+ }
60
+ }
61
+ ]
62
+ })
63
+ }
64
+ ];
65
+
66
+ function createPublishAzureAction(options) {
67
+ const { integrations, config } = options;
68
+ return pluginScaffolderNode.createTemplateAction({
69
+ id: "publish:azure",
70
+ examples,
71
+ description: "Initializes a git repository of the content in the workspace, and publishes it to Azure.",
72
+ schema: {
73
+ input: {
74
+ type: "object",
75
+ required: ["repoUrl"],
76
+ properties: {
77
+ repoUrl: {
78
+ title: "Repository Location",
79
+ type: "string"
80
+ },
81
+ description: {
82
+ title: "Repository Description",
83
+ type: "string"
84
+ },
85
+ defaultBranch: {
86
+ title: "Default Branch",
87
+ type: "string",
88
+ description: `Sets the default branch on the repository. The default value is 'master'`
89
+ },
90
+ gitCommitMessage: {
91
+ title: "Git Commit Message",
92
+ type: "string",
93
+ description: `Sets the commit message on the repository. The default value is 'initial commit'`
94
+ },
95
+ gitAuthorName: {
96
+ title: "Default Author Name",
97
+ type: "string",
98
+ description: `Sets the default author name for the commit. The default value is 'Scaffolder'`
99
+ },
100
+ gitAuthorEmail: {
101
+ title: "Default Author Email",
102
+ type: "string",
103
+ description: `Sets the default author email for the commit.`
104
+ },
105
+ sourcePath: {
106
+ title: "Source Path",
107
+ description: "Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.",
108
+ type: "string"
109
+ },
110
+ token: {
111
+ title: "Authentication Token",
112
+ type: "string",
113
+ description: "The token to use for authorization to Azure"
114
+ }
115
+ }
116
+ },
117
+ output: {
118
+ type: "object",
119
+ properties: {
120
+ remoteUrl: {
121
+ title: "A URL to the repository with the provider",
122
+ type: "string"
123
+ },
124
+ repoContentsUrl: {
125
+ title: "A URL to the root of the repository",
126
+ type: "string"
127
+ },
128
+ repositoryId: {
129
+ title: "The Id of the created repository",
130
+ type: "string"
131
+ },
132
+ commitHash: {
133
+ title: "The git commit hash of the initial commit",
134
+ type: "string"
135
+ }
136
+ }
137
+ }
138
+ },
139
+ async handler(ctx) {
140
+ var _a, _b;
141
+ const {
142
+ repoUrl,
143
+ defaultBranch = "master",
144
+ gitCommitMessage = "initial commit",
145
+ gitAuthorName,
146
+ gitAuthorEmail
147
+ } = ctx.input;
148
+ const { owner, repo, host, organization } = pluginScaffolderNode.parseRepoUrl(
149
+ repoUrl,
150
+ integrations
151
+ );
152
+ if (!organization) {
153
+ throw new errors.InputError(
154
+ `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing organization`
155
+ );
156
+ }
157
+ const url = `https://${host}/${organization}`;
158
+ const credentialProvider = integration.DefaultAzureDevOpsCredentialsProvider.fromIntegrations(integrations);
159
+ const credentials = await credentialProvider.getCredentials({ url });
160
+ if (credentials === void 0 && ctx.input.token === void 0) {
161
+ throw new errors.InputError(
162
+ `No credentials provided ${url}, please check your integrations config`
163
+ );
164
+ }
165
+ const authHandler = ctx.input.token || (credentials == null ? void 0 : credentials.type) === "pat" ? azureDevopsNodeApi.getPersonalAccessTokenHandler((_a = ctx.input.token) != null ? _a : credentials.token) : azureDevopsNodeApi.getBearerHandler(credentials.token);
166
+ const webApi = new azureDevopsNodeApi.WebApi(url, authHandler);
167
+ const client = await webApi.getGitApi();
168
+ const createOptions = { name: repo };
169
+ const returnedRepo = await client.createRepository(createOptions, owner);
170
+ if (!returnedRepo) {
171
+ throw new errors.InputError(
172
+ `Unable to create the repository with Organization ${organization}, Project ${owner} and Repo ${repo}.
173
+ Please make sure that both the Org and Project are typed corrected and exist.`
174
+ );
175
+ }
176
+ const remoteUrl = returnedRepo.remoteUrl;
177
+ if (!remoteUrl) {
178
+ throw new errors.InputError(
179
+ "No remote URL returned from create repository for Azure"
180
+ );
181
+ }
182
+ const repositoryId = returnedRepo.id;
183
+ if (!repositoryId) {
184
+ throw new errors.InputError("No Id returned from create repository for Azure");
185
+ }
186
+ const repoContentsUrl = remoteUrl;
187
+ const gitAuthorInfo = {
188
+ name: gitAuthorName ? gitAuthorName : config.getOptionalString("scaffolder.defaultAuthor.name"),
189
+ email: gitAuthorEmail ? gitAuthorEmail : config.getOptionalString("scaffolder.defaultAuthor.email")
190
+ };
191
+ const auth = ctx.input.token || (credentials == null ? void 0 : credentials.type) === "pat" ? {
192
+ username: "notempty",
193
+ password: (_b = ctx.input.token) != null ? _b : credentials.token
194
+ } : { token: credentials.token };
195
+ const commitResult = await pluginScaffolderNode.initRepoAndPush({
196
+ dir: pluginScaffolderNode.getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),
197
+ remoteUrl,
198
+ defaultBranch,
199
+ auth,
200
+ logger: ctx.logger,
201
+ commitMessage: gitCommitMessage ? gitCommitMessage : config.getOptionalString("scaffolder.defaultCommitMessage"),
202
+ gitAuthorInfo
203
+ });
204
+ ctx.output("commitHash", commitResult == null ? void 0 : commitResult.commitHash);
205
+ ctx.output("remoteUrl", remoteUrl);
206
+ ctx.output("repoContentsUrl", repoContentsUrl);
207
+ ctx.output("repositoryId", repositoryId);
208
+ }
209
+ });
210
+ }
211
+
212
+ exports.createPublishAzureAction = createPublishAzureAction;
213
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/actions/azure.examples.ts","../src/actions/azure.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\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Azure.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:azure',\n name: 'Publish to Azure',\n input: {\n repoUrl:\n 'dev.azure.com?organization=organization&owner=project&repo=repo',\n },\n },\n ],\n }),\n },\n {\n description: 'Add a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:azure',\n name: 'Publish to Azure',\n input: {\n repoUrl:\n 'dev.azure.com?organization=organization&owner=project&repo=repo',\n description: 'Initialize a git repository',\n },\n },\n ],\n }),\n },\n {\n description: 'Change the default branch.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:azure',\n name: 'Publish to Azure',\n input: {\n repoUrl:\n 'dev.azure.com?organization=organization&owner=project&repo=repo',\n description: 'Initialize a git repository',\n defaultBranch: 'main',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 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\nimport { InputError } from '@backstage/errors';\nimport {\n DefaultAzureDevOpsCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n initRepoAndPush,\n getRepoSourceDirectory,\n parseRepoUrl,\n createTemplateAction,\n} from '@backstage/plugin-scaffolder-node';\nimport { GitRepositoryCreateOptions } from 'azure-devops-node-api/interfaces/GitInterfaces';\nimport {\n getBearerHandler,\n getPersonalAccessTokenHandler,\n WebApi,\n} from 'azure-devops-node-api';\nimport { Config } from '@backstage/config';\nimport { examples } from './azure.examples';\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to Azure.\n * @public\n */\nexport function createPublishAzureAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n description?: string;\n defaultBranch?: string;\n sourcePath?: string;\n token?: string;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n }>({\n id: 'publish:azure',\n examples,\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Azure.',\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n description: {\n title: 'Repository Description',\n type: 'string',\n },\n defaultBranch: {\n title: 'Default Branch',\n type: 'string',\n description: `Sets the default branch on the repository. The default value is 'master'`,\n },\n gitCommitMessage: {\n title: 'Git Commit Message',\n type: 'string',\n description: `Sets the commit message on the repository. The default value is 'initial commit'`,\n },\n gitAuthorName: {\n title: 'Default Author Name',\n type: 'string',\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Default Author Email',\n type: 'string',\n description: `Sets the default author email for the commit.`,\n },\n sourcePath: {\n title: 'Source Path',\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.',\n type: 'string',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to Azure',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n remoteUrl: {\n title: 'A URL to the repository with the provider',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the root of the repository',\n type: 'string',\n },\n repositoryId: {\n title: 'The Id of the created repository',\n type: 'string',\n },\n commitHash: {\n title: 'The git commit hash of the initial commit',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n defaultBranch = 'master',\n gitCommitMessage = 'initial commit',\n gitAuthorName,\n gitAuthorEmail,\n } = ctx.input;\n\n const { owner, repo, host, organization } = parseRepoUrl(\n repoUrl,\n integrations,\n );\n\n if (!organization) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing organization`,\n );\n }\n\n const url = `https://${host}/${organization}`;\n const credentialProvider =\n DefaultAzureDevOpsCredentialsProvider.fromIntegrations(integrations);\n const credentials = await credentialProvider.getCredentials({ url: url });\n\n if (credentials === undefined && ctx.input.token === undefined) {\n throw new InputError(\n `No credentials provided ${url}, please check your integrations config`,\n );\n }\n\n const authHandler =\n ctx.input.token || credentials?.type === 'pat'\n ? getPersonalAccessTokenHandler(ctx.input.token ?? credentials!.token)\n : getBearerHandler(credentials!.token);\n\n const webApi = new WebApi(url, authHandler);\n const client = await webApi.getGitApi();\n const createOptions: GitRepositoryCreateOptions = { name: repo };\n const returnedRepo = await client.createRepository(createOptions, owner);\n\n if (!returnedRepo) {\n throw new InputError(\n `Unable to create the repository with Organization ${organization}, Project ${owner} and Repo ${repo}.\n Please make sure that both the Org and Project are typed corrected and exist.`,\n );\n }\n const remoteUrl = returnedRepo.remoteUrl;\n\n if (!remoteUrl) {\n throw new InputError(\n 'No remote URL returned from create repository for Azure',\n );\n }\n const repositoryId = returnedRepo.id;\n\n if (!repositoryId) {\n throw new InputError('No Id returned from create repository for Azure');\n }\n\n // blam: Repo contents is serialized into the path,\n // so it's just the base path I think\n const repoContentsUrl = remoteUrl;\n\n const gitAuthorInfo = {\n name: gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n const auth =\n ctx.input.token || credentials?.type === 'pat'\n ? {\n username: 'notempty',\n password: ctx.input.token ?? credentials!.token,\n }\n : { token: credentials!.token };\n\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),\n remoteUrl,\n defaultBranch,\n auth: auth,\n logger: ctx.logger,\n commitMessage: gitCommitMessage\n ? gitCommitMessage\n : config.getOptionalString('scaffolder.defaultCommitMessage'),\n gitAuthorInfo,\n });\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n ctx.output('repositoryId', repositoryId);\n },\n });\n}\n"],"names":["yaml","createTemplateAction","parseRepoUrl","InputError","DefaultAzureDevOpsCredentialsProvider","getPersonalAccessTokenHandler","getBearerHandler","WebApi","initRepoAndPush","getRepoSourceDirectory"],"mappings":";;;;;;;;;;;;;;AAmBO,MAAM,QAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WACE,EAAA,0FAAA;AAAA,IACF,OAAA,EAASA,yBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAAA;AAAA,UACJ,MAAQ,EAAA,eAAA;AAAA,UACR,IAAM,EAAA,kBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OACE,EAAA,iEAAA;AAAA,WACJ;AAAA,SACF;AAAA,OACF;AAAA,KACD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AAO,kBAAkB,gCAAgC,CAAA;AAAA,OAC/D,CAAA;AAEA,MAAA,MAAM,OACJ,GAAI,CAAA,KAAA,CAAM,KAAS,IAAA,CAAA,WAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,WAAA,CAAa,UAAS,KACrC,GAAA;AAAA,QACE,QAAU,EAAA,UAAA;AAAA,QACV,QAAU,EAAA,CAAA,EAAA,GAAA,GAAA,CAAI,KAAM,CAAA,KAAA,KAAV,YAAmB,WAAa,CAAA,KAAA;AAAA,OAE5C,GAAA,EAAE,KAAO,EAAA,WAAA,CAAa,KAAM,EAAA,CAAA;AAElC,MAAM,MAAA,YAAA,GAAe,MAAMK,oCAAgB,CAAA;AAAA,QACzC,KAAKC,2CAAuB,CAAA,GAAA,CAAI,aAAe,EAAA,GAAA,CAAI,MAAM,UAAU,CAAA;AAAA,QACnE,SAAA;AAAA,QACA,aAAA;AAAA,QACA,IAAA;AAAA,QACA,QAAQ,GAAI,CAAA,MAAA;AAAA,QACZ,aAAe,EAAA,gBAAA,GACX,gBACA,GAAA,MAAA,CAAO,kBAAkB,iCAAiC,CAAA;AAAA,QAC9D,aAAA;AAAA,OACD,CAAA,CAAA;AAED,MAAI,GAAA,CAAA,MAAA,CAAO,YAAc,EAAA,YAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,YAAA,CAAc,UAAU,CAAA,CAAA;AACjD,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA,CAAA;AACjC,MAAI,GAAA,CAAA,MAAA,CAAO,mBAAmB,eAAe,CAAA,CAAA;AAC7C,MAAI,GAAA,CAAA,MAAA,CAAO,gBAAgB,YAAY,CAAA,CAAA;AAAA,KACzC;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
@@ -0,0 +1,25 @@
1
+ import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder-node';
2
+ import * as _backstage_types from '@backstage/types';
3
+ import { ScmIntegrationRegistry } from '@backstage/integration';
4
+ import { Config } from '@backstage/config';
5
+
6
+ /**
7
+ * Creates a new action that initializes a git repository of the content in the workspace
8
+ * and publishes it to Azure.
9
+ * @public
10
+ */
11
+ declare function createPublishAzureAction(options: {
12
+ integrations: ScmIntegrationRegistry;
13
+ config: Config;
14
+ }): _backstage_plugin_scaffolder_node.TemplateAction<{
15
+ repoUrl: string;
16
+ description?: string | undefined;
17
+ defaultBranch?: string | undefined;
18
+ sourcePath?: string | undefined;
19
+ token?: string | undefined;
20
+ gitCommitMessage?: string | undefined;
21
+ gitAuthorName?: string | undefined;
22
+ gitAuthorEmail?: string | undefined;
23
+ }, _backstage_types.JsonObject>;
24
+
25
+ export { createPublishAzureAction };
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@backstage/plugin-scaffolder-backend-module-azure",
3
+ "description": "The azure module for @backstage/plugin-scaffolder-backend",
4
+ "version": "0.0.0-nightly-20231213021616",
5
+ "main": "dist/index.cjs.js",
6
+ "types": "dist/index.d.ts",
7
+ "license": "Apache-2.0",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "main": "dist/index.cjs.js",
11
+ "types": "dist/index.d.ts"
12
+ },
13
+ "backstage": {
14
+ "role": "backend-plugin-module"
15
+ },
16
+ "scripts": {
17
+ "start": "backstage-cli package start",
18
+ "build": "backstage-cli package build",
19
+ "lint": "backstage-cli package lint",
20
+ "test": "backstage-cli package test",
21
+ "clean": "backstage-cli package clean",
22
+ "prepack": "backstage-cli package prepack",
23
+ "postpack": "backstage-cli package postpack"
24
+ },
25
+ "dependencies": {
26
+ "@backstage/backend-common": "^0.0.0-nightly-20231213021616",
27
+ "@backstage/config": "^1.1.1",
28
+ "@backstage/errors": "^1.2.3",
29
+ "@backstage/integration": "^0.0.0-nightly-20231213021616",
30
+ "@backstage/plugin-scaffolder-node": "^0.0.0-nightly-20231213021616",
31
+ "azure-devops-node-api": "^11.0.1",
32
+ "yaml": "^2.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@backstage/cli": "^0.0.0-nightly-20231213021616"
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ]
40
+ }