Large diffs are not rendered by default.

@@ -0,0 +1,5 @@
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
@@ -0,0 +1,38 @@
[![NPM version](http://img.shields.io/npm/v/hydrolysis.svg)](https://npmjs.org/package/hydrolysis)
[![Build Status](https://travis-ci.org/Polymer/hydrolysis.svg?branch=master)](https://travis-ci.org/Polymer/hydrolysis)
# hydrolysis

Static analysis utilities for polymer.

## Install
```
npm install hydrolysis
```

## Usage
```js
var hyd = require('hydrolysis');
hyd.Analyzer.analyze('path-to-polymer-element.html')
.then(function(analyzer) {
console.log(analyzer.elementsByTagName['my-element'])
});
```

For more detail, see the [API Docs](API.md).


## Developing
You need [wct](https://github.com/Polymer/web-component-tester) to run the tests.

Run a one-off build of the project:

```sh
npm run build
```

Or watch the source for changes, and rebuild each time a file is modified:

```sh
npm run watch
```
@@ -0,0 +1,23 @@
{
"name": "hydrolysis",
"main": "hydrolysis.js",
"ignore": [
"lib/",
"examples/",
"demo/",
"test/",
".gitignore",
"gulpfile.js",
"package.json"
],
"repository": {
"type": "git",
"url": "git://github.com/Polymer/hydrolysis.git"
},
"devDependencies": {
"polymer": "Polymer/polymer#^0.9.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*"
},
"version": "1.21.4"
}
@@ -0,0 +1,114 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="hydrolysis.html">

<script>
(function() {
var hydrolysis = require('hydrolysis');

Polymer({

is: 'hydrolysis-analyzer',

properties: {

/**
* The URL to an import that declares (or transitively imports) the
* elements that you wish to see analyzed.
*
* If the URL is relative, it will be resolved relative to the master
* document.
*
* If you change this value after the `<hydrolysis-analyzer>` has been
* instantiated, you must call `analyze()`.
*/
src: {
type: String,
},

/**
* Whether _all_ dependencies should be loaded and analyzed.
*
* Turning this on will probably slow down the load process dramatically.
*/
transitive: {
type: Boolean,
},

/**
* Whether the hydrolysis descriptors should be cleaned of redundant
* properties.
*/
clean: {
type: Boolean,
},

/** The resultant `Analyzer` object from Hydrolysis. */
analyzer: {
type: Object,
readOnly: true,
notify: true,
},

/** Whether the analyzer is loading/analyzing resources. */
loading: {
type: Boolean,
readOnly: true,
notify: true,
},

},

ready: function() {
this.analyze();
},

/**
* Begins loading the imports referenced by `src`.
*
* If you make changes to this element's configuration, you must call this
* function to kick off another analysis pass.
*/
analyze: function() {
if (!this.src) {
return;
}
// We can implement request cancellation when someone needs it.
if (this.loading) {
console.error('Analyzer is already loading a document:', this);
return;
}
this._setLoading(true);

var options = {
clean: this.clean,
filter: this.transitive ? function() { return false; } : null,
attachAst: true,
};

var baseUri = this.ownerDocument.baseURI;
var srcUrl = new URL(this.src, baseUri).toString();
hydrolysis.Analyzer.analyze(srcUrl, options).then(function(analyzer) {
this._setLoading(false);
this._setAnalyzer(analyzer);
}.bind(this))
.catch(function(error) {
console.error('Failed to load source at:', this.src, error);
console.error(error.stack);
this._setLoading(false);
this._setAnalyzer(null);
}.bind(this));
},

});

})();
</script>
@@ -0,0 +1,10 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<script src="hydrolysis.js"></script>

Large diffs are not rendered by default.

@@ -0,0 +1,29 @@
/**
* @license
* Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
/*jslint node: true */
'use strict';

/**
* Static analysis for Polymer.
* @namespace hydrolysis
*/
module.exports = {
Analyzer: require('./lib/analyzer'),
docs: require('./lib/ast-utils/docs'),
FSResolver: require('./lib/loader/fs-resolver'),
jsdoc: require('./lib/ast-utils/jsdoc'),
Loader: require('./lib/loader/file-loader'),
NoopResolver: require('./lib/loader/noop-resolver'),
RedirectResolver: require('./lib/loader/redirect-resolver'),
XHRResolver: require('./lib/loader/xhr-resolver'),
StringResolver: require('./lib/loader/string-resolver'),
_jsParse: require('./lib/ast-utils/js-parse'),
_importParse: require('./lib/ast-utils/import-parse'),
};
@@ -30,14 +30,14 @@
"web-component-tester": "polymer/web-component-tester#^3.4.0"
},
"ignore": [],
"homepage": "https://github.com/polymerelements/iron-a11y-announcer",
"homepage": "https://github.com/PolymerElements/iron-a11y-announcer",
"_release": "1.0.4",
"_resolution": {
"type": "version",
"tag": "v1.0.4",
"commit": "5ce3eb8c4282bb53cd72e348858dc6be6b4c50b9"
},
"_source": "git://github.com/polymerelements/iron-a11y-announcer.git",
"_source": "git://github.com/PolymerElements/iron-a11y-announcer.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-a11y-announcer"
"_originalSource": "PolymerElements/iron-a11y-announcer"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -30,14 +30,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"ignore": [],
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
"homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior",
"_release": "1.1.0",
"_resolution": {
"type": "version",
"tag": "v1.1.0",
"commit": "cd8c972278c0d916bef57209d7dce5b81e67687c"
},
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
"_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-a11y-keys-behavior"
"_originalSource": "polymerelements/iron-a11y-keys-behavior"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -42,7 +42,7 @@
"tag": "v1.1.0",
"commit": "b09b0d57ba917bac9315de4761373d88e85ac52e"
},
"_source": "git://github.com/polymerelements/iron-dropdown.git",
"_source": "git://github.com/PolymerElements/iron-dropdown.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-dropdown"
"_originalSource": "PolymerElements/iron-dropdown"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.