Skip to content

Commit df1fc34

Browse files
committedNov 5, 2024
Initial implementation. Gets the latest glucose measurement from LibreLinkUp.
1 parent d72fe17 commit df1fc34

17 files changed

+6544
-0
lines changed
 

‎.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+
});

‎.vscodeignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/**
4+
node_modules/**
5+
src/**
6+
.gitignore
7+
.yarnrc
8+
esbuild.js
9+
vsc-extension-quickstart.md
10+
**/tsconfig.json
11+
**/eslint.config.mjs
12+
**/*.map
13+
**/*.ts
14+
**/.vscode-test.*

‎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

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import tsParser from "@typescript-eslint/parser";
3+
4+
export default [{
5+
files: ["**/*.ts"],
6+
}, {
7+
plugins: {
8+
"@typescript-eslint": typescriptEslint,
9+
},
10+
11+
languageOptions: {
12+
parser: tsParser,
13+
ecmaVersion: 2022,
14+
sourceType: "module",
15+
},
16+
17+
rules: {
18+
"@typescript-eslint/naming-convention": ["warn", {
19+
selector: "import",
20+
format: ["camelCase", "PascalCase"],
21+
}],
22+
23+
curly: "warn",
24+
eqeqeq: "warn",
25+
"no-throw-literal": "warn",
26+
semi: "warn",
27+
},
28+
}];

0 commit comments

Comments
 (0)
Please sign in to comment.