Commit 10a0eef

Anton Golub <antongolub@antongolub.com>
2025-03-07 15:29:12
ci: codeql tweakup (#1121)
* chore: minor syntax imprs * ci(codeql): add bundles to `path-ignore` * ci: extract codeql config
1 parent a38be55
.github/codeql/codeql-config.yml
@@ -0,0 +1,11 @@
+paths:
+  - .github
+  - docs
+  - examples
+  - man
+  - src
+  - scripts
+  - test
+  - test-d
+paths-ignore:
+  - build
.github/workflows/codeql.yml
@@ -39,6 +39,7 @@ jobs:
       - name: Initialize CodeQL
         uses: github/codeql-action/init@v3
         with:
+          config-file: ./.github/codeql/codeql-config.yml
           languages: ${{ matrix.language }}
           build-mode: ${{ matrix.build-mode }}
 
src/cli.ts
@@ -128,10 +128,10 @@ async function runScript(
   scriptPath: string,
   tempPath: string
 ): Promise<void> {
-  let nm = ''
+  let nmLink = ''
   const rmTemp = () => {
     fs.rmSync(tempPath, { force: true, recursive: true })
-    nm && fs.rmSync(nm, { force: true, recursive: true })
+    nmLink && fs.rmSync(nmLink, { force: true, recursive: true })
   }
   try {
     if (tempPath) {
@@ -140,7 +140,7 @@ async function runScript(
     }
     const cwd = path.dirname(scriptPath)
     if (typeof argv.preferLocal === 'string') {
-      nm = linkNodeModules(cwd, argv.preferLocal)
+      nmLink = linkNodeModules(cwd, argv.preferLocal)
     }
     if (argv.install) {
       await installDeps(parseDeps(script), cwd, argv.registry)
src/vendor-extra.ts
@@ -36,7 +36,7 @@ global.AbortController = global.AbortController || AbortController
 
 export const createRequire = _createRequire as unknown as (
   filename: string | URL
-) => NodeRequire
+) => NodeJS.Require
 
 export const globbyModule = {
   convertPathToPattern,
.gitignore
@@ -5,4 +5,5 @@ package/
 reports/
 docs/.vitepress/cache/
 yarn.lock
+pnpm-lock.yaml
 temp
.size-limit.json
@@ -30,7 +30,7 @@
   {
     "name": "all",
     "path": "build/*",
-    "limit": "851 kB",
+    "limit": "851.1 kB",
     "brotli": false,
     "gzip": false
   }