@backstage/repo-tools 0.1.1-next.0 → 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,23 @@
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
+
12
+ ## 0.1.1-next.1
13
+
14
+ ### Patch Changes
15
+
16
+ - d48cf39f2a: fix glob on windows os
17
+ - Updated dependencies
18
+ - @backstage/cli-common@0.1.11
19
+ - @backstage/errors@1.1.4
20
+
3
21
  ## 0.1.1-next.0
4
22
 
5
23
  ### Patch Changes
@@ -45,8 +45,7 @@ async function resolvePackagePath(packagePath) {
45
45
  async function findPackageDirs(selectedPaths = []) {
46
46
  const packageDirs = new Array();
47
47
  for (const packageRoot of selectedPaths) {
48
- const fullPath = paths.resolveTargetRoot(packageRoot);
49
- const dirs = isGlob__default["default"](fullPath) ? await glob(fullPath) : [fullPath];
48
+ const dirs = isGlob__default["default"](packageRoot) ? await glob(packageRoot, { cwd: paths.targetRoot }) : [packageRoot];
50
49
  for (const dir of dirs) {
51
50
  const packageDir = await resolvePackagePath(dir);
52
51
  if (!packageDir) {
@@ -80,16 +79,6 @@ var _tokens;
80
79
  const tmpDir = paths.resolveTargetRoot(
81
80
  "./node_modules/.cache/api-extractor"
82
81
  );
83
- const {
84
- PackageJsonLookup
85
- } = require("@rushstack/node-core-library/lib/PackageJsonLookup");
86
- const old = PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor;
87
- PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor = function tryGetPackageJsonFilePathForPatch(path$1) {
88
- if (path$1.includes("@material-ui") && !path.dirname(path$1).endsWith("@material-ui")) {
89
- return void 0;
90
- }
91
- return old.call(this, path$1);
92
- };
93
82
  const {
94
83
  ApiReportGenerator
95
84
  } = require("@microsoft/api-extractor/lib/generators/ApiReportGenerator");
@@ -115,7 +104,7 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
115
104
  collector.messageRouter,
116
105
  (messages) => {
117
106
  return messages.filter((message) => {
118
- var _a2, _b, _c;
107
+ var _a2, _b, _c, _d;
119
108
  if (message.messageId !== "ae-forgotten-export") {
120
109
  return true;
121
110
  }
@@ -132,13 +121,17 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
132
121
  `Failed to find source file in program at path "${message.sourceFilePath}"`
133
122
  );
134
123
  }
135
- const localName = (_a2 = sourceFile.identifiers) == null ? void 0 : _a2.get(symbolName);
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
+ }
136
129
  if (!localName) {
137
130
  throw new Error(
138
131
  `Unable to find local name of "${symbolName}" in ${sourceFile.fileName}`
139
132
  );
140
133
  }
141
- const local = (_b = sourceFile.locals) == null ? void 0 : _b.get(localName);
134
+ const local = (_c = sourceFile.locals) == null ? void 0 : _c.get(localName);
142
135
  if (!local) {
143
136
  return true;
144
137
  }
@@ -148,7 +141,7 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
148
141
  `Unable to find type declaration of "${symbolName}" in ${sourceFile.fileName}`
149
142
  );
150
143
  }
151
- const declarations = (_c = type.aliasSymbol) == null ? void 0 : _c.declarations;
144
+ const declarations = (_d = type.aliasSymbol) == null ? void 0 : _d.declarations;
152
145
  if (!declarations || declarations.length === 0) {
153
146
  return true;
154
147
  }
@@ -191,9 +184,11 @@ async function createTemporaryTsConfig(includedPackageDirs) {
191
184
  await fs__default["default"].writeJson(path$1, {
192
185
  extends: "./tsconfig.json",
193
186
  include: [
187
+ // These two contain global definitions that are needed for stable API report generation
194
188
  ...assetTypeFile,
195
189
  ...includedPackageDirs.map((dir) => path.join(dir, "src"))
196
190
  ],
191
+ // we don't exclude node_modules so that we can use the asset-types.d.ts file
197
192
  exclude: []
198
193
  });
199
194
  return path$1;
@@ -309,9 +304,12 @@ async function runApiExtraction({
309
304
  enabled: false
310
305
  },
311
306
  messages: {
307
+ // Silence compiler warnings, as these will prevent the CI build to work
312
308
  compilerMessageReporting: {
313
309
  default: {
314
310
  logLevel: "none"
311
+ // These contain absolute file paths, so can't be included in the report
312
+ // addToApiReportFile: true,
315
313
  }
316
314
  },
317
315
  extractorMessageReporting: {
@@ -333,7 +331,8 @@ async function runApiExtraction({
333
331
  },
334
332
  configObjectFullPath: projectFolder,
335
333
  packageJsonFullPath: path.resolve(projectFolder, "package.json"),
336
- tsdocConfigFile: await getTsDocConfig()
334
+ tsdocConfigFile: await getTsDocConfig(),
335
+ ignoreMissingEntryPoint: true
337
336
  });
338
337
  extractorConfig.packageFolder = packageFolder;
339
338
  if (!compilerState) {
@@ -611,6 +610,7 @@ async function buildDocs({
611
610
  super(parameters);
612
611
  this.values = parameters.values;
613
612
  }
613
+ /** @override */
614
614
  get kind() {
615
615
  return _DocFrontMatter.kind;
616
616
  }
@@ -618,6 +618,7 @@ async function buildDocs({
618
618
  let DocFrontMatter = _DocFrontMatter;
619
619
  DocFrontMatter.kind = "DocFrontMatter";
620
620
  const _DocCodeSpanLink = class extends tsdoc.DocLinkTag {
621
+ /** @override */
621
622
  get kind() {
622
623
  return _DocCodeSpanLink.kind;
623
624
  }
@@ -625,9 +626,12 @@ async function buildDocs({
625
626
  let DocCodeSpanLink = _DocCodeSpanLink;
626
627
  DocCodeSpanLink.kind = "DocCodeSpanLink";
627
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.
628
631
  getEscapedText(text) {
629
632
  return text.replace(/\\/g, "\\\\").replace(/[*#[\]_`~]/g, (x) => `\\${x}`).replace(/---/g, "\\-\\-\\-").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\|/g, "&#124;");
630
633
  }
634
+ /** @override */
631
635
  writeNode(docNode, context, docNodeSiblings) {
632
636
  switch (docNode.kind) {
633
637
  case DocFrontMatter.kind: {
@@ -672,6 +676,7 @@ async function buildDocs({
672
676
  super.writeNode(docNode, context, docNodeSiblings);
673
677
  }
674
678
  }
679
+ /** @override */
675
680
  emit(stringBuilder, docNode, options) {
676
681
  stringBuilder._chunks.length = 0;
677
682
  return super.emit(stringBuilder, docNode, options);
@@ -711,6 +716,10 @@ async function buildDocs({
711
716
  }
712
717
  return filename;
713
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 */
714
723
  _writeBreadcrumb(output, apiItem) {
715
724
  let title;
716
725
  let description;
@@ -821,6 +830,7 @@ async function buildDocs({
821
830
  documenterConfig: {
822
831
  outputTarget: "markdown",
823
832
  newlineKind: "\n",
833
+ // De ba dålig kod
824
834
  configFilePath: "",
825
835
  configFile: {}
826
836
  },
@@ -1126,4 +1136,4 @@ function parseArrayOption(value) {
1126
1136
  }
1127
1137
 
1128
1138
  exports.buildApiReports = buildApiReports;
1129
- //# sourceMappingURL=api-reports-14c64adc.cjs.js.map
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-14c64adc.cjs.js'); }).then((m) => m.buildApiReports)
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.0",
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.17.11",
37
- "@microsoft/api-extractor": "^7.23.0",
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.0",
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
  },