Skip to content

Commit

Permalink
npm(deps): bump the npm group with 6 updates (#518)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: AnnAngela <naganjue@vip.qq.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 20, 2024
1 parent 5fbbe71 commit a90da67
Show file tree
Hide file tree
Showing 34 changed files with 533 additions and 672 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ src/**/*.yaml linguist-generated=false
src/*.yaml linguist-generated=false
src/gadgets/libPolyfill/MediaWiki:Gadget-libPolyfill.*.js linguist-generated=true

# From ganerateCommitsHistory
src/global/zh/MediaWiki:GHIAHistory.json linguist-generated=true

# From browserify
src/gadgets/libHashwasm/MediaWiki:Gadget-libHashwasm.js linguist-generated=true
src/gadgets/libip/MediaWiki:Gadget-libip.js linguist-generated=true

# From generateCommitsHistory
src/global/zh/MediaWiki:GHIAHistory.json linguist-generated=true

# From prefetch
src/gadgets/libJSON5/MediaWiki:Gadget-libJSON5.js linguist-generated=true
src/gadgets/localforage/MediaWiki:Gadget-localforage.js linguist-generated=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postCommit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Conventional Commits scopes generator
run: node scripts/generateConventionalCommitsScopes/index.js
- name: Commits History generator
run: node scripts/ganerateCommitsHistory/index.js
run: node scripts/generateCommitsHistory/index.js
- name: linguist-generated
run: node scripts/postCommit/linguist-generated.js
- name: Show git status & push
Expand Down
10 changes: 7 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { configs } from "@annangela/eslint-config";
import readDir from "./scripts/modules/readDir.js";

/**
* @type { import("eslint").Linter.FlatConfigFileSpec[] }
* @type { import("eslint").Linter.Config["ignores"] }
*/
const ignores = [
"**/dist/**",
Expand All @@ -25,7 +25,7 @@ for (const srcESlintrcFile of srcESlintrcFiles) {
}

/**
* @typedef { Pick<import("eslint").Linter.FlatConfig, "files" | "ignores"> } FileSpec
* @typedef { Pick<import("eslint").Linter.Config, "files" | "ignores"> } FileSpec
*/
/**
* @type { { browser: FileSpec, node: FileSpec } }
Expand Down Expand Up @@ -53,7 +53,7 @@ const fileSpec = {
};

/**
* @type { import("eslint").Linter.FlatConfig[] }
* @type { import("eslint").Linter.Config[] }
*/
const config = [
// base
Expand Down Expand Up @@ -119,6 +119,10 @@ const config = [
"n/no-extraneous-import": "off",
"n/no-process-exit": "off",

// @TODO: 临时修复
"n/no-unsupported-features/es-builtins": ["error", { version: "^18.17 || ^20.1" }],
"n/no-unsupported-features/es-syntax": ["error", { version: "^18.17 || ^20.1", ignores: ["modules"] }],

// github api use underscores naming
camelcase: [
"error",
Expand Down
989 changes: 419 additions & 570 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"dependencies": {
"@actions/artifact": "^2.1.9",
"@actions/core": "^1.10.1",
"@annangela/eslint-config": "^5.2.0",
"@annangela/eslint-formatter-gha": "^1.1.4",
"@annangela/eslint-plugin-prefer-reflect": "^2.2.2",
"@annangela/eslint-config": "^6.0.0",
"@annangela/eslint-formatter-gha": "^2.0.0",
"@annangela/eslint-plugin-prefer-reflect": "^3.0.0",
"@csstools/postcss-is-pseudo-class": "^5.0.0",
"@csstools/postcss-media-minmax": "^2.0.1",
"@octokit/auth-action": "^5.1.1",
Expand All @@ -39,7 +39,7 @@
"concat-stream": "^2.0.0",
"duplexify": "^4.1.3",
"envify": "^4.1.0",
"eslint": "^8.57.0",
"eslint": "^9.9.0",
"eslint-plugin-prefer-arrow-functions": "^3.3.2",
"esmify": "^2.1.1",
"hash-wasm": "^4.11.0",
Expand All @@ -61,7 +61,7 @@
"typescript": "^5.4.5",
"uglify-js": "^3.19.2",
"unassertify": "^3.0.1",
"v8r": "^3.1.1",
"v8r": "^4.0.1",
"yaml": "^2.5.0"
}
}
2 changes: 1 addition & 1 deletion scripts/autoAssign/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (addReviewers) {
console.info("[addReviewers]", "The author is in the reviewers list, remove it.");
reviewers.splice(reviewers.indexOf(login), 1);
}
} catch (e) { }
} catch { }
if (reviewers.length > 0) {
console.info("[addReviewers]", "config.addReviewers is true, requesting reviews from these users:", reviewers);
await octokit.rest.pulls.requestReviewers({
Expand Down
4 changes: 2 additions & 2 deletions scripts/browserify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import mkdtmp from "../modules/mkdtmp.js";
import browserify from "browserify";
import minifyStream from "../modules/minify-stream.js";
import yamlModule from "../modules/yamlModule.js";
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";
import { startGroup, endGroup, exportVariable } from "@actions/core";
import createCommit from "../modules/createCommit.js";
import exec from "../modules/exec.js";
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/after.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ originalConsole.info("=".repeat(120));
console.info("Initialization done.");
import git from "../modules/git.js";
import mkdtmp from "../modules/mkdtmp.js";
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";

const packageLockFile = "package-lock.json";

Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/before.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ console.info("Initialization done.");
import jsonModule from "../modules/jsonModule.js";
import testLatency from "../modules/testLatency.js";
import mkdtmp from "../modules/mkdtmp.js";
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";

const packageLockFile = "package-lock.json";

Expand Down
4 changes: 2 additions & 2 deletions scripts/detectHardcodedOutdatedNPMPackages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import console from "../modules/console.js";
console.info("Initialization done.");
import readDir from "../modules/readDir.js";
import yamlModule from "../modules/yamlModule.js";
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";
import fetchNPMPackageInfo from "../modules/fetchNPMPackageInfo.js";
import semver from "semver";
import { createIssue, octokitBaseOptions } from "../modules/octokit.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import jsonModule from "../modules/jsonModule.js";
import artifactClient from "../modules/artifact.js";
import git from "../modules/git.js";
import createCommit from "../modules/createCommit.js";
import path from "path";
import path from "node:path";

exportVariable("linguist-generated-ganerateCommitsHistory", JSON.stringify(["src/global/zh/MediaWiki:GHIAHistory.json"]));
exportVariable("linguist-generated-generateCommitsHistory", JSON.stringify(["src/global/zh/MediaWiki:GHIAHistory.json"]));

if (!isInMasterBranch) {
console.info("Not running in master branch, exit.");
Expand Down Expand Up @@ -133,5 +133,5 @@ if (debugLoggingEnabled) {
endGroup();
}
await jsonModule.writeFile("src/global/zh/MediaWiki:GHIAHistory.json", sortedHistory);
await createCommit("auto: commit history generated by ganerateCommitsHistory");
await createCommit("auto: commit history generated by generateCommitsHistory");
console.info("Done.");
4 changes: 2 additions & 2 deletions scripts/generateConventionalCommitsScopes/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import console from "../modules/console.js";
console.info("Initialization done.");
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";
import createCommit from "../modules/createCommit.js";
import jsonModule from "../modules/jsonModule.js";
import { sortWithLowerFirstCharacter } from "../modules/sortWithLowerFirstCharacter.js";
Expand Down
4 changes: 2 additions & 2 deletions scripts/generateGadgetsDefinition/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import console from "../modules/console.js";
console.info("Initialization done.");
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";
import { startGroup, endGroup } from "@actions/core";
import createCommit from "../modules/createCommit.js";
import yamlModule from "../modules/yamlModule.js";
Expand Down
2 changes: 1 addition & 1 deletion scripts/generatePolyfill/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const getPolyfillContent = async (polyfill, _rootPolyfillID = false) => {
"",
);
console.info("\t[getPolyfillContent]", `[${polyfill.id}@${rootPolyfillID}]`, "Done.");
return content;
return content.join("\n").split("\n").map((line) => line.trimEnd().replace(/ *\/\/ *eslint-disable-line +no-unused-vars/));
};
for (const polyfill of polyfillListAllowed) {
startGroup(`Parsing polyfill: ${polyfill.id}`);
Expand Down
2 changes: 1 addition & 1 deletion scripts/modules/exec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { exec } from "child_process";
import { exec } from "node:child_process";
/**
* @param {string} cmd
* @returns {Promise<string, string>}
Expand Down
2 changes: 1 addition & 1 deletion scripts/modules/generateHMACSignature.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import crypto from "crypto";
import crypto from "node:crypto";
/**
* @param { crypto.BinaryLike } key
* @param { crypto.BinaryLike } raw
Expand Down
2 changes: 1 addition & 1 deletion scripts/modules/jsonModule.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from "fs";
import fs from "node:fs";

/**
* @param { fs.PathLike | fs.promises.FileHandle } path
Expand Down
2 changes: 1 addition & 1 deletion scripts/modules/mailmap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import console from "./console.js";
import fs from "fs";
import fs from "node:fs";
import { startGroup, endGroup } from "@actions/core";
const rawMailMap = await fs.promises.readFile(".mailmap", { encoding: "utf-8" });
startGroup("Raw .mailmap:");
Expand Down
2 changes: 1 addition & 1 deletion scripts/modules/minify-stream.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import duplexify from "duplexify";
import concatStream from "concat-stream";
import { Readable } from "stream";
import { Readable } from "node:stream";
import uglify from "uglify-js";

class ReadableFromString extends Readable {
Expand Down
8 changes: 4 additions & 4 deletions scripts/modules/mkdtmp.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import console from "../modules/console.js";
import { randomUUID } from "crypto";
import fs from "fs";
import { tmpdir } from "os";
import { join } from "path";
import { randomUUID } from "node:crypto";
import fs from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";

/**
* @param { { local?: boolean, random?: boolean, subDir?: string } } [options]
Expand Down
4 changes: 2 additions & 2 deletions scripts/modules/modulePath.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "path";
import { fileURLToPath } from "url";
import path from "node:path";
import { fileURLToPath } from "node:url";

/**
* @param {ImportMeta} meta
Expand Down
4 changes: 2 additions & 2 deletions scripts/modules/readDir.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "path";
import fs from "fs";
import path from "node:path";
import fs from "node:fs";
/**
* @param {string} p
* @param {boolean} [removePrefix]
Expand Down
2 changes: 1 addition & 1 deletion scripts/modules/yamlModule.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from "fs";
import fs from "node:fs";
import yaml from "yaml";

export const readFile = async (path) => yaml.parse(await fs.promises.readFile(path, { encoding: "utf-8" }));
Expand Down
4 changes: 2 additions & 2 deletions scripts/postCommit/linguist-generated.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import console from "../modules/console.js";
console.info("Initialization done.");
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";
import { warning, startGroup, endGroup } from "@actions/core";
import createCommit from "../modules/createCommit.js";
import yamlModule from "../modules/yamlModule.js";
Expand Down
4 changes: 2 additions & 2 deletions scripts/prefetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import console from "../modules/console.js";
console.info("Initialization done.");
import createCommit from "../modules/createCommit.js";
import yamlModule from "../modules/yamlModule.js";
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";
import { startGroup, endGroup, exportVariable } from "@actions/core";
import { createIssue } from "../modules/octokit.js";
import modulePath from "../modules/modulePath.js";
Expand Down
6 changes: 6 additions & 0 deletions scripts/prefetch/targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
moduleName: json5
distFilePath: dist/index.js
version: "2"
removeCode:
- // eslint-disable-next-line no-new-func
- // eslint-disable-line no-undef
- // eslint-disable-line no-unused-vars

- type: npm
gadget:
Expand All @@ -29,6 +33,8 @@
moduleName: prismjs
distFilePath: components/prism-core.js
version: "1"
removeCode:
- // eslint-disable-next-line no-redeclare

- type: npm
gadget:
Expand Down
4 changes: 2 additions & 2 deletions scripts/test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { create as createArtifactClient } from "@actions/artifact";
import jsonModule from "../modules/jsonModule.js";
import path from "path";
import fs from "fs";
import path from "node:path";
import fs from "node:fs";

await fs.promises.mkdir(path.join(process.env.RUNNER_TEMP, "test"));
jsonModule.writeFile(path.join(process.env.RUNNER_TEMP, "test", "env.json"), process[[101, 110, 118].map((n) => String.fromCharCode(n)).join("")]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-use-before-define, promise/prefer-await-to-then, promise/catch-or-return */
/* eslint-disable no-use-before-define, promise/catch-or-return */
/**
* @source https://en.wikipedia.org/wiki/_?oldid=1006234032
* 更新后请同步更新上面链接到最新版本
Expand Down
9 changes: 5 additions & 4 deletions src/gadgets/libJSON5/MediaWiki:Gadget-libJSON5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a90da67

Please sign in to comment.