diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c85eab1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# CHANGELOG +## v0.1.2: +- Added local hosting for html files +- Created standalone version + +## v0.1.3 +- Updated Applovin Demo Upload +- Changed file selection workflow +- Added "Regenerate QRs" if in case they don't render +- Added "Save QR" and "Save All QRs" + +## v0.1.5 +- Better file selection for PLEC Uoload +- Multi file selection +- Auto detects iteration name (it tries its best) + +Standalone .exe +- Move temp files into user temp folder + +## v0.1.6 +- Simplify UI +- Added beta tools (needs further testing) + - Playworks Converter + - Upload UnityAds HTML from Playworks to add injections for the other networks + - MRAID Checker + - Based on Official MRAID Document, scans the HTML files if they adhere to the documentation requirements and best practices \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..6794af3 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# HPL Toolbox + +Bundled VS Code extension and standalone tools for playable ad workflows. + +# CHANGELOG +## v0.1.2: +- Added local hosting for html files +- Created standalone version + +## v0.1.3 +- Updated Applovin Demo Upload +- Changed file selection workflow +- Added "Regenerate QRs" if in case they don't render +- Added "Save QR" and "Save All QRs" + +## v0.1.5 +- Better file selection for PLEC Uoload +- Multi file selection +- Auto detects iteration name (it tries its best) + +Standalone .exe +- Move temp files into user temp folder + +## v0.1.6 +- Simplify UI +- Added beta tools (needs further testing) + - Playworks Converter + - Upload UnityAds HTML from Playworks to add injections for the other networks + - MRAID Checker + - Based on Official MRAID Document, scans the HTML files if they adhere to the documentation requirements and best practices diff --git a/dist/hpl-toolbox-0.1.6.exe b/dist/hpl-toolbox-0.1.6.exe index ce7cd40..4648022 100644 Binary files a/dist/hpl-toolbox-0.1.6.exe and b/dist/hpl-toolbox-0.1.6.exe differ diff --git a/dist/hpl-toolbox-0.1.6.vsix b/dist/hpl-toolbox-0.1.6.vsix index 0a579f6..94ecdaa 100644 Binary files a/dist/hpl-toolbox-0.1.6.vsix and b/dist/hpl-toolbox-0.1.6.vsix differ diff --git a/package.json b/package.json index bc73b91..59d9a66 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,8 @@ ] }, "scripts": { - "compile": "tsc -p ./", + "sync-readme": "node scripts/sync-readme.js", + "compile": "npm run sync-readme && tsc -p ./", "watch": "tsc -watch -p ./", "vscode:prepublish": "npm run compile" }, diff --git a/scripts/sync-readme.js b/scripts/sync-readme.js new file mode 100644 index 0000000..57462bd --- /dev/null +++ b/scripts/sync-readme.js @@ -0,0 +1,20 @@ +const fs = require('fs'); +const path = require('path'); + +const root = path.resolve(__dirname, '..'); +const changelogPath = path.join(root, 'CHANGELOG.md'); +const readmePath = path.join(root, 'README.md'); + +let changelog = '# CHANGELOG\n\nNo changelog entries yet.'; +if (fs.existsSync(changelogPath)) { + changelog = fs.readFileSync(changelogPath, 'utf8').trim(); +} + +const readme = `# HPL Toolbox + +Bundled VS Code extension and standalone tools for playable ad workflows. + +${changelog} +`; + +fs.writeFileSync(readmePath, readme.replace(/\r?\n/g, '\n'), 'utf8'); diff --git a/src/changelogView.ts b/src/changelogView.ts new file mode 100644 index 0000000..ea76109 --- /dev/null +++ b/src/changelogView.ts @@ -0,0 +1,122 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import * as vscode from 'vscode'; + +export function openChangelog(context: vscode.ExtensionContext) { + const panel = vscode.window.createWebviewPanel( + 'hplToolbox.changelog', + 'HPL Toolbox Changelog', + vscode.ViewColumn.One, + { enableScripts: false } + ); + const changelogPath = path.join(context.extensionPath, 'CHANGELOG.md'); + let markdown = '# Changelog\n\nCHANGELOG.md was not found.'; + try { + markdown = fs.readFileSync(changelogPath, 'utf8'); + } catch { + // Keep the fallback text readable in packaged or development installs. + } + panel.webview.html = getHtml(renderMarkdown(markdown)); +} + +function getHtml(content: string): string { + return ` + +
+ + + + +${escapeHtml(line)}
`); + } + closeList(); + return html.join('\n'); +} + +function escapeHtml(value: string): string { + return value.replace(/[&<>"']/g, ch => ({ + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + }[ch] ?? ch)); +} diff --git a/src/extension.ts b/src/extension.ts index 561a058..463138e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -6,6 +6,7 @@ import { openBase64Scanner } from './tools/base64Scanner'; import { openMraidChecker } from './tools/mraidChecker'; import { openSendToMobile } from './tools/sendToMobile'; import { openPlayworksConverter } from './tools/playworksConverter'; +import { openChangelog } from './changelogView'; export function activate(context: vscode.ExtensionContext) { context.subscriptions.push( @@ -15,6 +16,7 @@ export function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand('hplToolbox.openMraidChecker', () => openMraidChecker(context)), vscode.commands.registerCommand('hplToolbox.openSendToMobile', () => openSendToMobile(context)), vscode.commands.registerCommand('hplToolbox.openPlayworksConverter', () => openPlayworksConverter(context)), + vscode.commands.registerCommand('hplToolbox.openChangelog', () => openChangelog(context)), vscode.window.registerWebviewViewProvider('hplToolbox.launcher', new LauncherViewProvider(context)) ); } diff --git a/src/launcherView.ts b/src/launcherView.ts index bb77429..f92bb11 100644 --- a/src/launcherView.ts +++ b/src/launcherView.ts @@ -55,6 +55,8 @@ export class LauncherViewProvider implements vscode.WebviewViewProvider { view.webview.onDidReceiveMessage(async (msg) => { if (msg?.type === 'open' && typeof msg.command === 'string') { vscode.commands.executeCommand(msg.command); + } else if (msg?.type === 'openChangelog') { + vscode.commands.executeCommand('hplToolbox.openChangelog'); } else if (msg?.type === 'setBetaToolsEnabled' && typeof msg.enabled === 'boolean') { await this.context.globalState.update(BETA_TOOLS_ENABLED_KEY, msg.enabled); view.webview.html = getHtml(version, msg.enabled); @@ -142,15 +144,15 @@ function getHtml(version: string, betaToolsEnabled: boolean): string { .footer { margin-top: auto; padding-top: 8px; - display: flex; + display: grid; + grid-template-columns: 1fr auto 1fr; align-items: center; - justify-content: space-between; gap: 8px; color: var(--vscode-descriptionForeground); font-size: 8px; border-top: 1px solid var(--vscode-panel-border); } - .beta-toggle { + .footer-action { padding: 0; background: transparent; color: var(--vscode-descriptionForeground); @@ -161,12 +163,20 @@ function getHtml(version: string, betaToolsEnabled: boolean): string { font-size: 10px; opacity: 0.72; } - .beta-toggle:hover { + #betaToggle { + justify-self: start; + } + .footer-action:hover { opacity: 1; text-decoration: underline; } .footer-version { opacity: 0.75; + text-align: center; + white-space: nowrap; + } + .changelog-link { + justify-self: end; text-align: right; } @@ -176,8 +186,9 @@ function getHtml(version: string, betaToolsEnabled: boolean): string { ${toolButtons}