diff --git a/build/main.js b/build/main.js index 8c0400a..9407692 100644 --- a/build/main.js +++ b/build/main.js @@ -24783,8 +24783,8 @@ function comparePackSizes(basePacks, sourcePacks, threshold) { // src/checks/replacements.ts import nativeManifest from "./native-O77SEK3D.json" with { type: "json" }; -import microUtilsManifest from "./micro-utilities-74AZJTCK.json" with { type: "json" }; -import preferredManifest from "./preferred-UDJHBJAQ.json" with { type: "json" }; +import microUtilsManifest from "./micro-utilities-N7NZTMHQ.json" with { type: "json" }; +import preferredManifest from "./preferred-S3MZM3ZJ.json" with { type: "json" }; var allReplacements = [ ...nativeManifest.moduleReplacements, ...microUtilsManifest.moduleReplacements, @@ -25180,7 +25180,7 @@ async function run() { const workspacePath = join2(baseWorkspace, workDir); core7.info(`Workspace path is ${workspacePath}`); const baseRef = getBaseRef(); - const currentRef = github2.context.sha; + const currentRef = github2.context.payload.pull_reuqest?.head.sha ?? github2.context.sha; const lockfileFilename = detectLockfile(workspacePath); core7.info(`Detected lockfile ${lockfileFilename}`); const token = core7.getInput("github-token", { required: true }); diff --git a/build/micro-utilities-74AZJTCK.json b/build/micro-utilities-N7NZTMHQ.json similarity index 60% rename from build/micro-utilities-74AZJTCK.json rename to build/micro-utilities-N7NZTMHQ.json index 92cdcf2..6df5749 100644 --- a/build/micro-utilities-74AZJTCK.json +++ b/build/micro-utilities-N7NZTMHQ.json @@ -1,5 +1,41 @@ { "moduleReplacements": [ + { + "type": "simple", + "moduleName": "arr-diff", + "replacement": "Use a.filter((item) => !b.includes(item))", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "array-last", + "replacement": "Use arr.at(-1) or arr[arr.length - 1]", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "array-union", + "replacement": "Use [...new Set([...a, ...b])]", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "array-uniq", + "replacement": "Use [...new Set(arr)]", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "array-unique", + "replacement": "Use [...new Set(arr)]", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "arrify", + "replacement": "Use (v == null ? [] : Array.isArray(v) ? v : [v])", + "category": "micro-utilities" + }, { "type": "simple", "moduleName": "call-bind", @@ -24,6 +60,18 @@ "replacement": "Use Object.defineProperty(target, Symbol.toStringTag, { value, configurable: true })", "category": "micro-utilities" }, + { + "type": "simple", + "moduleName": "filter-obj", + "replacement": "Use Object.fromEntries(Object.entries(obj).filter(fn))", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "has-flag", + "replacement": "Use process.argv.includes('--flag')", + "category": "micro-utilities" + }, { "type": "simple", "moduleName": "is-array-buffer", @@ -36,6 +84,12 @@ "replacement": "Use Object.prototype.toString.call(v) === \"[object Boolean]\"", "category": "micro-utilities" }, + { + "type": "simple", + "moduleName": "is-ci", + "replacement": "Use Boolean(process.env.CI)", + "category": "micro-utilities" + }, { "type": "simple", "moduleName": "is-date-object", @@ -48,6 +102,12 @@ "replacement": "Use (n % 2) === 0", "category": "micro-utilities" }, + { + "type": "simple", + "moduleName": "is-finite", + "replacement": "Use Number.isFinite(v)", + "category": "micro-utilities" + }, { "type": "simple", "moduleName": "is-negative", @@ -126,11 +186,47 @@ "replacement": "Use process.platform === \"win32\"", "category": "micro-utilities" }, + { + "type": "simple", + "moduleName": "kind-of", + "replacement": "Use typeof v, or Object.prototype.toString.call(v) to get the internal [[Class]]", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "lower-case", + "replacement": "Use str.toLocaleLowerCase() or str.toLowerCase()", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "repeat-string", + "replacement": "Use str.repeat(n)", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "slash", + "replacement": "Use path.startsWith('\\\\?\\') ? path : path.replace(/\\/g, '/')", + "category": "micro-utilities" + }, { "type": "simple", "moduleName": "split-lines", "replacement": "Use str.split(/\\r?\\n/)", "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "uniq", + "replacement": "Use [...new Set(arr)]", + "category": "micro-utilities" + }, + { + "type": "simple", + "moduleName": "upper-case", + "replacement": "Use str.toLocaleUpperCase() or str.toUpperCase()", + "category": "micro-utilities" } ] } diff --git a/build/preferred-UDJHBJAQ.json b/build/preferred-S3MZM3ZJ.json similarity index 96% rename from build/preferred-UDJHBJAQ.json rename to build/preferred-S3MZM3ZJ.json index ef62368..eaa7abc 100644 --- a/build/preferred-UDJHBJAQ.json +++ b/build/preferred-S3MZM3ZJ.json @@ -3,7 +3,7 @@ { "type": "documented", "moduleName": "@jsdevtools/ez-spawn", - "docPath": "process-exec", + "docPath": "ez-spawn", "category": "preferred" }, { @@ -39,13 +39,13 @@ { "type": "documented", "moduleName": "buffer-equals", - "docPath": "buffer-equal", + "docPath": "buffer-equals", "category": "preferred" }, { "type": "documented", "moduleName": "builtin-modules", - "docPath": "is-builtin-module", + "docPath": "builtin-modules", "category": "preferred" }, { @@ -60,12 +60,24 @@ "docPath": "chalk", "category": "preferred" }, + { + "type": "documented", + "moduleName": "core-util-is", + "docPath": "core-util-is", + "category": "preferred" + }, { "type": "documented", "moduleName": "cpx", "docPath": "cpx", "category": "preferred" }, + { + "type": "documented", + "moduleName": "crypto-js", + "docPath": "crypto-js", + "category": "preferred" + }, { "type": "documented", "moduleName": "deep-equal", @@ -135,7 +147,13 @@ { "type": "documented", "moduleName": "execa", - "docPath": "process-exec", + "docPath": "execa", + "category": "preferred" + }, + { + "type": "documented", + "moduleName": "ez-spawn", + "docPath": "ez-spawn", "category": "preferred" }, { @@ -153,25 +171,31 @@ { "type": "documented", "moduleName": "fast-glob", - "docPath": "glob", + "docPath": "fast-glob", "category": "preferred" }, { "type": "documented", "moduleName": "find-cache-dir", - "docPath": "find-up", + "docPath": "find-cache-dir", "category": "preferred" }, { "type": "documented", "moduleName": "find-cache-directory", - "docPath": "find-up", + "docPath": "find-cache-directory", "category": "preferred" }, { "type": "documented", "moduleName": "find-file-up", - "docPath": "find-up", + "docPath": "find-file-up", + "category": "preferred" + }, + { + "type": "documented", + "moduleName": "find-pkg", + "docPath": "find-pkg", "category": "preferred" }, { @@ -186,6 +210,12 @@ "docPath": "fs-extra", "category": "preferred" }, + { + "type": "documented", + "moduleName": "get-value", + "docPath": "dot-prop", + "category": "preferred" + }, { "type": "documented", "moduleName": "glob", @@ -195,7 +225,7 @@ { "type": "documented", "moduleName": "globby", - "docPath": "glob", + "docPath": "globby", "category": "preferred" }, { @@ -207,7 +237,7 @@ { "type": "documented", "moduleName": "graphemer", - "docPath": "grapheme", + "docPath": "graphemer", "category": "preferred" }, { @@ -234,6 +264,12 @@ "docPath": "js-yaml", "category": "preferred" }, + { + "type": "documented", + "moduleName": "jsx-ast-utils", + "docPath": "jsx-ast-utils", + "category": "preferred" + }, { "type": "documented", "moduleName": "lint-staged", @@ -1512,12 +1548,6 @@ "docPath": "lodash-underscore", "category": "preferred" }, - { - "type": "documented", - "moduleName": "lodash.pullby", - "docPath": "lodash-underscore", - "category": "preferred" - }, { "type": "documented", "moduleName": "lodash.random", @@ -2040,12 +2070,6 @@ "docPath": "lodash-underscore", "category": "preferred" }, - { - "type": "documented", - "moduleName": "lodash.unique", - "docPath": "lodash-underscore", - "category": "preferred" - }, { "type": "documented", "moduleName": "lodash.uniqueid", @@ -2205,7 +2229,7 @@ { "type": "documented", "moduleName": "moment", - "docPath": "momentjs", + "docPath": "moment", "category": "preferred" }, { @@ -2214,6 +2238,18 @@ "docPath": "npm-run-all", "category": "preferred" }, + { + "type": "documented", + "moduleName": "object-hash", + "docPath": "object-hash", + "category": "preferred" + }, + { + "type": "documented", + "moduleName": "object-path", + "docPath": "dot-prop", + "category": "preferred" + }, { "type": "documented", "moduleName": "ora", @@ -2232,6 +2268,12 @@ "docPath": "path-exists", "category": "preferred" }, + { + "type": "documented", + "moduleName": "pkg-dir", + "docPath": "pkg-dir", + "category": "preferred" + }, { "type": "documented", "moduleName": "pkg-up", @@ -2253,19 +2295,19 @@ { "type": "documented", "moduleName": "read-package-up", - "docPath": "find-up", + "docPath": "read-package-up", "category": "preferred" }, { "type": "documented", "moduleName": "read-pkg", - "docPath": "find-up", + "docPath": "read-pkg", "category": "preferred" }, { "type": "documented", "moduleName": "read-pkg-up", - "docPath": "find-up", + "docPath": "read-pkg-up", "category": "preferred" }, { @@ -2280,6 +2322,12 @@ "docPath": "rimraf", "category": "preferred" }, + { + "type": "documented", + "moduleName": "set-value", + "docPath": "dot-prop", + "category": "preferred" + }, { "type": "documented", "moduleName": "shortid", @@ -2292,6 +2340,12 @@ "docPath": "sort-object", "category": "preferred" }, + { + "type": "documented", + "moduleName": "string-width", + "docPath": "string-width", + "category": "preferred" + }, { "type": "documented", "moduleName": "strip-ansi", @@ -2322,6 +2376,12 @@ "docPath": "uri-js", "category": "preferred" }, + { + "type": "documented", + "moduleName": "utf8", + "docPath": "utf8", + "category": "preferred" + }, { "type": "documented", "moduleName": "xmldom", diff --git a/src/main.ts b/src/main.ts index 353f891..3b746e5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,7 +26,8 @@ async function run(): Promise { core.info(`Workspace path is ${workspacePath}`); const baseRef = getBaseRef(); - const currentRef = github.context.sha; + const currentRef = + github.context.payload.pull_reuqest?.head.sha ?? github.context.sha; const lockfileFilename = detectLockfile(workspacePath); core.info(`Detected lockfile ${lockfileFilename}`);