Skip to content

Commit 5b6f6ea

Browse files
authored
fix(rxjs): removed unnecessary peer deps (#7427)
* fix(rxjs): removed unnecessary peer deps resolves #7426 * chore(rxjs.dev): fix types and unbreak build
1 parent 10e151e commit 5b6f6ea

File tree

5 files changed

+20
-22
lines changed

5 files changed

+20
-22
lines changed

apps/rxjs.dev/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@
7777
"@types/jasmine": "~3.6.0",
7878
"@types/jasminewd2": "^2.0.3",
7979
"@types/lunr": "^2.3.3",
80-
"@types/node": "^20.6.3",
80+
"@types/node": "^20.11.0",
8181
"@types/svgo": "^1.3.3",
8282
"@types/trusted-types": "^2.0.7",
83+
"@types/yamljs": "^0.2.34",
8384
"@typescript-eslint/eslint-plugin": "^6.9.0",
8485
"@typescript-eslint/parser": "^6.9.1",
8586
"archiver": "^3.0.0",

apps/rxjs.dev/tools/transforms/rxjs-decision-tree-generator/src/lib/decisionTreeReducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function decisionTreeReducer(tree: TreeNode[], apiList: FlattenedApiList,
2828

2929
if (!curr.options) {
3030
// we found the function/operator we want to use
31-
const apiNode: FlattenedApiNode = apiList[treeNode.label!];
31+
const apiNode: FlattenedApiNode = apiList[treeNode.label! as keyof FlattenedApiList];
3232
if (!apiNode) {
3333
log.warn(`Decision Tree Generator - (reducer) - warning: Label does not exist in API List: ${treeNode.label}`);
3434
}

apps/rxjs.dev/tools/transforms/rxjs-decision-tree-generator/src/lib/helpers.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ApiListNode, TreeNodeRaw } from './interfaces';
2+
13
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
24

35
/**
@@ -20,7 +22,7 @@ export function isStable(stability: string): boolean {
2022
* @param {*} tree
2123
* @returns
2224
*/
23-
export function treeNodeCount(tree) {
25+
export function treeNodeCount(tree: TreeNodeRaw[]) {
2426
return tree.reduce((acc: number, curr) => {
2527
let childSum: number;
2628
if (curr.children) {
@@ -39,23 +41,22 @@ export function treeNodeCount(tree) {
3941
* @param {*} tree
4042
* @returns
4143
*/
42-
export function rawNodesWithMethodCount(tree) {
43-
return tree.filter(node => {
44+
export function rawNodesWithMethodCount(tree: TreeNodeRaw[]): number {
45+
return tree.filter((node) => {
4446
let childHadMethod = false;
4547

4648
if (node.method) {
4749
return node;
4850
}
4951

5052
if (node.children) {
51-
childHadMethod = rawNodesWithMethodCount(node.children);
53+
childHadMethod = rawNodesWithMethodCount(node.children) > 0;
5254
}
5355

5456
return childHadMethod;
5557
}).length;
5658
}
5759

58-
5960
/**
6061
* Recursively count valid API references
6162
* Deprecated API refs are invalid
@@ -64,7 +65,7 @@ export function rawNodesWithMethodCount(tree) {
6465
* @param {*} apiList
6566
* @returns
6667
*/
67-
export function validApiRefCount(apiList): number {
68+
export function validApiRefCount(apiList: ApiListNode[]): number {
6869
return apiList.reduce((acc, curr) => {
6970
const itemCount = curr.items.reduce((a, node) => {
7071
if (node.stability === 'deprecated') {

packages/rxjs/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,5 @@
193193
"pre-commit": "lint-staged",
194194
"commit-msg": "validate-commit-msg"
195195
}
196-
},
197-
"peerDependencies": {
198-
"@types/node": "^20.6.3",
199-
"typescript": "^5.2.2"
200196
}
201197
}

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2817,12 +2817,12 @@
28172817
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.63.tgz#1788fa8da838dbb5f9ea994b834278205db6ca2b"
28182818
integrity sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==
28192819

2820-
"@types/node@^20.6.3":
2821-
version "20.8.8"
2822-
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.8.tgz#adee050b422061ad5255fc38ff71b2bb96ea2a0e"
2823-
integrity sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==
2820+
"@types/node@^20.11.0":
2821+
version "20.11.0"
2822+
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.0.tgz#8e0b99e70c0c1ade1a86c4a282f7b7ef87c9552f"
2823+
integrity sha512-o9bjXmDNcF7GbM4CNQpmi+TutCgap/K3w1JyKgxAjqx41zp9qlIAVFi0IhCNsJcXolEqLWhbFbEeL0PvYm4pcQ==
28242824
dependencies:
2825-
undici-types "~5.25.1"
2825+
undici-types "~5.26.4"
28262826

28272827
"@types/parse-json@^4.0.0":
28282828
version "4.0.2"
@@ -2942,6 +2942,11 @@
29422942
"@types/unist" "*"
29432943
"@types/vfile-message" "*"
29442944

2945+
"@types/yamljs@^0.2.34":
2946+
version "0.2.34"
2947+
resolved "https://registry.yarnpkg.com/@types/yamljs/-/yamljs-0.2.34.tgz#c10b1f31b173f2cc93342f27b0796c2eb5b3ae84"
2948+
integrity sha512-gJvfRlv9ErxdOv7ux7UsJVePtX54NAvQyd8ncoiFqK8G5aeHIfQfGH2fbruvjAQ9657HwAaO54waS+Dsk2QTUQ==
2949+
29452950
"@typescript-eslint/eslint-plugin@^6.9.0":
29462951
version "6.13.1"
29472952
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.1.tgz#f98bd887bf95551203c917e734d113bf8d527a0c"
@@ -15799,11 +15804,6 @@ undefsafe@^2.0.2:
1579915804
resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c"
1580015805
integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==
1580115806

15802-
undici-types@~5.25.1:
15803-
version "5.25.3"
15804-
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3"
15805-
integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==
15806-
1580715807
undici-types@~5.26.4:
1580815808
version "5.26.5"
1580915809
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"

0 commit comments

Comments
 (0)