Skip to content

Commit 7f289d5

Browse files
committed
fixup! chore(suggestion-bot): move into repo
1 parent eebb90a commit 7f289d5

18 files changed

+44
-106
lines changed

.changeset/clean-towns-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"suggestion-bot": patch
3+
---
4+
5+
Publish from rnx-kit

docsite/generate.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
const fs = require("node:fs");
33
const path = require("node:path");
44

5+
const UTF_8 = /** @type {const} */ ({ encoding: "utf-8" });
6+
57
const badges = [
68
"https://github\\.com/microsoft/rnx-kit/actions/workflows",
79
"https://img\\.shields\\.io",
@@ -12,6 +14,7 @@ const badgesRE = new RegExp(
1214
"g"
1315
);
1416

17+
const localImagesRE = /!\[(.*?)\]\(\.\/(.*?)\)/g;
1518
const titleRE = /# @rnx-kit\/(.*)/;
1619

1720
function copyContributing() {
@@ -33,19 +36,22 @@ function generateToolsSidebar() {
3336
continue;
3437
}
3538

36-
const content = fs.readFileSync(manifest, { encoding: "utf-8" });
37-
if (JSON.parse(content).private) {
39+
if (JSON.parse(fs.readFileSync(manifest, UTF_8)).private) {
3840
continue;
3941
}
4042

4143
const output = path.join("docs", "tools", `${pkg}.md`);
4244
if (!fs.existsSync(output)) {
43-
const content = fs.readFileSync(readme, { encoding: "utf-8" });
45+
const content = fs.readFileSync(readme, UTF_8);
4446
fs.writeFileSync(
4547
output,
4648
content
4749
.replace(titleRE, "# $1") // Remove scope from title
4850
.replace(badgesRE, "") // Remove badges
51+
.replace(
52+
localImagesRE,
53+
`![$1](${path.join("..", "..", path.dirname(readme), "$2")})`
54+
)
4955
);
5056
}
5157

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"nx": "patch:nx@npm%3A22.5.4#~/.yarn/patches/nx-npm-22.5.4-3d43ac9c10.patch",
5252
"oxfmt": "catalog:",
5353
"oxlint": "catalog:",
54-
"suggestion-bot": "^4.0.0",
54+
"suggestion-bot": "workspace:*",
5555
"typescript": "catalog:"
5656
},
5757
"resolutions": {

packages/suggestion-bot/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.d.ts
2+
*.d.ts.map

packages/suggestion-bot/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# suggestion-bot
22

3-
[![build](https://github.com/tido64/suggestion-bot/actions/workflows/build.yml/badge.svg)](https://github.com/tido64/suggestion-bot/actions/workflows/build.yml)
3+
[![Build](https://github.com/microsoft/rnx-kit/actions/workflows/build.yml/badge.svg)](https://github.com/microsoft/rnx-kit/actions/workflows/build.yml)
44
[![npm version](https://img.shields.io/npm/v/suggestion-bot)](https://www.npmjs.com/package/suggestion-bot)
55

66
`suggestion-bot` submits code reviews with suggestions based on your diffs.
77

8-
![screenshot of code review with suggestions](docs/screenshot.png)
8+
![screenshot of code review with suggestions](./docs/screenshot.png)
99

1010
## Usage
1111

packages/suggestion-bot/cli.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
#!/usr/bin/env node
22

3-
//
4-
// Copyright (c) Tommy Nguyen
5-
//
6-
// This source code is licensed under the MIT license found in the
7-
// LICENSE file in the root directory of this source tree.
8-
//
9-
103
import * as fs from "node:fs";
114
import * as path from "node:path";
125
import { fileURLToPath, URL } from "node:url";
Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "suggestion-bot",
3-
"version": "0.0.1-dev",
3+
"version": "4.0.3",
44
"description": "suggestion-bot submits code reviews with suggestions based on your diffs",
55
"keywords": [
66
"code review",
@@ -10,15 +10,16 @@
1010
"review",
1111
"suggestion"
1212
],
13-
"homepage": "https://github.com/tido64/suggestion-bot#readme",
13+
"homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/suggestion-bot#readme",
1414
"license": "MIT",
1515
"author": {
16-
"name": "Tommy Nguyen",
17-
"email": "4123478+tido64@users.noreply.github.com"
16+
"name": "Microsoft Open Source",
17+
"email": "microsoftopensource@users.noreply.github.com"
1818
},
1919
"repository": {
2020
"type": "git",
21-
"url": "https://github.com/tido64/suggestion-bot.git"
21+
"url": "https://github.com/microsoft/rnx-kit",
22+
"directory": "packages/suggestion-bot"
2223
},
2324
"bin": "cli.js",
2425
"files": [
@@ -38,12 +39,13 @@
3839
"./package.json": "./package.json"
3940
},
4041
"scripts": {
41-
"build": "yarn clean && yarn lint && tsc",
42+
"//build": "We run `tsgo` directly because we don't want to output to `lib`",
43+
"build": "yarn clean && tsgo",
4244
"clean": "git clean -dfqx -- src/ test/",
43-
"format": "oxfmt $(git ls-files '*.js' '*.json' '*.md' '*.ts' '*.yml' ':!:.yarn/**/*.cjs')",
44-
"lint": "oxlint $(git ls-files '*.js' ':!:*.config.js' ':!:.yarn/**/*.js')",
45+
"format": "rnx-kit-scripts format",
46+
"lint": "rnx-kit-scripts lint",
4547
"suggest": "suggestion-bot",
46-
"test": "node --test --experimental-test-coverage $(git ls-files 'test/*.test.js')"
48+
"test": "rnx-kit-scripts test"
4749
},
4850
"dependencies": {
4951
"@octokit/core": "^7.0.0",
@@ -52,24 +54,11 @@
5254
"parse-diff": "^0.11.0"
5355
},
5456
"devDependencies": {
55-
"@rnx-kit/oxlint-config": "^1.0.2",
56-
"@rnx-kit/tsconfig": "^3.0.0",
57-
"@types/node": "^24.0.0",
58-
"oxfmt": "^0.40.0",
59-
"oxlint": "^1.51.0",
60-
"semantic-release": "^25.0.0",
61-
"typescript": "^5.0.0"
62-
},
63-
"resolutions": {
64-
"@microsoft/eslint-plugin-sdl/eslint-plugin-n": "^17.10.3",
65-
"@microsoft/eslint-plugin-sdl/eslint-plugin-react": "^7.37.3",
66-
"@semantic-release/npm/npm": "link:."
67-
},
68-
"release": {
69-
"extends": "./.github/semantic-release.json"
57+
"@rnx-kit/scripts": "*",
58+
"@rnx-kit/tsconfig": "*",
59+
"@types/node": "^24.0.0"
7060
},
7161
"engines": {
7262
"node": ">=20.9"
73-
},
74-
"packageManager": "yarn@4.12.0"
63+
}
7564
}

packages/suggestion-bot/src/AzureDevOpsClient.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
//
2-
// Copyright (c) Tommy Nguyen
3-
//
4-
// This source code is licensed under the MIT license found in the
5-
// LICENSE file in the root directory of this source tree.
6-
//
71
// @ts-check
82
import * as azdevapi from "azure-devops-node-api";
93
import { makeComments } from "./makeComments.js";

packages/suggestion-bot/src/GitHubClient.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
//
2-
// Copyright (c) Tommy Nguyen
3-
//
4-
// This source code is licensed under the MIT license found in the
5-
// LICENSE file in the root directory of this source tree.
6-
//
71
// @ts-check
82
import * as octokit_core from "@octokit/core";
93
import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";

packages/suggestion-bot/src/helpers.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
//
2-
// Copyright (c) Tommy Nguyen
3-
//
4-
// This source code is licensed under the MIT license found in the
5-
// LICENSE file in the root directory of this source tree.
6-
//
71
// @ts-check
82

93
/**

0 commit comments

Comments
 (0)