@backstage/repo-tools 0.1.1-next.1 → 0.1.1-next.2
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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @backstage/repo-tools
|
|
2
2
|
|
|
3
|
+
## 0.1.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 76fc6f7ec8: Updates Api-extractor and api-documenter version
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/cli-common@0.1.11
|
|
10
|
+
- @backstage/errors@1.1.4
|
|
11
|
+
|
|
3
12
|
## 0.1.1-next.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -79,16 +79,6 @@ var _tokens;
|
|
|
79
79
|
const tmpDir = paths.resolveTargetRoot(
|
|
80
80
|
"./node_modules/.cache/api-extractor"
|
|
81
81
|
);
|
|
82
|
-
const {
|
|
83
|
-
PackageJsonLookup
|
|
84
|
-
} = require("@rushstack/node-core-library/lib/PackageJsonLookup");
|
|
85
|
-
const old = PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor;
|
|
86
|
-
PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor = function tryGetPackageJsonFilePathForPatch(path$1) {
|
|
87
|
-
if (path$1.includes("@material-ui") && !path.dirname(path$1).endsWith("@material-ui")) {
|
|
88
|
-
return void 0;
|
|
89
|
-
}
|
|
90
|
-
return old.call(this, path$1);
|
|
91
|
-
};
|
|
92
82
|
const {
|
|
93
83
|
ApiReportGenerator
|
|
94
84
|
} = require("@microsoft/api-extractor/lib/generators/ApiReportGenerator");
|
|
@@ -114,7 +104,7 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
|
|
|
114
104
|
collector.messageRouter,
|
|
115
105
|
(messages) => {
|
|
116
106
|
return messages.filter((message) => {
|
|
117
|
-
var _a2, _b, _c;
|
|
107
|
+
var _a2, _b, _c, _d;
|
|
118
108
|
if (message.messageId !== "ae-forgotten-export") {
|
|
119
109
|
return true;
|
|
120
110
|
}
|
|
@@ -131,13 +121,17 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
|
|
|
131
121
|
`Failed to find source file in program at path "${message.sourceFilePath}"`
|
|
132
122
|
);
|
|
133
123
|
}
|
|
134
|
-
|
|
124
|
+
let localName = (_a2 = sourceFile.identifiers) == null ? void 0 : _a2.get(symbolName);
|
|
125
|
+
if (!localName) {
|
|
126
|
+
const [, trimmedSymbolName] = symbolName.match(/(.*)_\d+/) || [];
|
|
127
|
+
localName = (_b = sourceFile.identifiers) == null ? void 0 : _b.get(trimmedSymbolName);
|
|
128
|
+
}
|
|
135
129
|
if (!localName) {
|
|
136
130
|
throw new Error(
|
|
137
131
|
`Unable to find local name of "${symbolName}" in ${sourceFile.fileName}`
|
|
138
132
|
);
|
|
139
133
|
}
|
|
140
|
-
const local = (
|
|
134
|
+
const local = (_c = sourceFile.locals) == null ? void 0 : _c.get(localName);
|
|
141
135
|
if (!local) {
|
|
142
136
|
return true;
|
|
143
137
|
}
|
|
@@ -147,7 +141,7 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
|
|
|
147
141
|
`Unable to find type declaration of "${symbolName}" in ${sourceFile.fileName}`
|
|
148
142
|
);
|
|
149
143
|
}
|
|
150
|
-
const declarations = (
|
|
144
|
+
const declarations = (_d = type.aliasSymbol) == null ? void 0 : _d.declarations;
|
|
151
145
|
if (!declarations || declarations.length === 0) {
|
|
152
146
|
return true;
|
|
153
147
|
}
|
|
@@ -190,9 +184,11 @@ async function createTemporaryTsConfig(includedPackageDirs) {
|
|
|
190
184
|
await fs__default["default"].writeJson(path$1, {
|
|
191
185
|
extends: "./tsconfig.json",
|
|
192
186
|
include: [
|
|
187
|
+
// These two contain global definitions that are needed for stable API report generation
|
|
193
188
|
...assetTypeFile,
|
|
194
189
|
...includedPackageDirs.map((dir) => path.join(dir, "src"))
|
|
195
190
|
],
|
|
191
|
+
// we don't exclude node_modules so that we can use the asset-types.d.ts file
|
|
196
192
|
exclude: []
|
|
197
193
|
});
|
|
198
194
|
return path$1;
|
|
@@ -308,9 +304,12 @@ async function runApiExtraction({
|
|
|
308
304
|
enabled: false
|
|
309
305
|
},
|
|
310
306
|
messages: {
|
|
307
|
+
// Silence compiler warnings, as these will prevent the CI build to work
|
|
311
308
|
compilerMessageReporting: {
|
|
312
309
|
default: {
|
|
313
310
|
logLevel: "none"
|
|
311
|
+
// These contain absolute file paths, so can't be included in the report
|
|
312
|
+
// addToApiReportFile: true,
|
|
314
313
|
}
|
|
315
314
|
},
|
|
316
315
|
extractorMessageReporting: {
|
|
@@ -332,7 +331,8 @@ async function runApiExtraction({
|
|
|
332
331
|
},
|
|
333
332
|
configObjectFullPath: projectFolder,
|
|
334
333
|
packageJsonFullPath: path.resolve(projectFolder, "package.json"),
|
|
335
|
-
tsdocConfigFile: await getTsDocConfig()
|
|
334
|
+
tsdocConfigFile: await getTsDocConfig(),
|
|
335
|
+
ignoreMissingEntryPoint: true
|
|
336
336
|
});
|
|
337
337
|
extractorConfig.packageFolder = packageFolder;
|
|
338
338
|
if (!compilerState) {
|
|
@@ -610,6 +610,7 @@ async function buildDocs({
|
|
|
610
610
|
super(parameters);
|
|
611
611
|
this.values = parameters.values;
|
|
612
612
|
}
|
|
613
|
+
/** @override */
|
|
613
614
|
get kind() {
|
|
614
615
|
return _DocFrontMatter.kind;
|
|
615
616
|
}
|
|
@@ -617,6 +618,7 @@ async function buildDocs({
|
|
|
617
618
|
let DocFrontMatter = _DocFrontMatter;
|
|
618
619
|
DocFrontMatter.kind = "DocFrontMatter";
|
|
619
620
|
const _DocCodeSpanLink = class extends tsdoc.DocLinkTag {
|
|
621
|
+
/** @override */
|
|
620
622
|
get kind() {
|
|
621
623
|
return _DocCodeSpanLink.kind;
|
|
622
624
|
}
|
|
@@ -624,9 +626,12 @@ async function buildDocs({
|
|
|
624
626
|
let DocCodeSpanLink = _DocCodeSpanLink;
|
|
625
627
|
DocCodeSpanLink.kind = "DocCodeSpanLink";
|
|
626
628
|
class CustomCustomMarkdownEmitter extends CustomMarkdownEmitter.CustomMarkdownEmitter {
|
|
629
|
+
// Until https://github.com/microsoft/rushstack/issues/2914 gets fixed or we change markdown renderer we need a fix
|
|
630
|
+
// to render pipe | character correctly.
|
|
627
631
|
getEscapedText(text) {
|
|
628
632
|
return text.replace(/\\/g, "\\\\").replace(/[*#[\]_`~]/g, (x) => `\\${x}`).replace(/---/g, "\\-\\-\\-").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\|/g, "|");
|
|
629
633
|
}
|
|
634
|
+
/** @override */
|
|
630
635
|
writeNode(docNode, context, docNodeSiblings) {
|
|
631
636
|
switch (docNode.kind) {
|
|
632
637
|
case DocFrontMatter.kind: {
|
|
@@ -671,6 +676,7 @@ async function buildDocs({
|
|
|
671
676
|
super.writeNode(docNode, context, docNodeSiblings);
|
|
672
677
|
}
|
|
673
678
|
}
|
|
679
|
+
/** @override */
|
|
674
680
|
emit(stringBuilder, docNode, options) {
|
|
675
681
|
stringBuilder._chunks.length = 0;
|
|
676
682
|
return super.emit(stringBuilder, docNode, options);
|
|
@@ -710,6 +716,10 @@ async function buildDocs({
|
|
|
710
716
|
}
|
|
711
717
|
return filename;
|
|
712
718
|
}
|
|
719
|
+
// We don't really get many chances to modify the generated AST
|
|
720
|
+
// so we hook in wherever we can. In this case we add the front matter
|
|
721
|
+
// just before writing the breadcrumbs at the top.
|
|
722
|
+
/** @override */
|
|
713
723
|
_writeBreadcrumb(output, apiItem) {
|
|
714
724
|
let title;
|
|
715
725
|
let description;
|
|
@@ -820,6 +830,7 @@ async function buildDocs({
|
|
|
820
830
|
documenterConfig: {
|
|
821
831
|
outputTarget: "markdown",
|
|
822
832
|
newlineKind: "\n",
|
|
833
|
+
// De ba dålig kod
|
|
823
834
|
configFilePath: "",
|
|
824
835
|
configFile: {}
|
|
825
836
|
},
|
|
@@ -1125,4 +1136,4 @@ function parseArrayOption(value) {
|
|
|
1125
1136
|
}
|
|
1126
1137
|
|
|
1127
1138
|
exports.buildApiReports = buildApiReports;
|
|
1128
|
-
//# sourceMappingURL=api-reports-
|
|
1139
|
+
//# sourceMappingURL=api-reports-c87f7f0e.cjs.js.map
|
package/dist/index.cjs.js
CHANGED
|
@@ -50,7 +50,7 @@ function registerCommands(program) {
|
|
|
50
50
|
"select some message code to be omited on the API Extractor (comma separated values i.e ae-cyclic-inherit-doc,ae-missing-getter )"
|
|
51
51
|
).description("Generate an API report for selected packages").action(
|
|
52
52
|
lazy(
|
|
53
|
-
() => Promise.resolve().then(function () { return require('./cjs/api-reports-
|
|
53
|
+
() => Promise.resolve().then(function () { return require('./cjs/api-reports-c87f7f0e.cjs.js'); }).then((m) => m.buildApiReports)
|
|
54
54
|
)
|
|
55
55
|
);
|
|
56
56
|
program.command("type-deps").description("Find inconsistencies in types of all packages and plugins").action(lazy(() => Promise.resolve().then(function () { return require('./cjs/type-deps-fba15630.cjs.js'); }).then((m) => m.default)));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/repo-tools",
|
|
3
3
|
"description": "CLI for Backstage repo tooling ",
|
|
4
|
-
"version": "0.1.1-next.
|
|
4
|
+
"version": "0.1.1-next.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@backstage/cli-common": "^0.1.11",
|
|
34
34
|
"@backstage/errors": "^1.1.4",
|
|
35
35
|
"@manypkg/get-packages": "^1.1.3",
|
|
36
|
-
"@microsoft/api-documenter": "^7.
|
|
37
|
-
"@microsoft/api-extractor": "^7.
|
|
36
|
+
"@microsoft/api-documenter": "^7.19.27",
|
|
37
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
38
38
|
"chalk": "^4.0.0",
|
|
39
39
|
"commander": "^9.1.0",
|
|
40
40
|
"fs-extra": "10.1.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"ts-node": "^10.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@backstage/cli": "^0.22.1-next.
|
|
47
|
+
"@backstage/cli": "^0.22.1-next.2",
|
|
48
48
|
"@types/is-glob": "^4.0.2",
|
|
49
49
|
"@types/mock-fs": "^4.13.0",
|
|
50
50
|
"mock-fs": "^5.1.0"
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"@microsoft/api-extractor-model": "*",
|
|
54
54
|
"@microsoft/tsdoc": "*",
|
|
55
55
|
"@microsoft/tsdoc-config": "*",
|
|
56
|
-
"@rushstack/node-core-library": "*",
|
|
57
56
|
"prettier": "^2.8.1",
|
|
58
57
|
"typescript": "> 3.0.0"
|
|
59
58
|
},
|