This repository has been archived by the owner on Sep 14, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only minimal changes to make tests and lint pass.
- Loading branch information
1 parent
861ecdc
commit 6cff2f3
Showing
46 changed files
with
2,949 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test/precache-data/* | ||
test/analyzer-data/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- | ||
If you are asking a question rather than filing a bug, you'll get better results | ||
using one of these instead: | ||
- Stack Overflow (http://stackoverflow.com/questions/tagged/polymer) | ||
- Polymer Slack Channel (https://bit.ly/polymerslack) | ||
- Mailing List (https://groups.google.com/forum/#!forum/polymer-dev) | ||
--> | ||
|
||
<!-- Instructions For Filing a Bug: https://github.com/Polymer/polymer/blob/master/CONTRIBUTING.md#filing-bugs --> | ||
|
||
### Description | ||
<!-- Example: Build failure when loading scripts from CDNs --> | ||
|
||
### Versions & Environment | ||
<!-- | ||
`npm list` will the version of polymer-build | ||
`node --version` will show the version for node | ||
--> | ||
- polymer-build: | ||
- node: | ||
- Operating System: | ||
|
||
#### Steps to Reproduce | ||
|
||
#### Expected Results | ||
<!-- Example: No error is throw --> | ||
|
||
#### Actual Results | ||
<!-- Example: Error is thrown --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,6 @@ | ||
# Logs | ||
logs | ||
*.log | ||
.DS_Store | ||
.vscode | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
node_modules/ | ||
lib/ | ||
typings/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: node_js | ||
node_js: | ||
- "6" | ||
- "5" | ||
- "4" | ||
sudo: false | ||
before_script: | ||
- npm install | ||
- npm run init | ||
- npm run build | ||
script: | ||
- npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Test against this version of Node.js | ||
environment: | ||
nodejs_version: "4.4.4" | ||
|
||
# Install scripts. (runs after repo cloning) | ||
install: | ||
# Get the latest stable version of Node.js or io.js | ||
- ps: Install-Product node $env:nodejs_version | ||
# install modules | ||
- npm install | ||
|
||
# Post-install test scripts. | ||
test_script: | ||
# Output useful info for debugging. | ||
- node --version | ||
- npm --version | ||
# run tests | ||
- npm run test | ||
|
||
# Don't actually build. | ||
build: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module 'fs-extra' { | ||
export function copySync(source: string, dest: string); | ||
export function readdirSync(path: string): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
declare module 'hydrolysis' { | ||
import {Node} from 'dom5'; | ||
interface Options { | ||
filter?: (path: string) => boolean; | ||
} | ||
interface Element { | ||
is: string; | ||
contentHref: string; | ||
desc?: string; | ||
} | ||
interface Behavior { | ||
is: string; | ||
contentHref: string; | ||
desc?: string; | ||
} | ||
|
||
/** | ||
* The metadata for all features and elements defined in one document | ||
*/ | ||
interface DocumentDescriptor { | ||
/** | ||
* The elements from the document. | ||
*/ | ||
// elements: ElementDescriptor[]; | ||
|
||
/** | ||
* The features from the document | ||
*/ | ||
// features: FeatureDescriptor[]; | ||
|
||
/** | ||
* The behaviors from the document | ||
*/ | ||
// behaviors: BehaviorDescriptor[]; | ||
|
||
href?: string; | ||
|
||
imports?: DocumentDescriptor[]; | ||
|
||
// parsedScript?: estree.Program; | ||
|
||
html?: { | ||
script: Node[], | ||
style: Node[], | ||
ast: Node | ||
}; | ||
} | ||
|
||
/** | ||
* The metadata of an entire HTML document, in promises. | ||
*/ | ||
interface AnalyzedDocument { | ||
/** | ||
* The url of the document. | ||
*/ | ||
href: string; | ||
/** | ||
* The parsed representation of the doc. Use the `ast` property to get | ||
* the full `parse5` ast. | ||
*/ | ||
// htmlLoaded: Promise<ParsedImport>; | ||
|
||
/** | ||
* Resolves to the list of this Document's transitive import dependencies. | ||
*/ | ||
depsLoaded: Promise<string[]>; | ||
|
||
/** | ||
* The direct dependencies of the document. | ||
*/ | ||
depHrefs: string[]; | ||
/** | ||
* Resolves to the list of this Document's import dependencies | ||
*/ | ||
metadataLoaded: Promise<DocumentDescriptor>; | ||
} | ||
|
||
export class Analyzer { | ||
static analyze(path: string, options: Options): Promise<Analyzer>; | ||
|
||
constructor(attachAST: boolean, loader: Loader); | ||
|
||
metadataTree(path: string): Promise<DocumentDescriptor>; | ||
annotate(): void; | ||
elements: Element[]; | ||
behaviors: Behavior[]; | ||
html: {[path: string]: AnalyzedDocument}; | ||
parsedDocuments: {[path: string]: Node}; | ||
|
||
load(href: string):Promise<AnalyzedDocument>; | ||
|
||
_getDependencies( | ||
href: string, | ||
found?: {[url:string]: boolean}, | ||
transitive?: boolean) | ||
: Promise<string[]> | ||
} | ||
// } | ||
// declare module 'hydrolysis/loader/resolver' { | ||
export class Deferred<T> { | ||
promise: Promise<T>; | ||
resolve: (val:(T|PromiseLike<T>))=>void; | ||
reject: (err:any)=>void; | ||
} | ||
|
||
/** | ||
* An object that knows how to resolve resources. | ||
*/ | ||
export interface Resolver { | ||
/** | ||
* Attempt to resolve `deferred` with the contents the specified URL. Returns | ||
* false if the Resolver is unable to resolve the URL. | ||
*/ | ||
accept(path:string, deferred:Deferred<string>):boolean; | ||
} | ||
|
||
class FSResolver implements Resolver { | ||
constructor(options: any); | ||
accept(path:string, deferred:Deferred<string>):boolean; | ||
} | ||
|
||
export class Loader { | ||
resolvers: Resolver[]; | ||
addResolver(resolver:Resolver): void; | ||
request(uri:string): Promise<string>; | ||
} | ||
} |
Oops, something went wrong.