Skip to content

Commit 030329e

Browse files
committed
update dependencies
1 parent b5397a6 commit 030329e

29 files changed

+3010
-1712
lines changed

.eslintrc.json

-71
This file was deleted.

.husky/pre-commit

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
yarn lint-staged
1+
npm test

.vscode-test.mjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vscode/test-cli';
2+
3+
export default defineConfig({
4+
files: 'out/test/**/*.test.js',
5+
});

.vscode/extensions.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint",
6+
"connor4312.esbuild-problem-matchers",
7+
"ms-vscode.extension-test-runner"
8+
]
9+
}

.vscode/launch.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
15
{
26
"version": "0.2.0",
37
"configurations": [
@@ -7,7 +11,7 @@
711
"request": "launch",
812
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
913
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
10-
"preLaunchTask": "npm: watch"
14+
"preLaunchTask": "${defaultBuildTask}"
1115
},
1216
{
1317
"name": "Extension Tests",
@@ -16,14 +20,15 @@
1620
"runtimeExecutable": "${execPath}",
1721
"args": [
1822
"${workspaceFolder}/fixtures/workspace/fixtures.code-workspace",
23+
"--disable-extensions",
1924
"--extensionDevelopmentPath=${workspaceFolder}",
20-
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index",
21-
"--disable-extensions"
25+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
2226
],
2327
"env": {
2428
"PLAYDATE_SDK_PATH": "${workspaceFolder}/fixtures/PlaydateSDK-1.12.3"
2529
},
26-
"outFiles": ["${workspaceFolder}/out/**/*.js"]
30+
"outFiles": ["${workspaceFolder}/out/**/*.js"],
31+
"preLaunchTask": "${defaultBuildTask}"
2732
}
2833
]
2934
}

.vscode/settings.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
33
"files.exclude": {
4-
"out": false // set this to true to hide the "out" folder with the compiled JS files
4+
"out": false, // set this to true to hide the "out" folder with the compiled JS files
5+
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
56
},
67
"search.exclude": {
7-
"out": true // set this to false to include "out" folder in search results
8+
"out": true, // set this to false to include "out" folder in search results
9+
"dist": true // set this to false to include "dist" folder in search results
810
},
911
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
1012
"typescript.tsc.autoDetect": "off",

.vscode/tasks.json

+44-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,58 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
13
{
24
"version": "2.0.0",
35
"tasks": [
46
{
5-
"type": "npm",
6-
"script": "build",
7-
"isBackground": false,
8-
"group": {
9-
"isDefault": true,
10-
"kind": "build"
7+
"label": "watch",
8+
"dependsOn": ["npm: watch:tsc", "npm: watch:esbuild"],
9+
"presentation": {
10+
"reveal": "never"
1111
},
12-
"problemMatcher": "$esbuild",
13-
"label": "npm: build"
12+
"group": {
13+
"kind": "build",
14+
"isDefault": true
15+
}
1416
},
1517
{
1618
"type": "npm",
17-
"script": "watch",
19+
"script": "watch:esbuild",
1820
"group": "build",
1921
"problemMatcher": "$esbuild-watch",
2022
"isBackground": true,
21-
"label": "npm: watch"
23+
"label": "npm: watch:esbuild",
24+
"presentation": {
25+
"group": "watch",
26+
"reveal": "never"
27+
}
28+
},
29+
{
30+
"type": "npm",
31+
"script": "watch:tsc",
32+
"group": "build",
33+
"problemMatcher": "$tsc-watch",
34+
"isBackground": true,
35+
"label": "npm: watch:tsc",
36+
"presentation": {
37+
"group": "watch",
38+
"reveal": "never"
39+
}
40+
},
41+
{
42+
"type": "npm",
43+
"script": "watch-tests",
44+
"problemMatcher": "$tsc-watch",
45+
"isBackground": true,
46+
"presentation": {
47+
"reveal": "never",
48+
"group": "watchers"
49+
},
50+
"group": "build"
51+
},
52+
{
53+
"label": "tasks: watch-tests",
54+
"dependsOn": ["npm: watch", "npm: watch-tests"],
55+
"problemMatcher": []
2256
}
2357
]
2458
}

esbuild.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const esbuild = require("esbuild");
2+
3+
const production = process.argv.includes('--production');
4+
const watch = process.argv.includes('--watch');
5+
6+
/**
7+
* @type {import('esbuild').Plugin}
8+
*/
9+
const esbuildProblemMatcherPlugin = {
10+
name: 'esbuild-problem-matcher',
11+
12+
setup(build) {
13+
build.onStart(() => {
14+
console.log('[watch] build started');
15+
});
16+
build.onEnd((result) => {
17+
result.errors.forEach(({ text, location }) => {
18+
console.error(`✘ [ERROR] ${text}`);
19+
console.error(` ${location.file}:${location.line}:${location.column}:`);
20+
});
21+
console.log('[watch] build finished');
22+
});
23+
},
24+
};
25+
26+
async function main() {
27+
const ctx = await esbuild.context({
28+
entryPoints: [
29+
'src/extension.ts'
30+
],
31+
bundle: true,
32+
format: 'cjs',
33+
minify: production,
34+
sourcemap: !production,
35+
sourcesContent: false,
36+
platform: 'node',
37+
outfile: 'dist/extension.js',
38+
external: ['vscode'],
39+
logLevel: 'silent',
40+
plugins: [
41+
/* add to the end of plugins array */
42+
esbuildProblemMatcherPlugin,
43+
],
44+
});
45+
if (watch) {
46+
await ctx.watch();
47+
} else {
48+
await ctx.rebuild();
49+
await ctx.dispose();
50+
}
51+
}
52+
53+
main().catch(e => {
54+
console.error(e);
55+
process.exit(1);
56+
});

eslint.config.mjs

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import tsParser from "@typescript-eslint/parser";
3+
import pluginImport from "eslint-plugin-import";
4+
5+
export default [
6+
{
7+
files: ["**/*.ts"],
8+
},
9+
{
10+
plugins: {
11+
"@typescript-eslint": typescriptEslint,
12+
import: pluginImport,
13+
},
14+
15+
languageOptions: {
16+
parser: tsParser,
17+
ecmaVersion: 2022,
18+
sourceType: "module",
19+
},
20+
21+
rules: {
22+
"@typescript-eslint/naming-convention": [
23+
"warn",
24+
{
25+
selector: "import",
26+
format: ["camelCase", "PascalCase"],
27+
},
28+
],
29+
30+
curly: "warn",
31+
eqeqeq: "warn",
32+
"no-throw-literal": "warn",
33+
semi: "warn",
34+
35+
"@typescript-eslint/no-unused-vars": [
36+
"error",
37+
{
38+
argsIgnorePattern: "^_",
39+
varsIgnorePattern: "^_",
40+
caughtErrorsIgnorePattern: "^_",
41+
},
42+
],
43+
44+
"import/order": [
45+
"error",
46+
{
47+
alphabetize: {
48+
order: "asc",
49+
caseInsensitive: false,
50+
},
51+
"newlines-between": "always",
52+
warnOnUnassignedImports: true,
53+
groups: [
54+
"builtin",
55+
"external",
56+
"internal",
57+
"parent",
58+
"sibling",
59+
"index",
60+
],
61+
},
62+
],
63+
},
64+
},
65+
];

0 commit comments

Comments
 (0)