@backstage/repo-tools 0.1.0-next.2 → 0.1.1-next.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,44 @@
1
1
  # @backstage/repo-tools
2
2
 
3
+ ## 0.1.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - c447a5221b: Use the project tsconfig in case of selection all packages
8
+ - 93cff3053e: Move some dependencies as `peerDependencies` because we need to always use same version as in `api-extractor`
9
+ - 75275b0b0b: Updated dependency `@microsoft/tsdoc-config` to `0.16.2`.
10
+ - Updated dependencies
11
+ - @backstage/cli-common@0.1.11
12
+ - @backstage/errors@1.1.4
13
+
14
+ ## 0.1.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 99713fd671: Introducing repo-tools package
19
+ - 03843259b4: Api reference documentation improvements
20
+
21
+ - breadcrumbs links semantics as code spans
22
+ - new `@config` annotation to describe related config keys
23
+
24
+ ### Patch Changes
25
+
26
+ - 9b1193f277: declare dependencies
27
+ - a8611bcac4: Add new command options to the `api-report`
28
+
29
+ - added `--allow-warnings`, `-a` to continue processing packages if selected packages have warnings
30
+ - added `--allow-all-warnings` to continue processing packages any packages have warnings
31
+ - added `--omit-messages`, `-o` to pass some warnings messages code to be omitted from the api-report.md files
32
+ - The `paths` argument for this command now takes as default the value on `workspaces.packages` inside the root package.json
33
+ - change the path resolution to use the `@backstage/cli-common` packages instead
34
+
35
+ - 25ec5c0c3a: Include asset-types.d.ts while running the api report command
36
+ - 71f80eb354: add the command type-deps to the repo tool package.
37
+ - ac440299ef: Updated api docs generation to be compatible with Docusaurus 2-alpha and 2.x.
38
+ - Updated dependencies
39
+ - @backstage/errors@1.1.4
40
+ - @backstage/cli-common@0.1.11
41
+
3
42
  ## 0.1.0-next.2
4
43
 
5
44
  ### 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("---");
@@ -1058,7 +1073,7 @@ const buildApiReports = async (paths$1 = [], opts) => {
1058
1073
  console.log("");
1059
1074
  }
1060
1075
  let temporaryTsConfigPath;
1061
- if (selectedPackageDirs) {
1076
+ if (!isAllPackages) {
1062
1077
  temporaryTsConfigPath = await createTemporaryTsConfig(selectedPackageDirs);
1063
1078
  }
1064
1079
  const tsconfigFilePath = temporaryTsConfigPath != null ? temporaryTsConfigPath : paths.resolveTargetRoot("tsconfig.json");
@@ -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-14c64adc.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-14c64adc.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.1-next.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,13 +30,11 @@
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
- "@microsoft/api-extractor-model": "^7.17.2",
39
- "@microsoft/tsdoc": "0.14.1",
40
38
  "chalk": "^4.0.0",
41
39
  "commander": "^9.1.0",
42
40
  "fs-extra": "10.1.0",
@@ -46,11 +44,24 @@
46
44
  "ts-node": "^10.0.0"
47
45
  },
48
46
  "devDependencies": {
49
- "@backstage/cli": "^0.22.0-next.4",
47
+ "@backstage/cli": "^0.22.1-next.0",
50
48
  "@types/is-glob": "^4.0.2",
51
49
  "@types/mock-fs": "^4.13.0",
52
50
  "mock-fs": "^5.1.0"
53
51
  },
52
+ "peerDependencies": {
53
+ "@microsoft/api-extractor-model": "*",
54
+ "@microsoft/tsdoc": "*",
55
+ "@microsoft/tsdoc-config": "*",
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"