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 node | |
const fs = require('fs'); | |
const sass = require('sass'); | |
const path = require('path'); | |
const pathToFileURL = require('url').pathToFileURL; | |
const CWD = process.cwd(); | |
const nodeModulesPath = path.join(CWD, 'node_modules'); | |
const SRC_PATH = process.argv[2]; // /home/user/project/src |
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 ts-node | |
import * as fs from 'fs' | |
import * as path from 'path' | |
import * as glob from 'glob' | |
const CWD = process.cwd() | |
// describe coverage-final.json file | |
type Statement = { |
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 node | |
const fs = require('fs'); | |
const path = require('path'); | |
const CWD = process.cwd(); | |
const EXTENSIONS = /\.(scss)$/; | |
const SASS_DATA = "@use '~@talend/bootstrap-theme/src/theme/guidelines' as *;\n"; | |
function transform(filename) { |
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 program = require('commander'); | |
const fs = require('fs'); | |
const tmp = require('tmp-promise'); | |
const PNG = require('pngjs').PNG; | |
const pixelmatch = require('pixelmatch'); | |
const puppeteer = require('puppeteer'); | |
program | |
.option('-p, --pullrequest [pr]', 'Pull request') | |
.option('-c, --config [config]', 'JSON config 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
const os = require('os'); | |
const fs = require('fs'); | |
const versions = require('./versions.json'); | |
function updatePart(dependencies) { | |
Object.keys(dependencies).forEach(dep => { | |
if (versions[dep]) { | |
dependencies[dep] = versions[dep]; | |
} | |
}) |
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 React from 'react'; | |
export default function WebComponent({ component, ...props }) { | |
const [myEl, setState] = React.useState(document.createElement(component)); | |
const el = React.useRef(null); | |
React.useEffect(() => { | |
if (myEl.tagName.toLowerCase() !== component.toLowerCase() ) { | |
setState(document.createElement(component)); | |
} else { | |
Object.keys(props).forEach(key => { |
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
/** | |
* IMPORTANT NOTE. | |
* Because react use synthetic event we have to patch the shadowDOM | |
* The following patch has to be applied just after the attachShadow | |
* and you must ban the use document.createElement. Use shadowRoot.createElement instead. | |
* Source: https://github.com/facebook/react/issues/9242 | |
*/ | |
function changeOwnerDocumentToShadowRoot(element, shadowRoot) { | |
Object.defineProperty(element, 'ownerDocument', {value: shadowRoot}); | |
} |
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 node | |
// parse webapp using cmf.json to extract all components | |
// generate for each component the lazy one | |
// To use it just download it in your cmf webapp folder and execute it | |
const mkdirp = require('mkdirp'); | |
const fs = require('fs'); | |
const CONFIG_PATH = './lazyroutes.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
#!/usr/bin/env node | |
const fs = require('fs'); | |
const settings = require(process.argv[2]); | |
if (!settings.props) { | |
console.log('no props in this file'); | |
process.exit(); | |
} | |
const extra = Object.keys(settings).filter(key => key !== 'props'); |