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
#!/usr/bin/env bash | |
## Usage: shellcheck.sh [fix] [path to file] | |
# name of all the directories that should be ignored | |
IGNORED_DIR_NAMES=("node_modules" "venv" "reports") | |
# find options for ignoring directories | |
IGNORE_PARAM=$(for i in "${!IGNORED_DIR_NAMES[@]}"; do | |
echo -n "-name ${IGNORED_DIR_NAMES[$i]} "; |
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
/******** | |
Convert chai-dom 1.8.1 to es module, without any other modification. | |
From https://github.com/nathanboktae/chai-dom/blob/86c3423/chai-dom.js | |
See https://github.com/nathanboktae/chai-dom/issues/38 | |
Usage: | |
import { chaiDom } from '<path-to>/chai-dom'; | |
chai.use(chaiDom); |
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 fs = require('fs'); | |
const glob = require('glob'); | |
const terser = require('terser'); | |
// use glob in order to list all files we want to minify | |
const files = glob.sync('./lib/**.js'); | |
files.forEach(filePath => { | |
// get the unminified script content | |
let data = fs.readFileSync(filePath, 'utf-8'); |
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
import resolve from 'rollup-plugin-node-resolve'; | |
import commonjs from 'rollup-plugin-commonjs'; | |
export default [ | |
// es2017 standalone bundle | |
{ | |
input: 'src/hello-element.js', | |
output: { | |
file: `lib/hello-element.bundle.js`, | |
format: 'iife', |
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
import resolve from 'rollup-plugin-node-resolve'; | |
import commonjs from 'rollup-plugin-commonjs'; | |
export default [ | |
// esm + es2017 w/o lit-element | |
{//...}, | |
// lit-element bundle | |
{ | |
input: 'node_modules/lit-element/lit-element.js', |
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
export default { | |
input: 'src/hello-element.js', | |
// exclude lit-element dependency | |
external: ['lit-element'], | |
output: { | |
file: `lib/hello-element.esm.js`, | |
// keep ES Module format | |
format: 'es', | |
// rewrite bare module specifier to a relative path | |
paths: { |
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
/* Lit-element simply re-exports lit-html 'html' tag so that you don't have | |
* to care about it. | |
* See https://github.com/Polymer/lit-element/blob/v2.0.1/src/lit-element.ts#L21 | |
*/ | |
import { LitElement, html } from 'lit-element'; | |
class HelloElement extends LitElement { | |
constructor() { | |
this.name = 'John'; |
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
{ | |
... | |
"type": "object", | |
"properties": {...}, | |
"additionalProperties": false, | |
"required": ["version"], | |
... | |
} |
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
{ | |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | |
"version": 1, | |
"newProjectRoot": "projects", | |
"projects": { | |
"angular-cli-deep-dive": {... | |
}, | |
"angular-cli-deep-dive-e2e": {... | |
} | |
}, |
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
{ | |
... | |
"properties": { | |
... | |
"newProjectRoot": { | |
"type": "string", | |
"description": "Path where new projects will be created." | |
}, | |
... | |
}, |
NewerOlder