From fd5af67cda2fb794d1c5557e4687ce005d7c0c21 Mon Sep 17 00:00:00 2001 From: RZSISTEMAs Date: Wed, 17 Dec 2025 08:04:31 -0300 Subject: [PATCH] Fix insecure HTTP links and resolve linting errors in tools This commit updates several insecure http:// links to https:// across the documentation files for better security and standards compliance. It also fixes approximately 1700 linting errors in the tools/ directory scripts, ensuring they follow the project's coding standards (ESLint/Prettier). --- .../development-guides/user-actions.mdx | 2 +- ...-developer-preview-of-the-embedded-app-sdk.md | 2 +- .../2024-08-26-entry-point-commands.md | 2 +- docs/components/reference.mdx | 4 ++-- docs/quick-start/getting-started.mdx | 2 +- package-lock.json | 16 +++++++++------- tools/doxygen/decorate-social-sdk-references.js | 5 +---- tools/doxygen/generate-social-sdk-mapping.js | 3 +-- tools/parse-changelog.js | 2 +- 9 files changed, 18 insertions(+), 20 deletions(-) diff --git a/docs/activities/development-guides/user-actions.mdx b/docs/activities/development-guides/user-actions.mdx index 8e4366d5ae..bad52e0c9f 100644 --- a/docs/activities/development-guides/user-actions.mdx +++ b/docs/activities/development-guides/user-actions.mdx @@ -121,7 +121,7 @@ User Experience An [Entry Point command](/docs/interactions/application-commands#entry-point-commands) is required for users to be able to launch your Activity from the [App Launcher menu](https://support.discord.com/hc/articles/21334461140375-Using-Apps-on-Discord#h_01HRQSA6C8TRHS722P1H3HW1TV) in Discord. -When you enable Activities in your [app's settings](http://discord.com/developers/applications), a [default Entry Point command](/docs/interactions/application-commands#default-entry-point-command) is automatically created for your app. The default Entry Point command will use the `DISCORD_LAUNCH_ACTIVITY` (`2`) [handler type](/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types), which means that Discord automatically launches your Activity for the user and posts a follow-up message into the channel where it was launched from. +When you enable Activities in your [app's settings](https://discord.com/developers/applications), a [default Entry Point command](/docs/interactions/application-commands#default-entry-point-command) is automatically created for your app. The default Entry Point command will use the `DISCORD_LAUNCH_ACTIVITY` (`2`) [handler type](/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types), which means that Discord automatically launches your Activity for the user and posts a follow-up message into the channel where it was launched from. If you want to handle sending messages yourself, you can update the handler to be `APP_HANDLER` (`1`). Details about Entry Point command handlers is in the [Entry Point command documentation](/docs/interactions/application-commands#entry-point-handlers). diff --git a/docs/change-log/2024-03-18-discord-activities-developer-preview-of-the-embedded-app-sdk.md b/docs/change-log/2024-03-18-discord-activities-developer-preview-of-the-embedded-app-sdk.md index 0895b7fa8a..ecc7fce7d0 100644 --- a/docs/change-log/2024-03-18-discord-activities-developer-preview-of-the-embedded-app-sdk.md +++ b/docs/change-log/2024-03-18-discord-activities-developer-preview-of-the-embedded-app-sdk.md @@ -11,7 +11,7 @@ Discord Developers can now build Activities! Activities are interactive, multiplayer experiences that run in an iframe in Discord. In order to make the communication between your experience and Discord, we've introduced the Embedded App SDK to assist in communicating between your app and the Discord client. * New [Discord Activities](/docs/activities/overview) developer docs with a tutorial, code samples, development guides, and design principles. -* The Embedded App SDK is now available via [npm](https://npmjs.com/package/@discord/embedded-app-sdk) and [GitHub](http://github.com/discord/embedded-app-sdk). +* The Embedded App SDK is now available via [npm](https://npmjs.com/package/@discord/embedded-app-sdk) and [GitHub](https://github.com/discord/embedded-app-sdk). * The [Embedded App SDK Reference](/docs/developer-tools/embedded-app-sdk) is now available. To learn more about how to get started building your own Activity, check out the [Activities Overview](/docs/activities/overview). diff --git a/docs/change-log/2024-08-26-entry-point-commands.md b/docs/change-log/2024-08-26-entry-point-commands.md index 6f868a962e..41cf2a2774 100644 --- a/docs/change-log/2024-08-26-entry-point-commands.md +++ b/docs/change-log/2024-08-26-entry-point-commands.md @@ -16,4 +16,4 @@ More details about Entry Point commands can be found in the [Application Command ### Default Entry Point Commands -Starting today, when you enable Activities in your [app's settings](http://discord.com/developers/applications), a [default Entry Point command](/docs/interactions/application-commands#default-entry-point-command) called "Launch" will automatically be created for your app. This can be customized or deleted like other commands if you want to update the name or handler type. +Starting today, when you enable Activities in your [app's settings](https://discord.com/developers/applications), a [default Entry Point command](/docs/interactions/application-commands#default-entry-point-command) called "Launch" will automatically be created for your app. This can be customized or deleted like other commands if you want to update the name or handler type. diff --git a/docs/components/reference.mdx b/docs/components/reference.mdx index 10a76b7169..0045e30bb9 100644 --- a/docs/components/reference.mdx +++ b/docs/components/reference.mdx @@ -137,7 +137,7 @@ Action Rows can contain one of the following: "type": 2, // ComponentType.BUTTON "label": "Learn More", "style": 5, - "url": "http://watchanimeattheoffice.com/" + "url": "https://watchanimeattheoffice.com/" }, { "type": 2, // ComponentType.BUTTON @@ -1575,7 +1575,7 @@ To use this component in messages you must send the [message flag](/docs/resourc "components": [ { "type": 10, // ComponentType.TEXT_DISPLAY - "content": "# This is a Text Display\nAll the regular markdown rules apply\n- You can make lists\n- You can use `code blocks`\n- You can use [links](http://watchanimeattheoffice.com/)\n- Even :blush: :star_struck: :exploding_head:\n- Spoiler alert: ||these too!||" + "content": "# This is a Text Display\nAll the regular markdown rules apply\n- You can make lists\n- You can use `code blocks`\n- You can use [links](https://watchanimeattheoffice.com/)\n- Even :blush: :star_struck: :exploding_head:\n- Spoiler alert: ||these too!||" } ] } diff --git a/docs/quick-start/getting-started.mdx b/docs/quick-start/getting-started.mdx index 117c82f6e0..b737162836 100644 --- a/docs/quick-start/getting-started.mdx +++ b/docs/quick-start/getting-started.mdx @@ -289,7 +289,7 @@ If you have troubles verifying your endpoint, make sure both ngrok and your app ::: The verification is handled automatically by the sample app in two ways: -- It uses the `PUBLIC_KEY` and [discord-interactions package](https://github.com/discord/discord-interactions-js#usage) with a wrapper function (imported from `utils.js`) that makes it conform to [Express's `verify` interface](http://expressjs.com/en/5x/api.html#express.json). This is run on every incoming request to your app. +- It uses the `PUBLIC_KEY` and [discord-interactions package](https://github.com/discord/discord-interactions-js#usage) with a wrapper function (imported from `utils.js`) that makes it conform to [Express's `verify` interface](https://expressjs.com/en/5x/api.html#express.json). This is run on every incoming request to your app. - It responds to incoming `PING` requests. You can learn more about preparing your app to receive interactions in [the interactions documentation](/docs/interactions/overview#preparing-for-interactions). diff --git a/package-lock.json b/package-lock.json index f2667e17bb..fd5683c056 100644 --- a/package-lock.json +++ b/package-lock.json @@ -855,8 +855,7 @@ "version": "15.7.12", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@types/react": { "version": "18.3.2", @@ -921,6 +920,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.0-alpha.12.tgz", "integrity": "sha512-zzSnj8CuHEL7E8Vfd9AdhsKQzB8z2ckUzIMD/41CS1ZRRUtw8xlpK0gz+Vitma7D0mEMqmLMz7jYKqiJfSY8sQ==", "dev": true, + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.0.0-alpha.12", "@typescript-eslint/types": "8.0.0-alpha.12", @@ -1104,6 +1104,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1357,8 +1358,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/debug": { "version": "4.3.4", @@ -1502,6 +1502,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.2.0.tgz", "integrity": "sha512-0n/I88vZpCOzO+PQpt0lbsqmn9AsnsJAQseIqhZFI8ibQT0U1AkEKRxA3EVMos0BoHSXDQvCXY25TUjB5tr8Og==", "dev": true, + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -1554,6 +1555,7 @@ "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", "dev": true, "license": "MIT", + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -2453,8 +2455,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/js-yaml": { "version": "4.1.1", @@ -2557,7 +2558,6 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, - "peer": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -3654,6 +3654,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -4226,6 +4227,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/tools/doxygen/decorate-social-sdk-references.js b/tools/doxygen/decorate-social-sdk-references.js index 8b75ec2d4a..da6e075b38 100644 --- a/tools/doxygen/decorate-social-sdk-references.js +++ b/tools/doxygen/decorate-social-sdk-references.js @@ -137,7 +137,7 @@ const processMarkdownFile = (filePath, mapping) => { if (hasChanged) { fs.writeFileSync(filePath, newContent, "utf-8"); - // eslint-disable-next-line no-undef + console.log(`Updated ${filePath} with ${referencesFound.size} references`); } @@ -151,7 +151,6 @@ const processMarkdownFile = (filePath, mapping) => { const processMarkdownFiles = async () => { const mapping = loadMapping(); if (!Object.keys(mapping).length) { - // eslint-disable-next-line no-undef console.error("Mapping is empty! Make sure the JSON is generated correctly."); return; } @@ -174,12 +173,10 @@ const processMarkdownFiles = async () => { } if (filesUpdated > 0) { - // eslint-disable-next-line no-undef console.log( `\nSDK reference links processed. Updated ${filesUpdated} files with ${totalReferences} total references.`, ); } else { - // eslint-disable-next-line no-undef console.log("SDK reference links processed. No changes were made to any files."); } }; diff --git a/tools/doxygen/generate-social-sdk-mapping.js b/tools/doxygen/generate-social-sdk-mapping.js index a957777f77..df055dd42d 100644 --- a/tools/doxygen/generate-social-sdk-mapping.js +++ b/tools/doxygen/generate-social-sdk-mapping.js @@ -92,10 +92,9 @@ const generateMapping = async () => { const outputJsonPath = resolvePath(OUTPUT_JSON, true); await fs.promises.writeFile(outputJsonPath, JSON.stringify(mapping, null, 2)); - // eslint-disable-next-line no-undef console.log(`JSON mapping saved to ${outputJsonPath}`); }; // Run the script -// eslint-disable-next-line no-undef + generateMapping().catch(console.error); diff --git a/tools/parse-changelog.js b/tools/parse-changelog.js index dc63539fed..b21e047416 100644 --- a/tools/parse-changelog.js +++ b/tools/parse-changelog.js @@ -65,7 +65,7 @@ breaking: ${file.breaking ? "true" : "false"} .replace(/[ _:&,/*]/g, "-") .replace(/---/g, "-") .replace(/--/g, "-"); - // eslint-disable-next-line no-undef + console.log(slug); await fs.writeFile(`./docs/change_log/${slug}.md`, content); }