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

issue/2662 Formalised plugin, data, schema and translate API #2667

Merged
merged 10 commits into from
Mar 12, 2020
7 changes: 0 additions & 7 deletions grunt/config/build-config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
module.exports = function(grunt, options) {
return {
options: {
baseUrl: '<%= sourcedir %>',
src: [
'<%= sourcedir %>components/**/bower.json',
'<%= sourcedir %>extensions/**/bower.json',
'<%= sourcedir %>menu/<%= menu %>/**/bower.json',
'<%= sourcedir %>theme/<%= theme %>/**/bower.json'
],
filter: function(filepath) {
return grunt.config('helpers').includedFilter(filepath);
},
Expand Down
18 changes: 7 additions & 11 deletions grunt/config/replace.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
var path = require('path');
var fs = require('fs');
const path = require('path');

module.exports = function(grunt, options) {

var courseDir = path.join(options.outputdir, 'course');
const Helpers = require('../helpers')(grunt);

var filterNullValues = function(obj) {
// hack to fix bug https://github.com/adaptlearning/adapt_framework/issues/1867
Expand Down Expand Up @@ -34,16 +33,13 @@ module.exports = function(grunt, options) {
};

var generatePatterns = function() {
var jsonext = grunt.config('jsonext');
var pathToConfig = path.join(courseDir, 'config.' + jsonext);
const framework = Helpers.getFramework({ useOutputData: true });
const data = framework.getData();

try {
// Verify that the configuration file exists.
fs.accessSync(pathToConfig);

var configJson = grunt.file.readJSON(pathToConfig);
var defaultLanguage = configJson._defaultLanguage || 'en';
var courseJson = grunt.file.readJSON(path.join(courseDir, defaultLanguage, 'course.' + jsonext));
const configJson = data.getConfigFileItem().item;
const defaultLanguage = configJson._defaultLanguage || 'en';
const courseJson = data.getLanguage(defaultLanguage).getCourseFileItem().item;

// Backwards compatibility for courses missing 'description'
if (!courseJson.hasOwnProperty('description')) {
Expand Down
8 changes: 0 additions & 8 deletions grunt/config/tracking-insert.js

This file was deleted.

8 changes: 0 additions & 8 deletions grunt/config/tracking-remove.js

This file was deleted.

8 changes: 0 additions & 8 deletions grunt/config/tracking-reset.js

This file was deleted.

10 changes: 0 additions & 10 deletions grunt/config/translate.js

This file was deleted.

Loading