@backstage/repo-tools 0.9.0 → 0.9.1-next.1
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 +22 -0
- package/dist/cjs/{api-reports-CRnhrg4z.cjs.js → api-reports-CA6tcw3u.cjs.js} +80 -118
- package/dist/cjs/{diff-D9fyiOf7.cjs.js → diff-Bd4yK7bq.cjs.js} +9 -16
- package/dist/cjs/{diff-BrXlSJqI.cjs.js → diff-CMZh-rYC.cjs.js} +2 -2
- package/dist/cjs/{exec-B_ZXslMw.cjs.js → exec-CZ6yu47S.cjs.js} +3 -4
- package/dist/cjs/{fuzz-gO9-nyTu.cjs.js → fuzz-BoxTBzQz.cjs.js} +2 -2
- package/dist/cjs/{fuzz-B61zys1g.cjs.js → fuzz-D2aOy9yo.cjs.js} +3 -6
- package/dist/cjs/{generate-catalog-info-CwsIGc45.cjs.js → generate-catalog-info-DxKb-9Wh.cjs.js} +6 -9
- package/dist/cjs/{index-BNyHrq4J.cjs.js → index-C5SnL4Ah.cjs.js} +9 -7
- package/dist/cjs/{init-YP8KI_MT.cjs.js → init-CspVKpxN.cjs.js} +2 -2
- package/dist/cjs/{knip-reports-BbrRgCsA.cjs.js → knip-reports-028OuOct.cjs.js} +2 -2
- package/dist/cjs/{lint-CVQdMx3q.cjs.js → lint-DqMp4VN_.cjs.js} +3 -3
- package/dist/cjs/{runner-CRAhuK8A.cjs.js → runner-DMC006Gs.cjs.js} +4 -5
- package/dist/cjs/{test-j65jkk-j.cjs.js → test-DVGFVBAP.cjs.js} +5 -5
- package/dist/cjs/{type-deps-N7WYsPqI.cjs.js → type-deps-DgJcEpV_.cjs.js} +3 -9
- package/dist/cjs/{verify-Ci5ngO-H.cjs.js → verify-ARmbHOf8.cjs.js} +2 -2
- package/dist/index.cjs.js +17 -21
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @backstage/repo-tools
|
|
2
2
|
|
|
3
|
+
## 0.9.1-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8721a02: Add `--client-additional-properties` option to `openapi generate` command
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-plugin-api@0.6.19-next.1
|
|
10
|
+
- @backstage/cli-node@0.2.6-next.0
|
|
11
|
+
- @backstage/config-loader@1.8.0
|
|
12
|
+
|
|
13
|
+
## 0.9.1-next.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @backstage/cli-node@0.2.6-next.0
|
|
19
|
+
- @backstage/backend-plugin-api@0.6.19-next.0
|
|
20
|
+
- @backstage/config-loader@1.8.0
|
|
21
|
+
- @backstage/catalog-model@1.5.0
|
|
22
|
+
- @backstage/cli-common@0.1.13
|
|
23
|
+
- @backstage/errors@1.2.4
|
|
24
|
+
|
|
3
25
|
## 0.9.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -26,31 +26,6 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
26
26
|
|
|
27
27
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
28
28
|
|
|
29
|
-
var __defProp = Object.defineProperty;
|
|
30
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
31
|
-
var __publicField = (obj, key, value) => {
|
|
32
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
33
|
-
return value;
|
|
34
|
-
};
|
|
35
|
-
var __accessCheck = (obj, member, msg) => {
|
|
36
|
-
if (!member.has(obj))
|
|
37
|
-
throw TypeError("Cannot " + msg);
|
|
38
|
-
};
|
|
39
|
-
var __privateGet = (obj, member, getter) => {
|
|
40
|
-
__accessCheck(obj, member, "read from private field");
|
|
41
|
-
return member.get(obj);
|
|
42
|
-
};
|
|
43
|
-
var __privateAdd = (obj, member, value) => {
|
|
44
|
-
if (member.has(obj))
|
|
45
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
46
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
47
|
-
};
|
|
48
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
49
|
-
__accessCheck(obj, member, "write to private field");
|
|
50
|
-
member.set(obj, value);
|
|
51
|
-
return value;
|
|
52
|
-
};
|
|
53
|
-
var _tokens;
|
|
54
29
|
const tmpDir = paths.paths.resolveTargetRoot(
|
|
55
30
|
"./node_modules/.cache/api-extractor"
|
|
56
31
|
);
|
|
@@ -73,13 +48,11 @@ function patchFileMessageFetcher(router, transform) {
|
|
|
73
48
|
}
|
|
74
49
|
const originalGenerateReviewFileContent = ApiReportGenerator.generateReviewFileContent;
|
|
75
50
|
ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewFileContent(collector, ...moreArgs) {
|
|
76
|
-
var _a;
|
|
77
51
|
const program = collector.program;
|
|
78
52
|
patchFileMessageFetcher(
|
|
79
53
|
collector.messageRouter,
|
|
80
54
|
(messages) => {
|
|
81
55
|
return messages.filter((message) => {
|
|
82
|
-
var _a2, _b, _c, _d;
|
|
83
56
|
if (message.messageId !== "ae-forgotten-export") {
|
|
84
57
|
return true;
|
|
85
58
|
}
|
|
@@ -96,17 +69,17 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
|
|
|
96
69
|
`Failed to find source file in program at path "${message.sourceFilePath}"`
|
|
97
70
|
);
|
|
98
71
|
}
|
|
99
|
-
let localName =
|
|
72
|
+
let localName = sourceFile.identifiers?.get(symbolName);
|
|
100
73
|
if (!localName) {
|
|
101
74
|
const [, trimmedSymbolName] = symbolName.match(/(.*)_\d+/) || [];
|
|
102
|
-
localName =
|
|
75
|
+
localName = sourceFile.identifiers?.get(trimmedSymbolName);
|
|
103
76
|
}
|
|
104
77
|
if (!localName) {
|
|
105
78
|
throw new Error(
|
|
106
79
|
`Unable to find local name of "${symbolName}" in ${sourceFile.fileName}`
|
|
107
80
|
);
|
|
108
81
|
}
|
|
109
|
-
const local =
|
|
82
|
+
const local = sourceFile.locals?.get(localName);
|
|
110
83
|
if (!local) {
|
|
111
84
|
return true;
|
|
112
85
|
}
|
|
@@ -116,13 +89,13 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
|
|
|
116
89
|
`Unable to find type declaration of "${symbolName}" in ${sourceFile.fileName}`
|
|
117
90
|
);
|
|
118
91
|
}
|
|
119
|
-
const declarations =
|
|
92
|
+
const declarations = type.aliasSymbol?.declarations;
|
|
120
93
|
if (!declarations || declarations.length === 0) {
|
|
121
94
|
return true;
|
|
122
95
|
}
|
|
123
96
|
const isIgnored = declarations.some((declaration) => {
|
|
124
97
|
const tags = [declaration.jsDoc].flat().filter(Boolean).flatMap((tagNode) => tagNode.tags);
|
|
125
|
-
return tags.some((tag) =>
|
|
98
|
+
return tags.some((tag) => tag?.tagName.text === "ignore");
|
|
126
99
|
});
|
|
127
100
|
return !isIgnored;
|
|
128
101
|
});
|
|
@@ -135,7 +108,7 @@ ApiReportGenerator.generateReviewFileContent = function decoratedGenerateReviewF
|
|
|
135
108
|
);
|
|
136
109
|
try {
|
|
137
110
|
const prettier = require("prettier");
|
|
138
|
-
const config =
|
|
111
|
+
const config = prettier.resolveConfig.sync(paths.paths.targetRoot) ?? {};
|
|
139
112
|
return prettier.format(content, {
|
|
140
113
|
...config,
|
|
141
114
|
parser: "markdown"
|
|
@@ -464,13 +437,13 @@ async function runApiExtraction({
|
|
|
464
437
|
}
|
|
465
438
|
}
|
|
466
439
|
class ExcerptTokenMatcher {
|
|
440
|
+
#tokens;
|
|
467
441
|
constructor(tokens) {
|
|
468
|
-
|
|
469
|
-
__privateSet(this, _tokens, tokens.slice());
|
|
442
|
+
this.#tokens = tokens.slice();
|
|
470
443
|
}
|
|
471
444
|
nextContent() {
|
|
472
|
-
const token =
|
|
473
|
-
if (
|
|
445
|
+
const token = this.#tokens.shift();
|
|
446
|
+
if (token?.kind === "Content") {
|
|
474
447
|
return token.text;
|
|
475
448
|
}
|
|
476
449
|
return void 0;
|
|
@@ -482,7 +455,7 @@ class ExcerptTokenMatcher {
|
|
|
482
455
|
getTokensUntilArrow() {
|
|
483
456
|
const tokens = [];
|
|
484
457
|
for (; ; ) {
|
|
485
|
-
const token =
|
|
458
|
+
const token = this.#tokens.shift();
|
|
486
459
|
if (token === void 0) {
|
|
487
460
|
return void 0;
|
|
488
461
|
}
|
|
@@ -493,12 +466,12 @@ class ExcerptTokenMatcher {
|
|
|
493
466
|
}
|
|
494
467
|
}
|
|
495
468
|
getComponentReturnTokens() {
|
|
496
|
-
const first =
|
|
469
|
+
const first = this.#tokens.shift();
|
|
497
470
|
if (!first) {
|
|
498
471
|
return void 0;
|
|
499
472
|
}
|
|
500
|
-
const second =
|
|
501
|
-
if (
|
|
473
|
+
const second = this.#tokens.shift();
|
|
474
|
+
if (this.#tokens.length !== 0) {
|
|
502
475
|
return void 0;
|
|
503
476
|
}
|
|
504
477
|
if (first.kind !== "Reference" || first.text !== "JSX.Element") {
|
|
@@ -512,8 +485,7 @@ class ExcerptTokenMatcher {
|
|
|
512
485
|
return void 0;
|
|
513
486
|
}
|
|
514
487
|
}
|
|
515
|
-
|
|
516
|
-
const _ApiModelTransforms = class _ApiModelTransforms {
|
|
488
|
+
class ApiModelTransforms {
|
|
517
489
|
static deserializeWithTransforms(serialized, transforms) {
|
|
518
490
|
if (serialized.kind !== "Package") {
|
|
519
491
|
throw new Error(
|
|
@@ -547,8 +519,35 @@ const _ApiModelTransforms = class _ApiModelTransforms {
|
|
|
547
519
|
transformed.metadata
|
|
548
520
|
);
|
|
549
521
|
}
|
|
522
|
+
static transformArrowComponents = (member) => {
|
|
523
|
+
if (member.kind !== "Variable") {
|
|
524
|
+
return member;
|
|
525
|
+
}
|
|
526
|
+
const { name, excerptTokens } = member;
|
|
527
|
+
const [firstChar] = name;
|
|
528
|
+
if (firstChar.toLocaleUpperCase("en-US") !== firstChar) {
|
|
529
|
+
return member;
|
|
530
|
+
}
|
|
531
|
+
const tokens = new ExcerptTokenMatcher(excerptTokens);
|
|
532
|
+
if (tokens.nextContent() !== `${name}: `) {
|
|
533
|
+
return member;
|
|
534
|
+
}
|
|
535
|
+
const declStart = tokens.nextContent();
|
|
536
|
+
if (declStart === "(props: " || declStart === "(_props: ") {
|
|
537
|
+
const props = tokens.getTokensUntilArrow();
|
|
538
|
+
const ret = tokens.getComponentReturnTokens();
|
|
539
|
+
if (props && ret) {
|
|
540
|
+
return this.makeComponentMember(member, ret, props);
|
|
541
|
+
}
|
|
542
|
+
} else if (declStart === "() => ") {
|
|
543
|
+
const ret = tokens.getComponentReturnTokens();
|
|
544
|
+
if (ret) {
|
|
545
|
+
return this.makeComponentMember(member, ret);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
return member;
|
|
549
|
+
};
|
|
550
550
|
static makeComponentMember(member, ret, props) {
|
|
551
|
-
var _a;
|
|
552
551
|
const declTokens = props ? [
|
|
553
552
|
{
|
|
554
553
|
kind: "Content",
|
|
@@ -569,7 +568,7 @@ const _ApiModelTransforms = class _ApiModelTransforms {
|
|
|
569
568
|
kind: "Function",
|
|
570
569
|
name: member.name,
|
|
571
570
|
releaseTag: member.releaseTag,
|
|
572
|
-
docComment:
|
|
571
|
+
docComment: member.docComment ?? "",
|
|
573
572
|
canonicalReference: member.canonicalReference,
|
|
574
573
|
excerptTokens: [...declTokens, ...ret],
|
|
575
574
|
returnTypeTokenRange: {
|
|
@@ -588,53 +587,24 @@ const _ApiModelTransforms = class _ApiModelTransforms {
|
|
|
588
587
|
overloadIndex: 1
|
|
589
588
|
};
|
|
590
589
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
const declStart = tokens.nextContent();
|
|
606
|
-
if (declStart === "(props: " || declStart === "(_props: ") {
|
|
607
|
-
const props = tokens.getTokensUntilArrow();
|
|
608
|
-
const ret = tokens.getComponentReturnTokens();
|
|
609
|
-
if (props && ret) {
|
|
610
|
-
return _ApiModelTransforms.makeComponentMember(member, ret, props);
|
|
611
|
-
}
|
|
612
|
-
} else if (declStart === "() => ") {
|
|
613
|
-
const ret = tokens.getComponentReturnTokens();
|
|
614
|
-
if (ret) {
|
|
615
|
-
return _ApiModelTransforms.makeComponentMember(member, ret);
|
|
590
|
+
static transformTrimDeclare = (member) => {
|
|
591
|
+
const { excerptTokens } = member;
|
|
592
|
+
const firstContent = new ExcerptTokenMatcher(excerptTokens).nextContent();
|
|
593
|
+
if (firstContent && firstContent.startsWith("export declare ")) {
|
|
594
|
+
return {
|
|
595
|
+
...member,
|
|
596
|
+
excerptTokens: [
|
|
597
|
+
{
|
|
598
|
+
kind: "Content",
|
|
599
|
+
text: firstContent.slice("export declare ".length)
|
|
600
|
+
},
|
|
601
|
+
...excerptTokens.slice(1)
|
|
602
|
+
]
|
|
603
|
+
};
|
|
616
604
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
__publicField(_ApiModelTransforms, "transformTrimDeclare", (member) => {
|
|
621
|
-
const { excerptTokens } = member;
|
|
622
|
-
const firstContent = new ExcerptTokenMatcher(excerptTokens).nextContent();
|
|
623
|
-
if (firstContent && firstContent.startsWith("export declare ")) {
|
|
624
|
-
return {
|
|
625
|
-
...member,
|
|
626
|
-
excerptTokens: [
|
|
627
|
-
{
|
|
628
|
-
kind: "Content",
|
|
629
|
-
text: firstContent.slice("export declare ".length)
|
|
630
|
-
},
|
|
631
|
-
...excerptTokens.slice(1)
|
|
632
|
-
]
|
|
633
|
-
};
|
|
634
|
-
}
|
|
635
|
-
return member;
|
|
636
|
-
});
|
|
637
|
-
let ApiModelTransforms = _ApiModelTransforms;
|
|
605
|
+
return member;
|
|
606
|
+
};
|
|
607
|
+
}
|
|
638
608
|
async function buildDocs({
|
|
639
609
|
inputDir,
|
|
640
610
|
outputDir
|
|
@@ -656,27 +626,25 @@ async function buildDocs({
|
|
|
656
626
|
])
|
|
657
627
|
);
|
|
658
628
|
}
|
|
659
|
-
|
|
629
|
+
class DocFrontMatter extends tsdoc.DocNode {
|
|
630
|
+
static kind = "DocFrontMatter";
|
|
631
|
+
values;
|
|
660
632
|
constructor(parameters) {
|
|
661
633
|
super(parameters);
|
|
662
|
-
__publicField(this, "values");
|
|
663
634
|
this.values = parameters.values;
|
|
664
635
|
}
|
|
665
636
|
/** @override */
|
|
666
637
|
get kind() {
|
|
667
|
-
return
|
|
638
|
+
return DocFrontMatter.kind;
|
|
668
639
|
}
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
const _DocCodeSpanLink = class _DocCodeSpanLink extends tsdoc.DocLinkTag {
|
|
640
|
+
}
|
|
641
|
+
class DocCodeSpanLink extends tsdoc.DocLinkTag {
|
|
642
|
+
static kind = "DocCodeSpanLink";
|
|
673
643
|
/** @override */
|
|
674
644
|
get kind() {
|
|
675
|
-
return
|
|
645
|
+
return DocCodeSpanLink.kind;
|
|
676
646
|
}
|
|
677
|
-
}
|
|
678
|
-
__publicField(_DocCodeSpanLink, "kind", "DocCodeSpanLink");
|
|
679
|
-
let DocCodeSpanLink = _DocCodeSpanLink;
|
|
647
|
+
}
|
|
680
648
|
class CustomCustomMarkdownEmitter extends CustomMarkdownEmitter.CustomMarkdownEmitter {
|
|
681
649
|
// Until https://github.com/microsoft/rushstack/issues/2914 gets fixed or we change markdown renderer we need a fix
|
|
682
650
|
// to render pipe | character correctly.
|
|
@@ -898,7 +866,6 @@ async function categorizePackageDirs(packageDirs) {
|
|
|
898
866
|
const cliPackageDirs = new Array();
|
|
899
867
|
await Promise.all(
|
|
900
868
|
Array(10).fill(0).map(async () => {
|
|
901
|
-
var _a;
|
|
902
869
|
for (; ; ) {
|
|
903
870
|
const dir = dirs.pop();
|
|
904
871
|
if (!dir) {
|
|
@@ -910,7 +877,7 @@ async function categorizePackageDirs(packageDirs) {
|
|
|
910
877
|
}
|
|
911
878
|
throw error;
|
|
912
879
|
});
|
|
913
|
-
const role =
|
|
880
|
+
const role = pkgJson?.backstage?.role;
|
|
914
881
|
if (!role) {
|
|
915
882
|
return;
|
|
916
883
|
}
|
|
@@ -925,8 +892,7 @@ async function categorizePackageDirs(packageDirs) {
|
|
|
925
892
|
return { tsPackageDirs, cliPackageDirs };
|
|
926
893
|
}
|
|
927
894
|
function parseHelpPage(helpPageContent) {
|
|
928
|
-
|
|
929
|
-
const [, usage] = (_a = helpPageContent.match(/^\s*Usage: (.*)$/im)) != null ? _a : [];
|
|
895
|
+
const [, usage] = helpPageContent.match(/^\s*Usage: (.*)$/im) ?? [];
|
|
930
896
|
const lines = helpPageContent.split(/\r?\n/);
|
|
931
897
|
let options = new Array();
|
|
932
898
|
let commands = new Array();
|
|
@@ -942,15 +908,12 @@ function parseHelpPage(helpPageContent) {
|
|
|
942
908
|
);
|
|
943
909
|
const sectionLines = lines.slice(0, sectionEndIndex);
|
|
944
910
|
lines.splice(0, sectionLines.length);
|
|
945
|
-
const sectionItems = sectionLines.map((line) => {
|
|
946
|
-
|
|
947
|
-
return (_a2 = line.match(/^\s{1,8}(.*?)\s\s+/)) == null ? void 0 : _a2[1];
|
|
948
|
-
}).filter(Boolean);
|
|
949
|
-
if ((sectionName == null ? void 0 : sectionName.toLocaleLowerCase("en-US")) === "options:") {
|
|
911
|
+
const sectionItems = sectionLines.map((line) => line.match(/^\s{1,8}(.*?)\s\s+/)?.[1]).filter(Boolean);
|
|
912
|
+
if (sectionName?.toLocaleLowerCase("en-US") === "options:") {
|
|
950
913
|
options = sectionItems;
|
|
951
|
-
} else if (
|
|
914
|
+
} else if (sectionName?.toLocaleLowerCase("en-US") === "commands:") {
|
|
952
915
|
commands = sectionItems;
|
|
953
|
-
} else if (
|
|
916
|
+
} else if (sectionName?.toLocaleLowerCase("en-US") === "arguments:") {
|
|
954
917
|
commandArguments = sectionItems;
|
|
955
918
|
} else {
|
|
956
919
|
throw new Error(`Unknown CLI section: ${sectionName}`);
|
|
@@ -984,7 +947,6 @@ async function exploreCliHelpPages(run) {
|
|
|
984
947
|
return helpPages;
|
|
985
948
|
}
|
|
986
949
|
function generateCliReport(name, models) {
|
|
987
|
-
var _a;
|
|
988
950
|
const content = [
|
|
989
951
|
`## CLI Report file for "${name}"`,
|
|
990
952
|
"",
|
|
@@ -997,7 +959,7 @@ function generateCliReport(name, models) {
|
|
|
997
959
|
`### \`${[model.name, ...helpPage.path].join(" ")}\``,
|
|
998
960
|
"",
|
|
999
961
|
"```",
|
|
1000
|
-
`Usage: ${
|
|
962
|
+
`Usage: ${helpPage.usage ?? "<none>"}`
|
|
1001
963
|
);
|
|
1002
964
|
if (helpPage.options.length > 0) {
|
|
1003
965
|
content.push("", "Options:", ...helpPage.options.map((l) => ` ${l}`));
|
|
@@ -1096,7 +1058,7 @@ const buildApiReports = async (paths$1 = [], opts) => {
|
|
|
1096
1058
|
const allowWarnings = parseArrayOption(opts.allowWarnings);
|
|
1097
1059
|
const allowAllWarnings = opts.allowAllWarnings;
|
|
1098
1060
|
const omitMessages = parseArrayOption(opts.omitMessages);
|
|
1099
|
-
const isAllPackages = !
|
|
1061
|
+
const isAllPackages = !paths$1?.length;
|
|
1100
1062
|
const selectedPackageDirs = await paths.resolvePackagePaths({
|
|
1101
1063
|
paths: paths$1,
|
|
1102
1064
|
include: opts.include,
|
|
@@ -1117,7 +1079,7 @@ const buildApiReports = async (paths$1 = [], opts) => {
|
|
|
1117
1079
|
if (!isAllPackages) {
|
|
1118
1080
|
temporaryTsConfigPath = await createTemporaryTsConfig(selectedPackageDirs);
|
|
1119
1081
|
}
|
|
1120
|
-
const tsconfigFilePath = temporaryTsConfigPath
|
|
1082
|
+
const tsconfigFilePath = temporaryTsConfigPath ?? paths.paths.resolveTargetRoot("tsconfig.json");
|
|
1121
1083
|
if (runTsc) {
|
|
1122
1084
|
console.log("# Compiling TypeScript");
|
|
1123
1085
|
await generateTypeDeclarations(tsconfigFilePath);
|
|
@@ -1157,4 +1119,4 @@ function parseArrayOption(value) {
|
|
|
1157
1119
|
}
|
|
1158
1120
|
|
|
1159
1121
|
exports.buildApiReports = buildApiReports;
|
|
1160
|
-
//# sourceMappingURL=api-reports-
|
|
1122
|
+
//# sourceMappingURL=api-reports-CA6tcw3u.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var cliNode = require('@backstage/cli-node');
|
|
4
|
-
var exec = require('./exec-
|
|
4
|
+
var exec = require('./exec-CZ6yu47S.cjs.js');
|
|
5
5
|
var openapiUtilities = require('@useoptic/openapi-utilities');
|
|
6
6
|
var paths = require('./paths-BvbxdT_S.cjs.js');
|
|
7
7
|
var constants = require('./constants-Dwa51b6l.cjs.js');
|
|
@@ -193,7 +193,6 @@ function cleanUpApiName(e) {
|
|
|
193
193
|
e.apiName = e.apiName.replace(paths.paths.targetDir, "").replace(constants.YAML_SCHEMA_PATH, "");
|
|
194
194
|
}
|
|
195
195
|
async function command(opts) {
|
|
196
|
-
var _a, _b, _c, _d, _e;
|
|
197
196
|
let packages = await cliNode.PackageGraph.listTargetPackages();
|
|
198
197
|
let since = "";
|
|
199
198
|
if (opts.since) {
|
|
@@ -210,10 +209,7 @@ async function command(opts) {
|
|
|
210
209
|
(pkg) => changedOpenApiSpecs.some((e) => e.startsWith(`${pkg.dir}/`))
|
|
211
210
|
);
|
|
212
211
|
}
|
|
213
|
-
const checkablePackages = packages.filter((e) =>
|
|
214
|
-
var _a2;
|
|
215
|
-
return (_a2 = e.packageJson.scripts) == null ? void 0 : _a2.diff;
|
|
216
|
-
});
|
|
212
|
+
const checkablePackages = packages.filter((e) => e.packageJson.scripts?.diff);
|
|
217
213
|
try {
|
|
218
214
|
const outputs = {
|
|
219
215
|
completed: [],
|
|
@@ -232,15 +228,12 @@ async function command(opts) {
|
|
|
232
228
|
}
|
|
233
229
|
);
|
|
234
230
|
const result = JSON.parse(stdout.toString());
|
|
235
|
-
outputs.completed.push(...
|
|
236
|
-
outputs.failed.push(...
|
|
237
|
-
outputs.noop.push(...
|
|
231
|
+
outputs.completed.push(...result.completed ?? []);
|
|
232
|
+
outputs.failed.push(...result.failed ?? []);
|
|
233
|
+
outputs.noop.push(...result.noop ?? []);
|
|
238
234
|
}
|
|
239
|
-
for (const pkg of packages.filter((e) => {
|
|
240
|
-
|
|
241
|
-
return !((_a2 = e.packageJson.scripts) == null ? void 0 : _a2.diff);
|
|
242
|
-
})) {
|
|
243
|
-
(_d = outputs.warning) == null ? void 0 : _d.push({
|
|
235
|
+
for (const pkg of packages.filter((e) => !e.packageJson.scripts?.diff)) {
|
|
236
|
+
outputs.warning?.push({
|
|
244
237
|
apiName: `${pkg.dir}/`,
|
|
245
238
|
warning: "No diff script found in package.json"
|
|
246
239
|
});
|
|
@@ -248,7 +241,7 @@ async function command(opts) {
|
|
|
248
241
|
outputs.completed.forEach(cleanUpApiName);
|
|
249
242
|
outputs.failed.forEach(cleanUpApiName);
|
|
250
243
|
outputs.noop.forEach(cleanUpApiName);
|
|
251
|
-
|
|
244
|
+
outputs.warning?.forEach(cleanUpApiName);
|
|
252
245
|
const { stdout: currentSha } = await exec.exec("git", ["rev-parse", "HEAD"]);
|
|
253
246
|
console.log(
|
|
254
247
|
generateCompareSummaryMarkdown(
|
|
@@ -268,4 +261,4 @@ async function command(opts) {
|
|
|
268
261
|
}
|
|
269
262
|
|
|
270
263
|
exports.command = command;
|
|
271
|
-
//# sourceMappingURL=diff-
|
|
264
|
+
//# sourceMappingURL=diff-Bd4yK7bq.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
|
-
var exec = require('./exec-
|
|
4
|
+
var exec = require('./exec-CZ6yu47S.cjs.js');
|
|
5
5
|
var helpers = require('./helpers-ja_ryoK_.cjs.js');
|
|
6
6
|
var paths = require('./paths-BvbxdT_S.cjs.js');
|
|
7
7
|
var process$1 = require('process');
|
|
@@ -81,4 +81,4 @@ async function command(opts) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
exports.command = command;
|
|
84
|
-
//# sourceMappingURL=diff-
|
|
84
|
+
//# sourceMappingURL=diff-CMZh-rYC.cjs.js.map
|
|
@@ -15,11 +15,10 @@ const exec = (command, args = [], options) => {
|
|
|
15
15
|
};
|
|
16
16
|
const spawn = (command, args, options) => {
|
|
17
17
|
return new Promise((resolve, reject) => {
|
|
18
|
-
|
|
19
|
-
const cp = child_process.spawn(command, args, options != null ? options : {});
|
|
18
|
+
const cp = child_process.spawn(command, args, options ?? {});
|
|
20
19
|
const error = [];
|
|
21
20
|
const stdout = [];
|
|
22
|
-
|
|
21
|
+
cp.stdout?.on("data", (data) => {
|
|
23
22
|
stdout.push(data.toString());
|
|
24
23
|
});
|
|
25
24
|
cp.on("error", (e) => {
|
|
@@ -36,4 +35,4 @@ const spawn = (command, args, options) => {
|
|
|
36
35
|
|
|
37
36
|
exports.exec = exec;
|
|
38
37
|
exports.spawn = spawn;
|
|
39
|
-
//# sourceMappingURL=exec-
|
|
38
|
+
//# sourceMappingURL=exec-CZ6yu47S.cjs.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
4
|
var paths = require('./paths-BvbxdT_S.cjs.js');
|
|
5
5
|
var chalk = require('chalk');
|
|
6
|
-
var exec = require('./exec-
|
|
6
|
+
var exec = require('./exec-CZ6yu47S.cjs.js');
|
|
7
7
|
var helpers = require('./helpers-ja_ryoK_.cjs.js');
|
|
8
8
|
var configLoader = require('@backstage/config-loader');
|
|
9
9
|
var YAML = require('js-yaml');
|
|
@@ -85,4 +85,4 @@ async function command(opts) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
exports.command = command;
|
|
88
|
-
//# sourceMappingURL=fuzz-
|
|
88
|
+
//# sourceMappingURL=fuzz-BoxTBzQz.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var cliNode = require('@backstage/cli-node');
|
|
4
|
-
var exec = require('./exec-
|
|
4
|
+
var exec = require('./exec-CZ6yu47S.cjs.js');
|
|
5
5
|
var chalk = require('chalk');
|
|
6
6
|
require('util');
|
|
7
7
|
require('child_process');
|
|
@@ -24,10 +24,7 @@ async function command(opts) {
|
|
|
24
24
|
);
|
|
25
25
|
packages = Array.from(withDevDependents).map((name) => graph.get(name));
|
|
26
26
|
}
|
|
27
|
-
const fuzzablePackages = packages.filter((e) =>
|
|
28
|
-
var _a;
|
|
29
|
-
return (_a = e.packageJson.scripts) == null ? void 0 : _a.fuzz;
|
|
30
|
-
});
|
|
27
|
+
const fuzzablePackages = packages.filter((e) => e.packageJson.scripts?.fuzz);
|
|
31
28
|
try {
|
|
32
29
|
for (const pkg of fuzzablePackages) {
|
|
33
30
|
await exec.exec("yarn", ["fuzz"], {
|
|
@@ -42,4 +39,4 @@ async function command(opts) {
|
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
exports.command = command;
|
|
45
|
-
//# sourceMappingURL=fuzz-
|
|
42
|
+
//# sourceMappingURL=fuzz-D2aOy9yo.cjs.js.map
|
package/dist/cjs/{generate-catalog-info-CwsIGc45.cjs.js → generate-catalog-info-DxKb-9Wh.cjs.js}
RENAMED
|
@@ -20,8 +20,7 @@ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
|
20
20
|
const readFile = util.promisify(fs__default.default.readFile);
|
|
21
21
|
const writeFile = util.promisify(fs__default.default.writeFile);
|
|
22
22
|
function isBackstagePackage(packageJson) {
|
|
23
|
-
|
|
24
|
-
return packageJson && packageJson.hasOwnProperty("backstage") && ((_a = packageJson == null ? void 0 : packageJson.backstage) == null ? void 0 : _a.role) !== "undefined";
|
|
23
|
+
return packageJson && packageJson.hasOwnProperty("backstage") && packageJson?.backstage?.role !== "undefined";
|
|
25
24
|
}
|
|
26
25
|
const isRejected = (input) => input.status === "rejected";
|
|
27
26
|
const isFulfilled = (input) => input.status === "fulfilled";
|
|
@@ -139,7 +138,6 @@ async function createCatalogInfoYaml(options) {
|
|
|
139
138
|
return instruction;
|
|
140
139
|
}
|
|
141
140
|
async function fixCatalogInfoYaml(options) {
|
|
142
|
-
var _a, _b, _c;
|
|
143
141
|
const { ci, codeowners, dryRun, packageJson, yamlPath, yamlString } = options;
|
|
144
142
|
const possibleOwners = getPossibleCodeowners(
|
|
145
143
|
codeowners,
|
|
@@ -152,12 +150,12 @@ async function fixCatalogInfoYaml(options) {
|
|
|
152
150
|
} catch (e) {
|
|
153
151
|
throw new Error(`Unable to parse ${path.relative(".", yamlPath)}: ${e}`);
|
|
154
152
|
}
|
|
155
|
-
const badOwner = !possibleOwners.includes(
|
|
153
|
+
const badOwner = !possibleOwners.includes(yamlJson.spec?.owner);
|
|
156
154
|
const badTitle = yamlJson.metadata.title !== packageJson.name;
|
|
157
155
|
const badName = yamlJson.metadata.name !== safeName;
|
|
158
|
-
const badType =
|
|
156
|
+
const badType = yamlJson.spec?.type !== `backstage-${packageJson.backstage.role}`;
|
|
159
157
|
if (badOwner || badTitle || badName || badType) {
|
|
160
|
-
const owner = badOwner ? getOwnerFromCodeowners(codeowners, yamlPath) :
|
|
158
|
+
const owner = badOwner ? getOwnerFromCodeowners(codeowners, yamlPath) : yamlJson.spec?.owner;
|
|
161
159
|
const newJson = createOrMergeEntity(packageJson, owner, yamlJson);
|
|
162
160
|
const instructions = [`Update ${path.relative(".", yamlPath)}`];
|
|
163
161
|
if (ci) {
|
|
@@ -194,7 +192,6 @@ async function fixCatalogInfoYaml(options) {
|
|
|
194
192
|
return "";
|
|
195
193
|
}
|
|
196
194
|
function createOrMergeEntity(packageJson, owner, existingEntity = {}) {
|
|
197
|
-
var _a;
|
|
198
195
|
const entityName = safeEntityName(packageJson.name);
|
|
199
196
|
return {
|
|
200
197
|
...existingEntity,
|
|
@@ -205,7 +202,7 @@ function createOrMergeEntity(packageJson, owner, existingEntity = {}) {
|
|
|
205
202
|
// Provide default name/title/description values.
|
|
206
203
|
name: entityName,
|
|
207
204
|
title: packageJson.name,
|
|
208
|
-
...packageJson.description && !
|
|
205
|
+
...packageJson.description && !existingEntity.metadata?.description ? { description: packageJson.description } : void 0
|
|
209
206
|
},
|
|
210
207
|
spec: {
|
|
211
208
|
lifecycle: "experimental",
|
|
@@ -217,4 +214,4 @@ function createOrMergeEntity(packageJson, owner, existingEntity = {}) {
|
|
|
217
214
|
}
|
|
218
215
|
|
|
219
216
|
exports.default = generateCatalogInfo;
|
|
220
|
-
//# sourceMappingURL=generate-catalog-info-
|
|
217
|
+
//# sourceMappingURL=generate-catalog-info-DxKb-9Wh.cjs.js.map
|
|
@@ -5,7 +5,7 @@ var path = require('path');
|
|
|
5
5
|
var constants = require('./constants-Dwa51b6l.cjs.js');
|
|
6
6
|
var paths = require('./paths-BvbxdT_S.cjs.js');
|
|
7
7
|
var fs = require('fs-extra');
|
|
8
|
-
var exec$1 = require('./exec-
|
|
8
|
+
var exec$1 = require('./exec-CZ6yu47S.cjs.js');
|
|
9
9
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
10
10
|
var helpers = require('./helpers-ja_ryoK_.cjs.js');
|
|
11
11
|
var YAML = require('js-yaml');
|
|
@@ -21,12 +21,13 @@ var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
|
21
21
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
22
22
|
var YAML__default = /*#__PURE__*/_interopDefaultCompat(YAML);
|
|
23
23
|
|
|
24
|
-
async function generate$1(outputDirectory) {
|
|
24
|
+
async function generate$1(outputDirectory, clientAdditionalProperties) {
|
|
25
25
|
const resolvedOpenapiPath = await helpers.getPathToCurrentOpenApiSpec();
|
|
26
26
|
const resolvedOutputDirectory = paths.paths.resolveTargetRoot(
|
|
27
27
|
outputDirectory,
|
|
28
28
|
constants.OUTPUT_PATH
|
|
29
29
|
);
|
|
30
|
+
const additionalProperties = clientAdditionalProperties ? `--additional-properties=${clientAdditionalProperties}` : "";
|
|
30
31
|
fs.mkdirpSync(resolvedOutputDirectory);
|
|
31
32
|
await fs__default.default.mkdirp(resolvedOutputDirectory);
|
|
32
33
|
await fs__default.default.writeFile(
|
|
@@ -50,7 +51,8 @@ async function generate$1(outputDirectory) {
|
|
|
50
51
|
"templates/typescript-backstage.yaml"
|
|
51
52
|
),
|
|
52
53
|
"--generator-key",
|
|
53
|
-
"v3.0"
|
|
54
|
+
"v3.0",
|
|
55
|
+
additionalProperties
|
|
54
56
|
],
|
|
55
57
|
{
|
|
56
58
|
maxBuffer: Number.MAX_VALUE,
|
|
@@ -73,9 +75,9 @@ async function generate$1(outputDirectory) {
|
|
|
73
75
|
force: true
|
|
74
76
|
});
|
|
75
77
|
}
|
|
76
|
-
async function command$2(outputPackage) {
|
|
78
|
+
async function command$2(outputPackage, clientAdditionalProperties) {
|
|
77
79
|
try {
|
|
78
|
-
await generate$1(outputPackage);
|
|
80
|
+
await generate$1(outputPackage, clientAdditionalProperties);
|
|
79
81
|
console.log(
|
|
80
82
|
chalk__default.default.green(`Generated client in ${outputPackage}/${constants.OUTPUT_PATH}`)
|
|
81
83
|
);
|
|
@@ -132,7 +134,7 @@ async function command(opts) {
|
|
|
132
134
|
process.exit(1);
|
|
133
135
|
}
|
|
134
136
|
if (opts.clientPackage) {
|
|
135
|
-
await command$2(opts.clientPackage);
|
|
137
|
+
await command$2(opts.clientPackage, opts.clientAdditionalProperties);
|
|
136
138
|
}
|
|
137
139
|
if (opts.server) {
|
|
138
140
|
await command$1();
|
|
@@ -140,4 +142,4 @@ async function command(opts) {
|
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
exports.command = command;
|
|
143
|
-
//# sourceMappingURL=index-
|
|
145
|
+
//# sourceMappingURL=index-C5SnL4Ah.cjs.js.map
|
|
@@ -4,7 +4,7 @@ var fs = require('fs-extra');
|
|
|
4
4
|
var constants = require('./constants-Dwa51b6l.cjs.js');
|
|
5
5
|
var paths = require('./paths-BvbxdT_S.cjs.js');
|
|
6
6
|
var chalk = require('chalk');
|
|
7
|
-
var exec = require('./exec-
|
|
7
|
+
var exec = require('./exec-CZ6yu47S.cjs.js');
|
|
8
8
|
var helpers = require('./helpers-ja_ryoK_.cjs.js');
|
|
9
9
|
require('@backstage/cli-common');
|
|
10
10
|
require('@backstage/cli-node');
|
|
@@ -71,4 +71,4 @@ async function singleCommand() {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
exports.singleCommand = singleCommand;
|
|
74
|
-
//# sourceMappingURL=init-
|
|
74
|
+
//# sourceMappingURL=init-CspVKpxN.cjs.js.map
|
|
@@ -156,7 +156,7 @@ async function runKnipReports({
|
|
|
156
156
|
|
|
157
157
|
const buildKnipReports = async (paths$1 = [], opts) => {
|
|
158
158
|
const isCiBuild = opts.ci;
|
|
159
|
-
const isAllPackages = !
|
|
159
|
+
const isAllPackages = !paths$1?.length;
|
|
160
160
|
const selectedPackageDirs = await paths.resolvePackagePaths({
|
|
161
161
|
paths: paths$1,
|
|
162
162
|
include: opts.include,
|
|
@@ -187,4 +187,4 @@ const buildKnipReports = async (paths$1 = [], opts) => {
|
|
|
187
187
|
};
|
|
188
188
|
|
|
189
189
|
exports.buildKnipReports = buildKnipReports;
|
|
190
|
-
//# sourceMappingURL=knip-reports-
|
|
190
|
+
//# sourceMappingURL=knip-reports-028OuOct.cjs.js.map
|
|
@@ -5,7 +5,7 @@ var spectralParsers = require('@stoplight/spectral-parsers');
|
|
|
5
5
|
var ruleset = require('@apisyouwonthate/style-guide');
|
|
6
6
|
var fs = require('fs-extra');
|
|
7
7
|
var chalk = require('chalk');
|
|
8
|
-
var runner = require('./runner-
|
|
8
|
+
var runner = require('./runner-DMC006Gs.cjs.js');
|
|
9
9
|
var spectralRulesets = require('@stoplight/spectral-rulesets');
|
|
10
10
|
var spectralFunctions = require('@stoplight/spectral-functions');
|
|
11
11
|
var types = require('@stoplight/types');
|
|
@@ -27,7 +27,7 @@ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
|
27
27
|
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
28
28
|
|
|
29
29
|
async function lint(directoryPath, config) {
|
|
30
|
-
const { strict } = config
|
|
30
|
+
const { strict } = config ?? {};
|
|
31
31
|
let openapiPath = "";
|
|
32
32
|
try {
|
|
33
33
|
openapiPath = await helpers.getPathToOpenApiSpec(directoryPath);
|
|
@@ -104,4 +104,4 @@ async function bulkCommand(paths = [], options) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
exports.bulkCommand = bulkCommand;
|
|
107
|
-
//# sourceMappingURL=lint-
|
|
107
|
+
//# sourceMappingURL=lint-DqMp4VN_.cjs.js.map
|
|
@@ -11,10 +11,9 @@ var pLimit__default = /*#__PURE__*/_interopDefaultCompat(pLimit);
|
|
|
11
11
|
var portFinder__default = /*#__PURE__*/_interopDefaultCompat(portFinder);
|
|
12
12
|
|
|
13
13
|
async function runner(paths$1, command, options) {
|
|
14
|
-
var _a;
|
|
15
14
|
const packages = await paths.resolvePackagePaths({ paths: paths$1 });
|
|
16
|
-
const limit = pLimit__default.default(
|
|
17
|
-
let port =
|
|
15
|
+
const limit = pLimit__default.default(options?.concurrencyLimit ?? 5);
|
|
16
|
+
let port = options?.startingPort && await portFinder__default.default.getPortPromise({
|
|
18
17
|
// Prevent collisions with optic which runs 8000->8999
|
|
19
18
|
port: options.startingPort,
|
|
20
19
|
stopPort: options.startingPort + 1e3
|
|
@@ -25,7 +24,7 @@ async function runner(paths$1, command, options) {
|
|
|
25
24
|
let resultText = "";
|
|
26
25
|
try {
|
|
27
26
|
if (port)
|
|
28
|
-
port =
|
|
27
|
+
port = options?.startingPort && await portFinder__default.default.getPortPromise({
|
|
29
28
|
// Prevent collisions with optic which runs 8000->8999
|
|
30
29
|
port: port + 1,
|
|
31
30
|
stopPort: options.startingPort + 1e3
|
|
@@ -46,4 +45,4 @@ async function runner(paths$1, command, options) {
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
exports.runner = runner;
|
|
49
|
-
//# sourceMappingURL=runner-
|
|
48
|
+
//# sourceMappingURL=runner-DMC006Gs.cjs.js.map
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
4
|
var path = require('path');
|
|
5
5
|
var chalk = require('chalk');
|
|
6
|
-
var runner = require('./runner-
|
|
6
|
+
var runner = require('./runner-DMC006Gs.cjs.js');
|
|
7
7
|
var constants = require('./constants-Dwa51b6l.cjs.js');
|
|
8
8
|
var paths = require('./paths-BvbxdT_S.cjs.js');
|
|
9
|
-
var exec = require('./exec-
|
|
9
|
+
var exec = require('./exec-CZ6yu47S.cjs.js');
|
|
10
10
|
var helpers = require('./helpers-ja_ryoK_.cjs.js');
|
|
11
11
|
require('p-limit');
|
|
12
12
|
require('portfinder');
|
|
@@ -47,7 +47,7 @@ async function test(directoryPath, { port }, options) {
|
|
|
47
47
|
constants.YAML_SCHEMA_PATH,
|
|
48
48
|
"--server-override",
|
|
49
49
|
`http://localhost:${port}`,
|
|
50
|
-
|
|
50
|
+
options?.update ? "--update" : ""
|
|
51
51
|
],
|
|
52
52
|
{
|
|
53
53
|
cwd: directoryPath,
|
|
@@ -62,7 +62,7 @@ async function test(directoryPath, { port }, options) {
|
|
|
62
62
|
err.message = err.message.split("\n").map((e) => e.replace(/.{1} Sending requests to server/, "")).filter((e) => !e.includes("PASS")).filter((e) => e.trim()).join("\n");
|
|
63
63
|
throw err;
|
|
64
64
|
}
|
|
65
|
-
if (await paths.paths.resolveTargetRoot("node_modules/.bin/prettier") &&
|
|
65
|
+
if (await paths.paths.resolveTargetRoot("node_modules/.bin/prettier") && options?.update) {
|
|
66
66
|
await exec.exec(`yarn prettier`, ["--write", openapiPath]);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -96,4 +96,4 @@ async function bulkCommand(paths = [], options) {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
exports.bulkCommand = bulkCommand;
|
|
99
|
-
//# sourceMappingURL=test-
|
|
99
|
+
//# sourceMappingURL=test-DVGFVBAP.cjs.js.map
|
|
@@ -53,14 +53,8 @@ function shouldCheckTypes(pkg) {
|
|
|
53
53
|
return !pkg.packageJson.private && pkg.packageJson.types && fs__default.default.existsSync(path.resolve(pkg.dir, "dist/index.d.ts"));
|
|
54
54
|
}
|
|
55
55
|
function findAllDeps(declSrc) {
|
|
56
|
-
const importedDeps = (declSrc.match(/^import .* from '.*';$/gm) || []).map((match) =>
|
|
57
|
-
|
|
58
|
-
return (_b = (_a = match.match(/from '(.*)'/)) == null ? void 0 : _a[1]) != null ? _b : "";
|
|
59
|
-
}).filter((n) => !n.startsWith("."));
|
|
60
|
-
const referencedDeps = (declSrc.match(/^\/\/\/ <reference types=".*" \/>$/gm) || []).map((match) => {
|
|
61
|
-
var _a, _b;
|
|
62
|
-
return (_b = (_a = match.match(/types="(.*)"/)) == null ? void 0 : _a[1]) != null ? _b : "";
|
|
63
|
-
}).filter((n) => !n.startsWith(".")).filter((n) => !["node", "react"].includes(n));
|
|
56
|
+
const importedDeps = (declSrc.match(/^import .* from '.*';$/gm) || []).map((match) => match.match(/from '(.*)'/)?.[1] ?? "").filter((n) => !n.startsWith("."));
|
|
57
|
+
const referencedDeps = (declSrc.match(/^\/\/\/ <reference types=".*" \/>$/gm) || []).map((match) => match.match(/types="(.*)"/)?.[1] ?? "").filter((n) => !n.startsWith(".")).filter((n) => !["node", "react"].includes(n));
|
|
64
58
|
return Array.from(/* @__PURE__ */ new Set([...importedDeps, ...referencedDeps]));
|
|
65
59
|
}
|
|
66
60
|
function checkTypes(pkg) {
|
|
@@ -172,4 +166,4 @@ function mkErr(name, msg, extra) {
|
|
|
172
166
|
}
|
|
173
167
|
|
|
174
168
|
exports.default = typeDeps;
|
|
175
|
-
//# sourceMappingURL=type-deps-
|
|
169
|
+
//# sourceMappingURL=type-deps-DgJcEpV_.cjs.js.map
|
|
@@ -6,7 +6,7 @@ var lodash = require('lodash');
|
|
|
6
6
|
var path = require('path');
|
|
7
7
|
var chalk = require('chalk');
|
|
8
8
|
var Parser = require('@apidevtools/swagger-parser');
|
|
9
|
-
var runner = require('./runner-
|
|
9
|
+
var runner = require('./runner-DMC006Gs.cjs.js');
|
|
10
10
|
var paths = require('./paths-BvbxdT_S.cjs.js');
|
|
11
11
|
var constants = require('./constants-Dwa51b6l.cjs.js');
|
|
12
12
|
var helpers = require('./helpers-ja_ryoK_.cjs.js');
|
|
@@ -66,4 +66,4 @@ async function bulkCommand(paths = []) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
exports.bulkCommand = bulkCommand;
|
|
69
|
-
//# sourceMappingURL=verify-
|
|
69
|
+
//# sourceMappingURL=verify-ARmbHOf8.cjs.js.map
|
package/dist/index.cjs.js
CHANGED
|
@@ -8,23 +8,17 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
10
10
|
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __publicField = (obj, key, value) => {
|
|
14
|
-
__defNormalProp(obj, key + "" , value);
|
|
15
|
-
return value;
|
|
16
|
-
};
|
|
17
11
|
class CustomError extends Error {
|
|
18
12
|
get name() {
|
|
19
13
|
return this.constructor.name;
|
|
20
14
|
}
|
|
21
15
|
}
|
|
22
16
|
class ExitCodeError extends CustomError {
|
|
17
|
+
code;
|
|
23
18
|
constructor(code, command) {
|
|
24
19
|
super(
|
|
25
20
|
command ? `Command '${command}' exited with code ${code}` : `Child exited with code ${code}`
|
|
26
21
|
);
|
|
27
|
-
__publicField(this, "code");
|
|
28
22
|
this.code = code;
|
|
29
23
|
}
|
|
30
24
|
}
|
|
@@ -54,7 +48,7 @@ function registerPackageCommand(program) {
|
|
|
54
48
|
"Initialize any required files to use the OpenAPI tooling for this package."
|
|
55
49
|
).action(
|
|
56
50
|
lazy(
|
|
57
|
-
() => Promise.resolve().then(function () { return require('./cjs/init-
|
|
51
|
+
() => Promise.resolve().then(function () { return require('./cjs/init-CspVKpxN.cjs.js'); }).then((m) => m.singleCommand)
|
|
58
52
|
)
|
|
59
53
|
);
|
|
60
54
|
openApiCommand.command("generate").option(
|
|
@@ -62,9 +56,11 @@ function registerPackageCommand(program) {
|
|
|
62
56
|
"Top-level path to where the client should be generated, ie packages/catalog-client."
|
|
63
57
|
).option("--server").description(
|
|
64
58
|
"Command to generate a client and/or a server stub from an OpenAPI spec."
|
|
59
|
+
).option("--client-additional-properties [properties]").description(
|
|
60
|
+
"Additional properties that can be passed to @openapitools/openapi-generator-cli"
|
|
65
61
|
).action(
|
|
66
62
|
lazy(
|
|
67
|
-
() => Promise.resolve().then(function () { return require('./cjs/index-
|
|
63
|
+
() => Promise.resolve().then(function () { return require('./cjs/index-C5SnL4Ah.cjs.js'); }).then((m) => m.command)
|
|
68
64
|
)
|
|
69
65
|
);
|
|
70
66
|
openApiCommand.command("fuzz").description(
|
|
@@ -76,10 +72,10 @@ function registerPackageCommand(program) {
|
|
|
76
72
|
"--exclude-checks <excludeChecks>",
|
|
77
73
|
"Exclude checks from schemathesis run"
|
|
78
74
|
).action(
|
|
79
|
-
lazy(() => Promise.resolve().then(function () { return require('./cjs/fuzz-
|
|
75
|
+
lazy(() => Promise.resolve().then(function () { return require('./cjs/fuzz-BoxTBzQz.cjs.js'); }).then((m) => m.command))
|
|
80
76
|
);
|
|
81
77
|
openApiCommand.command("diff").option("--ignore", "Ignore linting failures and only log the results.").option("--json", "Output the results as JSON").option("--since <ref>", "Diff the API against a specific ref").action(
|
|
82
|
-
lazy(() => Promise.resolve().then(function () { return require('./cjs/diff-
|
|
78
|
+
lazy(() => Promise.resolve().then(function () { return require('./cjs/diff-CMZh-rYC.cjs.js'); }).then((m) => m.command))
|
|
83
79
|
);
|
|
84
80
|
}
|
|
85
81
|
function registerRepoCommand(program) {
|
|
@@ -90,23 +86,23 @@ function registerRepoCommand(program) {
|
|
|
90
86
|
"Verify that all OpenAPI schemas are valid and set up correctly."
|
|
91
87
|
).action(
|
|
92
88
|
lazy(
|
|
93
|
-
() => Promise.resolve().then(function () { return require('./cjs/verify-
|
|
89
|
+
() => Promise.resolve().then(function () { return require('./cjs/verify-ARmbHOf8.cjs.js'); }).then((m) => m.bulkCommand)
|
|
94
90
|
)
|
|
95
91
|
);
|
|
96
92
|
openApiCommand.command("lint [paths...]").description("Lint OpenAPI schemas.").option(
|
|
97
93
|
"--strict",
|
|
98
94
|
"Fail on any linting severity messages, not just errors."
|
|
99
95
|
).action(
|
|
100
|
-
lazy(() => Promise.resolve().then(function () { return require('./cjs/lint-
|
|
96
|
+
lazy(() => Promise.resolve().then(function () { return require('./cjs/lint-DqMp4VN_.cjs.js'); }).then((m) => m.bulkCommand))
|
|
101
97
|
);
|
|
102
98
|
openApiCommand.command("test [paths...]").description("Test OpenAPI schemas against written tests").option("--update", "Update the spec on failure.").action(
|
|
103
|
-
lazy(() => Promise.resolve().then(function () { return require('./cjs/test-
|
|
99
|
+
lazy(() => Promise.resolve().then(function () { return require('./cjs/test-DVGFVBAP.cjs.js'); }).then((m) => m.bulkCommand))
|
|
104
100
|
);
|
|
105
101
|
openApiCommand.command("fuzz").description("Fuzz all packages").option(
|
|
106
102
|
"--since <ref>",
|
|
107
103
|
"Only fuzz packages that have changed since the given ref"
|
|
108
104
|
).action(
|
|
109
|
-
lazy(() => Promise.resolve().then(function () { return require('./cjs/fuzz-
|
|
105
|
+
lazy(() => Promise.resolve().then(function () { return require('./cjs/fuzz-D2aOy9yo.cjs.js'); }).then((m) => m.command))
|
|
110
106
|
);
|
|
111
107
|
openApiCommand.command("diff").description(
|
|
112
108
|
"Diff the repository against a specific ref, will run all package `diff` scripts."
|
|
@@ -115,7 +111,7 @@ function registerRepoCommand(program) {
|
|
|
115
111
|
"Diff the API against a specific ref",
|
|
116
112
|
"origin/master"
|
|
117
113
|
).action(
|
|
118
|
-
lazy(() => Promise.resolve().then(function () { return require('./cjs/diff-
|
|
114
|
+
lazy(() => Promise.resolve().then(function () { return require('./cjs/diff-Bd4yK7bq.cjs.js'); }).then((m) => m.command))
|
|
119
115
|
);
|
|
120
116
|
}
|
|
121
117
|
function registerCommands(program) {
|
|
@@ -142,10 +138,10 @@ function registerCommands(program) {
|
|
|
142
138
|
"Turn on release tag validation for the public, beta, and alpha APIs"
|
|
143
139
|
).description("Generate an API report for selected packages").action(
|
|
144
140
|
lazy(
|
|
145
|
-
() => Promise.resolve().then(function () { return require('./cjs/api-reports-
|
|
141
|
+
() => Promise.resolve().then(function () { return require('./cjs/api-reports-CA6tcw3u.cjs.js'); }).then((m) => m.buildApiReports)
|
|
146
142
|
)
|
|
147
143
|
);
|
|
148
|
-
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-
|
|
144
|
+
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-DgJcEpV_.cjs.js'); }).then((m) => m.default)));
|
|
149
145
|
program.command("generate-catalog-info").option(
|
|
150
146
|
"--dry-run",
|
|
151
147
|
"Shows what would happen without actually writing any yaml."
|
|
@@ -154,14 +150,14 @@ function registerCommands(program) {
|
|
|
154
150
|
"CI run checks that there are no changes to catalog-info.yaml files"
|
|
155
151
|
).description("Create or fix info yaml files for all backstage packages").action(
|
|
156
152
|
lazy(
|
|
157
|
-
() => Promise.resolve().then(function () { return require('./cjs/generate-catalog-info-
|
|
153
|
+
() => Promise.resolve().then(function () { return require('./cjs/generate-catalog-info-DxKb-9Wh.cjs.js'); }).then(
|
|
158
154
|
(m) => m.default
|
|
159
155
|
)
|
|
160
156
|
)
|
|
161
157
|
);
|
|
162
158
|
program.command("knip-reports [paths...]").option("--ci", "CI run checks that there is no changes on knip reports").description("Generate a knip report for selected packages").action(
|
|
163
159
|
lazy(
|
|
164
|
-
() => Promise.resolve().then(function () { return require('./cjs/knip-reports-
|
|
160
|
+
() => Promise.resolve().then(function () { return require('./cjs/knip-reports-028OuOct.cjs.js'); }).then((m) => m.buildKnipReports)
|
|
165
161
|
)
|
|
166
162
|
);
|
|
167
163
|
registerPackageCommand(program);
|
|
@@ -180,7 +176,7 @@ function lazy(getActionFunc) {
|
|
|
180
176
|
};
|
|
181
177
|
}
|
|
182
178
|
|
|
183
|
-
var version = "0.9.
|
|
179
|
+
var version = "0.9.1-next.1";
|
|
184
180
|
|
|
185
181
|
const main = (argv) => {
|
|
186
182
|
commander.program.name("backstage-repo-tools").version(version);
|
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.9.
|
|
4
|
+
"version": "0.9.1-next.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
45
45
|
"@apisyouwonthate/style-guide": "^1.4.0",
|
|
46
|
-
"@backstage/backend-plugin-api": "^0.6.
|
|
46
|
+
"@backstage/backend-plugin-api": "^0.6.19-next.1",
|
|
47
47
|
"@backstage/catalog-model": "^1.5.0",
|
|
48
48
|
"@backstage/cli-common": "^0.1.13",
|
|
49
|
-
"@backstage/cli-node": "^0.2.
|
|
49
|
+
"@backstage/cli-node": "^0.2.6-next.0",
|
|
50
50
|
"@backstage/config-loader": "^1.8.0",
|
|
51
51
|
"@backstage/errors": "^1.2.4",
|
|
52
52
|
"@manypkg/get-packages": "^1.1.3",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"yaml-diff-patch": "^2.0.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@backstage/backend-test-utils": "^0.
|
|
80
|
-
"@backstage/cli": "^0.26.
|
|
79
|
+
"@backstage/backend-test-utils": "^0.4.0-next.1",
|
|
80
|
+
"@backstage/cli": "^0.26.7-next.1",
|
|
81
81
|
"@backstage/types": "^1.1.1",
|
|
82
82
|
"@types/is-glob": "^4.0.2",
|
|
83
83
|
"@types/node": "^18.17.8",
|