Skip to content
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

Draft: Decaffeinate & drop Ruby, get CI running again #584

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 4 additions & 6 deletions .github/workflows/build-chorus2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ jobs:

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 8
node-version: 21

- name: Install dependencies
run: |
sudo gem install bundler && bundle config path vendor/bundle
npm install
bundle install
npm clean-install

- name: Build
run: |
grunt build --force
npx grunt build --force

- name: Prepare for uploading
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ dist/js/build/*
*.mo
.vscode
webinterface.default*.zip
.env
22 changes: 0 additions & 22 deletions Gemfile

This file was deleted.

69 changes: 0 additions & 69 deletions Gemfile.lock

This file was deleted.

137 changes: 73 additions & 64 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

module.exports = function (grunt) {
require('dotenv').config();

var cwd = process.cwd();

Expand Down Expand Up @@ -43,20 +44,19 @@ module.exports = function (grunt) {

},

// Includes and order of compiling coffee.
coffeeStack: [
'*.coffee',
'helpers/{,**}/*.coffee',
'config/{,**}/*.coffee',
'entities/{,**}/*.coffee',
'controllers/{,**}/*.coffee',
'views/{,**}/*.coffee',
'components/{,**}/*.coffee',
'apps/{,**}/*.coffee'
],

// Joins all libraries and complied app into a single js file.
concatStack: {
// Includes and order of compiling the app.
app: [
'src/js/*.js',
'src/js/helpers/{,**}/*.js',
'src/js/config/{,**}/*.js',
'src/js/entities/{,**}/*.js',
'src/js/controllers/{,**}/*.js',
'src/js/views/{,**}/*.js',
'src/js/components/{,**}/*.js',
'src/js/apps/{,**}/*.js'
],
src: [
// Core dependencies.
'src/lib/core/jquery.js',
Expand Down Expand Up @@ -140,7 +140,7 @@ module.exports = function (grunt) {
},
sass: {
files: [ggp('themeSrc') + 'sass/{,**/}*.{scss,sass}'],
tasks: ['compass:dev'],
tasks: ['sass:dev'],
options: {}
},
images: {
Expand All @@ -150,12 +150,12 @@ module.exports = function (grunt) {
files: [ggp('themeDist') + 'css/{,**/}*.css']
},
eco: {
files: [ggp('jsSrc') + '/**/*.eco'],
files: [ggp('jsSrc') + '**/*.eco'],
tasks: ['eco', 'concat:libs', 'uglify:libs', 'concat:dev']
},
coffee: {
files: [ggp('jsSrc') + '{,**/}*.coffee'],
tasks: ['coffee', 'concat:dev']
js: {
files: [ggp('jsSrc') + '{,**/}*.js'],
tasks: ['concat:app', 'concat:dev']
},
po2json: {
files: [ggp('langSrcStrings')],
Expand All @@ -175,44 +175,6 @@ module.exports = function (grunt) {
}
},

// Compile compass.
compass: {
options: {
config: ggp('themeSrc') + 'config.rb',
bundleExec: true,
force: true
},
dev: {
options: {
environment: 'development'
}
},
dist: {
options: {
environment: 'production',
outputStyle: 'compressed'
}
}
},

// Compile coffee.
coffee: {
options: {
bare: true,
join: true
},
files: {
expand: true,
flatten: true,
cwd: ggp('jsSrc'),
src: ggs('coffeeStack'),
dest: ggp('jsBuild'),
rename: function (dest, src) {
return dest + 'app.js';
}
}
},

// Compile all the *.eco templates into a single tpl.js
eco: {
app: {
Expand All @@ -227,22 +189,40 @@ module.exports = function (grunt) {
},

// Injects css changes automatically and sync interaction between browsers.
// TODO: Move proxy details to envvar file or similar.
browserSync: {
dev: {
bsFiles: {
src: ggp('themeDist') + 'css/{,**/}*.css'
src: [
ggp('dist') + '**/*',
]
},
options: {
watchTask: true,
injectChanges: true,
hostname: "192.168.0.5",
proxy: "192.168.0.10:8080",
proxy: process.env.PROXY_TARGET || '192.168.0.10:8080',
open: false,
ports: {
min: 3102,
max: 3103
}
},
serveStatic: [
{
route: '/js',
dir: ggp('jsDist')
},
{
route: '/lang',
dir: ggp('langDist')
},
{
route: '/themes/base',
dir: ggp('themeDist')
},
{
route: '/lib',
dir: './dist/lib'
}
],
}
}
},
Expand All @@ -268,6 +248,10 @@ module.exports = function (grunt) {
options: {
separator: ';'
},
app: {
src: ggs('concatStack', 'app'),
dest: ggp('jsBuild') + 'app.js'
},
libs: {
src: ggs('concatStack', 'src'),
dest: ggp('jsBuild') + 'libs.js'
Expand Down Expand Up @@ -370,13 +354,14 @@ module.exports = function (grunt) {
});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
// grunt.loadNpmTasks('grunt-contrib-compass');
// grunt.loadNpmTasks('grunt-dart-sass');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-browser-sync');
grunt.loadNpmTasks('grunt-contrib-coffee');
// grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-eco');
grunt.loadNpmTasks('grunt-po2json');
grunt.loadNpmTasks('grunt-marked');
Expand All @@ -389,6 +374,30 @@ module.exports = function (grunt) {
* Eg "grunt lang" will rebuild languages.
*/

grunt.registerTask('sass', function() {
const done = this.async();
const sass = require('sass');
const globImporter = require('node-sass-glob-importer');
const sassOptions = {
importer: globImporter(),
pkgImporter: new sass.NodePackageImporter(),
file: ggp('themeSrc') + 'sass/base.scss',
outFile: ggp('themeDist') + 'css/base.css',
outputStyle: this.args && this.args[0] === 'dist' ? 'compressed' : 'expanded',
};

sass.render(sassOptions, (err, result) => {
if (err) {
grunt.log.error(err);
done(false);
} else {
grunt.file.write(sassOptions.outFile, result.css);
grunt.log.ok(`Compiled ${sassOptions.file} to ${sassOptions.outFile}`);
done(true);
}
});
})

// Development watch task.
grunt.registerTask('default', ['browserSync:dev', 'watch']);

Expand All @@ -400,13 +409,13 @@ module.exports = function (grunt) {
'po2json',
'copy:lang',
'marked',
'concat:app',
'eco',
'coffee',
'concat:libs',
'uglify:libs',
// 'uglify:app', // Uncomment if concat:dist is used.
'concat:dev', // App is not minified for in the wild debugging. Change to concat:dist to save ~200K
'compass:dist'
'sass:dist'
]);

};
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

if [ "$1" == "" ]; then
echo "Missing version number. I did nothing"
exit 1
fi

if [ "$1" == "install" ]; then
echo "Installing dev dependencies"
npm install
bundle install
npm clean-install
exit 1
fi

Expand All @@ -33,7 +33,7 @@ cp src/xml/addon.release.xml dist/addon.xml

echo "Running Grunt"
echo "=============================================="
grunt build
npx grunt build

echo "removing old zip and build files"
echo "=============================================="
Expand Down
30,703 changes: 14,138 additions & 16,565 deletions dist/js/kodi-webinterface.js

Large diffs are not rendered by default.

30,793 changes: 30,792 additions & 1 deletion dist/themes/base/css/base.css

Large diffs are not rendered by default.

Loading