@techdocs/cli 1.8.12 → 1.8.13
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 +12 -0
- package/dist/cjs/{migrate-BZzIXl_A.cjs.js → migrate-Ddd_MQkE.cjs.js} +4 -4
- package/dist/cjs/migrate-Ddd_MQkE.cjs.js.map +1 -0
- package/dist/cjs/{publish-CnXRqKHz.cjs.js → publish-DH7Mbt7b.cjs.js} +4 -4
- package/dist/cjs/publish-DH7Mbt7b.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +11 -11
- package/dist/index.cjs.js +3 -3
- package/package.json +4 -4
- package/dist/cjs/migrate-BZzIXl_A.cjs.js.map +0 -1
- package/dist/cjs/publish-CnXRqKHz.cjs.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
+
## 1.8.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- aeae3be: Import discovery from backend-defaults instead of backend-common
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-defaults@0.3.1
|
|
10
|
+
- @backstage/plugin-techdocs-node@1.12.6
|
|
11
|
+
- @backstage/catalog-model@1.5.0
|
|
12
|
+
- @backstage/cli-common@0.1.14
|
|
13
|
+
- @backstage/config@1.2.0
|
|
14
|
+
|
|
3
15
|
## 1.8.12
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var discovery = require('@backstage/backend-defaults/discovery');
|
|
4
4
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
5
5
|
var utility = require('./utility-CsspJYjU.cjs.js');
|
|
6
6
|
var PublisherConfig = require('./PublisherConfig-Cn5i8vF5.cjs.js');
|
|
@@ -12,8 +12,8 @@ require('@backstage/config');
|
|
|
12
12
|
async function migrate(opts) {
|
|
13
13
|
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
14
14
|
const config = PublisherConfig.PublisherConfig.getValidConfig(opts);
|
|
15
|
-
const discovery =
|
|
16
|
-
const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery });
|
|
15
|
+
const discovery$1 = discovery.HostDiscovery.fromConfig(config);
|
|
16
|
+
const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery: discovery$1 });
|
|
17
17
|
if (!publisher.migrateDocsCase) {
|
|
18
18
|
throw new Error(`Migration not implemented for ${opts.publisherType}`);
|
|
19
19
|
}
|
|
@@ -35,4 +35,4 @@ async function migrate(opts) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
exports.default = migrate;
|
|
38
|
-
//# sourceMappingURL=migrate-
|
|
38
|
+
//# sourceMappingURL=migrate-Ddd_MQkE.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-Ddd_MQkE.cjs.js","sources":["../../src/commands/migrate/migrate.ts"],"sourcesContent":["/*\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 { HostDiscovery } from '@backstage/backend-defaults/discovery';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function migrate(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n if (!publisher.migrateDocsCase) {\n throw new Error(`Migration not implemented for ${opts.publisherType}`);\n }\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n throw new Error('');\n }\n\n // Validate and parse migration arguments.\n const removeOriginal = opts.removeOriginal;\n const numericConcurrency = parseInt(opts.concurrency, 10);\n\n if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {\n throw new Error(\n `Concurrency must be a number greater than 1. ${opts.concurrency} provided.`,\n );\n }\n\n await publisher.migrateDocsCase({\n concurrency: numericConcurrency,\n removeOriginal,\n });\n}\n"],"names":["createLogger","PublisherConfig","discovery","HostDiscovery","Publisher"],"mappings":";;;;;;;;;;;AAsBA,eAA8B,QAAQ,IAAoB,EAAA;AACxD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAAC,WAAA,GAAYC,uBAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,aAAQF,aAAW,CAAA,CAAA;AAE1E,EAAI,IAAA,CAAC,UAAU,eAAiB,EAAA;AAC9B,IAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,IAAA,CAAK,aAAa,CAAE,CAAA,CAAA,CAAA;AAAA,GACvE;AAGA,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAM,MAAA,IAAI,MAAM,EAAE,CAAA,CAAA;AAAA,GACpB;AAGA,EAAA,MAAM,iBAAiB,IAAK,CAAA,cAAA,CAAA;AAC5B,EAAA,MAAM,kBAAqB,GAAA,QAAA,CAAS,IAAK,CAAA,WAAA,EAAa,EAAE,CAAA,CAAA;AAExD,EAAA,IAAI,CAAC,MAAO,CAAA,SAAA,CAAU,kBAAkB,CAAA,IAAK,sBAAsB,CAAG,EAAA;AACpE,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,6CAAA,EAAgD,KAAK,WAAW,CAAA,UAAA,CAAA;AAAA,KAClE,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,UAAU,eAAgB,CAAA;AAAA,IAC9B,WAAa,EAAA,kBAAA;AAAA,IACb,cAAA;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var path = require('path');
|
|
4
4
|
var utility = require('./utility-CsspJYjU.cjs.js');
|
|
5
|
-
var
|
|
5
|
+
var discovery = require('@backstage/backend-defaults/discovery');
|
|
6
6
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
7
7
|
var PublisherConfig = require('./PublisherConfig-Cn5i8vF5.cjs.js');
|
|
8
8
|
require('winston');
|
|
@@ -13,8 +13,8 @@ require('@backstage/config');
|
|
|
13
13
|
async function publish(opts) {
|
|
14
14
|
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
15
15
|
const config = PublisherConfig.PublisherConfig.getValidConfig(opts);
|
|
16
|
-
const discovery =
|
|
17
|
-
const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery });
|
|
16
|
+
const discovery$1 = discovery.HostDiscovery.fromConfig(config);
|
|
17
|
+
const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery: discovery$1 });
|
|
18
18
|
const { isAvailable } = await publisher.getReadiness();
|
|
19
19
|
if (!isAvailable) {
|
|
20
20
|
return Promise.reject(new Error(""));
|
|
@@ -33,4 +33,4 @@ async function publish(opts) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
exports.default = publish;
|
|
36
|
-
//# sourceMappingURL=publish-
|
|
36
|
+
//# sourceMappingURL=publish-DH7Mbt7b.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-DH7Mbt7b.cjs.js","sources":["../../src/commands/publish/publish.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { HostDiscovery } from '@backstage/backend-defaults/discovery';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(opts: OptionValues): Promise<any> {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = opts.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(opts.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","discovery","HostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;;;AAwBA,eAA8B,QAAQ,IAAkC,EAAA;AACtE,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAAC,WAAA,GAAYC,uBAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,aAAQF,aAAW,CAAA,CAAA;AAG1E,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,EAAE,CAAC,CAAA,CAAA;AAAA,GACrC;AAEA,EAAM,MAAA,CAAC,WAAW,IAAM,EAAA,IAAI,IAAI,IAAK,CAAA,MAAA,CAAO,MAAM,GAAG,CAAA,CAAA;AACrD,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,IAAA;AAAA,IACA,QAAU,EAAA;AAAA,MACR,SAAA;AAAA,MACA,IAAA;AAAA,KACF;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,SAAA,GAAYG,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,SAAU,CAAA,OAAA,CAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAE7C,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
|
|
@@ -1632,7 +1632,7 @@
|
|
|
1632
1632
|
}
|
|
1633
1633
|
},
|
|
1634
1634
|
{
|
|
1635
|
-
"path": "../backend-
|
|
1635
|
+
"path": "../backend-defaults/config.d.ts",
|
|
1636
1636
|
"value": {
|
|
1637
1637
|
"type": "object",
|
|
1638
1638
|
"properties": {
|
|
@@ -1640,6 +1640,7 @@
|
|
|
1640
1640
|
"type": "object",
|
|
1641
1641
|
"properties": {
|
|
1642
1642
|
"auth": {
|
|
1643
|
+
"description": "Options used by the default auth, httpAuth and userInfo services.",
|
|
1643
1644
|
"type": "object",
|
|
1644
1645
|
"properties": {
|
|
1645
1646
|
"dangerouslyDisableDefaultAuthPolicy": {
|
|
@@ -1965,17 +1966,17 @@
|
|
|
1965
1966
|
}
|
|
1966
1967
|
},
|
|
1967
1968
|
"discovery": {
|
|
1968
|
-
"description": "
|
|
1969
|
+
"description": "Options used by the default discovery service.",
|
|
1969
1970
|
"type": "object",
|
|
1970
1971
|
"properties": {
|
|
1971
1972
|
"endpoints": {
|
|
1972
|
-
"description": "
|
|
1973
|
+
"description": "A list of target baseUrls and the associated plugins.",
|
|
1973
1974
|
"type": "array",
|
|
1974
1975
|
"items": {
|
|
1975
1976
|
"type": "object",
|
|
1976
1977
|
"properties": {
|
|
1977
1978
|
"target": {
|
|
1978
|
-
"description": "The target
|
|
1979
|
+
"description": "The target base URL to use for the plugin.\n\nCan be either a string or an object with internal and external keys.\nTargets with `{{pluginId}}` or `{{ pluginId }} in the URL will be replaced with the plugin ID.",
|
|
1979
1980
|
"anyOf": [
|
|
1980
1981
|
{
|
|
1981
1982
|
"type": "object",
|
|
@@ -1998,7 +1999,7 @@
|
|
|
1998
1999
|
]
|
|
1999
2000
|
},
|
|
2000
2001
|
"plugins": {
|
|
2001
|
-
"description": "Array of plugins which use the target
|
|
2002
|
+
"description": "Array of plugins which use the target base URL.",
|
|
2002
2003
|
"type": "array",
|
|
2003
2004
|
"items": {
|
|
2004
2005
|
"type": "string"
|
|
@@ -2021,7 +2022,7 @@
|
|
|
2021
2022
|
}
|
|
2022
2023
|
},
|
|
2023
2024
|
{
|
|
2024
|
-
"path": "../backend-
|
|
2025
|
+
"path": "../backend-app-api/config.d.ts",
|
|
2025
2026
|
"value": {
|
|
2026
2027
|
"type": "object",
|
|
2027
2028
|
"properties": {
|
|
@@ -2029,7 +2030,6 @@
|
|
|
2029
2030
|
"type": "object",
|
|
2030
2031
|
"properties": {
|
|
2031
2032
|
"auth": {
|
|
2032
|
-
"description": "Options used by the default auth, httpAuth and userInfo services.",
|
|
2033
2033
|
"type": "object",
|
|
2034
2034
|
"properties": {
|
|
2035
2035
|
"dangerouslyDisableDefaultAuthPolicy": {
|
|
@@ -2355,17 +2355,17 @@
|
|
|
2355
2355
|
}
|
|
2356
2356
|
},
|
|
2357
2357
|
"discovery": {
|
|
2358
|
-
"description": "
|
|
2358
|
+
"description": "Discovery options.",
|
|
2359
2359
|
"type": "object",
|
|
2360
2360
|
"properties": {
|
|
2361
2361
|
"endpoints": {
|
|
2362
|
-
"description": "
|
|
2362
|
+
"description": "Endpoints\n\nA list of target baseUrls and the associated plugins.",
|
|
2363
2363
|
"type": "array",
|
|
2364
2364
|
"items": {
|
|
2365
2365
|
"type": "object",
|
|
2366
2366
|
"properties": {
|
|
2367
2367
|
"target": {
|
|
2368
|
-
"description": "The target
|
|
2368
|
+
"description": "The target baseUrl to use for the plugin\n\nCan be either a string or an object with internal and external keys.\nTargets with `{{pluginId}}` or `{{ pluginId }} in the url will be replaced with the pluginId.",
|
|
2369
2369
|
"anyOf": [
|
|
2370
2370
|
{
|
|
2371
2371
|
"type": "object",
|
|
@@ -2388,7 +2388,7 @@
|
|
|
2388
2388
|
]
|
|
2389
2389
|
},
|
|
2390
2390
|
"plugins": {
|
|
2391
|
-
"description": "Array of plugins which use the target
|
|
2391
|
+
"description": "Array of plugins which use the target baseUrl.",
|
|
2392
2392
|
"type": "array",
|
|
2393
2393
|
"items": {
|
|
2394
2394
|
"type": "string"
|
package/dist/index.cjs.js
CHANGED
|
@@ -91,7 +91,7 @@ function registerCommands(program) {
|
|
|
91
91
|
"--concurrency <MAX CONCURRENT REQS>",
|
|
92
92
|
"Optional Controls the number of API requests allowed to be performed simultaneously.",
|
|
93
93
|
"25"
|
|
94
|
-
).option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/migrate-
|
|
94
|
+
).option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/migrate-Ddd_MQkE.cjs.js'); }).then((m) => m.default)));
|
|
95
95
|
program.command("publish").description(
|
|
96
96
|
"Publish generated TechDocs site to an external storage AWS S3, Google GCS, etc."
|
|
97
97
|
).requiredOption(
|
|
@@ -147,7 +147,7 @@ function registerCommands(program) {
|
|
|
147
147
|
"--directory <PATH>",
|
|
148
148
|
"Path of the directory containing generated files to publish",
|
|
149
149
|
"./site/"
|
|
150
|
-
).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/publish-
|
|
150
|
+
).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/publish-DH7Mbt7b.cjs.js'); }).then((m) => m.default)));
|
|
151
151
|
program.command("serve:mkdocs").description("Serve a documentation project locally using MkDocs serve.").option(
|
|
152
152
|
"-i, --docker-image <DOCKER_IMAGE>",
|
|
153
153
|
"The mkdocs docker container to use",
|
|
@@ -228,7 +228,7 @@ function lazy(getActionFunc) {
|
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
var version = "1.8.
|
|
231
|
+
var version = "1.8.13";
|
|
232
232
|
|
|
233
233
|
const main = (argv) => {
|
|
234
234
|
commander.program.name("techdocs-cli").version(version);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techdocs/cli",
|
|
3
3
|
"description": "Utility CLI for managing TechDocs sites in Backstage.",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.13",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"techdocs-cli": "bin/techdocs-cli"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@backstage/cli": "^0.26.
|
|
38
|
+
"@backstage/cli": "^0.26.8",
|
|
39
39
|
"@types/commander": "^2.12.2",
|
|
40
40
|
"@types/fs-extra": "^11.0.0",
|
|
41
41
|
"@types/http-proxy": "^1.17.4",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"ext": "ts"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@backstage/backend-
|
|
59
|
+
"@backstage/backend-defaults": "^0.3.1",
|
|
60
60
|
"@backstage/catalog-model": "^1.5.0",
|
|
61
61
|
"@backstage/cli-common": "^0.1.14",
|
|
62
62
|
"@backstage/config": "^1.2.0",
|
|
63
|
-
"@backstage/plugin-techdocs-node": "^1.12.
|
|
63
|
+
"@backstage/plugin-techdocs-node": "^1.12.6",
|
|
64
64
|
"commander": "^12.0.0",
|
|
65
65
|
"fs-extra": "^11.0.0",
|
|
66
66
|
"global-agent": "^3.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-BZzIXl_A.cjs.js","sources":["../../src/commands/migrate/migrate.ts"],"sourcesContent":["/*\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 { HostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function migrate(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n if (!publisher.migrateDocsCase) {\n throw new Error(`Migration not implemented for ${opts.publisherType}`);\n }\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n throw new Error('');\n }\n\n // Validate and parse migration arguments.\n const removeOriginal = opts.removeOriginal;\n const numericConcurrency = parseInt(opts.concurrency, 10);\n\n if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {\n throw new Error(\n `Concurrency must be a number greater than 1. ${opts.concurrency} provided.`,\n );\n }\n\n await publisher.migrateDocsCase({\n concurrency: numericConcurrency,\n removeOriginal,\n });\n}\n"],"names":["createLogger","PublisherConfig","HostDiscovery","Publisher"],"mappings":";;;;;;;;;;;AAsBA,eAA8B,QAAQ,IAAoB,EAAA;AACxD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAA,SAAA,GAAYC,2BAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAE1E,EAAI,IAAA,CAAC,UAAU,eAAiB,EAAA;AAC9B,IAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,IAAA,CAAK,aAAa,CAAE,CAAA,CAAA,CAAA;AAAA,GACvE;AAGA,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAM,MAAA,IAAI,MAAM,EAAE,CAAA,CAAA;AAAA,GACpB;AAGA,EAAA,MAAM,iBAAiB,IAAK,CAAA,cAAA,CAAA;AAC5B,EAAA,MAAM,kBAAqB,GAAA,QAAA,CAAS,IAAK,CAAA,WAAA,EAAa,EAAE,CAAA,CAAA;AAExD,EAAA,IAAI,CAAC,MAAO,CAAA,SAAA,CAAU,kBAAkB,CAAA,IAAK,sBAAsB,CAAG,EAAA;AACpE,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,6CAAA,EAAgD,KAAK,WAAW,CAAA,UAAA,CAAA;AAAA,KAClE,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,UAAU,eAAgB,CAAA;AAAA,IAC9B,WAAa,EAAA,kBAAA;AAAA,IACb,cAAA;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish-CnXRqKHz.cjs.js","sources":["../../src/commands/publish/publish.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { HostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(opts: OptionValues): Promise<any> {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = opts.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(opts.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","HostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;;;AAwBA,eAA8B,QAAQ,IAAkC,EAAA;AACtE,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAA,SAAA,GAAYC,2BAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAG1E,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,EAAE,CAAC,CAAA,CAAA;AAAA,GACrC;AAEA,EAAM,MAAA,CAAC,WAAW,IAAM,EAAA,IAAI,IAAI,IAAK,CAAA,MAAA,CAAO,MAAM,GAAG,CAAA,CAAA;AACrD,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,IAAA;AAAA,IACA,QAAU,EAAA;AAAA,MACR,SAAA;AAAA,MACA,IAAA;AAAA,KACF;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,SAAA,GAAYC,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,SAAU,CAAA,OAAA,CAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAE7C,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
|