Skip to content
Closed
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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

12 changes: 0 additions & 12 deletions .eslintrc.json

This file was deleted.

16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Validate JavaScript Build
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
check:
name: Validate JavaScript Build
runs-on: ubuntu-latest
container:
image: debian:bookworm
Expand Down Expand Up @@ -61,3 +62,16 @@ jobs:
git add video2commons/frontend/static/*.min.js video2commons/frontend/templates/*.min.html
git commit -m "Update built files from CI"
git push origin $GITHUB_HEAD_REF

biome:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Biome
uses: biomejs/setup-biome@v2.7.0

- name: Run Biome
run: biome ci .
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

116 changes: 69 additions & 47 deletions Gulpfile.mjs
Original file line number Diff line number Diff line change
@@ -1,52 +1,74 @@
import gulp from 'gulp';
import concat from 'gulp-concat';
import htmlmin from 'gulp-htmlmin';
import rename from 'gulp-rename';
import uglify from 'gulp-uglify';
import {nunjucksPrecompile} from 'gulp-nunjucks';
/* eslint-env node */

gulp.task( 'scripts', function () {
return gulp
.src( [ './video2commons/frontend/static/*.js', '!./video2commons/frontend/static/*.min.js' ] )
.pipe( rename( { suffix: '.min' } ) )
.pipe( uglify() )
.pipe( gulp.dest( './video2commons/frontend/static/' ) );
} );

gulp.task( 'jinja2', function () {
return gulp
.src( [ './video2commons/frontend/templates/**.html', '!./video2commons/frontend/templates/**.min.html' ] )
.pipe( rename( { suffix: '.min' } ) )
.pipe( htmlmin( { collapseWhitespace: true, minifyCSS: true } ) )
.pipe( gulp.dest( './video2commons/frontend/templates/' ) );
} );

gulp.task( 'nunjucks', function () {
return gulp
.src( [ './video2commons/frontend/static/templates/**.html' ] )
.pipe( htmlmin( { collapseWhitespace: true, minifyCSS: true } ) )
.pipe( nunjucksPrecompile() )
.pipe( concat( '../templates.min.js' ) )
.pipe( uglify() )
.pipe( gulp.dest( './video2commons/frontend/static/templates' ) );
} );

gulp.task( 'watch', function () {
var changeevent = function ( event ) {
// eslint-disable-next-line no-console
console.log( 'File ' + event.path + ' was ' + event.type + ', running tasks...' );
import gulp from "gulp";
import concat from "gulp-concat";
import htmlmin from "gulp-htmlmin";
import { nunjucksPrecompile } from "gulp-nunjucks";
import rename from "gulp-rename";
import uglify from "gulp-uglify";

gulp.task("scripts", () =>
gulp
.src([
"./video2commons/frontend/static/*.js",
"!./video2commons/frontend/static/*.min.js",
])
.pipe(rename({ suffix: ".min" }))
.pipe(uglify())
.pipe(gulp.dest("./video2commons/frontend/static/")),
);

gulp.task("jinja2", () =>
gulp
.src([
"./video2commons/frontend/templates/**.html",
"!./video2commons/frontend/templates/**.min.html",
])
.pipe(rename({ suffix: ".min" }))
.pipe(htmlmin({ collapseWhitespace: true, minifyCSS: true }))
.pipe(gulp.dest("./video2commons/frontend/templates/")),
);

gulp.task("nunjucks", () =>
gulp
.src(["./video2commons/frontend/static/templates/**.html"])
.pipe(htmlmin({ collapseWhitespace: true, minifyCSS: true }))
.pipe(nunjucksPrecompile())
.pipe(concat("../templates.min.js"))
.pipe(uglify())
.pipe(gulp.dest("./video2commons/frontend/static/templates")),
);

gulp.task("watch", () => {
var changeevent = (event) => {
console.log(`File ${event.path} was ${event.type}, running tasks...`);
};
gulp.watch( [ './video2commons/frontend/static/*.js', '!./video2commons/frontend/static/*.min.js' ], gulp.series('scripts') )
.on( 'change', changeevent );
gulp
.watch(
[
"./video2commons/frontend/static/*.js",
"!./video2commons/frontend/static/*.min.js",
],
gulp.series("scripts"),
)
.on("change", changeevent);

gulp.watch( [ './video2commons/frontend/templates/**.html', '!./video2commons/frontend/templates/**.min.html' ], gulp.series('jinja2') )
.on( 'change', changeevent );
gulp
.watch(
[
"./video2commons/frontend/templates/**.html",
"!./video2commons/frontend/templates/**.min.html",
],
gulp.series("jinja2"),
)
.on("change", changeevent);

gulp.watch( [ './video2commons/frontend/static/templates/**.html' ], gulp.series('nunjucks') )
.on( 'change', changeevent );
} );
gulp
.watch(
["./video2commons/frontend/static/templates/**.html"],
gulp.series("nunjucks"),
)
.on("change", changeevent);
});

gulp.task( 'build', gulp.series( 'scripts', 'jinja2', 'nunjucks' ));
gulp.task("build", gulp.series("scripts", "jinja2", "nunjucks"));

gulp.task( 'default', gulp.series( 'build', 'watch' ));
gulp.task("default", gulp.series("build", "watch"));
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# video2commons [![Build Status](https://travis-ci.org/toolforge/video2commons.svg?branch=master)](https://travis-ci.org/toolforge/video2commons) [![Code Climate](https://codeclimate.com/github/toolforge/video2commons/badges/gpa.svg)](https://codeclimate.com/github/toolforge/video2commons)
# video2commons [![Build Status](https://github.com/toolforge/video2commons/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/toolforge/video2commons/actions/workflows/ci.yml) [![Code Climate](https://codeclimate.com/github/toolforge/video2commons/badges/gpa.svg)](https://codeclimate.com/github/toolforge/video2commons)

Transfer video and audio from external sites to Commons. Video2commons is available for everyone (uses OAuth) via Wikimedia Commons.

Expand Down
41 changes: 41 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.13/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": ["Gulpfile.mjs", "**/*.js", "!**/*.min.js"],
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noInnerDeclarations": "off"
},
"suspicious": {
"noAssignInExpressions": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
Loading