-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add frontend infrastructure for video player app #905
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
985c499
Add standard Hypothesis frontend build tooling and video player app s…
robertknight 69c848b
Update Makefile for switch from npm to yarn
robertknight 5836c31
Add "dev" setting to app
robertknight 9eb4527
Add frontend asset serving based on h-assets package
robertknight 06293fa
Add initial route to serve video player
robertknight 91b04ab
Add a note in .prettierignore about what `via/static/js/` contains
robertknight 17376e6
Set JSON `type` attr on config script tag
robertknight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-typescript", | ||
[ | ||
"@babel/preset-react", | ||
{ | ||
"runtime": "automatic", | ||
"importSource": "preact" | ||
} | ||
], | ||
|
||
// Compile JS for browser targets set by `browserslist` key in package.json. | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"bugfixes": true | ||
} | ||
] | ||
], | ||
"env": { | ||
"development": { | ||
"presets": [ | ||
[ | ||
"@babel/preset-react", | ||
{ | ||
"development": true, | ||
"runtime": "automatic", | ||
"importSource": "preact" | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
*.pyc | ||
*.egg-info/ | ||
via/static/**/*.gz | ||
build/ | ||
node_modules/ | ||
build.tar | ||
.devdata* | ||
|
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,4 @@ | ||
# Ignore minified JS assets - these should be moved to `build/scripts/` in future. | ||
via/static/js/ | ||
|
||
via/static/vendor/ |
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
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,67 @@ | ||
import { | ||
buildCSS, | ||
buildJS, | ||
generateManifest, | ||
runTests, | ||
watchJS, | ||
} from '@hypothesis/frontend-build'; | ||
import gulp from 'gulp'; | ||
|
||
// import tailwindConfig from './tailwind.config.mjs'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CSS and testing parts of this are not used yet. This will come in follow-up PRs. |
||
|
||
gulp.task('build-js', () => buildJS('./rollup.config.mjs')); | ||
gulp.task('watch-js', () => watchJS('./rollup.config.mjs')); | ||
|
||
// gulp.task('build-css', () => | ||
// buildCSS( | ||
// [ | ||
// './lms/static/styles/lms.scss', | ||
// './lms/static/styles/frontend_apps.scss', | ||
// './lms/static/styles/ui-playground.scss', | ||
// ], | ||
// { tailwindConfig } | ||
// ) | ||
// ); | ||
|
||
// gulp.task('watch-css', () => { | ||
// gulp.watch( | ||
// [ | ||
// './lms/static/styles/**/*.{css,scss}', | ||
// './lms/static/scripts/frontend_apps/**/*.js', | ||
// './lms/static/scripts/frontend_apps/**/*.ts', | ||
// './lms/static/scripts/frontend_apps/**/*.tsx', | ||
// './lms/static/scripts/ui-playground/**/*.js', | ||
// ], | ||
// { ignoreInitial: false }, | ||
// gulp.series('build-css') | ||
// ); | ||
// }); | ||
|
||
gulp.task('watch-manifest', () => { | ||
gulp.watch('build/**/*.{css,js,map}', generateManifest); | ||
}); | ||
|
||
gulp.task( | ||
'build', | ||
gulp.series(['build-js' /*, 'build-css'*/], generateManifest) | ||
); | ||
gulp.task( | ||
'watch', | ||
gulp.parallel(['watch-js', /* 'watch-css', */ 'watch-manifest']) | ||
); | ||
|
||
// Unit and integration testing tasks. | ||
// | ||
// Some (eg. a11y) tests rely on CSS bundles. We assume that JS will always take | ||
// longer to build than CSS, so build in parallel. | ||
// gulp.task( | ||
// 'test', | ||
// gulp.parallel('build-css', () => | ||
// runTests({ | ||
// bootstrapFile: 'lms/static/scripts/bootstrap.js', | ||
// karmaConfig: 'lms/static/scripts/karma.config.js', | ||
// rollupConfig: 'rollup-tests.config.mjs', | ||
// testsPattern: 'lms/static/scripts/**/*-test.js', | ||
// }) | ||
// ) | ||
// ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structure here matches the lms app's Dockerfile.