Skip to content

Commit

Permalink
Initial code (#3)
Browse files Browse the repository at this point in the history
Initial version that supports parsing JSON, HTML, SRT, and WEBVTT files.

Thanks to Ryan for his help with eslint and prettier.

---------

Co-authored-by: Ryan Hirsch <Ryan.Hirsch@gmail.com>
  • Loading branch information
stevencrader and RyanHirsch authored Mar 17, 2023
1 parent 33f3c94 commit 03fba31
Show file tree
Hide file tree
Showing 61 changed files with 49,416 additions and 9,530 deletions.
89 changes: 89 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"parser": "@typescript-eslint/parser",
"env": {
"node": true,
"commonjs": true
},
"extends": [
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:sonarjs/recommended",
"plugin:jsdoc/recommended"
],
"parserOptions": {
"project": "./tsconfig-eslint.json"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "./"
}
}
},
"plugins": ["jsdoc", "prettier"],
"rules": {
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
],
"no-underscore-dangle": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/explicit-function-return-type": "error",
"no-plusplus": "off",
"import/prefer-default-export": "off",
"import/newline-after-import": "error",
"import/order": [
"error",
{
"newlines-between": "always"
}
],
"no-return-await": "off",
"no-await-in-loop": "off",
"no-console": [
"error",
{
"allow": ["debug", "warn", "error"]
}
],
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/return-await": ["error", "in-try-catch"],
"jsdoc/require-param-type": 0,
"jsdoc/require-returns-type": 0,
"jsdoc/require-jsdoc": [
"error",
{
"require": {
"ArrowFunctionExpression": true,
"ClassDeclaration": true,
"ClassExpression": true,
"FunctionDeclaration": true,
"FunctionExpression": true,
"MethodDefinition": true
}
}
]
},
"overrides": [
{
"files": ["**/*.test.ts", "test/*.ts", "test/**/*.ts"],
"rules": {
"sonarjs/no-duplicate-string": "off"
}
}
]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=lf
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

# This action works with pull requests and pushes
on:
pull_request:
push:

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"

- name: Install project dependencies
run: yarn

- name: Run All Lint Commands
run: yarn run lint
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Tests

on: [push]

jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"

- name: Install project dependencies
run: yarn

- name: Run tests
run: yarn run test:coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,4 @@ Network Trash Folder
Temporary Items
.apdisk

/test/test_output/
61 changes: 61 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

6 changes: 6 additions & 0 deletions .idea/jsLinters/eslint.xml

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

7 changes: 7 additions & 0 deletions .idea/prettier.xml

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

11 changes: 11 additions & 0 deletions .idea/runConfigurations/All_Tests.xml

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

12 changes: 12 additions & 0 deletions .idea/runConfigurations/build.xml

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

12 changes: 12 additions & 0 deletions .idea/runConfigurations/lint.xml

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

12 changes: 12 additions & 0 deletions .idea/runConfigurations/lint_fix.xml

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

12 changes: 12 additions & 0 deletions .idea/runConfigurations/test.xml

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

12 changes: 12 additions & 0 deletions .idea/runConfigurations/test_coverage.xml

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

8 changes: 7 additions & 1 deletion .idea/transcriptator.iml

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

12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.gitlab-ci.yml
.yarn
yarn.lock
dist
node_modules
coverage
.pnp.loader.mjs
.pnp.cjs
test/test_files
test/test_output
.idea
.vscode
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 4,
"printWidth": 120,
"semi": false,
"singleQuote": false
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cSpell.words": [
"BUZZCAST",
"LALALAND",
"marlonrock",
"WEBVTT"
]
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
30 changes: 30 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Contributing

Thank you for your interest in contributing to this project.

## Issues/Feature Requests

If you have encountered an issue or would like a feature to be added, please create a [GitHub Issue](https://github.com/stevencrader/transcriptator/issues) for the project.

## Code Contributions

Before making any changes or building the project locally, install [NodeJS 16.17.1](https://nodejs.org/) and [yarn 3.4.1](https://yarnpkg.com/getting-started/install) or newer.

1. For this repository
2. Clone the forked copy of the project
3. Change to the project directory
4. Before making changes, pull the latest changes from the upstream repo
5. Create a new branch
6. Make any changes
7. Track changes
8. Commit changes to branch
9. Push changes to the forked project
10. When all changes are complete, create a [Pull Request](https://github.com/stevencrader/transcriptator/pulls) to merge the changes to the `master` branch.

- Add a title and description of the changes
- If fixing an open Issue, reference the issue number using the GitHub syntax: `#2`
- For a Pull Request to be accepted, all GitHub actions must pass.
- Run the `lint-fix` script and resolve any issues.
- Run the `test` script and resolve any failing tests.
- If new features added, write new tests to cover the changes.
- To get a coverage report run the `test:coverage` script
Loading

0 comments on commit 03fba31

Please sign in to comment.