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/1683+issue/1678: grunt allow .txt/.json, include build model in output #1684

Merged
merged 10 commits into from Nov 17, 2017

Conversation

oliverfoster
Copy link
Member

@oliverfoster oliverfoster commented Jul 24, 2017

issue/1678:

  • allow course/**/*.json files to be course/**/*.txt or any other extension in both grunt and the framework.
    to test:
  1. rename config.json, en/course.json, en/contentObject.json, en/articles.json, en/blocks.json and en/components.json to config.txt, en/course.txt, en/contentObject.txt, en/articles.txt, en/blocks.txt and en/components.txt.
  2. run $ grunt dev --jsonext=txt

issue/1683:

  • include build commands, config, plugin bower.json and package json in build output
  1. run grunt dev or grunt build
  2. when adapt loads, run
var Adapt = require("core/js/adapt");
Adapt.build.toJSON();
You should have an object which looks something like:
{
  "jsonext": "txt",
  "theme": "**",
  "menu": "**",
  "languages": "**",
  "package": {
    "name": "adapt_framework",
    "version": "2.1.3",
    "description": "Adapt Learning output framework",
    "repository": {
      "type": "git",
      "url": "git://github.com/adaptlearning/adapt_framework.git"
    },
    "license": "GPL-3.0",
    "bugs": {
      "url": "https://github.com/adaptlearning/adapt_framework/issues"
    },
    "contributors": [
      {
        "name": "Alan Bourne",
        "email": "alan@zenduo.co.uk"
      },
      {
        "name": "Aniket Dharia",
        "email": "aniket.dharia@vyassystems.com"
      },
      {
        "name": "Belal Almassri",
        "email": "belal.almassri@spongeuk.com"
      },
      {
        "name": "Brian Quinn",
        "email": "brian@learningpool.com"
      },
      {
        "name": "Chris Jones",
        "email": "chris.jones@spongeuk.com"
      },
      {
        "name": "Chris Steele",
        "email": "chris.steele@kineo.com"
      },
      {
        "name": "Chuck Lorenz",
        "email": "chucklorenz@yahoo.com"
      },
      {
        "name": "Dan Ghost",
        "email": "daniel.ghost@kineo.com"
      },
      {
        "name": "Dan Gray",
        "email": "dan@sinensis.co.uk"
      },
      {
        "name": "Daryl Hedley",
        "email": "darylhedley@hotmail.com"
      },
      {
        "name": "Dennis Dobrenko",
        "email": "dennis.dobrenko@kineo.co.il"
      },
      {
        "name": "Fabien O'Carroll",
        "email": "fabien@allou.is"
      },
      {
        "name": "Gavin McMaster",
        "email": "gavin.mcmaster@kineo.com"
      },
      {
        "name": "Guy Willis",
        "email": "guy.willis@kineo.com"
      },
      {
        "name": "Himanshu Rajotia",
        "email": "himanshu.rajotia@vyassys.com"
      },
      {
        "name": "Kevin Corry",
        "email": "kevinc@learningpool.com"
      },
      {
        "name": "Kirsty Hames",
        "email": "kirsty.hames@kineo.com"
      },
      {
        "name": "Laura Haselum",
        "email": "laura.haselum@kineo.com"
      },
      {
        "name": "Lukasz Grela",
        "email": "lukasz.grela@gmail.com"
      },
      {
        "name": "Matt Leathes",
        "email": "matt.leathes@kineo.com"
      },
      {
        "name": "Oliver Foster",
        "email": "oliver.foster@kineo.com"
      },
      {
        "name": "Petra Nußdorfer",
        "email": "petra.nussdorfer@learnchamp.com"
      },
      {
        "name": "Ryan Adams",
        "email": "ryana@learningpool.com"
      },
      {
        "name": "Sal Ali",
        "email": ""
      },
      {
        "name": "Sven Laux",
        "email": "sven.laux@kineo.com"
      },
      {
        "name": "Thomas Berger",
        "email": "thomas.berger@learnchamp.com"
      },
      {
        "name": "Thomas Eitler",
        "email": "thomas.eitler@learnchamp.com"
      },
      {
        "name": "Thomas Taylor",
        "email": "me@taylortom.co.uk"
      },
      {
        "name": "Tom Greenfield",
        "email": "tom.greenfield@kineo.com"
      }
    ],
    "dependencies": {
      "async": "^1.5.2",
      "chalk": "~1.1.3",
      "columnify": "~1.5.4",
      "csv": "^0.4.6",
      "grunt": "~1.0.1",
      "grunt-concurrent": "~2.3.0",
      "grunt-contrib-clean": "~1.0.0",
      "grunt-contrib-connect": "~1.0.2",
      "grunt-contrib-copy": "~1.0.0",
      "grunt-contrib-handlebars": "~1.0.0",
      "grunt-contrib-jshint": "~1.0.0",
      "grunt-contrib-watch": "~1.0.0",
      "grunt-jscs": "~2.8.0",
      "grunt-jsonlint": "~1.0.7",
      "grunt-newer": "^1.2.0",
      "grunt-open": "~0.2.3",
      "grunt-replace": "~1.0.1",
      "jit-grunt": "~0.10.0",
      "jshint-stylish": "~2.2.0",
      "less": "~2.7.1",
      "load-grunt-config": "~0.19.2",
      "requirejs": "~2.2.0",
      "time-grunt": "~1.3.0",
      "underscore": "~1.8.3",
      "underscore-deep-extend": "~1.1.4",
      "iconv-lite": "^0.4.13",
      "jschardet": "^1.4.1"
    }
  },
  "plugins": [
    {
      "name": "adapt-contrib-accordion",
      "version": "2.1.0",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-accordion",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-accordion%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "description": "An accordion component that displays clickable titles, which reveal display text",
      "main": "/js/adapt-contrib-accordion.js",
      "displayName": "Accordion",
      "component": "accordion",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-assessmentResults",
      "version": "2.1.0",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-assessmentResults",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-assessmentResults%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Assessment Results",
      "component": "assessmentResults",
      "description": "A component used to display a single assessment's results",
      "main": "/js/adapt-contrib-assessmentResults.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-blank",
      "version": "2.0.0",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-blank",
      "issues": "https://adaptlearning.atlassian.net/secure/CreateIssueDetails!init.jspa?pid=10100&issuetype=1&priority=6&components=10503",
      "displayName": "Blank",
      "component": "blank",
      "description": "A simple adapt core contributed blank component",
      "main": "/js/adapt-contrib-blank.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-gmcq",
      "version": "2.1.1",
      "framework": "^2.0.11",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-gmcq",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-gmcq%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Graphical Multiple Choice Question",
      "component": "gmcq",
      "description": "A multiple choice question component, with images",
      "main": "/js/adapt-contrib-gmcq.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-graphic",
      "version": "2.0.4",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-graphic",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-graphic%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Graphic",
      "component": "graphic",
      "assetFields": [
        "_graphic.small",
        "_graphic.large"
      ],
      "description": "Graphic component which dynamically displays small and large images of different resolutions based upon device width",
      "main": "/js/adapt-contrib-graphic.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-hotgraphic",
      "version": "2.1.0",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-hotgraphic",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-hotgraphic%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "description": "A component that enables a user to click on hot spots over an image and display a detailed popup that includes an image with text.",
      "main": "/js/adapt-contrib-hotgraphic.js",
      "displayName": "Hot Graphic",
      "component": "hotgraphic",
      "assetFields": [
        "_graphic.src",
        "_items[]._graphic.src"
      ],
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "pluginDependencies": {
        "adapt-contrib-narrative": "*"
      },
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-matching",
      "version": "2.1.2",
      "framework": "^2.0.15",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-matching",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-matching%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "description": "A question component that allows the learner to match the options to question stems",
      "main": "/js/adapt-contrib-matching.js",
      "displayName": "Matching Question",
      "component": "matching",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-mcq",
      "version": "2.1.1",
      "framework": "^2.0.11",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-mcq",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-mcq%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Multiple Choice Question",
      "component": "mcq",
      "description": "A multiple choice question component",
      "main": "/js/adapt-contrib-mcq.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-media",
      "version": "2.1.0",
      "framework": "^2.0.13",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-media",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-media%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Media",
      "component": "media",
      "assetFields": [
        "_media.ogv",
        "_media.mp4",
        "_media.poster"
      ],
      "description": "Playback of video and audio with a Flash Player fallback for IE8+",
      "main": "/js/adapt-contrib-media.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-narrative",
      "version": "2.0.6",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-narrative",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-narrative%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Narrative",
      "component": "narrative",
      "assetFields": [
        "_items[]._graphic.src"
      ],
      "description": "A component that displays an image gallery with accompanying text",
      "main": "/js/adapt-contrib-narrative.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-slider",
      "version": "2.1.4",
      "framework": "^2.0.13",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-slider",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-slider%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Slider",
      "component": "slider",
      "description": "A question component that allows the learner to position a slider on scale",
      "main": "/js/adapt-contrib-slider.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-text",
      "version": "2.0.2",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-text",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-text%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Text",
      "component": "text",
      "description": "A simple core contributed text component",
      "main": "/js/adapt-contrib-text.js",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-textInput",
      "version": "2.0.7",
      "framework": "^2.0.11",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-textInput",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-textInput%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "description": "A question component that allows the learner to input text based upon a question stem.",
      "main": "/js/adapt-contrib-textInput.js",
      "displayName": "Text Input",
      "component": "textinput",
      "keywords": [
        "adapt-plugin",
        "adapt-component"
      ],
      "license": "GPLv3"
    },
    {
      "name": "adapt-contrib-assessment",
      "version": "2.1.0",
      "framework": "^2.1.3",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-assessment",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-assessment%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Assessment",
      "extension": "assessment",
      "description": "An extension which attaches to an article object to group various question components and provide a score with feedback",
      "main": "/js/adapt-assessmentArticleExtension.js",
      "keywords": [
        "adapt-plugin",
        "adapt-extension"
      ],
      "license": "GPLv3",
      "targetAttribute": "_assessment"
    },
    {
      "name": "adapt-contrib-bookmarking",
      "version": "2.1.1",
      "framework": "^2.0.18",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-bookmarking",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-bookmarking%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Bookmarking",
      "extension": "bookmarking",
      "description": "A bookmarking extension",
      "main": "/js/adapt-contrib-bookmarking.js",
      "keywords": [
        "adapt-plugin",
        "adapt-extension"
      ],
      "license": "GPLv3",
      "targetAttribute": "_bookmarking"
    },
    {
      "name": "adapt-contrib-languagePicker",
      "repository": "git://github.com/adaptlearning/adapt-contrib-languagePicker.git",
      "framework": "^2.0.14",
      "version": "1.0.5",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-languagePicker",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues",
      "displayName": "Language Picker",
      "extension": "languagePicker",
      "description": "An extension to select a Language",
      "main": "/js/adapt-languagePicker.js",
      "keywords": [
        "adapt-plugin",
        "adapt-extension"
      ],
      "license": "GPLv3",
      "targetAttribute": "_languagePicker"
    },
    {
      "name": "adapt-contrib-pageLevelProgress",
      "version": "2.0.8",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-pageLevelProgress",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-pageLevelProgress%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Page Level Progress",
      "extension": "pageLevelProgress",
      "description": "An extension to show a user's progress through a page",
      "main": "/js/adapt-contrib-pageLevelProgress.js",
      "keywords": [
        "adapt-plugin",
        "adapt-extension"
      ],
      "license": "GPLv3",
      "targetAttribute": "_pageLevelProgress"
    },
    {
      "name": "adapt-contrib-resources",
      "version": "2.0.6",
      "framework": "^2.0.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-resources",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-resources%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Resources",
      "extension": "resources",
      "description": "An extension to allow learners to view resources",
      "main": "/js/adapt-contrib-resources.js",
      "keywords": [
        "adapt-plugin",
        "adapt-extension"
      ],
      "license": "GPLv3",
      "targetAttribute": "_resources"
    },
    {
      "name": "adapt-contrib-spoor",
      "version": "2.1.1",
      "framework": "^2.0.16",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-spoor",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-spoor%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20the%20contents%20of%20the%20SCORM%20debug%20window.",
      "displayName": "Spoor",
      "extension": "spoor",
      "description": "An extension which allows basic SCORM tracking",
      "main": "/js/adapt-contrib-spoor.js",
      "keywords": [
        "adapt-plugin",
        "adapt-extension"
      ],
      "license": "GPLv3",
      "targetAttribute": "_spoor"
    },
    {
      "name": "adapt-contrib-trickle",
      "version": "2.1.3",
      "framework": "^2.0.13",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-trickle",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-trickle%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Trickle",
      "extension": "trickle",
      "description": "A vertical locking extension",
      "main": "/js/adapt-contrib-trickle.js",
      "keywords": [
        "adapt-plugin",
        "adapt-extension"
      ],
      "license": "GPLv3",
      "targetAttribute": "_trickle"
    },
    {
      "name": "adapt-contrib-tutor",
      "version": "2.1.0",
      "framework": "^2.0.18",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-tutor",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-tutor%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Tutor",
      "extension": "tutor",
      "description": "An extension which provides a basic feedback overlay for question components",
      "main": "/js/adapt-contrib-tutor.js",
      "keywords": [
        "adapt-plugin",
        "adapt-extension"
      ],
      "license": "GPLv3",
      "targetAttribute": "_tutor"
    },
    {
      "name": "adapt-contrib-boxMenu",
      "version": "2.0.6",
      "framework": "^2.1.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-boxmenu",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-boxmenu%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Box menu",
      "menu": "boxmenu",
      "description": "A core bundled menu",
      "main": "js/adapt-contrib-boxmenu.js",
      "keywords": [
        "adapt-plugin",
        "adapt-menu"
      ],
      "license": "GPLv3",
      "targetAttribute": "_boxMenu"
    },
    {
      "name": "adapt-contrib-vanilla",
      "version": "2.1.1",
      "framework": "^2.1.0",
      "homepage": "https://github.com/adaptlearning/adapt-contrib-vanilla",
      "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-vanilla%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.",
      "displayName": "Vanilla",
      "theme": "vanilla",
      "description": "A core bundled theme",
      "main": "js/vanilla.js",
      "keywords": [
        "adapt-plugin",
        "adapt-theme"
      ],
      "license": "GPLv3",
      "ignore": [
        "**/.*",
        "node_modules",
        "bower_components",
        "test",
        "tests"
      ]
    }
  ]
}

