Skip to content

Commit 4c4724f

Browse files
authored
Monorepo refactor (#130)
* Task: added lerna * WIP: storybook conversion * mend * WIP: adding MediaPlayer * move TimedTextEditor, TranscriptEditor and adapters util to packages (#128) * moved TimedTextEditor and TranscriptEditor to packages also created stories, and package.json for each, but can't test them in storybook coz they have dependencies on adapters in Util folder * moved Util and demdemo app * got storybook working * added demo app to storybook * mend * Fix: commenting out demo * Changed repo packages folder structure (#129) * cleaned up adapters * changed folder structure * fixed timecode converter duplice module * made all packages private except for TranscriptEditor * working * "Monorepo" refactor spike remove lerna (#135) * got storybook working tests not working yet * fixed tests using jest, and removed CRA dependency, updated babel config for babel 7 and stubbed css files for jest tests for css node modules * Added support for demo app in storybook * fixed eslint CRA had it's own linter internally, so added linting + dependencies * cleaned up export scripts in package.json * updated README * finalised refactor see PR description for more details * rename demo app editor to demoTranscript * bringing back style lint, and fixing lint in storybook config * updated with current master AWS adapter * linting * fix #132 playtime displaied double playtime on display is double of actual total playtime * temporary fix #73 monospace duration and current time in media player to stop moving while playing * Feature: Added custom css loading to storybook (#136) * Resolved conflict iwth AWS adapter
1 parent 1dd823f commit 4c4724f

File tree

133 files changed

+39534
-25793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+39534
-25793
lines changed

.babelrc

-15
This file was deleted.

.eslintrc

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"no-unused-expressions": "error",
1919
"no-trailing-spaces": "error",
2020
"no-nested-ternary": "error",
21-
"space-infix-ops": "error",
2221
"indent": ["warn", 2],
2322
"arrow-spacing": ["error", { "before": true, "after": true }],
2423
"space-in-parens": [ 0, "never" ],

.github/ISSUE_TEMPLATE/bug_report.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: pietrop
88
---
99

1010
**Describe the bug**
11-
A clear and concise description of what the bug is.
11+
<!-- A clear and concise description of what the bug is. -->
1212

1313
**To Reproduce**
1414
Steps to reproduce the behavior:
@@ -18,10 +18,10 @@ Steps to reproduce the behavior:
1818
4. See error
1919

2020
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
21+
<!-- A clear and concise description of what you expected to happen. -->
2222

2323
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
24+
<!-- If applicable, add screenshots to help explain your problem. -->
2525

2626
**Desktop (please complete the following information):**
2727
- OS: [e.g. iOS]
@@ -35,4 +35,4 @@ If applicable, add screenshots to help explain your problem.
3535
- Version [e.g. 22]
3636

3737
**Additional context**
38-
Add any other context about the problem here.
38+
<!-- Add any other context about the problem here. -->

.github/ISSUE_TEMPLATE/feature_request.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ assignees: pietrop
88
---
99

1010
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
1212

1313
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
14+
<!-- A clear and concise description of what you want to happen. -->
1515

1616
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
17+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
1818

1919
**Additional context**
20-
Add any other context or screenshots about the feature request here.
20+
<!-- Add any other context or screenshots about the feature request here. -->

.github/ISSUE_TEMPLATE/question.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ assignees: pietrop
77

88
---
99

10-
_where applicable, please provide context and use case around your question._
10+
<!-- _where applicable, please provide context and use case around your question._ -->

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,5 @@ typings/
8888

8989
# next.js build output
9090
.next
91+
92+
stats.json

.npmignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
src
2+
demo
3+
lib
4+
packages
5+
build
6+
.babelrc
7+
.babel.config.js
8+
webpack.config.js

.storybook/addons.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import '@storybook/addon-options/register';
2+
import '@storybook/addon-actions/register';
3+
import '@storybook/addon-links/register';

.storybook/config.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { configure } from '@storybook/react';
2+
import { setOptions } from '@storybook/addon-options';
3+
4+
// automatically import all files ending in *.stories.js
5+
// https://webpack.js.org/guides/dependency-management/
6+
const components = require.context('../packages/components/', true, /.stories.js$/);
7+
const demo = require.context('../demo/', true, /.stories.js$/);
8+
const styles = require.context('./styles', true, /\.scss$/);
9+
10+
function loadStories() {
11+
demo.keys().forEach((filename) => demo(filename));
12+
components.keys().forEach((filename) => components(filename));
13+
styles.keys().forEach((filename) => styles(filename));
14+
}
15+
16+
setOptions({
17+
name: 'react-transcript-editor',
18+
url: 'https://github.com/bbc/react-transcript-editor',
19+
addonPanelInRight: true
20+
});
21+
22+
configure(loadStories, module);

.storybook/styles/fonts.scss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import url('https://gel.files.bbci.co.uk/r2.302/bbc-reith.css');

.storybook/styles/main.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body * {
2+
// font-family: ReithSans, Helvetica, sans-serif !important;
3+
font-family: ReithSerif, Fallback, sans-serif;
4+
}

.storybook/webpack.config.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// https://github.com/storybooks/storybook/issues/270#issuecomment-318101549
2+
// this config augments the storybook one with support for css modules
3+
// storybook does not have support for css modules out of the box
4+
// if CRA were to be present, storybook webpack augment those configs
5+
module.exports = {
6+
module: {
7+
rules: [
8+
{
9+
test: /\.module.css$/,
10+
use: [
11+
{
12+
loader: "style-loader"
13+
},
14+
{
15+
loader: "css-loader",
16+
options: {
17+
modules: true
18+
}
19+
}
20+
]
21+
},
22+
{
23+
test: /\.scss$/,
24+
use: [
25+
{
26+
loader: "style-loader"
27+
},
28+
{
29+
loader: "css-loader",
30+
options: {
31+
sourceMap: true
32+
}
33+
},
34+
{
35+
loader: "sass-loader",
36+
options: {
37+
sourcemap: true
38+
}
39+
}
40+
]
41+
}
42+
]
43+
}
44+
};

.stylelintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
"media-feature-range-operator-space-after": "always",
1616
"media-feature-colon-space-after": "always"
1717
}
18-
}
18+
}

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Travis CI configuration to run automated test when pushing to github
12
language: node_js
23
node_js:
34
- "10"
@@ -9,5 +10,5 @@ install:
910
- npm install
1011

