Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
callThroughHook('linkStep', async () => {
// remove integrity hash to make this operation atomic
await this.integrityChecker.removeIntegrityFile();
this.reporter.step(curr, total, this.reporter.lang('linkingDependencies'), emoji.get('link'));
flattenedTopLevelPatterns = this.preparePatternsForLinking(
flattenedTopLevelPatterns,
manifest,
this.config.lockfileFolder === this.config.cwd,
);
await this.linker.init(flattenedTopLevelPatterns, workspaceLayout, {
linkDuplicates: this.flags.linkDuplicates,
ignoreOptional: this.flags.ignoreOptional,
});
}),
);
// init
reporter.step(2, 4, reporter.lang('whyInitGraph'), emoji.get('truck'));
const lockfile = yield (_wrapper || _load_wrapper()).default.fromDirectory(config.cwd, reporter);
const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
var _ref7 = yield install.fetchRequestFromCwd();
const depRequests = _ref7.requests,
patterns = _ref7.patterns;
yield install.resolver.init(depRequests, install.flags.flat);
const hoisted = yield install.linker.getFlatHoistedTree(patterns);
// finding
reporter.step(3, 4, reporter.lang('whyFinding'), emoji.get('mag'));
let match;
for (const _ref8 of hoisted) {
var _ref9 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref8, 2);
const loc = _ref9[0];
const info = _ref9[1];
if (info.key === query || info.previousKeys.indexOf(query) >= 0) {
match = [loc, info];
break;
}
}
if (!match) {
reporter.error(reporter.lang('whyUnknownMatch'));
throw new MessageError(reporter.lang('moduleNotInManifest'));
}
}
// save manifests
await config.saveRootManifests(rootManifests);
// run hooks - npm runs these one after another
for (const action of ['preuninstall', 'uninstall', 'postuninstall']) {
for (const [loc] of manifests) {
await config.executeLifecycleScript(action, loc);
}
}
// reinstall so we can get the updated lockfile
reporter.step(++step, totalSteps, reporter.lang('uninstallRegenerate'), emoji.get('hammer'));
const installFlags = {force: true, workspaceRootIsCwd: true, ...flags};
const reinstall = new Install(installFlags, config, new NoopReporter(), lockfile);
await reinstall.init();
//
reporter.success(reporter.lang('uninstalledPackages'));
}
themeData.namespace = capCase(themeData.package);
// Dev url
themeData.url = devUrl;
if (!devUrl) {
themeData.url = promptFor({
label: `${emoji.get('earth_africa')} Please enter a theme development url (for local development with browsersync - no protocol):`,
prompt: 'Dev url (e.g. dev.wordpress.com): ',
error: 'Dev url is required and cannot be empty.',
}).trim();
}
confirmed = summary([
{label: `${emoji.get('green_book')} Theme name`, variable: themeData.name},
{label: `${emoji.get('package')} Package`, variable: themeData.package},
{label: `${emoji.get('sun_behind_cloud')} Namespace`, variable: themeData.namespace},
{label: `${emoji.get('bullettrain_front')} Theme prefix`, variable: themeData.prefix},
{label: `${emoji.get('earth_africa')} Dev url`, variable: themeData.url},
], noConfirm);
} while (confirmed !== 'y');
return themeData;
};
// Namespace
themeData.namespace = capCase(themeData.package);
// Dev url
if (!devUrl) {
themeData.url = promptFor({
label: `${emoji.get('earth_africa')} Please enter a theme development url (for local development with browsersync - no protocol):`,
prompt: 'Dev url (e.g. dev.wordpress.com): ',
error: 'Dev url is required and cannot be empty.',
}).trim();
} else {
themeData.url = devUrl;
}
confirmed = summary([
{label: `${emoji.get('green_book')} Theme name`, variable: themeData.name},
{label: `${emoji.get('package')} Package`, variable: themeData.package},
{label: `${emoji.get('sun_behind_cloud')} Namespace`, variable: themeData.namespace},
{label: `${emoji.get('bullettrain_front')} Theme prefix`, variable: themeData.prefix},
{label: `${emoji.get('earth_africa')} Dev url`, variable: themeData.url},
], noConfirm);
} while (confirmed !== 'y');
return themeData;
};
.on('log', (context, messages) => {
// Custom log processing
});
log.enableStackTrace();
log.setLevel(TRACE);
log.log(INFO, 'The logger has initialized');
log.trace(emoji.get('mostly_sunny'));
log.debug(emoji.get('sun_small_cloud'));
log.info(emoji.get('barely_sunny'));
log.warn(emoji.get('rain_cloud'));
log.error(emoji.get('lightning_cloud'));
log.setLevel(OFF); // Turn off logging
log.error(emoji.get('scream'));
const contextLog = logger(emoji.get('rainbow'))
.use(minimal({
useNativeConsoleMethods: false
}))
.use(styleable({
showTimestamp: true
}))
.on('log', (context, messages) => {
// Custom log processing
});
contextLog.setLevel(INFO);
contextLog.enableStackTrace();
contextLog.trace(emoji.get('mostly_sunny'));
contextLog.debug(emoji.get('sun_small_cloud'));
const projectConfigFilePath = path.join('amplify', '.config', 'project-config.json');
fs.writeFileSync(projectConfigFilePath, JSON.stringify(projectConfig, null, 4));
console.log(`${emoji.get('boom')} Successfully created base Amplify Project`);
resolve(projectConfig.frontend);
})
.catch(e => {
reject(e);
});
}
console.log(`${emoji.get('x')} Failed to create base Amplify Project`);
reject();
});
});
}
console.log(
`An Amplify project is already initialized in your current working directory ${emoji.get('smiley')}. Not generating base project.`
);
console.log();
const existingApp = true;
const projectConfig = await getProjectConfig(existingApp);
return projectConfig.frontend;
}
async function amplifyCLIVersionCheck() {
const amplifyCLIVersionSpawn = spawnSync('amplify', ['-v']);
const minCLIVersion = engines['@aws-amplify/cli'];
if (amplifyCLIVersionSpawn.stderr !== null) {
const amplifyCLIVersion = semver.coerce(stripAnsi(amplifyCLIVersionSpawn.stdout.toString()));
if (semver.satisfies(amplifyCLIVersion, minCLIVersion)) {
console.log(`${emoji.get('white_check_mark')} Found Amplify CLI version ${amplifyCLIVersion}`);
} else {
console.log(
`${emoji.get('worried')} Found Amplify CLI version ${amplifyCLIVersion}. The minimum required version is ${minCLIVersion}`
);
console.log(`${emoji.get('sweat_smile')} Installing Amplify CLI. Hold tight.`);
await installAmplifyCLI();
}
} else {
console.log(`${emoji.get('worried')} Amplify CLI was not found.`);
console.log(`${emoji.get('sweat_smile')} Installing Amplify CLI. Hold tight.`);
await installAmplifyCLI();
}
}
case '03n':
return emoji.get('cloud');
case '04n':
return emoji.get('cloud');
case '09n':
return emoji.get('rain_cloud');
case '10n':
return emoji.get('rain_cloud');
case '11n':
return emoji.get('lightning');
case '13n':
return emoji.get('snowflake');
case '50n':
return emoji.get('wind_blowing_face');
default:
return emoji.get('sunny');
}
}
import { get } from 'node-emoji';
export const EMOJIS = {
HEART: get('heart'),
COFFEE: get('coffee'),
BEER: get('beer'),
BROKEN_HEART: get('broken_heart'),
CRYING: get('crying_cat_face'),
HEART_EYES: get('heart_eyes_cat'),
JOY: get('joy_cat'),
KISSING: get('kissing_cat'),
SCREAM: get('scream_cat'),
ROCKET: get('rocket'),
SMIRK: get('smirk_cat'),
RAISED_HANDS: get('raised_hands'),
POINT_RIGHT: get('point_right'),
ZAP: get('zap'),
BOOM: get('boom'),
PRAY: get('pray'),
WINE: get('wine_glass'),
};