var hideAttributes = [ 'outputdir', 'sourcedir', 'root' ];
hideAttributes.forEach(function(attrName) { delete buildConfig[attrName]; });

grunt.file.write(buildConfigPath, JSON.stringify(buildConfig, null, " "));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change the third argument of JSON.stringify to an integer, as per #1462 (comment)?

@@ -57,7 +57,7 @@ module.exports = function(grunt) {
//iterate through lanugage folders
grunt.file.expand({filter: 'isDirectory'}, grunt.config('outputdir') + 'course/*').forEach(function(path) {
var currentCourseFolder = path;
var currentCourseJsonFile = currentCourseFolder + '/' + 'course.json';
var currentCourseJsonFile = currentCourseFolder + '/' + 'course.' + grunt.config('jsonext');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be caching jsonext outside the forEach loop like here?

@@ -15,7 +15,7 @@ module.exports = function (grunt) {
"blocks",
"components"
].forEach(function (filename) {
var src = path.join(srcPath, "course", targetLang, filename+".json");
var src = path.join(srcPath, "course", targetLang, filename+"."+grunt.config("jsonext"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be caching jsonext outside the forEach loop like here?


});

return BuildModel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; missing from end of line.

@oliverfoster oliverfoster changed the title issue/1683+issue/1678 issue/1683+issue/1678: allow .txt/.json, include build model in output Aug 18, 2017
@moloko
Copy link
Contributor

moloko commented Sep 13, 2017

@oliverfoster you have a conflict on grunt/helpers.js

@oliverfoster
Copy link
Member Author

ta

@oliverfoster oliverfoster changed the title issue/1683+issue/1678: allow .txt/.json, include build model in output issue/1683+issue/1678: grunt allow .txt/.json, include build model in output Oct 2, 2017
@oliverfoster oliverfoster self-assigned this Oct 2, 2017
Copy link
Contributor

@tomgreenfield tomgreenfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any scope for the grunt task converting the (src) JSON to (build) text for you, or is that just crazy talk?

@oliverfoster
Copy link
Member Author

oliverfoster commented Oct 4, 2017

yea, totally could do. you mean changing the file name extensions in the output directory?

update: this gets really irritating when the src and output paths are the same thing

@brian-learningpool
Copy link
Member

I think the setting of Adapt.build should also be dependent on a switch, similar to the json-ext option. While this is useful enhancement for debugging, I'm not sure it should be always on by default on production builds.

@oliverfoster
Copy link
Member Author

I would normally concur @brian-learningpool but I'd like this API to be consistently available at run-time as it'll be useful for passing compile-time variables into the run-time environment. Is it a size concern regarding the bower.json from all of plugins?

@brian-learningpool
Copy link
Member

It's a combination of the size and the fact the entire bower.json file is dropped in. This could reveal infrastructure details about the location of non-core or non-OS plugins, i.e. through the homePage attribute.

A lot of the information in the Build as it currently is is non-essential to assist with debugging, e.g. contributors, devdependencies, etc. I think a combination of the plugin name and version should be enough for troubleshooting.

@oliverfoster
Copy link
Member Author

oliverfoster commented Oct 30, 2017

cool, if i pick out the necessaries and drop the others would that suffice?

bower.json

    {
      "name": "adapt-contrib-vanilla",
      "version": "2.1.1",
      "framework": "^2.1.0",
      "displayName": "Vanilla",
      "theme": "vanilla",
      "description": "A core bundled theme",
      "main": "js/vanilla.js",
      "keywords": [
        "adapt-plugin",
        "adapt-theme"
      ],
      "license": "GPLv3"
    }

which is: name, version, framework, displayName, theme, component, extension, menu, description, main, keywords, licence

package.json

{
    "name": "adapt_framework",
    "version": "2.1.3",
    "description": "Adapt Learning output framework",
    "repository": {
      "type": "git",
      "url": "git://github.com/adaptlearning/adapt_framework.git"
    },
    "license": "GPL-3.0"
}

which is: name, version, description, repository, license

@brian-learningpool
Copy link
Member

Works for me -- thanks.


var jsonext = grunt.config('jsonext');
var pathToConfig = path.join(courseDir, 'config.'+jsonext);
var courseDir = path.join(options.outputdir, 'course');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched to always use the build folder files as they're always available and it reduces the code here


var generatePatterns = function() {
var jsonext = grunt.config('jsonext');
var pathToConfig = path.join(courseDir, 'config.'+jsonext);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added these in here, as the config isn't ready until this point


// Ensure that only whitelisted attributes can be replaced.
courseJson = _.pick(courseJson, 'title', 'displayTitle', 'body', 'description');
configJson = _.pick(configJson, '_xapi', '_spoor');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed these restrictions as both files are distributed with the finished product and it'll allow more flexibility in the string replacement
#1798

buildConfig.plugins.push(plugin);
});

// remove path specific variables
var hideAttributes = [ 'outputdir', 'sourcedir', 'root' ];
hideAttributes.forEach(function(attrName) { delete buildConfig[attrName]; });

grunt.file.write(buildConfigPath, JSON.stringify(buildConfig, null, 2));
grunt.file.write(buildConfigPath, JSON.stringify(buildConfig));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write adapt/js/build.min.js minified to reduce file size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants