Skip to content

Commit c564d3c

Browse files
committed
feat: replace prettier with oxfmt
1 parent 36020f4 commit c564d3c

9 files changed

Lines changed: 121 additions & 406 deletions

File tree

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
- name: Install
1818
run: bun install
1919

20-
- name: Check formatting with Prettier
20+
- name: Check formatting
2121
run: bun run format:check

.oxfmtrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 2,
6+
"endOfLine": "lf",
7+
"ignorePatterns": ["node_modules", "dist", ".husky", ".github"]
8+
}

.prettierignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

bun.lock

Lines changed: 66 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/nx-set-shas.js

Lines changed: 5 additions & 269 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,15 @@ var __getProtoOf = Object.getPrototypeOf;
44
var __defProp = Object.defineProperty;
55
var __getOwnPropNames = Object.getOwnPropertyNames;
66
var __hasOwnProp = Object.prototype.hasOwnProperty;
7-
function __accessProp(key) {
8-
return this[key];
9-
}
10-
var __toESMCache_node;
11-
var __toESMCache_esm;
127
var __toESM = (mod, isNodeMode, target) => {
13-
var canCache = mod != null && typeof mod === "object";
14-
if (canCache) {
15-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16-
var cached = cache.get(mod);
17-
if (cached)
18-
return cached;
19-
}
208
target = mod != null ? __create(__getProtoOf(mod)) : {};
219
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
2210
for (let key of __getOwnPropNames(mod))
2311
if (!__hasOwnProp.call(to, key))
2412
__defProp(to, key, {
25-
get: __accessProp.bind(mod, key),
13+
get: () => mod[key],
2614
enumerable: true
2715
});
28-
if (canCache)
29-
cache.set(mod, to);
3016
return to;
3117
};
3218
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
@@ -18847,253 +18833,6 @@ function parse(options) {
1884718833
body = remainingParameters;
1884818834
}
1884918835
}
18850-
<<<<<<< HEAD
18851-
}
18852-
if (!headers["content-type"] && typeof body !== "undefined") {
18853-
headers["content-type"] = "application/json; charset=utf-8";
18854-
}
18855-
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
18856-
body = "";
18857-
}
18858-
return Object.assign({ method, url, headers }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null);
18859-
}
18860-
function endpointWithDefaults(defaults, route, options) {
18861-
return parse(merge(defaults, route, options));
18862-
}
18863-
function withDefaults(oldDefaults, newDefaults) {
18864-
const DEFAULTS2 = merge(oldDefaults, newDefaults);
18865-
const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
18866-
return Object.assign(endpoint2, {
18867-
DEFAULTS: DEFAULTS2,
18868-
defaults: withDefaults.bind(null, DEFAULTS2),
18869-
merge: merge.bind(null, DEFAULTS2),
18870-
parse
18871-
});
18872-
}
18873-
var endpoint = withDefaults(null, DEFAULTS);
18874-
18875-
// node_modules/fast-content-type-parse/index.js
18876-
var NullObject = function NullObject2() {};
18877-
NullObject.prototype = Object.create(null);
18878-
var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
18879-
var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
18880-
var mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u;
18881-
var defaultContentType = { type: "", parameters: new NullObject };
18882-
Object.freeze(defaultContentType.parameters);
18883-
Object.freeze(defaultContentType);
18884-
function safeParse(header) {
18885-
if (typeof header !== "string") {
18886-
return defaultContentType;
18887-
}
18888-
let index = header.indexOf(";");
18889-
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
18890-
if (mediaTypeRE.test(type) === false) {
18891-
return defaultContentType;
18892-
}
18893-
const result = {
18894-
type: type.toLowerCase(),
18895-
parameters: new NullObject
18896-
};
18897-
if (index === -1) {
18898-
return result;
18899-
}
18900-
let key;
18901-
let match;
18902-
let value;
18903-
paramRE.lastIndex = index;
18904-
while (match = paramRE.exec(header)) {
18905-
if (match.index !== index) {
18906-
return defaultContentType;
18907-
}
18908-
index += match[0].length;
18909-
key = match[1].toLowerCase();
18910-
value = match[2];
18911-
if (value[0] === '"') {
18912-
value = value.slice(1, value.length - 1);
18913-
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
18914-
}
18915-
result.parameters[key] = value;
18916-
}
18917-
if (index !== header.length) {
18918-
return defaultContentType;
18919-
}
18920-
return result;
18921-
}
18922-
var $safeParse = safeParse;
18923-
18924-
// node_modules/json-with-bigint/json-with-bigint.js
18925-
var intRegex = /^-?\d+$/;
18926-
var noiseValue = /^-?\d+n+$/;
18927-
var originalStringify = JSON.stringify;
18928-
var originalParse = JSON.parse;
18929-
var customFormat = /^-?\d+n$/;
18930-
var bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
18931-
var noiseStringify = /([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
18932-
var JSONStringify = (value, replacer, space) => {
18933-
if ("rawJSON" in JSON) {
18934-
return originalStringify(value, (key, value2) => {
18935-
if (typeof value2 === "bigint")
18936-
return JSON.rawJSON(value2.toString());
18937-
if (typeof replacer === "function")
18938-
return replacer(key, value2);
18939-
if (Array.isArray(replacer) && replacer.includes(key))
18940-
return value2;
18941-
return value2;
18942-
}, space);
18943-
}
18944-
if (!value)
18945-
return originalStringify(value, replacer, space);
18946-
const convertedToCustomJSON = originalStringify(value, (key, value2) => {
18947-
const isNoise = typeof value2 === "string" && Boolean(value2.match(noiseValue));
18948-
if (isNoise)
18949-
return value2.toString() + "n";
18950-
if (typeof value2 === "bigint")
18951-
return value2.toString() + "n";
18952-
if (typeof replacer === "function")
18953-
return replacer(key, value2);
18954-
if (Array.isArray(replacer) && replacer.includes(key))
18955-
return value2;
18956-
return value2;
18957-
}, space);
18958-
const processedJSON = convertedToCustomJSON.replace(bigIntsStringify, "$1$2$3");
18959-
const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3");
18960-
return denoisedJSON;
18961-
};
18962-
var isContextSourceSupported = () => JSON.parse("1", (_, __, context) => !!context && context.source === "1");
18963-
var convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
18964-
const isCustomFormatBigInt = typeof value === "string" && value.match(customFormat);
18965-
if (isCustomFormatBigInt)
18966-
return BigInt(value.slice(0, -1));
18967-
const isNoiseValue = typeof value === "string" && value.match(noiseValue);
18968-
if (isNoiseValue)
18969-
return value.slice(0, -1);
18970-
if (typeof userReviver !== "function")
18971-
return value;
18972-
return userReviver(key, value, context);
18973-
};
18974-
var JSONParseV2 = (text, reviver) => {
18975-
return JSON.parse(text, (key, value, context) => {
18976-
const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
18977-
const isInt = context && intRegex.test(context.source);
18978-
const isBigInt = isBigNumber && isInt;
18979-
if (isBigInt)
18980-
return BigInt(context.source);
18981-
if (typeof reviver !== "function")
18982-
return value;
18983-
return reviver(key, value, context);
18984-
});
18985-
};
18986-
var MAX_INT = Number.MAX_SAFE_INTEGER.toString();
18987-
var MAX_DIGITS = MAX_INT.length;
18988-
var stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
18989-
var noiseValueWithQuotes = /^"-?\d+n+"$/;
18990-
var JSONParse = (text, reviver) => {
18991-
if (!text)
18992-
return originalParse(text, reviver);
18993-
if (isContextSourceSupported())
18994-
return JSONParseV2(text, reviver);
18995-
const serializedData = text.replace(stringsOrLargeNumbers, (text2, digits, fractional, exponential) => {
18996-
const isString = text2[0] === '"';
18997-
const isNoise = isString && Boolean(text2.match(noiseValueWithQuotes));
18998-
if (isNoise)
18999-
return text2.substring(0, text2.length - 1) + 'n"';
19000-
const isFractionalOrExponential = fractional || exponential;
19001-
const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT);
19002-
if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
19003-
return text2;
19004-
return '"' + text2 + 'n"';
19005-
});
19006-
return originalParse(serializedData, (key, value, context) => convertMarkedBigIntsReviver(key, value, context, reviver));
19007-
};
19008-
19009-
// node_modules/@octokit/request-error/dist-src/index.js
19010-
class RequestError extends Error {
19011-
name;
19012-
status;
19013-
request;
19014-
response;
19015-
constructor(message, statusCode, options) {
19016-
super(message, { cause: options.cause });
19017-
this.name = "HttpError";
19018-
this.status = Number.parseInt(statusCode);
19019-
if (Number.isNaN(this.status)) {
19020-
this.status = 0;
19021-
}
19022-
if ("response" in options) {
19023-
this.response = options.response;
19024-
}
19025-
const requestCopy = Object.assign({}, options.request);
19026-
if (options.request.headers.authorization) {
19027-
requestCopy.headers = Object.assign({}, options.request.headers, {
19028-
authorization: options.request.headers.authorization.replace(/(?<! ) .*$/, " [REDACTED]")
19029-
});
19030-
}
19031-
requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
19032-
this.request = requestCopy;
19033-
}
19034-
}
19035-
19036-
// node_modules/@octokit/request/dist-bundle/index.js
19037-
var VERSION2 = "10.0.8";
19038-
var defaults_default = {
19039-
headers: {
19040-
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
19041-
}
19042-
};
19043-
function isPlainObject2(value) {
19044-
if (typeof value !== "object" || value === null)
19045-
return false;
19046-
if (Object.prototype.toString.call(value) !== "[object Object]")
19047-
return false;
19048-
const proto = Object.getPrototypeOf(value);
19049-
if (proto === null)
19050-
return true;
19051-
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
19052-
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
19053-
}
19054-
var noop = () => "";
19055-
async function fetchWrapper(requestOptions) {
19056-
const fetch2 = requestOptions.request?.fetch || globalThis.fetch;
19057-
if (!fetch2) {
19058-
throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");
19059-
}
19060-
const log = requestOptions.request?.log || console;
19061-
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
19062-
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
19063-
const requestHeaders = Object.fromEntries(Object.entries(requestOptions.headers).map(([name, value]) => [
19064-
name,
19065-
String(value)
19066-
]));
19067-
let fetchResponse;
19068-
try {
19069-
fetchResponse = await fetch2(requestOptions.url, {
19070-
method: requestOptions.method,
19071-
body,
19072-
redirect: requestOptions.request?.redirect,
19073-
headers: requestHeaders,
19074-
signal: requestOptions.request?.signal,
19075-
...requestOptions.body && { duplex: "half" }
19076-
});
19077-
} catch (error2) {
19078-
let message = "Unknown Error";
19079-
if (error2 instanceof Error) {
19080-
if (error2.name === "AbortError") {
19081-
error2.status = 500;
19082-
throw error2;
19083-
}
19084-
message = error2.message;
19085-
if (error2.name === "TypeError" && "cause" in error2) {
19086-
if (error2.cause instanceof Error) {
19087-
message = error2.cause.message;
19088-
} else if (typeof error2.cause === "string") {
19089-
message = error2.cause;
19090-
||||||| parent of aa04f85 (feat!: migrate to Node 24)
19091-
return request2(requestOptions).then((response) => {
19092-
if (response.data.errors) {
19093-
const headers = {};
19094-
for (const key of Object.keys(response.headers)) {
19095-
headers[key] = response.headers[key];
19096-
=======
1909718836
}
1909818837
if (!headers["content-type"] && typeof body !== "undefined") {
1909918838
headers["content-type"] = "application/json; charset=utf-8";
@@ -19347,7 +19086,6 @@ async function fetchWrapper(requestOptions) {
1934719086
message = error2.cause.message;
1934819087
} else if (typeof error2.cause === "string") {
1934919088
message = error2.cause;
19350-
>>>>>>> aa04f85 (feat!: migrate to Node 24)
1935119089
}
1935219090
}
1935319091
}
@@ -22300,11 +22038,7 @@ var BASE_SHA;
2230022038
let HEAD_SHA = headResult.stdout;
2230122039
if (["pull_request", "pull_request_target"].includes(eventName) && !context2.payload.pull_request.merged) {
2230222040
const pullRequestEventName = "pull_request";
22303-
const baseResult = spawnSync("git", [
22304-
"merge-base",
22305-
`${remote}/${context2.payload[pullRequestEventName].base.ref}`,
22306-
"HEAD"
22307-
], { encoding: "utf-8" });
22041+
const baseResult = spawnSync("git", ["merge-base", `${remote}/${context2.payload[pullRequestEventName].base.ref}`, "HEAD"], { encoding: "utf-8" });
2230822042
BASE_SHA = baseResult.stdout;
2230922043
} else if (eventName == "merge_group" && usePreviousMergeGroupCommit) {
2231022044
const baseResult = spawnSync("git", ["rev-parse", "HEAD^1"], {
@@ -22337,7 +22071,9 @@ var BASE_SHA;
2233722071
encoding: "utf-8"
2233822072
});
2233922073
if (baseRes.status !== 0 || !baseRes.stdout) {
22340-
const emptyTreeRes = spawnSync("git", ["hash-object", "-t", "tree", "/dev/null"], { encoding: "utf-8" });
22074+
const emptyTreeRes = spawnSync("git", ["hash-object", "-t", "tree", "/dev/null"], {
22075+
encoding: "utf-8"
22076+
});
2234122077
BASE_SHA = emptyTreeRes.stdout ?? `4b825dc642cb6eb9a060e54bf8d69288fbee4904`;
2234222078
process.stdout.write(`HEAD~1 does not exist. We are therefore defaulting to use the empty git tree hash as BASE.
2234322079
`);

0 commit comments

Comments
 (0)