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) #726

Merged
merged 27 commits into from
Dec 27, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .babelrc

This file was deleted.

10 changes: 0 additions & 10 deletions .editorconfig

This file was deleted.

8 changes: 5 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/flow-typed/
/coverage
/dist
dist/
types/
demo/
webpack.config.js
tsconfig.json
60 changes: 60 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"plugins": ["@typescript-eslint"],
"rules": {
"indent": ["error", 2],
"react/prefer-stateless-function": "off",
"max-len": ["warn", { "code": 500 }],
"eol-last": "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": "warn",
"@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"
}
}
],
"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"
}
]
},
"overrides": [],
"settings": {
"jest": {
"version": 26
}
},
"env": {
"browser": true,
"commonjs": true,
"es6": true
}
}
27 changes: 0 additions & 27 deletions .eslintrc.json

This file was deleted.

5 changes: 0 additions & 5 deletions .flowconfig

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/run_canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,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
50 changes: 6 additions & 44 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,45 +1,7 @@
# MacOS
.DS_Store

# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
dist
lib
node_modules
jspm_packages

# Optional npm cache directory
.npm
.npmrc

# Optional REPL history
.node_repl_history

.idea

dist/
*.log
api-extractor/report/
api-extractor/report-temp/
api-extractor/playkit-js.api.json
49 changes: 0 additions & 49 deletions .npmignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierignore

This file was deleted.

5 changes: 1 addition & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"printWidth": 150,
"printWidth": 200,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"proseWrap": "preserve"
}
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/playkit.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