toc[key].forEach(item => { console.log(`### ${item.name}`) console.log(item.desc) console.log('\n') console.log(`[${item.relative}](${item.url.replace(/ /g, '%20')})`) })
const genChunkName = (context, component) => { const chunkName = path.relative(context, component) .split('/') .filter(s => s !== '..') .map(s => kebabCase(s)) .join('--') return `vue-remark--${chunkName}` }
function hotReloadService(service) { const relPath = path.relative(process.cwd(), service.__filename); broker.logger.info(`Hot reload '${service.name}' service...`, kleur.grey(relPath)); return broker.destroyService(service) .then(() => { if (fs.existsSync(service.__filename)) { return broker.loadService(service.__filename); } }); }
_onRemove(filePath) { filePath = slash(filePath); const relativePath = path.relative(this.sourcePath, filePath); if ( relativePath.indexOf("node_modules") !== -1 || relativePath.indexOf("zero-builds") !== -1 ) { return; } debug("[REM]".yellow, filePath); if (this.isWatching) this._emitFileChange("remove", filePath); }
test.serial('cwd option', async t => { const {results} = await fn.lintFiles('**/*', {cwd: 'fixtures/cwd'}); const paths = results.map(r => path.relative(__dirname, r.filePath)); paths.sort(); t.deepEqual(paths, [path.join('fixtures', 'cwd', 'unicorn.js')]); });
const applyOverrides = (file, options) => { if (options.overrides && options.overrides.length > 0) { const {overrides} = options; delete options.overrides; let {applicable, hash} = findApplicableOverrides(path.relative(options.cwd, file), overrides); options = mergeWith(...[getEmptyOptions(), options].concat(applicable.map(override => normalizeOptions(override)), mergeFn)); delete options.files; return {options, hash}; } return {options}; }
test('ignore files in .gitignore', async t => { const cwd = path.join(__dirname, 'fixtures/gitignore'); const error = await t.throwsAsync(main(['--reporter=json'], {cwd})); const reports = JSON.parse(error.stdout); const files = reports .map(report => path.relative(cwd, report.filePath)) .map(report => slash(report)); t.deepEqual(files.sort(), ['index.js', 'test/bar.js'].sort()); });
function checkAllReady(){ if(recorderBrowser && ((openChecker && checkerBrowser) || (mobile && recorderMobileApp) || !(openChecker || mobile))){ if(continueRecord){ var testFile = path.resolve(fileName); var absfileName = path.relative(rootPath, testFile).replace(/\\/g,'/'); loadModule(absfileName); } } }
function getFileMatches( inputFiles ) { return inputFiles.map( ( inputFile ) => { debug( 'Parsing inputFile: ' + inputFile ); const relativeInputFilePath = path.relative( __dirname, inputFile ).replace( /^[/.]+/, '' ); return parser.getMatches( fs.readFileSync( inputFile, 'utf8' ) ).map( ( match ) => { match.line = relativeInputFilePath + ':' + match.line; return match; } ); } ); }
const createPath = function (dialogPath, configPath) { const luFilePath = dialogPath.replace('.dialog', '.lu') const relativePath = path.relative(configPath, luFilePath) return relativePath }
test('negative gitignores', async t => { const cwd = path.join(__dirname, 'fixtures/negative-gitignore'); const error = await t.throwsAsync(main(['--reporter=json'], {cwd})); const reports = JSON.parse(error.stdout); const files = reports.map(report => path.relative(cwd, report.filePath)); t.deepEqual(files, ['foo.js']); });
function genChunkName (context, route) { const chunkName = relative(context, route.component) .split('/') .filter(s => s !== '..') .map(s => slugify(s)) .join('--') return `page--${chunkName}` }
const genChunkName = (context, component) => { const chunkName = path.relative(context, component) .split('/') .filter(s => s !== '..') .map(s => kebabCase(s)) .join('--') return `vue-remark--${chunkName}` }
function genChunkName (context, route) { const chunkName = relative(context, route.component) .split('/') .filter(s => s !== '..') .map(s => slugify(s)) .join('--') return `page--${chunkName}` }
_onRemove(filePath) { filePath = slash(filePath); const relativePath = path.relative(this.sourcePath, filePath); if ( relativePath.indexOf("node_modules") !== -1 || relativePath.indexOf("zero-builds") !== -1 ) { return; } debug("[REM]".yellow, filePath); if (this.isWatching) this._emitFileChange("remove", filePath); }