@techdocs/cli 0.0.0-nightly-20240617021823 → 0.0.0-nightly-20240618021721
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 +5 -4
- package/dist/cjs/{generate-ZiP9GGnN.cjs.js → generate-CHbYjdPP.cjs.js} +2 -11
- package/dist/cjs/generate-CHbYjdPP.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +109 -109
- package/dist/index.cjs.js +1 -1
- package/package.json +5 -7
- package/dist/cjs/generate-ZiP9GGnN.cjs.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20240618021721
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- 2110d76: Removed `dockerode` dependency.
|
|
7
8
|
- Updated dependencies
|
|
8
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
9
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
10
|
-
- @backstage/cli-common@0.0.0-nightly-
|
|
9
|
+
- @backstage/backend-common@0.0.0-nightly-20240618021721
|
|
10
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20240618021721
|
|
11
|
+
- @backstage/cli-common@0.0.0-nightly-20240618021721
|
|
11
12
|
- @backstage/catalog-model@1.5.0
|
|
12
13
|
- @backstage/config@1.2.0
|
|
13
14
|
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var path = require('path');
|
|
4
4
|
var fs = require('fs-extra');
|
|
5
|
-
var Docker = require('dockerode');
|
|
6
5
|
var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
|
|
7
|
-
var backendCommon = require('@backstage/backend-common');
|
|
8
6
|
var config = require('@backstage/config');
|
|
9
7
|
var utility = require('./utility-CsspJYjU.cjs.js');
|
|
10
8
|
require('winston');
|
|
@@ -14,7 +12,6 @@ require('process');
|
|
|
14
12
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
15
13
|
|
|
16
14
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
17
|
-
var Docker__default = /*#__PURE__*/_interopDefaultCompat(Docker);
|
|
18
15
|
|
|
19
16
|
async function generate(opts) {
|
|
20
17
|
const logger = utility.createLogger({ verbose: opts.verbose });
|
|
@@ -46,11 +43,6 @@ async function generate(opts) {
|
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
});
|
|
49
|
-
let containerRunner;
|
|
50
|
-
if (opts.docker) {
|
|
51
|
-
const dockerClient = new Docker__default.default();
|
|
52
|
-
containerRunner = new backendCommon.DockerContainerRunner({ dockerClient });
|
|
53
|
-
}
|
|
54
46
|
let parsedLocationAnnotation = {};
|
|
55
47
|
if (opts.techdocsRef) {
|
|
56
48
|
try {
|
|
@@ -62,8 +54,7 @@ async function generate(opts) {
|
|
|
62
54
|
}
|
|
63
55
|
}
|
|
64
56
|
const techdocsGenerator = await pluginTechdocsNode.TechdocsGenerator.fromConfig(config$1, {
|
|
65
|
-
logger
|
|
66
|
-
containerRunner
|
|
57
|
+
logger
|
|
67
58
|
});
|
|
68
59
|
logger.info("Generating documentation...");
|
|
69
60
|
await techdocsGenerator.run({
|
|
@@ -87,4 +78,4 @@ async function generate(opts) {
|
|
|
87
78
|
}
|
|
88
79
|
|
|
89
80
|
exports.default = generate;
|
|
90
|
-
//# sourceMappingURL=generate-
|
|
81
|
+
//# sourceMappingURL=generate-CHbYjdPP.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-CHbYjdPP.cjs.js","sources":["../../src/commands/generate/generate.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 fs from 'fs-extra';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n getMkdocsYml,\n} from '@backstage/plugin-techdocs-node';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n getLogStream,\n} from '../../lib/utility';\n\nexport default async function generate(opts: OptionValues) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: opts.verbose });\n\n const sourceDir = resolve(opts.sourceDir);\n const outputDir = resolve(opts.outputDir);\n const omitTechdocsCorePlugin = opts.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = opts.dockerImage;\n const pullImage = opts.pull;\n const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;\n const defaultPlugins = opts.defaultPlugin;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n sourceDir,\n );\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: opts.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n legacyCopyReadmeMdToIndexMd,\n omitTechdocsCorePlugin,\n defaultPlugins,\n },\n },\n },\n });\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (opts.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n opts.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(opts.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: opts.etag,\n logStream: getLogStream(logger),\n siteOptions: { name: opts.siteName },\n runAsDefaultUser: opts.runAsDefaultUser,\n });\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","getMkdocsYml","config","ConfigReader","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","getLogStream"],"mappings":";;;;;;;;;;;;;;;AA+BA,eAA8B,SAAS,IAAoB,EAAA;AAKzD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,SAAA,GAAYC,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAM,MAAA,SAAA,GAAYA,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,yBAAyB,IAAK,CAAA,4BAAA,CAAA;AACpC,EAAA,MAAM,cAAc,IAAK,CAAA,WAAA,CAAA;AACzB,EAAA,MAAM,YAAY,IAAK,CAAA,IAAA,CAAA;AACvB,EAAA,MAAM,8BAA8B,IAAK,CAAA,2BAAA,CAAA;AACzC,EAAA,MAAM,iBAAiB,IAAK,CAAA,aAAA,CAAA;AAE5B,EAAO,MAAA,CAAA,IAAA,CAAK,CAAoB,iBAAA,EAAA,SAAS,CAAE,CAAA,CAAA,CAAA;AAC3C,EAAO,MAAA,CAAA,IAAA,CAAK,CAAkC,+BAAA,EAAA,SAAS,CAAE,C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AAAA,IACX,SAAA,EAAWI,qBAAa,MAAM,CAAA;AAAA,IAC9B,WAAa,EAAA,EAAE,IAAM,EAAA,IAAA,CAAK,QAAS,EAAA;AAAA,IACnC,kBAAkB,IAAK,CAAA,gBAAA;AAAA,GACxB,CAAA,CAAA;AAED,EAAA,IAAI,iBAAmB,EAAA;AACrB,IAAQ,OAAA,CAAA,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAGN,mBAAA,CAAA,MAAA,CAAO,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AAEA,EAAA,MAAA,CAAO,KAAK,OAAO,CAAA,CAAA;AACrB;;;;"}
|
|
@@ -1567,115 +1567,6 @@
|
|
|
1567
1567
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
1568
1568
|
}
|
|
1569
1569
|
},
|
|
1570
|
-
{
|
|
1571
|
-
"path": "../integration-aws-node/config.d.ts",
|
|
1572
|
-
"value": {
|
|
1573
|
-
"type": "object",
|
|
1574
|
-
"properties": {
|
|
1575
|
-
"aws": {
|
|
1576
|
-
"description": "Configuration for access to AWS accounts",
|
|
1577
|
-
"type": "object",
|
|
1578
|
-
"properties": {
|
|
1579
|
-
"accountDefaults": {
|
|
1580
|
-
"description": "Defaults for retrieving AWS account credentials",
|
|
1581
|
-
"type": "object",
|
|
1582
|
-
"properties": {
|
|
1583
|
-
"roleName": {
|
|
1584
|
-
"description": "The IAM role to assume to retrieve temporary AWS credentials",
|
|
1585
|
-
"type": "string"
|
|
1586
|
-
},
|
|
1587
|
-
"partition": {
|
|
1588
|
-
"description": "The AWS partition of the IAM role, e.g. \"aws\", \"aws-cn\"",
|
|
1589
|
-
"type": "string"
|
|
1590
|
-
},
|
|
1591
|
-
"region": {
|
|
1592
|
-
"description": "The STS regional endpoint to use when retrieving temporary AWS credentials, e.g. \"ap-northeast-1\"",
|
|
1593
|
-
"type": "string"
|
|
1594
|
-
},
|
|
1595
|
-
"externalId": {
|
|
1596
|
-
"description": "The unique identifier needed to assume the role to retrieve temporary AWS credentials",
|
|
1597
|
-
"visibility": "secret",
|
|
1598
|
-
"type": "string"
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
},
|
|
1602
|
-
"mainAccount": {
|
|
1603
|
-
"description": "Main account to use for retrieving AWS account credentials",
|
|
1604
|
-
"type": "object",
|
|
1605
|
-
"properties": {
|
|
1606
|
-
"accessKeyId": {
|
|
1607
|
-
"description": "The access key ID for a set of static AWS credentials",
|
|
1608
|
-
"visibility": "secret",
|
|
1609
|
-
"type": "string"
|
|
1610
|
-
},
|
|
1611
|
-
"secretAccessKey": {
|
|
1612
|
-
"description": "The secret access key for a set of static AWS credentials",
|
|
1613
|
-
"visibility": "secret",
|
|
1614
|
-
"type": "string"
|
|
1615
|
-
},
|
|
1616
|
-
"profile": {
|
|
1617
|
-
"description": "The configuration profile from a credentials file at ~/.aws/credentials and\na configuration file at ~/.aws/config.",
|
|
1618
|
-
"type": "string"
|
|
1619
|
-
},
|
|
1620
|
-
"region": {
|
|
1621
|
-
"description": "The STS regional endpoint to use for the main account, e.g. \"ap-northeast-1\"",
|
|
1622
|
-
"type": "string"
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
},
|
|
1626
|
-
"accounts": {
|
|
1627
|
-
"description": "Configuration for retrieving AWS accounts credentials",
|
|
1628
|
-
"type": "array",
|
|
1629
|
-
"items": {
|
|
1630
|
-
"type": "object",
|
|
1631
|
-
"properties": {
|
|
1632
|
-
"accountId": {
|
|
1633
|
-
"description": "The account ID of the target account that this matches on, e.g. \"123456789012\"",
|
|
1634
|
-
"type": "string"
|
|
1635
|
-
},
|
|
1636
|
-
"accessKeyId": {
|
|
1637
|
-
"description": "The access key ID for a set of static AWS credentials",
|
|
1638
|
-
"visibility": "secret",
|
|
1639
|
-
"type": "string"
|
|
1640
|
-
},
|
|
1641
|
-
"secretAccessKey": {
|
|
1642
|
-
"description": "The secret access key for a set of static AWS credentials",
|
|
1643
|
-
"visibility": "secret",
|
|
1644
|
-
"type": "string"
|
|
1645
|
-
},
|
|
1646
|
-
"profile": {
|
|
1647
|
-
"description": "The configuration profile from a credentials file at ~/.aws/credentials and\na configuration file at ~/.aws/config.",
|
|
1648
|
-
"type": "string"
|
|
1649
|
-
},
|
|
1650
|
-
"roleName": {
|
|
1651
|
-
"description": "The IAM role to assume to retrieve temporary AWS credentials",
|
|
1652
|
-
"type": "string"
|
|
1653
|
-
},
|
|
1654
|
-
"partition": {
|
|
1655
|
-
"description": "The AWS partition of the IAM role, e.g. \"aws\", \"aws-cn\"",
|
|
1656
|
-
"type": "string"
|
|
1657
|
-
},
|
|
1658
|
-
"region": {
|
|
1659
|
-
"description": "The STS regional endpoint to use when retrieving temporary AWS credentials, e.g. \"ap-northeast-1\"",
|
|
1660
|
-
"type": "string"
|
|
1661
|
-
},
|
|
1662
|
-
"externalId": {
|
|
1663
|
-
"description": "The unique identifier needed to assume the role to retrieve temporary AWS credentials",
|
|
1664
|
-
"visibility": "secret",
|
|
1665
|
-
"type": "string"
|
|
1666
|
-
}
|
|
1667
|
-
},
|
|
1668
|
-
"required": [
|
|
1669
|
-
"accountId"
|
|
1670
|
-
]
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
},
|
|
1676
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
1677
|
-
}
|
|
1678
|
-
},
|
|
1679
1570
|
{
|
|
1680
1571
|
"path": "../backend-app-api/config.d.ts",
|
|
1681
1572
|
"value": {
|
|
@@ -2065,6 +1956,115 @@
|
|
|
2065
1956
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
2066
1957
|
}
|
|
2067
1958
|
},
|
|
1959
|
+
{
|
|
1960
|
+
"path": "../integration-aws-node/config.d.ts",
|
|
1961
|
+
"value": {
|
|
1962
|
+
"type": "object",
|
|
1963
|
+
"properties": {
|
|
1964
|
+
"aws": {
|
|
1965
|
+
"description": "Configuration for access to AWS accounts",
|
|
1966
|
+
"type": "object",
|
|
1967
|
+
"properties": {
|
|
1968
|
+
"accountDefaults": {
|
|
1969
|
+
"description": "Defaults for retrieving AWS account credentials",
|
|
1970
|
+
"type": "object",
|
|
1971
|
+
"properties": {
|
|
1972
|
+
"roleName": {
|
|
1973
|
+
"description": "The IAM role to assume to retrieve temporary AWS credentials",
|
|
1974
|
+
"type": "string"
|
|
1975
|
+
},
|
|
1976
|
+
"partition": {
|
|
1977
|
+
"description": "The AWS partition of the IAM role, e.g. \"aws\", \"aws-cn\"",
|
|
1978
|
+
"type": "string"
|
|
1979
|
+
},
|
|
1980
|
+
"region": {
|
|
1981
|
+
"description": "The STS regional endpoint to use when retrieving temporary AWS credentials, e.g. \"ap-northeast-1\"",
|
|
1982
|
+
"type": "string"
|
|
1983
|
+
},
|
|
1984
|
+
"externalId": {
|
|
1985
|
+
"description": "The unique identifier needed to assume the role to retrieve temporary AWS credentials",
|
|
1986
|
+
"visibility": "secret",
|
|
1987
|
+
"type": "string"
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
},
|
|
1991
|
+
"mainAccount": {
|
|
1992
|
+
"description": "Main account to use for retrieving AWS account credentials",
|
|
1993
|
+
"type": "object",
|
|
1994
|
+
"properties": {
|
|
1995
|
+
"accessKeyId": {
|
|
1996
|
+
"description": "The access key ID for a set of static AWS credentials",
|
|
1997
|
+
"visibility": "secret",
|
|
1998
|
+
"type": "string"
|
|
1999
|
+
},
|
|
2000
|
+
"secretAccessKey": {
|
|
2001
|
+
"description": "The secret access key for a set of static AWS credentials",
|
|
2002
|
+
"visibility": "secret",
|
|
2003
|
+
"type": "string"
|
|
2004
|
+
},
|
|
2005
|
+
"profile": {
|
|
2006
|
+
"description": "The configuration profile from a credentials file at ~/.aws/credentials and\na configuration file at ~/.aws/config.",
|
|
2007
|
+
"type": "string"
|
|
2008
|
+
},
|
|
2009
|
+
"region": {
|
|
2010
|
+
"description": "The STS regional endpoint to use for the main account, e.g. \"ap-northeast-1\"",
|
|
2011
|
+
"type": "string"
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
},
|
|
2015
|
+
"accounts": {
|
|
2016
|
+
"description": "Configuration for retrieving AWS accounts credentials",
|
|
2017
|
+
"type": "array",
|
|
2018
|
+
"items": {
|
|
2019
|
+
"type": "object",
|
|
2020
|
+
"properties": {
|
|
2021
|
+
"accountId": {
|
|
2022
|
+
"description": "The account ID of the target account that this matches on, e.g. \"123456789012\"",
|
|
2023
|
+
"type": "string"
|
|
2024
|
+
},
|
|
2025
|
+
"accessKeyId": {
|
|
2026
|
+
"description": "The access key ID for a set of static AWS credentials",
|
|
2027
|
+
"visibility": "secret",
|
|
2028
|
+
"type": "string"
|
|
2029
|
+
},
|
|
2030
|
+
"secretAccessKey": {
|
|
2031
|
+
"description": "The secret access key for a set of static AWS credentials",
|
|
2032
|
+
"visibility": "secret",
|
|
2033
|
+
"type": "string"
|
|
2034
|
+
},
|
|
2035
|
+
"profile": {
|
|
2036
|
+
"description": "The configuration profile from a credentials file at ~/.aws/credentials and\na configuration file at ~/.aws/config.",
|
|
2037
|
+
"type": "string"
|
|
2038
|
+
},
|
|
2039
|
+
"roleName": {
|
|
2040
|
+
"description": "The IAM role to assume to retrieve temporary AWS credentials",
|
|
2041
|
+
"type": "string"
|
|
2042
|
+
},
|
|
2043
|
+
"partition": {
|
|
2044
|
+
"description": "The AWS partition of the IAM role, e.g. \"aws\", \"aws-cn\"",
|
|
2045
|
+
"type": "string"
|
|
2046
|
+
},
|
|
2047
|
+
"region": {
|
|
2048
|
+
"description": "The STS regional endpoint to use when retrieving temporary AWS credentials, e.g. \"ap-northeast-1\"",
|
|
2049
|
+
"type": "string"
|
|
2050
|
+
},
|
|
2051
|
+
"externalId": {
|
|
2052
|
+
"description": "The unique identifier needed to assume the role to retrieve temporary AWS credentials",
|
|
2053
|
+
"visibility": "secret",
|
|
2054
|
+
"type": "string"
|
|
2055
|
+
}
|
|
2056
|
+
},
|
|
2057
|
+
"required": [
|
|
2058
|
+
"accountId"
|
|
2059
|
+
]
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
},
|
|
2065
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
2066
|
+
}
|
|
2067
|
+
},
|
|
2068
2068
|
{
|
|
2069
2069
|
"path": "../../node_modules/@backstage-community/plugin-puppetdb/node_modules/@backstage/plugin-permission-common/config.d.ts",
|
|
2070
2070
|
"value": {
|
package/dist/index.cjs.js
CHANGED
|
@@ -47,7 +47,7 @@ function registerCommands(program) {
|
|
|
47
47
|
"--runAsDefaultUser",
|
|
48
48
|
"Bypass setting the container user as the same user and group id as host for Linux and MacOS",
|
|
49
49
|
false
|
|
50
|
-
).alias("build").action(lazy(() => Promise.resolve().then(function () { return require('./cjs/generate-
|
|
50
|
+
).alias("build").action(lazy(() => Promise.resolve().then(function () { return require('./cjs/generate-CHbYjdPP.cjs.js'); }).then((m) => m.default)));
|
|
51
51
|
program.command("migrate").description(
|
|
52
52
|
"Migrate objects with case-sensitive entity triplets to lower-case versions."
|
|
53
53
|
).requiredOption(
|
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": "0.0.0-nightly-
|
|
4
|
+
"version": "0.0.0-nightly-20240618021721",
|
|
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.0.0-nightly-
|
|
38
|
+
"@backstage/cli": "^0.0.0-nightly-20240618021721",
|
|
39
39
|
"@types/commander": "^2.12.2",
|
|
40
40
|
"@types/fs-extra": "^11.0.0",
|
|
41
41
|
"@types/http-proxy": "^1.17.4",
|
|
@@ -56,14 +56,12 @@
|
|
|
56
56
|
"ext": "ts"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@backstage/backend-common": "^0.0.0-nightly-
|
|
59
|
+
"@backstage/backend-common": "^0.0.0-nightly-20240618021721",
|
|
60
60
|
"@backstage/catalog-model": "^1.5.0",
|
|
61
|
-
"@backstage/cli-common": "^0.0.0-nightly-
|
|
61
|
+
"@backstage/cli-common": "^0.0.0-nightly-20240618021721",
|
|
62
62
|
"@backstage/config": "^1.2.0",
|
|
63
|
-
"@backstage/plugin-techdocs-node": "^0.0.0-nightly-
|
|
64
|
-
"@types/dockerode": "^3.3.0",
|
|
63
|
+
"@backstage/plugin-techdocs-node": "^0.0.0-nightly-20240618021721",
|
|
65
64
|
"commander": "^12.0.0",
|
|
66
|
-
"dockerode": "^4.0.0",
|
|
67
65
|
"fs-extra": "^11.0.0",
|
|
68
66
|
"global-agent": "^3.0.0",
|
|
69
67
|
"http-proxy": "^1.18.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-ZiP9GGnN.cjs.js","sources":["../../src/commands/generate/generate.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 fs from 'fs-extra';\nimport Docker from 'dockerode';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n getMkdocsYml,\n} from '@backstage/plugin-techdocs-node';\nimport {\n ContainerRunner,\n DockerContainerRunner,\n} from '@backstage/backend-common';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n getLogStream,\n} from '../../lib/utility';\n\nexport default async function generate(opts: OptionValues) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: opts.verbose });\n\n const sourceDir = resolve(opts.sourceDir);\n const outputDir = resolve(opts.outputDir);\n const omitTechdocsCorePlugin = opts.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = opts.dockerImage;\n const pullImage = opts.pull;\n const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;\n const defaultPlugins = opts.defaultPlugin;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n sourceDir,\n );\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: opts.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n legacyCopyReadmeMdToIndexMd,\n omitTechdocsCorePlugin,\n defaultPlugins,\n },\n },\n },\n });\n\n // Docker client (conditionally) used by the generators, based on techdocs.generators config.\n let containerRunner: ContainerRunner | undefined;\n\n if (opts.docker) {\n const dockerClient = new Docker();\n containerRunner = new DockerContainerRunner({ dockerClient });\n }\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (opts.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n opts.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n containerRunner,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(opts.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: opts.etag,\n logStream: getLogStream(logger),\n siteOptions: { name: opts.siteName },\n runAsDefaultUser: opts.runAsDefaultUser,\n });\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","getMkdocsYml","config","ConfigReader","Docker","DockerContainerRunner","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","getLogStream"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,eAA8B,SAAS,IAAoB,EAAA;AAKzD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,SAAA,GAAYC,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAM,MAAA,SAAA,GAAYA,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,yBAAyB,IAAK,CAAA,4BAAA,CAAA;AACpC,EAAA,MAAM,cAAc,IAAK,CAAA,WAAA,CAAA;AACzB,EAAA,MAAM,YAAY,IAAK,CAAA,IAAA,CAAA;AACvB,EAAA,MAAM,8BAA8B,IAAK,CAAA,2BAAA,CAAA;AACzC,EAAA,MAAM,iBAAiB,IAAK,CAAA,aAAA,CAAA;AAE5B,EAAO,MAAA,CAAA,IAAA,CAAK,CAAoB,iBAAA,EAAA,SAAS,CAAE,CAAA,CAAA,CAAA;AAC3C,EAAO,MAAA,CAAA,IAAA,CAAK,CAAkC,+BAAA,EAAA,SAAS,CAAE,CAAA,CAAA,CAAA;AAEzD,EAAA,MAAA,CAAO,QAAQ,iDAAiD,CAAA,CAAA;AAEhE,EAAM,MAAAC,mBAAA,CAAG,UAAU,SAAS,CAAA,CAAA;AAE5B,EAAA,MAAM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