1112
script:
12-
- npm run test-ci
13-
# could also run lit
13+
- npm run test:ci
14+
# TODO: could also run lit

CONTRIBUTING.md

-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
This project has a [Code of Conduct](./CODE_OF_CONDUCT.md) that we expect all of our contributors to abide by, please check it out before contributing.
44

55
## Contributor license agreement
6-
76
By submitting code as an individual or as an entity you agree that your code is licensed the same as the [React Transcript Editor](./LICENCE.md).
87

9-
108
## Pull requests and branching
119

1210
1. [Feel free to start by raising an issue](https://github.com/bbc/react-transcript-editor/issues/new?template=feature_request.md) so that others can be aware of areas where there is active development, and if needed we can synchronies the effort.

PULL_REQUEST_TEMPLATE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
**Is your Pull Request request related to another [issue](https://github.com/bbc/react-transcript-editor/issues) in this repository ?**
2-
_If so please link to other issues and PRs as appropriate_
2+
<!-- _If so please link to other issues and PRs as appropriate_ -->
33

44
**Describe what the PR does**
5-
_A clear and concise description of what the PR does. Feel free to use bulletpoints and checkboxes if needed [...]_
5+
<!-- _A clear and concise description of what the PR does. Feel free to use bulletpoints and checkboxes if needed [...]_ -->
66

77

88
**State whether the PR is ready for review or whether it needs extra work**
9-
_If you are still working on it and just setting it up for later review, or if it's ready to be reviewed for merging_
9+
<!-- _If you are still working on it and just setting it up for later review, or if it's ready to be reviewed for merging_ -->
1010

1111
**Additional context**
12-
Add any other context or screenshots about the PR.
12+
<!-- Add any other context or screenshots about the PR. -->

0 commit comments

Comments
 (0)