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

feat(FEC-13371): Refactor: Migrate to TypeScript (from Flow) #254

Merged
merged 15 commits into from
Dec 27, 2023
22 changes: 0 additions & 22 deletions .babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore
JonathanTGold marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

85 changes: 64 additions & 21 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,69 @@
{
"parser": "babel-eslint",
"extends": ["eslint:recommended", "plugin:flowtype/recommended"],
"plugins": ["prettier", "import", "flowtype", "mocha-no-only"],
"env": {
"browser": true,
"es6": true,
"mocha": true,
"amd": true,
"commonjs": true
"root": true,
"parser": "@typescript-eslint/parser",
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"plugins": ["prettier", "@typescript-eslint"],
"rules": {
"indent": ["error", 2],
"react/prefer-stateless-function": "off",
"max-len": ["warn", {"code": 500}],
"eol-last": "off",
"prettier/prettier": "off",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "explicit",
"overrides": {
"accessors": "explicit",
"constructors": "no-public",
"methods": "explicit",
"properties": "explicit",
"parameterProperties": "explicit"
}
}
],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"Function": false // Overrides the rule for "Function" type only
}
}
],
"block-scoped-var": "error",
"eqeqeq": "error",
"no-var": "error",
"no-console": "error",
"prefer-const": "error",
"prefer-arrow-callback": "error",
"no-trailing-spaces": "error",
"quotes": ["warn", "single", {"avoidEscape": true}],
"no-restricted-properties": [
"error",
{
"object": "describe",
"property": "only"
},
{
"object": "it",
"property": "only"
}
]
},
"globals": {
"should": true,
"sinon": true,
"__VERSION__": true,
"__NAME__": true,
"process": true,
"__dirname": true
"overrides": [],
"settings": {
"jest": {
"version": 26
}
},
"rules": {
"prettier/prettier": "error",
"mocha-no-only/mocha-no-only": "off",
"require-jsdoc": ["error"],
"valid-jsdoc": ["error"]
"env": {
"browser": true,
"commonjs": true,
"es6": true
}
}
7 changes: 0 additions & 7 deletions .flowconfig

This file was deleted.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

##### Prerequisites

- [ ] Have you checked for duplicate [issues](https://github.com/kaltura/playkit-js-dash/issues): **\_\_**
- [ ] Which Plugin [version](https://github.com/kaltura/playkit-js-dash/releases) are you using: **\_\_**
- [ ] Have you checked for duplicate [issues](https://github.com/kaltura/playkit-js-hls/issues): **\_\_**
JonathanTGold marked this conversation as resolved.
Show resolved Hide resolved
- [ ] Which Plugin [version](https://github.com/kaltura/playkit-js-hls/releases) are you using: **\_\_**
JonathanTGold marked this conversation as resolved.
Show resolved Hide resolved
- [ ] Can you reproduce the issue with our latest release version: **\_\_**
- [ ] Can you reproduce the issue with the latest code from master: **\_\_**
- [ ] What browser and OS names and versions are you using: **\_\_**
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run_canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ jobs:
uses: kaltura/playkit-js-common/.github/workflows/canary_dependency.yaml@master
secrets: inherit
with:
node-version: "20.x"
schema-type: "playerV3Versions"
tests-yarn-run-to-execute: 'build eslint flow test'
tests-yarn-run-to-execute: 'build lint type-check test'
27 changes: 0 additions & 27 deletions .github/workflows/run_canary_full_flow.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/run_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
PLAYER_MSTEAMS_WEBHOOK: ${{ secrets.PLAYER_MSTEAMS_WEBHOOK }}
PLAYER_GITHUB_BOT_TOKEN: ${{ secrets.PLAYER_GITHUB_BOT_TOKEN }}
with:
node-version: "20.x"
type: "dependency"
env: "prod"
schema-type: "playerV3Versions"
tests-yarn-run-to-execute: 'build eslint flow test'
tests-yarn-run-to-execute: 'build lint type-check test'
27 changes: 24 additions & 3 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,35 @@ on:
- "*"

jobs:
running-tests:
build:
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
with:
yarn-run-to-execute: 'build eslint flow test'
node-version: '20.x'
yarn-run-to-execute: 'build'
test:
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
with:
node-version: '20.x'
yarn-run-to-execute: 'test'
type-check:
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
with:
node-version: '20.x'
yarn-run-to-execute: 'type-check'
build-types:
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
with:
node-version: '20.x'
yarn-run-to-execute: 'build:types'
lint:
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
with:
node-version: '20.x'
yarn-run-to-execute: 'lint'
notification:
if: always()
uses: kaltura/ovp-pipelines-pub/.github/workflows/notification.yaml@master
needs: running-tests
needs: [build, test, type-check, lint]
secrets:
PLAYER_MSTEAMS_WEBHOOK: ${{ secrets.PLAYER_MSTEAMS_WEBHOOK }}
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ jspm_packages
.idea

dist/
lib
api-extractor/report/
api-extractor/report-temp/
49 changes: 0 additions & 49 deletions .npmignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

37 changes: 37 additions & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
"bundledPackages": [],
"compiler": {},
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/api-extractor/report",
"reportTempFolder": "<projectFolder>/api-extractor/report-temp"
},
"docModel": {
"enabled": true,
"apiJsonFilePath": "<projectFolder>/api-extractor/<unscopedPackageName>.api.json"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts"
},
"tsdocMetadata": {},
"messages": {
"compilerMessageReporting": {
"default": {
"logLevel": "warning"
}
},
"extractorMessageReporting": {
"default": {
"logLevel": "warning"
}
},
"tsdocMessageReporting": {
"default": {
"logLevel": "warning"
}
}
}
}
Loading
Loading