Skip to content

Commit

Permalink
Declare jsu for typescript import compatibility refs #34417 (#9)
Browse files Browse the repository at this point in the history
Declare jsu for typescript import compatibility refs #34417 #9
  • Loading branch information
sschoorens authored Feb 9, 2024
1 parent bd615c1 commit 56b92af
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 346 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ __pycache__
pip-log.txt

# Unit test / coverage reports
.coverage
coverage/
.tox
nosetests.xml

Expand Down
2 changes: 1 addition & 1 deletion dist/jsu.min.js

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
/* globals require */
/* sudo npm install -g gulp gulp-concat gulp-minify */
const gulp = require('gulp');
const concat = require('gulp-concat');
const minify = require('gulp-minify');
import gulp from 'gulp';
import * as concat from 'gulp-concat';
import * as minify from 'gulp-minify';

gulp.task('autobuild', function () {
gulp.watch('src/**', {'ignoreInitial': false}, gulp.series('build'));
});

gulp.task('build', function () {
return gulp.src(['src/jsu.js', 'src/lib/*.js'])
.pipe(concat('dist/jsu.js'))
.pipe(minify({
.pipe(concat.default('dist/jsu.js'))
.pipe(minify.default({
ext: {'src': '.tmp.js', 'min': '.min.js'},
compress: {'hoist_vars': true}
}))
Expand Down
24 changes: 16 additions & 8 deletions karma.conf.js → karma.conf.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Karma configuration
// Generated on Tue Sep 27 2022 10:45:26 GMT+0200 (Central European Summer Time)
/* globals module */
module.exports = function (config) {
module.exports = (config) => {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',

Expand All @@ -30,8 +29,8 @@ module.exports = function (config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor
preprocessors: {
'src/**/*.js': ['coverage'],
'tests/*.spec.js': ['browserify']
'src/**/*.js': ['browserify', 'coverage'],
'tests/*.spec.js': ['browserify'],
},


Expand Down Expand Up @@ -60,7 +59,13 @@ module.exports = function (config) {

// start these browsers
// available browser launchers: https://www.npmjs.com/search?q=keywords:karma-launcher
browsers: ['ChromeHeadless'],
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},


// Continuous Integration mode
Expand All @@ -72,11 +77,14 @@ module.exports = function (config) {
concurrency: 1,

browserify: {
debug: true // display file line error
debug: true,
plugin: ['esmify']
},
coverageReporter: {
type: 'text',
dir: '.coverage'
reporters:[
{type: 'lcov', dir:'coverage/', includeAllSources: true},
{type: 'text', includeAllSources: true}
]
}
});
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
"version": "8",
"description": "",
"main": "gulpfile.js",
"type": "module",
"scripts": {
"test": "karma start karma.conf.js",
"test": "karma start",
"build": "gulp build",
"lint": "eslint ."
},
"author": "",
"license": "LGPLv3",
"devDependencies": {
"eslint": "latest",
"esmify": "latest",
"gulp": "latest",
"gulp-concat": "latest",
"gulp-minify": "latest",
Expand Down
Loading

0 comments on commit 56b92af

Please sign in to comment.