Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(scripts): type runInstaller #1663

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"ignorePatterns": ["dist", "browser"],
"plugins": [
"@typescript-eslint",
"path-alias",
"simple-header",
"simple-import-sort",
"unused-imports",
"path-alias"
"unicorn",
"unused-imports"
],
"settings": {
"import/resolver": {
Expand All @@ -33,13 +34,13 @@
"templates": { "author": [".*", "Vendicated and contributors"] }
}
],

"quotes": ["error", "double", { "avoidEscape": true }],
"jsx-quotes": ["error", "prefer-double"],
"no-mixed-spaces-and-tabs": "error",
"indent": ["error", 4, { "SwitchCase": 1 }],
"arrow-parens": ["error", "as-needed"],
"eol-last": ["error", "always"],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"no-multi-spaces": "error",
"no-trailing-spaces": "error",
"no-whitespace-before-property": "error",
Expand Down Expand Up @@ -85,11 +86,15 @@
"prefer-const": "error",
"prefer-spread": "error",

"@typescript-eslint/func-call-spacing": ["error", "never"],

"path-alias/no-relative": "error",

"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",

"unused-imports/no-unused-imports": "error",
"unicorn/prefer-node-protocol": "error",

"path-alias/no-relative": "error"
"unused-imports/no-unused-imports": "error"
}
}
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
"build": "node scripts/build/build.mjs",
"buildWeb": "node --require=./scripts/suppressExperimentalWarnings.js scripts/build/buildWeb.mjs",
"generatePluginJson": "tsx scripts/generatePluginList.ts",
"inject": "node scripts/runInstaller.mjs",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --ignore-pattern src/userplugins",
"lint-styles": "stylelint \"src/**/*.css\" --ignore-pattern src/userplugins",
"lint:fix": "pnpm lint --fix",
"test": "pnpm build && pnpm lint && pnpm lint-styles && pnpm testTsc && pnpm generatePluginJson",
"testWeb": "pnpm lint && pnpm buildWeb && pnpm testTsc",
"inject": "tsx scripts/runInstaller.mts",
"lint": "pnpm run lint-user --ignore-pattern src/userplugins",
"lint:fix": "pnpm run lint --fix",
"lint-styles": "pnpm run lint-user-styles --ignore-pattern src/userplugins",
"lint-user": "eslint . --ext .js,.jsx,.mjs,.mjsx,.mts,.mtsx,.ts,.tsx",
"lint-user:fix": "pnpm run lint-user --fix",
"lint-user-styles": "stylelint \"src/**/*.css\"",
"test": "pnpm run build && pnpm run lint && pnpm run lint-styles && pnpm run testTsc && pnpm run generatePluginJson",
"testTsc": "tsc --noEmit",
"uninject": "node scripts/runInstaller.mjs",
"testWeb": "pnpm run lint && pnpm run buildWeb && pnpm run testTsc",
"uninject": "tsx scripts/runInstaller.mts",
"watch": "node scripts/build/build.mjs --watch"
},
"dependencies": {
Expand Down Expand Up @@ -55,6 +58,7 @@
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-path-alias": "^1.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unicorn": "^48.0.1",
"eslint-plugin-unused-imports": "^2.0.0",
"highlight.js": "10.6.0",
"moment": "^2.29.4",
Expand Down
108 changes: 101 additions & 7 deletions pnpm-lock.yaml

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

6 changes: 3 additions & 3 deletions scripts/build/buildWeb.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import { readFileSync } from "node:fs";
import { appendFile, mkdir, readFile, rm, writeFile } from "node:fs/promises";
import { join } from "node:path";

import esbuild from "esbuild";
import { zip } from "fflate";
import { readFileSync } from "fs";
import { appendFile, mkdir, readFile, rm, writeFile } from "fs/promises";
import { join } from "path";

import { commonOpts, globPlugins, VERSION, watch } from "./common.mjs";

Expand Down
10 changes: 5 additions & 5 deletions scripts/build/common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import "../suppressExperimentalWarnings.js";
import "../checkNodeVersion.js";

import { exec, execSync } from "child_process";
import { existsSync, readFileSync } from "fs";
import { readdir, readFile } from "fs/promises";
import { join, relative } from "path";
import { promisify } from "util";
import { exec, execSync } from "node:child_process";
import { existsSync, readFileSync } from "node:fs";
import { readdir, readFile } from "node:fs/promises";
import { join, relative } from "node:path";
import { promisify } from "node:util";

// wtf is this assert syntax
import PackageJSON from "../../package.json" assert { type: "json" };
Expand Down
7 changes: 4 additions & 3 deletions scripts/generatePluginList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import { Dirent, readdirSync, readFileSync, writeFileSync } from "fs";
import { access, readFile } from "fs/promises";
import { join } from "path";
import { Dirent, readdirSync, readFileSync, writeFileSync } from "node:fs";
import { access, readFile } from "node:fs/promises";
import { join } from "node:path";

import { BigIntLiteral, createSourceFile, Identifier, isArrayLiteralExpression, isCallExpression, isExportAssignment, isIdentifier, isObjectLiteralExpression, isPropertyAccessExpression, isPropertyAssignment, isSatisfiesExpression, isStringLiteral, isVariableStatement, NamedDeclaration, NodeArray, ObjectLiteralExpression, ScriptTarget, StringLiteral, SyntaxKind } from "typescript";

import { getPluginTarget } from "./utils.mjs";
Expand Down
3 changes: 2 additions & 1 deletion scripts/generateReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
// eslint-disable-next-line spaced-comment
/// <reference types="../src/modules" />

import { readFileSync } from "fs";
import { readFileSync } from "node:fs";

import pup, { JSHandle } from "puppeteer-core";

for (const variable of ["DISCORD_TOKEN", "CHROMIUM_BIN"]) {
Expand Down
Loading