Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
appJson.expo.entryPoint = EXPO_APP_ENTRY;
}
log('Writing app.json...');
await fse.writeFile(path.resolve('app.json'), JSON.stringify(appJson, null, 2));
log(chalk.green('Wrote to app.json, please update it manually in the future.'));
// This is validated later...
let defaultDependencies: any = {};
let defaultDevDependencies: any = {};
/**
* Extract the template and copy it over
*/
try {
const tempDir = temporary.directory();
await Exp.extractTemplateAppAsync(templateSpec, tempDir, appJson);
fse.copySync(path.join(tempDir, 'ios'), path.join(projectRoot, 'ios'));
fse.copySync(path.join(tempDir, 'android'), path.join(projectRoot, 'android'));
const { dependencies, devDependencies } = JsonFile.read(path.join(tempDir, 'package.json'));
defaultDependencies = ensureDependenciesMap(dependencies);
defaultDevDependencies = devDependencies;
log('Successfully copied template native code.');
} catch (e) {
log(chalk.red(e.message));
log(chalk.red(`Eject failed, see above output for any issues.`));
log(chalk.yellow('You may want to delete the `ios` and/or `android` directories.'));
process.exit(1);
}
log(`Updating your package.json...`);
if (!pkg.scripts) {
it('should support .huskyrc', (): void => {
const tempDir = tempy.directory()
fs.writeFileSync(
path.join(tempDir, '.huskyrc'),
JSON.stringify(testConf.husky)
)
expect(getConf(tempDir)).toEqual({ skipCI: true, foo: 'bar' })
})
})
it(`should use defaults when all the required parameters are present, with 'globFollow' and symlinks`, async function() {
const outputDir = tempy.directory();
const swDest = upath.join(outputDir, 'sw.js');
const globDirectory = tempy.directory();
await fse.ensureSymlink(GLOB_DIR, upath.join(globDirectory, 'link'));
const options = Object.assign({}, BASE_OPTIONS, {
globDirectory,
globFollow: false,
swDest,
});
const {count, filePaths, size, warnings} = await generateSW(options);
expect(warnings).to.be.empty;
expect(count).to.eql(4);
expect(size).to.eql(2535);
confirmDirectoryContains(outputDir, filePaths);
test('dir exists', t => {
const dir = makeDir.sync(tempy.directory());
t.true(dir.length > 0);
assertDirectory(t, dir);
});
module.exports.mockCyclical = function mockCyclical () {
var sfs = new ScopedFS(tempy.directory())
fs.mkdirSync(path.join(sfs.base, 'subdir'))
fs.writeFileSync(path.join(sfs.base, 'subdir', 'foo.txt'), 'more content', 'utf8')
fs.symlinkSync(sfs.base, path.join(sfs.base, 'subdir', 'symlink'))
return sfs
}
async function def (fn) {
const a = await DatArchive.create({localPath: tempy.directory()})
await a.mkdir('/multi')
const write = (path, record) => a.writeFile(path, JSON.stringify(record))
await fn(write, a)
return a
}
for (let i = 0; i < 10; i++) {
const getDir = _ => join(tempy.directory(), 'foo/bar/baz');
const convertTo = (opts, format) => {
const outputPath = path.join(tempy.directory(), opts.defaultFileName);
const converter = converters.get(format);
if (!converter) {
throw new Error(`Unsupported file format: ${format}`);
}
opts.onProgress(0);
track(`file/export/format/${format}`);
return converter({outputPath, ...opts});
};
export default function uiDev(panel: Panel) {
const initialState: any = {
dir: tempy.directory(),
listHeight: 150
};
const store = createStore(rootReducer, initialState);
render(
,
panel.getItem()
);
const hiddenColumns = atom.config.get("textual-velocity.hiddenColumns");
store.dispatch(A.changeHiddenColumns(hiddenColumns));
const rawFiles = generateRawFiles(20000);
store.dispatch(A.readDirDone(rawFiles));
}