@backstage/repo-tools 0.1.0-next.2 → 0.1.0

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,33 @@
1
1
  # @backstage/repo-tools
2
2
 
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 99713fd671: Introducing repo-tools package
8
+ - 03843259b4: Api reference documentation improvements
9
+
10
+ - breadcrumbs links semantics as code spans
11
+ - new `@config` annotation to describe related config keys
12
+
13
+ ### Patch Changes
14
+
15
+ - 9b1193f277: declare dependencies
16
+ - a8611bcac4: Add new command options to the `api-report`
17
+
18
+ - added `--allow-warnings`, `-a` to continue processing packages if selected packages have warnings
19
+ - added `--allow-all-warnings` to continue processing packages any packages have warnings
20
+ - added `--omit-messages`, `-o` to pass some warnings messages code to be omitted from the api-report.md files
21
+ - The `paths` argument for this command now takes as default the value on `workspaces.packages` inside the root package.json
22
+ - change the path resolution to use the `@backstage/cli-common` packages instead
23
+
24
+ - 25ec5c0c3a: Include asset-types.d.ts while running the api report command
25
+ - 71f80eb354: add the command type-deps to the repo tool package.
26
+ - ac440299ef: Updated api docs generation to be compatible with Docusaurus 2-alpha and 2.x.
27
+ - Updated dependencies
28
+ - @backstage/errors@1.1.4
29
+ - @backstage/cli-common@0.1.11
30
+
3
31
  ## 0.1.0-next.2
4
32
 
5
33
  ### Patch Changes
@@ -3,7 +3,6 @@
3
3
  var fs = require('fs-extra');
4
4
  var path = require('path');
5
5
  var child_process = require('child_process');
6
- var prettier = require('prettier');
7
6
  var apiExtractor = require('@microsoft/api-extractor');
8
7
  var tsdoc = require('@microsoft/tsdoc');
9
8
  var tsdocConfig = require('@microsoft/tsdoc-config');
@@ -22,7 +21,6 @@ var minimatch = require('minimatch');
22
21
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
22
 
24
23
  var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
25
- var prettier__default = /*#__PURE__*/_interopDefaultLegacy(prettier);
26
24
  var g__default = /*#__PURE__*/_interopDefaultLegacy(g);
27
25
  var isGlob__default = /*#__PURE__*/_interopDefaultLegacy(isGlob);
28
26
  var minimatch__default = /*#__PURE__*/_interopDefaultLegacy(minimatch);
@@ -111,12 +109,13 @@ function patchFileMessageFetcher(router, transform) {
111
109
  }
112
110
  const originalGenerateReviewFileContent = ApiReportGenerator.generateReviewFileContent;
