Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrades numerous dependencies #611

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
35 changes: 15 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
"fmt_test": "test $(prettier -l './*.{mjs,js,ts,md,json,html}' './{src,docs,tests}/{**/,}*.{mjs,js,ts,md,json,html}' | wc -l) -eq 0",
"watchtest": "CHROME_ONLY=1 karma start --no-single-run"
},
"husky": {
"hooks": {
"pre-commit": "npm test"
}
},
"author": {
"name": "Surma",
"email": "surma@google.com"
Expand All @@ -31,24 +26,24 @@
},
"license": "Apache-2.0",
"devDependencies": {
"chai": "4.2.0",
"conditional-type-checks": "1.0.5",
"husky": "4.2.5",
"karma": "^5.0.9",
"@rollup/plugin-terser": "0.4.0",
"@rollup/plugin-typescript": "11.0.0",
"chai": "4.3.7",
"conditional-type-checks": "1.0.6",
"husky": "8.0.3",
"karma": "6.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.0",
"karma-chrome-launcher": "3.1.1",
"karma-detect-browsers": "2.3.3",
"karma-firefox-launcher": "1.3.0",
"karma-firefox-launcher": "2.1.2",
"karma-mocha": "^2.0.1",
"karma-safari-launcher": "1.0.0",
"karma-safaritechpreview-launcher": "2.0.2",
"mocha": "^7.2.0",
"prettier": "2.0.5",
"rimraf": "3.0.2",
"rollup": "^2.11.2",
"rollup-plugin-terser": "^6.1.0",
"rollup-plugin-typescript2": "^0.27.1",
"typescript": "^3.9.3"
},
"dependencies": {}
"mocha": "^10.2.0",
"prettier": "2.8.3",
"rimraf": "4.1.2",
"rollup": "3.10.1",
"tslib": "^2.4.1",
"typescript": "4.9.4"
}
}
22 changes: 10 additions & 12 deletions rollup.config.js → rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import typescript from "rollup-plugin-typescript2";
import { terser } from "rollup-plugin-terser";
import typescript from "@rollup/plugin-typescript";
import terser from "@rollup/plugin-terser";
import { sync } from "rimraf";

function config({ format, minify, input, ext = "js" }) {
const dir = `dist/${format}/`;
Expand All @@ -14,15 +15,12 @@ function config({ format, minify, input, ext = "js" }) {
},
plugins: [
typescript({
clean: true,
typescript: require("typescript"),
tsconfigOverride: {
compilerOptions: {
sourceMap: true,
},
// Don’t ask. Without this, the typescript plugin is convinced
// to create subfolders and misplace the .d.ts files.
files: ["./src/comlink.ts", "./src/protocol.ts"],
tsconfig: "./tsconfig.json",
compilerOptions: {
declaration: true,
declarationDir: ".",
sourceMap: true,
outDir: "dist",
},
}),
minify
Expand All @@ -35,7 +33,7 @@ function config({ format, minify, input, ext = "js" }) {
};
}

require("rimraf").sync("dist");
sync("dist");

export default [
{ input: "comlink", format: "esm", minify: false, ext: "mjs" },
Expand Down
2 changes: 1 addition & 1 deletion src/comlink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ export function transfer<T>(obj: T, transfers: Transferable[]): T {
return obj;
}

export function proxy<T>(obj: T): T & ProxyMarked {
export function proxy<T extends {}>(obj: T): T & ProxyMarked {
return Object.assign(obj, { [proxyMarker]: true }) as any;
}

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"include": ["src/**/*.ts"]
"include": ["src/**/*.ts"],
"exclude": ["dist"]
}