diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5064bd2..9afd29a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Create a report to help us improve (After v3.1.1, preferably open this report from inside the dribbblish settings `About > Report Bugs` as it adds additional info automatically) +about: Create a report to help us improve (After v3.1.1, preferably open this report from inside the Dribbblish settings `About > Report Bugs` as it adds additional info automatically) title: "" labels: ["bug"] assignees: "" @@ -18,10 +18,10 @@ Steps to reproduce the behavior: **Desktop Setup** - - Operating System: - - Spotify: - - Spicetify: - - Dribbblish: +- Operating System: +- Spotify: +- Spicetify: +- Dribbblish: **Logs** ```console - +[paste logs here] ``` diff --git a/src/js/main.js b/src/js/main.js index 4c55295..21e7390 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -358,31 +358,9 @@ Dribbblish.on("ready", () => { data: "Create Report", onChange: () => { const reportBody = ` - **Describe the bug** - - - **To Reproduce** - Steps to reproduce the behavior: - 1. - - **Screenshots** - - - **Logs** - - - - \`\`\`console - - \`\`\` + ${process.env.BUG_REPORT} + --- ### Info for Contributors: diff --git a/webpack.config.js b/webpack.config.js index a20952d..d5a9a23 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,7 +6,7 @@ const fs = require("fs"); const icons = {}; // Add Material Icons -let iconDir = path.resolve(__dirname, "./node_modules/@material-icons/svg/svg"); +let iconDir = path.resolve(__dirname, "node_modules/@material-icons/svg/svg"); for (const dir of fs.readdirSync(iconDir)) { icons[dir.replace("_", "-")] = {}; for (const file of fs.readdirSync(path.resolve(iconDir, dir))) { @@ -14,14 +14,14 @@ for (const dir of fs.readdirSync(iconDir)) { } } // Add Custom Icons -iconDir = path.resolve(__dirname, "./src/icons"); +iconDir = path.resolve(__dirname, "src/icons"); for (const icon of fs.readdirSync(iconDir)) { icons[icon.replace(/\..*?$/, "")] = fs.readFileSync(path.resolve(iconDir, icon), { encoding: "utf8" }); } /** @type {import('webpack').Configuration} */ module.exports = { - entry: [path.resolve(__dirname, "./src/js/main.js"), path.resolve(__dirname, "./src/styles/main.scss"), path.resolve(__dirname, "./src/styles/Colors.scss")], + entry: [path.resolve(__dirname, "src/js/main.js"), path.resolve(__dirname, "src/styles/main.scss"), path.resolve(__dirname, "src/styles/Colors.scss")], output: { path: path.resolve(__dirname, "dist"), filename: "dribbblish-dynamic.js" @@ -29,11 +29,11 @@ module.exports = { module: { rules: [ { - include: path.resolve(__dirname, "./src/js/main.js"), + include: path.resolve(__dirname, "src/js/main.js"), use: [] }, { - include: path.resolve(__dirname, "./src/styles/main.scss"), + include: path.resolve(__dirname, "src/styles/main.scss"), type: "asset/resource", generator: { filename: "user.css" @@ -47,7 +47,7 @@ module.exports = { sassOptions: { functions: { "font64($font)": (font) => { - const file = path.resolve(__dirname, "./src/fonts", font.getValue()); + const file = path.resolve(__dirname, "src/fonts", font.getValue()); return new sass.types.String(`"data:font/truetype;charset=utf-8;base64,${fs.readFileSync(file, { encoding: "base64" })}"`); } } @@ -57,18 +57,24 @@ module.exports = { ] }, { - include: path.resolve(__dirname, "./src/styles/Colors.scss"), + include: path.resolve(__dirname, "src/styles/Colors.scss"), type: "asset/resource", generator: { filename: "color.ini" }, - use: [path.resolve(__dirname, "./src/loaders/color-loader.js")] + use: [path.resolve(__dirname, "src/loaders/color-loader.js")] } ] }, devtool: "inline-source-map", plugins: [ new webpack.DefinePlugin({ + "process.env.BUG_REPORT": JSON.stringify( + fs + .readFileSync(path.resolve(__dirname, ".github/ISSUE_TEMPLATE/bug_report.md"), { encoding: "utf8" }) + .replace(/^---(.*?\r?\n)+---(.*?\r?\n)*?(?=\S)/, "") // Replace GitHub header + .replace(/\*\*Desktop Setup\*\*\r?\n(- .*?\r?\n)+\r?\n/, "") // Replace **Desktop Setup** block + ), "process.env.DRIBBBLISH_ICONS": JSON.stringify(icons), "process.env.DRIBBBLISH_VERSION": JSON.stringify(process.env.DRIBBBLISH_VERSION ?? "Dev"), "process.env.COMMIT_HASH": JSON.stringify(process.env.COMMIT_HASH ?? "local")