113
111
  ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewFileContent(collector, ...moreArgs) {
112
+ var _a;
114
113
  const program = collector.program;
115
114
  patchFileMessageFetcher(
116
115
  collector.messageRouter,
117
116
  (messages) => {
118
117
  return messages.filter((message) => {
119
- var _a, _b, _c;
118
+ var _a2, _b, _c;
120
119
  if (message.messageId !== "ae-forgotten-export") {
121
120
  return true;
122
121
  }
@@ -133,7 +132,7 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
133
132
  `Failed to find source file in program at path "${message.sourceFilePath}"`
134
133
  );
135
134
  }
136
- const localName = (_a = sourceFile.identifiers) == null ? void 0 : _a.get(symbolName);
135
+ const localName = (_a2 = sourceFile.identifiers) == null ? void 0 : _a2.get(symbolName);
137
136
  if (!localName) {
138
137
  throw new Error(
139
138
  `Unable to find local name of "${symbolName}" in ${sourceFile.fileName}`
@@ -166,22 +165,36 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
166
165
  collector,
167
166
  ...moreArgs
168
167
  );
169
- return prettier__default["default"].format(content, {
170
- ...require("@spotify/prettier-config"),
171
- parser: "markdown"
172
- });
168
+ try {
169
+ const prettier = require("prettier");
170
+ const config = (_a = prettier.resolveConfig.sync(paths.targetRoot)) != null ? _a : {};
171
+ return prettier.format(content, {
172
+ ...config,
173
+ parser: "markdown"
174
+ });
175
+ } catch (e) {
176
+ return content;
177
+ }
173
178
  };
174
179
  async function createTemporaryTsConfig(includedPackageDirs) {
175
180
  const path$1 = paths.resolveTargetRoot("tsconfig.tmp.json");
176
181
  process.once("exit", () => {
177
182
  fs__default["default"].removeSync(path$1);
178
183
  });
184
+ let assetTypeFile = [];
185
+ try {
186
+ assetTypeFile = [
187
+ require.resolve("@backstage/cli/asset-types/asset-types.d.ts")
188
+ ];
189
+ } catch {
190
+ }
179
191
  await fs__default["default"].writeJson(path$1, {
180
192
  extends: "./tsconfig.json",
181
193
  include: [
182
- "packages/cli/asset-types/asset-types.d.ts",
194
+ ...assetTypeFile,
183
195
  ...includedPackageDirs.map((dir) => path.join(dir, "src"))
184
- ]
196
+ ],
197
+ exclude: []
185
198
  });
186
199
  return path$1;
187
200
  }
@@ -622,7 +635,9 @@ async function buildDocs({
622
635
  context.writer.writeLine("---");
623
636
  for (const [name, value] of Object.entries(node.values)) {
624
637
  if (value) {
625
- context.writer.writeLine(`${name}: ${value}`);
638
+ context.writer.writeLine(
639
+ `${name}: "${String(value).replace(/\"/g, "")}"`
640
+ );
626
641
  }
627
642
  }
628
643
  context.writer.writeLine("---");
@@ -1111,4 +1126,4 @@ function parseArrayOption(value) {
1111
1126
  }
1112
1127
 
1113
1128
  exports.buildApiReports = buildApiReports;
1114
- //# sourceMappingURL=api-reports-bc48eddc.cjs.js.map
1129
+ //# sourceMappingURL=api-reports-ab9d0a66.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-bc48eddc.cjs.js'); }).then((m) => m.buildApiReports)
53
+ () => Promise.resolve().then(function () { return require('./cjs/api-reports-ab9d0a66.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.0-next.2",
4
+ "version": "0.1.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,13 +30,14 @@
30
30
  "backstage-repo-tools": "bin/backstage-repo-tools"
31
31
  },
32
32
  "dependencies": {
33
- "@backstage/cli-common": "^0.1.11-next.0",
34
- "@backstage/errors": "^1.1.4-next.1",
33
+ "@backstage/cli-common": "^0.1.11",
34
+ "@backstage/errors": "^1.1.4",
35
35
  "@manypkg/get-packages": "^1.1.3",
36
36
  "@microsoft/api-documenter": "^7.17.11",
37
37
  "@microsoft/api-extractor": "^7.23.0",
38
38
  "@microsoft/api-extractor-model": "^7.17.2",
39
39
  "@microsoft/tsdoc": "0.14.1",
40
+ "@microsoft/tsdoc-config": "0.16.1",
40
41
  "chalk": "^4.0.0",
41
42
  "commander": "^9.1.0",
42
43
  "fs-extra": "10.1.0",
@@ -46,11 +47,21 @@
46
47
  "ts-node": "^10.0.0"
47
48
  },
48
49
  "devDependencies": {
49
- "@backstage/cli": "^0.22.0-next.4",
50
+ "@backstage/cli": "^0.22.0",
50
51
  "@types/is-glob": "^4.0.2",
51
52
  "@types/mock-fs": "^4.13.0",
52
53
  "mock-fs": "^5.1.0"
53
54
  },
55
+ "peerDependencies": {
56
+ "@rushstack/node-core-library": "*",
57
+ "prettier": "^2.8.1",
58
+ "typescript": "> 3.0.0"
59
+ },
60
+ "peerDependenciesMeta": {
61
+ "prettier": {
62
+ "optional": true
63
+ }
64
+ },
54
65
  "files": [
55
66
  "bin",
56
67
  "dist/**/*.js"