Permalink
Browse files

Update assetgraph version

  • Loading branch information...
1 parent 6323015 commit 0adce0384e73777edde82d8bc7815c9af1be805c @Munter committed Aug 25, 2016
Showing with 20 additions and 9 deletions.
  1. +1 −5 bin/assetviz
  2. +16 −1 index.js
  3. +3 −3 package.json
View
@@ -73,10 +73,7 @@ if (!rootUrl && inputUrls.length === 1) {
var AssetGraph = require('assetgraph'),
query = AssetGraph.query,
followRelationsQueryObj = query.not({
- type: 'HtmlAnchor',
- to: {
- url: /^https?:/
- }
+ type: 'HtmlAnchor'
}),
assetviz = require('../index.js'),
chalk = require('chalk');
@@ -92,7 +89,6 @@ new AssetGraph({root: rootUrl})
console.warn(chalk.green('') + asset.url);
}
})
- .registerRequireJsConfig()
.loadAssets(inputUrls)
.populate({followRelations: followRelationsQueryObj})
.queue(function fixBaseAssetsOfUnresolvedOutgoingRelationsFromHtmlFragments(assetGraph) {
View
@@ -86,10 +86,25 @@ module.exports = function (config) {
assetGraph.findRelations(undefined, true).forEach(function (relation) {
if (verbose || ('idx' in relation.from && 'idx' in relation.to)) {
- var typeString = relationLabelByType[relation.type] || '';
+ var typeString = relationLabelByType[relation.type] || relation.type;
if (typeof typeString === 'function') {
typeString = typeString(relation);
}
+
+ if (typeof relation.to.idx === 'undefined') {
+ relation.to.idx = idx;
+ data.assets.push({
+ path: relation.crossorigin ? relation.to.url : Path.relative(assetGraph.root, relation.to.url),
+ fileName: (relation.to.url ? relation.to.url : 'i:' + relation.to).replace(/"/g, '\\"'),
+ type: relation.to.type && relation.to.type.toLowerCase(),
+ size: 0,
+ r: 3,
+ outgoing: 0,
+ initial: relation.to.isInitial
+ });
+ idx += 1;
+ }
+
data.assets[relation.from.idx].outgoing += 1;
data.relations.push({
source: relation.from.idx,
View
@@ -20,10 +20,10 @@
"author": "Peter Müller <munter@fumle.dk>",
"license": "MIT",
"dependencies": {
- "assetgraph": "^1.23.1",
- "chalk": "1.1.1",
+ "assetgraph": "^2.14.0",
+ "chalk": "^1.1.3",
"optimist": "0.6.1",
- "urltools": "0.2.0"
+ "urltools": "^0.2.1"
},
"bin": "./bin/assetviz"
}

0 comments on commit 0adce03

Please sign in to comment.