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
const JSX = { | |
createElement(name: string, props: { [id: string]: string }, ...content: string[]) { | |
props = props || {}; | |
const propsstr = Object.keys(props) | |
.map(key => { | |
const value = props[key]; | |
if (key === "className") return `class="${value}"`; | |
else return `${key}="${value}"`; | |
}) | |
.join(" "); |
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
/** | |
* __EXAMPLE__ | |
* <element-name> | |
* <span slot="slot-1">Projected content</span> | |
* </element-name> | |
*/ | |
const HTMLTemplate = ` | |
<style></style> | |
<slot name="slot-1">Default content</slot> |
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
angular.module('webComponents', []). | |
directive('bindWebComponent', ['$parse', function ($parse) { | |
return { | |
restrict: 'A', | |
scope: false, | |
compile: function bindWebComponentCompile($element, $attr) { | |
var attrMap = {}; | |
for (var prop in $attr) { | |
var dash_prop = prop. |
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
async function request (endpoint, options = {}) { | |
const response = await fetch(endpoint, { | |
headers: { | |
Accept: 'application/json, text/plain, */*', | |
'Content-Type': 'application/json', | |
}, | |
...options, | |
}); | |
return response.json(); |
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
### STAGE 0: Build ### | |
FROM node:8.9.0 as builder | |
RUN mkdir -p /home/app | |
WORKDIR /home/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . ./ | |
RUN npm run lint | |
RUN npm run test:ci | |
RUN npm run build --prod |