This file contains hidden or 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'); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| /** | |
| * Run `node css.js` from this package root to compile every `*.module.scss` to a sibling `*.module.css` and rewrite imports accordingly. | |
| * | |
| * - Scans the package for `*.module.scss` files (ignoring node_modules, lib, lib-esm, .turbo, .git, dist, build, etc.). | |
| * - Compiles each of them with `sass` into a `*.module.css` that sits in the same folder. | |
| * - Updates `.js`, `.jsx`, `.ts`, and `.tsx` files so `.module.scss` imports point to the new `.module.css` files. | |
| * - Optionally deletes the original `*.module.scss` files after successful compilation (use --delete flag). | |
| * | |
| * Usage: | |
| * node css.js # Compile and update imports (keep .scss files) |
This file contains hidden or 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
| git config --global alias.lol "log --graph --pretty=format:'%s' --abbrev-commit" |
OlderNewer