Skip to content

Commit 330e602

Browse files
committed
chore: upgrade eslint, prettier versions
1 parent 3543903 commit 330e602

5 files changed

Lines changed: 64 additions & 48 deletions

File tree

.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25661,7 +25661,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2566125661
return (mod && mod.__esModule) ? mod : { "default": mod };
2566225662
};
2566325663
Object.defineProperty(exports, "__esModule", ({ value: true }));
25664-
exports.main = exports.isValidConventionalCommitMessage = void 0;
25664+
exports.isValidConventionalCommitMessage = void 0;
25665+
exports.main = main;
2566525666
const node_console_1 = __nccwpck_require__(7540);
2566625667
const node_fs_1 = __nccwpck_require__(3024);
2566725668
const yaml_1 = __importDefault(__nccwpck_require__(8815));
@@ -25752,7 +25753,9 @@ function main() {
2575225753
(0, node_console_1.warn)(`Multiple projects found. Using ${projectName} as default, but we recommend specifying the project name in the inputs.`);
2575325754
}
2575425755
}
25755-
(0, node_console_1.info)(configPath ? "Uploading spec and config files..." : "Uploading spec file...");
25756+
(0, node_console_1.info)(configPath
25757+
? "Uploading spec and config files..."
25758+
: "Uploading spec file...");
2575625759
const response = yield uploadSpecAndConfig(inputPath, configPath, stainless_api_key, projectName, commitMessage, guessConfig, branch);
2575725760
if (!response.ok) {
2575825761
const errorMsg = `Build failed with the following outcomes: ${JSON.stringify(response.errors)} See more details in the Stainless Studio.`;
@@ -25775,10 +25778,9 @@ function main() {
2577525778
}
2577625779
});
2577725780
}
25778-
exports.main = main;
2577925781
function uploadSpecAndConfig(specPath, configPath, token, projectName, commitMessage, guessConfig, branch) {
25780-
var _a;
2578125782
return __awaiter(this, void 0, void 0, function* () {
25783+
var _a;
2578225784
const stainless = new sdk_1.default({ apiKey: token, project: projectName });
2578325785
const specContent = (0, node_fs_1.readFileSync)(specPath, "utf8");
2578425786
let configContent;

index.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Stainless from "@stainless-api/sdk";
66

77
// https://www.conventionalcommits.org/en/v1.0.0/
88
const CONVENTIONAL_COMMIT_REGEX = new RegExp(
9-
/^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?(!?): .*$/
9+
/^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?(!?): .*$/,
1010
);
1111

1212
export const isValidConventionalCommitMessage = (message: string) => {
@@ -43,7 +43,7 @@ function getInputValue(name: string, options?: { required: boolean }): string {
4343
// Get boolean input values from either GitHub Actions or GitLab CI environment
4444
function getBooleanInputValue(
4545
name: string,
46-
options?: { required: boolean }
46+
options?: { required: boolean },
4747
): boolean {
4848
if (isGitLabCI()) {
4949
// Try GitLab-specific INPUT_ prefixed variable first (like GitHub Actions)
@@ -102,13 +102,15 @@ export async function main() {
102102
projectName = projects.data[0]!.slug;
103103
if (projects.data.length > 1) {
104104
warn(
105-
`Multiple projects found. Using ${projectName} as default, but we recommend specifying the project name in the inputs.`
105+
`Multiple projects found. Using ${projectName} as default, but we recommend specifying the project name in the inputs.`,
106106
);
107107
}
108108
}
109109

110110
info(
111-
configPath ? "Uploading spec and config files..." : "Uploading spec file..."
111+
configPath
112+
? "Uploading spec and config files..."
113+
: "Uploading spec file...",
112114
);
113115
const response = await uploadSpecAndConfig(
114116
inputPath,
@@ -117,11 +119,11 @@ export async function main() {
117119
projectName,
118120
commitMessage,
119121
guessConfig,
120-
branch
122+
branch,
121123
);
122124
if (!response.ok) {
123125
const errorMsg = `Build failed with the following outcomes: ${JSON.stringify(
124-
response.errors
126+
response.errors,
125127
)} See more details in the Stainless Studio.`;
126128
error(errorMsg);
127129
throw Error(errorMsg);
@@ -139,7 +141,7 @@ export async function main() {
139141
response.decoratedSpec = JSON.stringify(
140142
YAML.parse(response.decoratedSpec),
141143
null,
142-
2
144+
2,
143145
);
144146
}
145147
writeFileSync(outputPath, response.decoratedSpec);
@@ -154,7 +156,7 @@ async function uploadSpecAndConfig(
154156
projectName: string,
155157
commitMessage: string,
156158
guessConfig: boolean,
157-
branch: string
159+
branch: string,
158160
): Promise<{
159161
ok: boolean;
160162
errors: Array<{
@@ -173,7 +175,7 @@ async function uploadSpecAndConfig(
173175
await stainless.projects.configs.guess({
174176
branch,
175177
spec: specContent,
176-
})
178+
}),
177179
)[0]?.content;
178180
} else if (configPath) {
179181
configContent = readFileSync(configPath, "utf8");
@@ -198,7 +200,7 @@ async function uploadSpecAndConfig(
198200
},
199201
allow_empty: true,
200202
},
201-
{ headers }
203+
{ headers },
202204
);
203205

204206
const pollingStart = Date.now();
@@ -207,7 +209,7 @@ async function uploadSpecAndConfig(
207209
build = await stainless.builds.retrieve(build.id);
208210
donePolling = Object.values(build.targets).every(
209211
(target) =>
210-
(target as Stainless.BuildTarget).commit.status === "completed"
212+
(target as Stainless.BuildTarget).commit.status === "completed",
211213
);
212214
if (!donePolling) {
213215
await new Promise((resolve) => setTimeout(resolve, 5 * 1000));
@@ -217,7 +219,7 @@ async function uploadSpecAndConfig(
217219
const errors = (
218220
Object.entries(build.targets) as [
219221
keyof Stainless.BuildObject.Targets,
220-
Stainless.BuildTarget
222+
Stainless.BuildTarget,
221223
][]
222224
)
223225
.map(([target, value]) => {
@@ -226,7 +228,7 @@ async function uploadSpecAndConfig(
226228
// all be considered failures.
227229
value.commit?.status === "completed" &&
228230
["noop", "error", "warning", "note", "success"].includes(
229-
value.commit.completed.conclusion
231+
value.commit.completed.conclusion,
230232
)
231233
) {
232234
return undefined;

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
"lint": "eslint ."
2020
},
2121
"devDependencies": {
22-
"@types/node": "^22.9.0",
22+
"@types/node": "^22.10.6",
2323
"@typescript-eslint/eslint-plugin": "^5.40.0",
2424
"@typescript-eslint/parser": "^5.40.0",
2525
"@vercel/ncc": "^0.38.0",
2626
"eslint": "^8.25.0",
27-
"eslint-config-prettier": "^8.5.0",
28-
"eslint-plugin-prettier": "^4.2.1",
27+
"eslint-config-prettier": "^10.1.5",
28+
"eslint-plugin-prettier": "^5.5.1",
29+
"prettier": "^3.6.2",
2930
"husky": "^8.0.1",
30-
"prettier": "^2.7.1",
31-
"typescript": "^4.8.4"
31+
"typescript": "^5.7.3"
3232
},
3333
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
3434
}

yarn.lock

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@
107107
"@nodelib/fs.scandir" "2.1.5"
108108
fastq "^1.6.0"
109109

110+
"@pkgr/core@^0.2.4":
111+
version "0.2.7"
112+
resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.7.tgz#eb5014dfd0b03e7f3ba2eeeff506eed89b028058"
113+
integrity sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg==
114+
110115
"@stainless-api/sdk@^0.1.0-alpha.10":
111116
version "0.1.0-alpha.11"
112117
resolved "https://registry.npmjs.org/@stainless-api/sdk/-/sdk-0.1.0-alpha.11.tgz"
@@ -117,12 +122,12 @@
117122
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz"
118123
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
119124

120-
"@types/node@^22.9.0":
121-
version "22.10.6"
122-
resolved "https://registry.npmjs.org/@types/node/-/node-22.10.6.tgz"
123-
integrity sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==
125+
"@types/node@^22.10.6":
126+
version "22.16.2"
127+
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.16.2.tgz#0a7b5b852105fb3f5019134f87fa859d5abcab9b"
128+
integrity sha512-Cdqa/eJTvt4fC4wmq1Mcc0CPUjp/Qy2FGqLza3z3pKymsI969TcZ54diNJv8UYUgeWxyb8FSbCkhdR6WqmUFhA==
124129
dependencies:
125-
undici-types "~6.20.0"
130+
undici-types "~6.21.0"
126131

127132
"@types/semver@^7.3.12":
128133
version "7.7.0"
@@ -355,17 +360,18 @@ escape-string-regexp@^4.0.0:
355360
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz"
356361
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
357362

358-
eslint-config-prettier@^8.5.0:
359-
version "8.10.0"
360-
resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz"
361-
integrity sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==
363+
eslint-config-prettier@^10.1.5:
364+
version "10.1.5"
365+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz#00c18d7225043b6fbce6a665697377998d453782"
366+
integrity sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==
362367

363-
eslint-plugin-prettier@^4.2.1:
364-
version "4.2.1"
365-
resolved "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz"
366-
integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==
368+
eslint-plugin-prettier@^5.5.1:
369+
version "5.5.1"
370+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz#470820964de9aedb37e9ce62c3266d2d26d08d15"
371+
integrity sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==
367372
dependencies:
368373
prettier-linter-helpers "^1.0.0"
374+
synckit "^0.11.7"
369375

370376
eslint-scope@^5.1.1:
371377
version "5.1.1"
@@ -828,10 +834,10 @@ prettier-linter-helpers@^1.0.0:
828834
dependencies:
829835
fast-diff "^1.1.2"
830836

831-
prettier@^2.7.1:
832-
version "2.8.8"
833-
resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz"
834-
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
837+
prettier@^3.6.2:
838+
version "3.6.2"
839+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393"
840+
integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==
835841

836842
punycode@^2.1.0:
837843
version "2.3.1"
@@ -908,6 +914,13 @@ supports-color@^7.1.0:
908914
dependencies:
909915
has-flag "^4.0.0"
910916

917+
synckit@^0.11.7:
918+
version "0.11.8"
919+
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.8.tgz#b2aaae998a4ef47ded60773ad06e7cb821f55457"
920+
integrity sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A==
921+
dependencies:
922+
"@pkgr/core" "^0.2.4"
923+
911924
text-table@^0.2.0:
912925
version "0.2.0"
913926
resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz"
@@ -949,15 +962,15 @@ type-fest@^0.20.2:
949962
resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz"
950963
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
951964

952-
typescript@^4.8.4:
953-
version "4.9.5"
954-
resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz"
955-
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
965+
typescript@^5.7.3:
966+
version "5.8.3"
967+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e"
968+
integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==
956969

957-
undici-types@~6.20.0:
958-
version "6.20.0"
959-
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz"
960-
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==
970+
undici-types@~6.21.0:
971+
version "6.21.0"
972+
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb"
973+
integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==
961974

962975
undici@^5.25.4:
963976
version "5.29.0"

0 commit comments

Comments
 (0)