Skip to content

Commit

Permalink
Bump dependencies, format code
Browse files Browse the repository at this point in the history
  • Loading branch information
printfn committed Oct 28, 2024
1 parent 105812a commit 008d06c
Show file tree
Hide file tree
Showing 15 changed files with 5,777 additions and 5,652 deletions.
8 changes: 6 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "connor4312.esbuild-problem-matchers", "ms-vscode.extension-test-runner"]
}
"recommendations": [
"dbaeumer.vscode-eslint",
"connor4312.esbuild-problem-matchers",
"ms-vscode.extension-test-runner"
]
}
8 changes: 2 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
Expand Down
20 changes: 10 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
74 changes: 34 additions & 40 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,40 @@
"version": "2.0.0",
"tasks": [
{
"label": "watch",
"dependsOn": [
"npm: watch:tsc",
"npm: watch:esbuild"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
"label": "watch",
"dependsOn": ["npm: watch:tsc", "npm: watch:esbuild"],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
Expand All @@ -54,10 +51,7 @@
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"dependsOn": ["npm: watch", "npm: watch-tests"],
"problemMatcher": []
}
]
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ you view `.jxl` files directly in your editor.
</picture>

You can download this extension from:
* [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=printfn.jpeg-xl)
* [OpenVSX (VSCodium)](https://open-vsx.org/extension/printfn/jpeg-xl)
* [GitHub](https://github.com/printfn/jpeg-xl-vscode/releases/latest)

- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=printfn.jpeg-xl)
- [OpenVSX (VSCodium)](https://open-vsx.org/extension/printfn/jpeg-xl)
- [GitHub](https://github.com/printfn/jpeg-xl-vscode/releases/latest)

## Features

Expand Down
12 changes: 6 additions & 6 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { context } from "esbuild";
import { context } from 'esbuild';

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');
Expand All @@ -13,10 +13,12 @@ const esbuildProblemMatcherPlugin = {
build.onStart(() => {
console.log('[watch] build started');
});
build.onEnd((result) => {
build.onEnd(result => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
console.error(` ${location.file}:${location.line}:${location.column}:`);
console.error(
` ${location.file}:${location.line}:${location.column}:`,
);
});
console.log('[watch] build finished');
});
Expand All @@ -25,9 +27,7 @@ const esbuildProblemMatcherPlugin = {

async function main() {
const ctx = await context({
entryPoints: [
'src/extension.ts'
],
entryPoints: ['src/extension.ts'],
bundle: true,
format: 'cjs',
minify: production,
Expand Down
54 changes: 30 additions & 24 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';

export default [{
files: ["**/*.ts"],
}, {
plugins: {
"@typescript-eslint": typescriptEslint,
},
export default [
{
files: ['**/*.ts'],
},
{
plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",
},
languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: 'module',
},

rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],
rules: {
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'import',
format: ['camelCase', 'PascalCase'],
},
],

curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "warn",
},
}];
curly: 'warn',
eqeqeq: 'warn',
'no-throw-literal': 'warn',
semi: 'warn',
},
},
];
3 changes: 2 additions & 1 deletion media/jxl.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
html, body {
html,
body {
height: 100%;
padding: 0;
}
Expand Down
15 changes: 7 additions & 8 deletions media/jxl.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @return {Promise<HTMLImageElement>}
*/
async function loadImageFromData(initialContent) {
const blob = new Blob([initialContent], { 'type': 'image/png' });
const blob = new Blob([initialContent], { type: 'image/png' });
const url = URL.createObjectURL(blob);
try {
const img = document.createElement('img');
Expand All @@ -31,7 +31,7 @@
}

class JXLEditor {
constructor( /** @type {HTMLElement} */ parent) {
constructor(/** @type {HTMLElement} */ parent) {
this._initElements(parent);
}

Expand Down Expand Up @@ -93,14 +93,13 @@
window.addEventListener('message', async e => {
const { type, body } = e.data;
switch (type) {
case 'update':
{
await editor.reset(body.content);
return;
}
case 'update': {
await editor.reset(body.content);
return;
}
}
});

// Signal to VS Code that the webview is initialized.
vscode.postMessage({ type: 'ready' });
}());
})();
Loading

0 comments on commit 008d06c

Please sign in to comment.