зеркало из https://github.com/github/lit-html.git
Re-organize files so lit-html.js is at the top-level of the package
This commit is contained in:
Родитель
6599e8fb26
Коммит
c2a1e0914a
|
@ -1,4 +1,15 @@
|
|||
lib/
|
||||
/node_modules/
|
||||
/lib/
|
||||
|
||||
# Compiler output
|
||||
/lit-html.d.ts
|
||||
/lit-html.js
|
||||
/lit-html.js.map
|
||||
/test/**/*.d.ts
|
||||
/test/**/*.js
|
||||
/test/**/*.js.map
|
||||
|
||||
yarn.lock
|
||||
|
||||
# Logs
|
||||
logs
|
||||
|
@ -13,48 +24,5 @@ pids
|
|||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# 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
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"name": "lit-html",
|
||||
"version": "0.1.0",
|
||||
"version": "0.4.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@types/chai": {
|
||||
"version": "4.0.1",
|
||||
|
@ -12,7 +13,8 @@
|
|||
"@types/mocha": {
|
||||
"version": "2.2.41",
|
||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.41.tgz",
|
||||
"integrity": "sha1-4nzwgXFT658nE7LT9saPHhw8pgg="
|
||||
"integrity": "sha1-4nzwgXFT658nE7LT9saPHhw8pgg=",
|
||||
"dev": true
|
||||
},
|
||||
"assertion-error": {
|
||||
"version": "1.0.2",
|
||||
|
@ -30,7 +32,11 @@
|
|||
"version": "1.1.8",
|
||||
"resolved": "http://35.185.235.147/brace-expansion/-/brace-expansion-1.1.8.tgz",
|
||||
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"browser-stdout": {
|
||||
"version": "1.3.0",
|
||||
|
@ -42,7 +48,15 @@
|
|||
"version": "4.0.2",
|
||||
"resolved": "http://35.185.235.147/chai/-/chai-4.0.2.tgz",
|
||||
"integrity": "sha1-L3MnxN5vOF3XeHmZ4qsCaXoyuDs=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"assertion-error": "1.0.2",
|
||||
"check-error": "1.0.2",
|
||||
"deep-eql": "2.0.2",
|
||||
"get-func-name": "2.0.0",
|
||||
"pathval": "1.1.0",
|
||||
"type-detect": "4.0.3"
|
||||
}
|
||||
},
|
||||
"check-error": {
|
||||
"version": "1.0.2",
|
||||
|
@ -54,7 +68,10 @@
|
|||
"version": "2.9.0",
|
||||
"resolved": "http://35.185.235.147/commander/-/commander-2.9.0.tgz",
|
||||
"integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-readlink": "1.0.1"
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
|
@ -66,13 +83,19 @@
|
|||
"version": "2.6.0",
|
||||
"resolved": "http://35.185.235.147/debug/-/debug-2.6.0.tgz",
|
||||
"integrity": "sha1-vFlryr52F/Edn6FTYe3tVgi4SZs=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "0.7.2"
|
||||
}
|
||||
},
|
||||
"deep-eql": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "http://35.185.235.147/deep-eql/-/deep-eql-2.0.2.tgz",
|
||||
"integrity": "sha1-sbrAblbwp2d3aG1Qyf63XC7XZ5o=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"type-detect": "3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"type-detect": {
|
||||
"version": "3.0.0",
|
||||
|
@ -110,7 +133,15 @@
|
|||
"version": "7.1.1",
|
||||
"resolved": "http://35.185.235.147/glob/-/glob-7.1.1.tgz",
|
||||
"integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "1.0.0",
|
||||
"inflight": "1.0.6",
|
||||
"inherits": "2.0.3",
|
||||
"minimatch": "3.0.4",
|
||||
"once": "1.4.0",
|
||||
"path-is-absolute": "1.0.1"
|
||||
}
|
||||
},
|
||||
"graceful-readlink": {
|
||||
"version": "1.0.1",
|
||||
|
@ -134,7 +165,11 @@
|
|||
"version": "1.0.6",
|
||||
"resolved": "http://35.185.235.147/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"once": "1.4.0",
|
||||
"wrappy": "1.0.2"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
|
@ -152,7 +187,11 @@
|
|||
"version": "3.2.0",
|
||||
"resolved": "http://35.185.235.147/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz",
|
||||
"integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lodash._basecopy": "3.0.1",
|
||||
"lodash.keys": "3.1.2"
|
||||
}
|
||||
},
|
||||
"lodash._basecopy": {
|
||||
"version": "3.0.1",
|
||||
|
@ -182,7 +221,12 @@
|
|||
"version": "3.1.1",
|
||||
"resolved": "http://35.185.235.147/lodash.create/-/lodash.create-3.1.1.tgz",
|
||||
"integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lodash._baseassign": "3.2.0",
|
||||
"lodash._basecreate": "3.0.3",
|
||||
"lodash._isiterateecall": "3.0.9"
|
||||
}
|
||||
},
|
||||
"lodash.isarguments": {
|
||||
"version": "3.1.0",
|
||||
|
@ -200,13 +244,21 @@
|
|||
"version": "3.1.2",
|
||||
"resolved": "http://35.185.235.147/lodash.keys/-/lodash.keys-3.1.2.tgz",
|
||||
"integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lodash._getnative": "3.9.1",
|
||||
"lodash.isarguments": "3.1.0",
|
||||
"lodash.isarray": "3.0.4"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "http://35.185.235.147/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "1.1.8"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
|
@ -218,13 +270,29 @@
|
|||
"version": "0.5.1",
|
||||
"resolved": "http://35.185.235.147/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
},
|
||||
"mocha": {
|
||||
"version": "3.4.2",
|
||||
"resolved": "http://35.185.235.147/mocha/-/mocha-3.4.2.tgz",
|
||||
"integrity": "sha1-0O9NMyEm2/GNDWQMmzgt1IvpdZQ=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"browser-stdout": "1.3.0",
|
||||
"commander": "2.9.0",
|
||||
"debug": "2.6.0",
|
||||
"diff": "3.2.0",
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"glob": "7.1.1",
|
||||
"growl": "1.9.2",
|
||||
"json3": "3.3.2",
|
||||
"lodash.create": "3.1.1",
|
||||
"mkdirp": "0.5.1",
|
||||
"supports-color": "3.1.2"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "0.7.2",
|
||||
|
@ -236,7 +304,10 @@
|
|||
"version": "1.4.0",
|
||||
"resolved": "http://35.185.235.147/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1.0.2"
|
||||
}
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
|
@ -254,7 +325,10 @@
|
|||
"version": "3.1.2",
|
||||
"resolved": "http://35.185.235.147/supports-color/-/supports-color-3.1.2.tgz",
|
||||
"integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "1.0.0"
|
||||
}
|
||||
},
|
||||
"type-detect": {
|
||||
"version": "4.0.3",
|
||||
|
|
10
package.json
10
package.json
|
@ -4,8 +4,8 @@
|
|||
"description": "HTML template literals in JavaScript",
|
||||
"license": "BSD-3-Clause",
|
||||
"repository": "PolymerLabs/lit-html",
|
||||
"main": "lib/lit-html.js",
|
||||
"module": "lib/lit-html.js",
|
||||
"main": "lit-html.js",
|
||||
"module": "lit-html.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
|
@ -16,12 +16,10 @@
|
|||
"author": "The Polymer Authors",
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.0.1",
|
||||
"@types/mocha": "^2.2.41",
|
||||
"chai": "^4.0.2",
|
||||
"mocha": "^3.4.2",
|
||||
"typescript": "^2.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/mocha": "^2.2.41"
|
||||
},
|
||||
"typings": "./lib/lit-html.d.ts"
|
||||
"typings": "./lit-html.d.ts"
|
||||
}
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
# lit-html Labs
|
||||
Add-ons for lit-html
|
||||
|
||||
## lit-extended.ts
|
||||
|
||||
An example of extending lit-html via a custom `TemplateInstance` subclasses.
|
||||
|
||||
The `render` function exported by `lit-extended.ts` supports setting properties
|
||||
and event handlers in templates:
|
||||
|
||||
```javascript
|
||||
import {render} from '../lit-html/lib/labs/lit-extended.js';
|
||||
|
||||
function t = (data) => html`
|
||||
<button
|
||||
class$="${data.isPrimary ? 'primary' : 'secondary'}"
|
||||
on-click="${()=>data.onClick}">
|
||||
${data.label}
|
||||
</button>
|
||||
<!-- property and event names are case-sensitive -->
|
||||
<my-element someProperty=${data.someProperty}></my-element>
|
||||
`;
|
||||
```
|
||||
|
||||
## repeat.ts
|
||||
|
||||
Implements a keyed-repeat that reuses DOM generated for items when possible.
|
||||
|
||||
```javascript
|
||||
import {repeat} from '../lit-html/lib/labs/repeat.js';
|
||||
|
||||
function t = (data) => html`
|
||||
<ul>
|
||||
${repeat(data, (d) => d.id, (d) => html`
|
||||
<li>${d.title}</li>
|
||||
`)}
|
||||
</ul>
|
||||
`;
|
||||
```
|
|
@ -16,7 +16,7 @@
|
|||
/// <reference path="../../../node_modules/@types/chai/index.d.ts" />
|
||||
|
||||
import {html, render as renderPlain} from '../../lit-html.js';
|
||||
import {render} from '../../labs/lit-extended.js';
|
||||
import {render} from '../../lib/lit-extended.js';
|
||||
|
||||
const assert = chai.assert;
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
/// <reference path="../../../node_modules/@types/chai/index.d.ts" />
|
||||
|
||||
import {html, NodePart, TemplateInstance} from '../../lit-html.js';
|
||||
import {repeat} from '../../labs/repeat.js';
|
||||
import {repeat} from '../../lib/repeat.js';
|
||||
|
||||
const assert = chai.assert;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
/// <reference path="../../../node_modules/@types/mocha/index.d.ts" />
|
||||
/// <reference path="../../../node_modules/@types/chai/index.d.ts" />
|
||||
|
||||
import {until} from '../../labs/until.js';
|
||||
import {until} from '../../lib/until.js';
|
||||
import {html, render} from '../../lit-html.js';
|
||||
|
||||
const assert = chai.assert;
|
|
@ -10,10 +10,10 @@
|
|||
</head>
|
||||
<body>
|
||||
<div id="mocha"></div>
|
||||
<script type="module" src="../lib/test/lit-html_test.js"></script>
|
||||
<script type="module" src="../lib/test/labs/repeat_test.js"></script>
|
||||
<script type="module" src="../lib/test/labs/until_test.js"></script>
|
||||
<script type="module" src="../lib/test/labs/lit-extended_test.js"></script>
|
||||
<script type="module" src="./lit-html_test.js"></script>
|
||||
<script type="module" src="./lib/repeat_test.js"></script>
|
||||
<script type="module" src="./lib/until_test.js"></script>
|
||||
<script type="module" src="./lib/lit-extended_test.js"></script>
|
||||
<script type="module">
|
||||
mocha.run();
|
||||
</script>
|
||||
|
|
|
@ -1,56 +1,20 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
|
||||
"module": "es2015", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
|
||||
"lib": ["es2017", "dom"], /* Specify library files to be included in the compilation: */
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
"sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||
"target": "es2017",
|
||||
"module": "es2015",
|
||||
"lib": ["es2017", "dom"],
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"outDir": "./",
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
// "noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
/* Additional Checks */
|
||||
"noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
"noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
]
|
||||
],
|
||||
"exclude": []
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче