Skip to content

Commit

Permalink
Fix TS and Webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
DervexDev committed May 18, 2024
1 parent a2a067b commit 196d13b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 113 deletions.
106 changes: 3 additions & 103 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions src/completion/data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as vscode from 'vscode'
import { decode } from '@msgpack/msgpack'
import * as msgpack from '@msgpack/msgpack'

import * as database from './database.msgpack'

Expand All @@ -10,10 +10,9 @@ export function startDataCompletion() {
pattern: '**/*(data|meta).json',
}

//@ts-ignore
const db = Buffer.from(database)

console.log(typeof db)
console.log(db)
console.log(decode(db))
// for (const item of msgpack.decodeMulti(db)) {
// console.log(item)
// }
}
4 changes: 2 additions & 2 deletions src/types/database.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module '*.msgpack' {
const content: Uint8Array
export default content
const content: string
export = content
}
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"module": "commonjs",
"target": "ES2020",
"outDir": "out",
"lib": ["ES2020"],
"lib": ["ES2020", "DOM"],
"typeRoots": [".src/types"],
"sourceMap": true,
"strict": true,
"noUnusedParameters": true
/* Additional Checks */
// "rootDir": "src",
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
}
Expand Down
6 changes: 5 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ const extensionConfig = {
],
},
{
test: /.msgpack/,
test: /\.m?js$/,
type: 'javascript/auto',
},
{
test: /\.msgpack$/,
type: 'asset/source',
},
],
Expand Down

0 comments on commit 196d13b

Please sign in to comment.