From 375341c0305e7eac3247bc201d2c5be2e9f5b8c9 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Sun, 4 Jan 2015 16:17:21 +0100 Subject: [PATCH 01/16] Adding load event emit, to prevent scrollToHashFailing Install inscturctions --- README.md | 18 ++++++++++++++- assets/index.js | 60 +++++++++++++++++++++++++++++++++++-------------- 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index aa0508d..2ba4c24 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,25 @@ Spec Dependencies is [SourceJS](http://sourcejs.com) plugin for adding crosslink Compatible with SourceJS v0.4+. +## Install + +To install, run npm in `sourcejs/user` folder: + +``` +npm install sourcejs-spec-status --save +``` + +Then run Grunt update in SourceJS root: + +``` +grunt update +``` + +After install, entering spec pages you will se prediction box. + ## How to use -Spec Dependencies automatically predicts all specs, that used in current spec ("most likely it uses" section on the picture above). If you also want to see next section to check which specs use current ("this spec used by"), you have to update info.json of the specs with "usedSpecs" property. Value of "usedSpecs" should be an array even for only element. +Spec Dependencies automatically predicts all specs, that used in current spec by comparing CSS classes names with existing Spec names. If you also want to see next section to check which specs use current ("this spec used by"), you have to update `info.json` of the specs with "usedSpecs" property. Value of "usedSpecs" should be an array even for only element. ``` // info.json of Example spec (/url/to/example/spec) diff --git a/assets/index.js b/assets/index.js index d390576..3ec3922 100644 --- a/assets/index.js +++ b/assets/index.js @@ -7,6 +7,14 @@ * */ "use strict"; +// Registering load event +window.source = window.source || {}; +window.source.loadEvents = window.source.loadEvents || {}; +window.source.loadEvents.specDepencencies = window.source.loadEvents.specDepencencies || { + finishEvent: 'specDepencenciesFinish', + updateEvent: 'specDepencenciesUpdate' +}; + define([ 'jquery', 'sourceModules/module', @@ -38,6 +46,8 @@ define([ }, this.options.pluginsOptions.specDependencies); + this.moduleOpts = this.options.pluginsOptions.specDependencies; + $(function() { _this.init(); }); @@ -49,8 +59,8 @@ define([ SpecDependencies.prototype.init = function() { var _this = this, - USED_BY_SPECS_CLASS = this.options.pluginsOptions.specDependencies.USED_BY_SPECS_CLASS, - USED_BY_SPEC_HEAD_LINK_CLASS = this.options.pluginsOptions.specDependencies.USED_BY_SPEC_HEAD_LINK_CLASS; + USED_BY_SPECS_CLASS = this.moduleOpts.USED_BY_SPECS_CLASS, + USED_BY_SPEC_HEAD_LINK_CLASS = this.moduleOpts.USED_BY_SPEC_HEAD_LINK_CLASS; // waiting for template's rendering setTimeout(function() { @@ -61,6 +71,16 @@ define([ utils.toggleBlock(USED_BY_SPEC_HEAD_LINK_CLASS, USED_BY_SPECS_CLASS); }; + // Let SourceJS know that all DOM operations from this plugins are done + SpecDependencies.prototype.emitFinishEvent = function() { + if (window.CustomEvent) { + new CustomEvent('specDepencenciesFinish'); + } else { + var event = document.createEvent('CustomEvent'); + event.initCustomEvent('specDepencenciesFinish', true, true); + } + }; + // Get classes of all elements inside .source_example SpecDependencies.prototype.getClassList = function() { var tags = $('.source_example *'), @@ -110,28 +130,32 @@ define([ }; SpecDependencies.prototype.getDependenciesTreeJSON = function() { - var URL_TO_DEPENDENCIES_FILE = this.options.pluginsOptions.specDependencies.URL_TO_DEPENDENCIES_FILE, + var URL_TO_DEPENDENCIES_FILE = this.moduleOpts.URL_TO_DEPENDENCIES_FILE, _this = this; $.ajax({ url: URL_TO_DEPENDENCIES_FILE, dataType: 'json', success: function(data) { - _this.getUsedByspecList(data); + _this.handleDependenciesData(data); }, error: function() { - console.log(_this.options.pluginsOptions.specDependencies.FILE_TREE_NOT_FOUND); + _this.handleDependenciesData(); } }); }; - SpecDependencies.prototype.getUsedByspecList = function(jsonTree) { - var specList, - currentUrl = this.getCurrentUrlPath(); - + SpecDependencies.prototype.handleDependenciesData = function(jsonTree) { if (jsonTree) { + var specList; + var currentUrl = this.getCurrentUrlPath(); + specList = jsonTree[currentUrl]; return this.drawUsedBySpecs(specList); + } else { + console.log(this.moduleOpts.FILE_TREE_NOT_FOUND); + + this.emitFinishEvent(); } return false; @@ -142,9 +166,9 @@ define([ var _this = this, specList = this.getUsedSpecList(), - USED_SPECS_CLASS = this.options.pluginsOptions.specDependencies.USED_SPECS_CLASS, - ROOT_CLASS = this.options.pluginsOptions.specDependencies.DEPENDENCIES_ROOT_CLASS, - HEADER = this.options.pluginsOptions.specDependencies.USED_SPECS_HEAD, + USED_SPECS_CLASS = this.moduleOpts.USED_SPECS_CLASS, + ROOT_CLASS = this.moduleOpts.DEPENDENCIES_ROOT_CLASS, + HEADER = this.moduleOpts.USED_SPECS_HEAD, res = "", header = "", @@ -170,10 +194,10 @@ define([ SpecDependencies.prototype.drawUsedBySpecs = function(specList) { var _this = this, - USED_BY_SPECS_CLASS = this.options.pluginsOptions.specDependencies.USED_BY_SPECS_CLASS, - ROOT_CLASS = this.options.pluginsOptions.specDependencies.DEPENDENCIES_ROOT_CLASS, - HEADER = this.options.pluginsOptions.specDependencies.USED_BY_SPEC_HEAD, - USED_BY_SPEC_HEAD_LINK_CLASS = this.options.pluginsOptions.specDependencies.USED_BY_SPEC_HEAD_LINK_CLASS, + USED_BY_SPECS_CLASS = this.moduleOpts.USED_BY_SPECS_CLASS, + ROOT_CLASS = this.moduleOpts.DEPENDENCIES_ROOT_CLASS, + HEADER = this.moduleOpts.USED_BY_SPEC_HEAD, + USED_BY_SPEC_HEAD_LINK_CLASS = this.moduleOpts.USED_BY_SPEC_HEAD_LINK_CLASS, res = "", header = "", @@ -193,10 +217,12 @@ define([ $('.' + ROOT_CLASS) .append(header + ''); } + + this.emitFinishEvent(); }; SpecDependencies.prototype.turnOnLayout = function() { - var ROOT_CLASS = this.options.pluginsOptions.specDependencies.DEPENDENCIES_ROOT_CLASS, + var ROOT_CLASS = this.moduleOpts.DEPENDENCIES_ROOT_CLASS, SECTION_CLASS = this.options.SECTION_CLASS; if($('.' + ROOT_CLASS).length === 0) { From 8a51386f610ae4421f60d26b855a96d77fb79000 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Sun, 4 Jan 2015 16:18:23 +0100 Subject: [PATCH 02/16] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 72e83bf..cec47da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sourcejs-spec-dependencies", - "version": "0.1.7", + "version": "0.1.8", "description": "Crosslinks of specs", "repository": { "type": "git", From 6c1c5b4ab6495e877a3998dab5368f1668907b31 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Sun, 4 Jan 2015 18:13:48 +0100 Subject: [PATCH 03/16] Adding lost dependency --- .gitignore | 3 ++- package.json | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c81d5b3..7b6d84b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store *.iml -.idea \ No newline at end of file +.idea +node_modules \ No newline at end of file diff --git a/package.json b/package.json index cec47da..0ddd926 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,8 @@ "_id": "sourcejs-spec-dependencies@0.1.0", "_shasum": "42656dba73da3d131b5aa5223c0f8107766f443e", "_resolved": "git://github.com/sourcejs/sourcejs-spec-dependencies#fe9fae410fda7e9ec76db2117613d55fc637faa0", - "_from": "sourcejs-spec-dependencies@git://github.com/sourcejs/sourcejs-spec-dependencies" + "_from": "sourcejs-spec-dependencies@git://github.com/sourcejs/sourcejs-spec-dependencies", + "dependencies": { + "deep-extend": "^0.3.2" + } } From 5401cbebe2e4b508a7157e912e236e8e38975805 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Sun, 4 Jan 2015 18:48:10 +0100 Subject: [PATCH 04/16] Updating misstyped npm modules name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ba4c24..ef25ffd 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Compatible with SourceJS v0.4+. To install, run npm in `sourcejs/user` folder: ``` -npm install sourcejs-spec-status --save +npm install sourcejs-spec-dependencies --save ``` Then run Grunt update in SourceJS root: From d8f24223bdd7ad5747e6cdb7cade0b8057fd5f24 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Sun, 4 Jan 2015 18:51:34 +0100 Subject: [PATCH 05/16] Updating package.json metas --- package.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/package.json b/package.json index 0ddd926..9eed35a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "sourcejs-spec-dependencies", "version": "0.1.8", - "description": "Crosslinks of specs", "repository": { "type": "git", "url": "https://github.com/sourcejs/sourcejs-spec-dependencies" @@ -18,12 +17,6 @@ "url": "https://github.com/sourcejs/sourcejs-spec-dependencies/issues" }, "homepage": "https://github.com/sourcejs/sourcejs-spec-dependencies", - "readme": "Spec Dependencies plugin (crosslinks)", - "readmeFilename": "README.md", - "_id": "sourcejs-spec-dependencies@0.1.0", - "_shasum": "42656dba73da3d131b5aa5223c0f8107766f443e", - "_resolved": "git://github.com/sourcejs/sourcejs-spec-dependencies#fe9fae410fda7e9ec76db2117613d55fc637faa0", - "_from": "sourcejs-spec-dependencies@git://github.com/sourcejs/sourcejs-spec-dependencies", "dependencies": { "deep-extend": "^0.3.2" } From 7c29a9e9291051de98b2b0df24f761cacbb38445 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Sun, 5 Apr 2015 19:16:52 +0200 Subject: [PATCH 06/16] Fixing deprecated API issues for SourceJS 0.5.1 --- assets/css/specDependencies.css | 2 +- assets/index.js | 12 +++++++----- package.json | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/assets/css/specDependencies.css b/assets/css/specDependencies.css index dff7f44..ccda579 100644 --- a/assets/css/specDependencies.css +++ b/assets/css/specDependencies.css @@ -26,7 +26,7 @@ body p.source_deps, .source_deps_used-by-specs, .source_deps_used-specs { - margin-left: -5px !important; + margin: 0 0 0 -5px !important; } .source_deps_used-by-specs > li, diff --git a/assets/index.js b/assets/index.js index 3ec3922..84beccc 100644 --- a/assets/index.js +++ b/assets/index.js @@ -19,9 +19,10 @@ define([ 'jquery', 'sourceModules/module', 'sourceModules/css', - 'sourceModules/parseFileTree', + 'text!/api/specs/raw', + 'text!/api/specs', 'sourceModules/utils' -], function ($, module, Css, pft, utils) { +], function ($, module, Css, fileTree, fileTreeFlat, utils) { function SpecDependencies() { var _this = this; @@ -47,11 +48,12 @@ define([ }, this.options.pluginsOptions.specDependencies); this.moduleOpts = this.options.pluginsOptions.specDependencies; + this.fileTree = JSON.parse(fileTree); + this.fileTreeFlat = JSON.parse(fileTreeFlat); $(function() { _this.init(); }); - } SpecDependencies.prototype = module.createInstance(); @@ -107,7 +109,7 @@ define([ }; SpecDependencies.prototype.getUsedSpecList = function() { - var specPaths = pft.getAllPages(), + var specPaths = this.fileTreeFlat, classList = this.getClassList(), specList = [], currentSpec = this.getCurrentUrlPath(); @@ -231,7 +233,7 @@ define([ }; SpecDependencies.prototype.getTitleOfSpecByUrl = function(url) { - var fileTree = pft.getParsedJSON(), + var fileTree = this.fileTree, urlArr = this.getCurrentUrlPathArray(url), title; diff --git a/package.json b/package.json index 9eed35a..a4d9497 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sourcejs-spec-dependencies", - "version": "0.1.8", + "version": "0.1.9", "repository": { "type": "git", "url": "https://github.com/sourcejs/sourcejs-spec-dependencies" From d1d1fce8f57d1447ea97e4b290b6cdad4197d9d0 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Tue, 7 Apr 2015 10:53:40 +0200 Subject: [PATCH 07/16] Adding Gitter badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ef25ffd..f32f1d3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Spec Dependencies (crosslinks) +[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/sourcejs/Source) + Spec Dependencies is [SourceJS](http://sourcejs.com) plugin for adding crosslinks section into each spec. It predicts used specs through the css selectors used in current spec. ![image](http://monosnap.com/image/gG9KatayyGGg5BxYt3704OIIQHUg0V.png) From 5391c32f990b9426379f36faaf275aa41fd7d677 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Thu, 18 Jun 2015 13:57:55 +0200 Subject: [PATCH 08/16] improve check for options object existence --- assets/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/index.js b/assets/index.js index 84beccc..a10eb44 100644 --- a/assets/index.js +++ b/assets/index.js @@ -29,6 +29,7 @@ define([ var moduleCss = new Css("/node_modules/sourcejs-spec-dependencies/assets/css/specDependencies.css"); + this.options.pluginsOptions = this.options.pluginsOptions || this.options.plugins || {}; this.options.pluginsOptions.specDependencies = $.extend(true, { DEPENDENCIES_ROOT_CLASS: "source_deps", From 878b596c95a363ff3f6798deedbd92a58e69c88e Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Thu, 18 Jun 2015 13:58:29 +0200 Subject: [PATCH 09/16] bump version to 0.1.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a4d9497..38fec99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sourcejs-spec-dependencies", - "version": "0.1.9", + "version": "0.1.10", "repository": { "type": "git", "url": "https://github.com/sourcejs/sourcejs-spec-dependencies" From ffabeaeae45ec495ae25b07b2b79c3e1e915265b Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Thu, 10 Mar 2016 20:10:45 +0100 Subject: [PATCH 10/16] search specs folder by default, update docs --- README.md | 28 ++++++++++++++++++++++++++-- core/index.js | 7 ++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f32f1d3..abeae13 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Spec Dependencies is [SourceJS](http://sourcejs.com) plugin for adding crosslink ![image](http://monosnap.com/image/gG9KatayyGGg5BxYt3704OIIQHUg0V.png) -Compatible with SourceJS v0.4+. +Compatible with SourceJS v0.4.x-0.5.x (not compatible with SourceJS installed as NPM dep). ## Install @@ -22,10 +22,34 @@ Then run Grunt update in SourceJS root: grunt update ``` -After install, entering spec pages you will se prediction box. +or from 0.5.2+ + +``` +npm run build +``` + ## How to use +### Configuration + +By default plugin will parse documentation pages located in `user/specs` folder, to extend the search folder list, update plugin options in `user/options.js`: + +``` +{ + plugins: { + specDependenciesTree: { + includedDirs: ['specs', 'more-specs'] + } + } +} +``` + +This conf will ensure that plugin checks both `user/specs` and `user/more-specs` folders to build the dependency tree. + + +### Manually set spec dependencies + Spec Dependencies automatically predicts all specs, that used in current spec by comparing CSS classes names with existing Spec names. If you also want to see next section to check which specs use current ("this spec used by"), you have to update `info.json` of the specs with "usedSpecs" property. Value of "usedSpecs" should be an array even for only element. ``` diff --git a/core/index.js b/core/index.js index 5705682..bb949c5 100644 --- a/core/index.js +++ b/core/index.js @@ -2,8 +2,10 @@ var fs = require('fs'); var deepExtend = require('deep-extend'); var path = require('path'); +var globalConfig = global.opts.plugins && global.opts.plugins.specDependenciesTree ? global.opts.plugins.specDependenciesTree : {}; + var config = { - includedDirs: [], + includedDirs: ['specs'], outputFile: "data/spec_dependencies_tree.json", // cron @@ -16,8 +18,7 @@ var config = { sourceRoot: global.opts.core.common.pathToUser }; // Overwriting base options -deepExtend(config, global.opts.core.specDependenciesTree); - +deepExtend(config, global.opts.core.specDependenciesTree, globalConfig); var specDependenciesTree = function(dir) { var outputJSON = {}, From 945174ebcd2b8b68be63957939eccdef0916ceeb Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Thu, 10 Mar 2016 20:11:06 +0100 Subject: [PATCH 11/16] bump versiont to v0.1.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 38fec99..617ec49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sourcejs-spec-dependencies", - "version": "0.1.10", + "version": "0.1.11", "repository": { "type": "git", "url": "https://github.com/sourcejs/sourcejs-spec-dependencies" From f80444b0b431128327f33f17b2263b10c670d702 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Tue, 3 May 2016 00:12:21 +0200 Subject: [PATCH 12/16] use namespaced define --- assets/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/index.js b/assets/index.js index a10eb44..2f1c5ac 100644 --- a/assets/index.js +++ b/assets/index.js @@ -15,7 +15,7 @@ window.source.loadEvents.specDepencencies = window.source.loadEvents.specDepence updateEvent: 'specDepencenciesUpdate' }; -define([ +sourcejs.amd.define([ 'jquery', 'sourceModules/module', 'sourceModules/css', From a76e63ae44c9145678d64c6e5e88480528a26090 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Tue, 3 May 2016 00:12:54 +0200 Subject: [PATCH 13/16] get proper user path, clean legacy code --- core/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/index.js b/core/index.js index bb949c5..0590831 100644 --- a/core/index.js +++ b/core/index.js @@ -1,6 +1,9 @@ var fs = require('fs'); var deepExtend = require('deep-extend'); var path = require('path'); +var getUserPath = require(path.join(global.pathToApp, 'core/lib/getUserPath')); + +var userPath = getUserPath(); var globalConfig = global.opts.plugins && global.opts.plugins.specDependenciesTree ? global.opts.plugins.specDependenciesTree : {}; @@ -14,11 +17,10 @@ var config = { cronRepeatTime: 60000, // file from parser get info - infoFile: "info.json", - sourceRoot: global.opts.core.common.pathToUser + infoFile: "info.json" }; // Overwriting base options -deepExtend(config, global.opts.core.specDependenciesTree, globalConfig); +deepExtend(config, globalConfig); var specDependenciesTree = function(dir) { var outputJSON = {}, @@ -47,14 +49,14 @@ var specDependenciesTree = function(dir) { }; var SpecDependenciesWrite = function() { - var outputFile = global.app.get('user') + "/" + config.outputFile; + var outputFile = path.join(userPath, config.outputFile); var outputPath = path.dirname(outputFile); if (!fs.existsSync(outputPath)) { fs.mkdirSync(outputPath); } - fs.writeFile(outputFile, JSON.stringify(specDependenciesTree(config.sourceRoot), null, 4), function (err) { + fs.writeFile(outputFile, JSON.stringify(specDependenciesTree(userPath), null, 4), function (err) { if (err) { console.log('Error writing file tree of dependecies: ', err); } else { From 9964f0b87bf8fc2291481e7187a8a8ae60180eff Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Tue, 3 May 2016 00:13:43 +0200 Subject: [PATCH 14/16] use proper quotes --- core/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/index.js b/core/index.js index 0590831..f368623 100644 --- a/core/index.js +++ b/core/index.js @@ -9,7 +9,7 @@ var globalConfig = global.opts.plugins && global.opts.plugins.specDependenciesTr var config = { includedDirs: ['specs'], - outputFile: "data/spec_dependencies_tree.json", + outputFile: 'data/spec_dependencies_tree.json', // cron cron: false, @@ -17,7 +17,7 @@ var config = { cronRepeatTime: 60000, // file from parser get info - infoFile: "info.json" + infoFile: 'info.json' }; // Overwriting base options deepExtend(config, globalConfig); @@ -33,7 +33,7 @@ var specDependenciesTree = function(dir) { var pathToInfo = dir + '/' + includedDir + '/' + specDir; if (fs.existsSync(pathToInfo + '/' + config.infoFile)) { - var fileJSON = JSON.parse(fs.readFileSync(pathToInfo + '/' + config.infoFile, "utf8")); + var fileJSON = JSON.parse(fs.readFileSync(pathToInfo + '/' + config.infoFile, 'utf8')); if (fileJSON['usedSpecs']) { fileJSON['usedSpecs'].forEach(function(usedSpec){ @@ -60,7 +60,7 @@ var SpecDependenciesWrite = function() { if (err) { console.log('Error writing file tree of dependecies: ', err); } else { - console.log("Spec dependencies JSON saved to " + outputFile); + console.log('Spec dependencies JSON saved to ' + outputFile); } }); }; From 4b2deb93a8a6fa5e26a5f093f60b067dd6b9acf6 Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Tue, 3 May 2016 00:14:18 +0200 Subject: [PATCH 15/16] update readme with new compat version and changes --- README.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index abeae13..6156b4b 100644 --- a/README.md +++ b/README.md @@ -6,34 +6,24 @@ Spec Dependencies is [SourceJS](http://sourcejs.com) plugin for adding crosslink ![image](http://monosnap.com/image/gG9KatayyGGg5BxYt3704OIIQHUg0V.png) -Compatible with SourceJS v0.4.x-0.5.x (not compatible with SourceJS installed as NPM dep). +Compatible with SourceJS 0.6.x. For older versions use `0.1.x` branch. ## Install -To install, run npm in `sourcejs/user` folder: +To install, run npm in SourceJS project folder: ``` npm install sourcejs-spec-dependencies --save ``` -Then run Grunt update in SourceJS root: - -``` -grunt update -``` - -or from 0.5.2+ - -``` -npm run build -``` +Restart the app, and you're ready to go. ## How to use ### Configuration -By default plugin will parse documentation pages located in `user/specs` folder, to extend the search folder list, update plugin options in `user/options.js`: +By default plugin will parse documentation pages located in `/specs` folder, to extend the search folder list, update plugin options in `/options.js`: ``` { @@ -45,7 +35,7 @@ By default plugin will parse documentation pages located in `user/specs` folder, } ``` -This conf will ensure that plugin checks both `user/specs` and `user/more-specs` folders to build the dependency tree. +This conf will ensure that plugin checks both `/specs` and `/more-specs` folders to build the dependency tree. ### Manually set spec dependencies From fff9ed0994da1964e7b886638c5a516f920f8e9c Mon Sep 17 00:00:00 2001 From: Robert Haritonov Date: Tue, 3 May 2016 00:14:32 +0200 Subject: [PATCH 16/16] bump version to 0.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 617ec49..c31cf0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sourcejs-spec-dependencies", - "version": "0.1.11", + "version": "0.2.0", "repository": { "type": "git", "url": "https://github.com/sourcejs/sourcejs-spec-dependencies"