-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add typescript dependency * Convert /model to ts * Convert utils to TS * Convert webrtc/stats/ to TS * Add type depedencies * Convert /webrtc/ to TS * Convert tests/model and tests/utils to TS * Convert tests/webrtc/stats/ to TS * Convert tests/webrtc/ to TS * Configure eslint * Bump version * Add build step to workflows * Add rollup config * Add back assert.ts * Add more types * Add ts-ignore for webrtc-adapter * Add prettier rule to eslintrc * Rebase on latest main * fix errors with lax constraints * revert to evaluating error constraint * update mediadevices unit-tests --------- Co-authored-by: Pontus Fagerström <pontus.fagerstrom@whereby.com>
- Loading branch information
1 parent
5ad66c2
commit af48e36
Showing
74 changed files
with
2,546 additions
and
1,290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
{ | ||
"parser": "@babel/eslint-parser", | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"jest/globals": true, | ||
"node": true | ||
"jest": true, | ||
"node": true, | ||
}, | ||
"extends": ["./config/eslint/browser", "prettier"], | ||
"ignorePatterns": ["dist/*"], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module", | ||
"requireConfigFile": false | ||
"ecmaFeatures": { | ||
"experimentalObjectRestSpread": true, | ||
}, | ||
}, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"plugins": ["prettier", "jest"], | ||
"rules": { | ||
"no-console": ["error", { "allow": ["warn", "error"] }], | ||
"prettier/prettier": "error" | ||
} | ||
"prettier/prettier": "error", | ||
"@typescript-eslint/ban-ts-comment": 0, | ||
"@typescript-eslint/no-namespace": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"prefer-spread": "off", | ||
"prefer-destructuring": "off", | ||
"prefer-rest-params": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"no-inner-declarations": "off", | ||
"no-unsafe-optional-chaining": "off", | ||
"no-prototype-builtins": "off", | ||
"no-case-declarations": "off", | ||
"no-empty": "off", | ||
"@typescript-eslint/ban-types": "off", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
node_modules/ | ||
test-report/ | ||
|
||
dist/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
module.exports = { | ||
testEnvironment: "jsdom", | ||
testMatch: ["<rootDir>/tests/**/?(*.)+(spec|test).[jt]s?(x)"], | ||
transform: { | ||
"^.+\\.(j|t)sx?$": "ts-jest", | ||
}, | ||
roots: ["<rootDir>"], | ||
coverageDirectory: "test-report/unit-tests", | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const typescript = require("rollup-plugin-typescript2"); | ||
const commonjs = require("@rollup/plugin-commonjs"); | ||
const replace = require("@rollup/plugin-replace"); | ||
const pkg = require("./package.json"); | ||
const { dts } = require("rollup-plugin-dts"); | ||
|
||
const dependencies = [...Object.keys(pkg.dependencies || {})]; | ||
const peerDependencies = [...Object.keys(pkg.peerDependencies || {})]; | ||
|
||
const tsOptions = { | ||
tsconfig: "tsconfig.build.json", | ||
}; | ||
|
||
const plugins = [ | ||
replace({ | ||
preventAssignment: true, | ||
// jslib-media uses global.navigator for some gUM calls, replace these | ||
delimiters: [" ", "."], | ||
values: { "global.navigator.mediaDevices": " navigator.mediaDevices." }, | ||
}), | ||
commonjs(), | ||
typescript(tsOptions), | ||
]; | ||
|
||
const external = [...dependencies, ...peerDependencies]; | ||
|
||
module.exports = [ | ||
// Esm build of lib, to be used with bundlers | ||
{ | ||
input: "src/index.ts", | ||
output: { | ||
file: "dist/index.esm.js", | ||
format: "esm", | ||
exports: "named", | ||
}, | ||
plugins, | ||
external, | ||
}, | ||
{ | ||
input: "src/index.ts", | ||
output: [{ file: "dist/index.d.ts", format: "es" }], | ||
external, | ||
plugins: [dts(tsOptions)], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./webrtc"; | ||
export * from "./utils"; | ||
export * from "./model"; |
Oops, something went wrong.