Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cli/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default async function main(
? ModuleLoader({
authToken: flags.registryToken,
npmRegistryUrl: flags.registry,
verbose: Boolean(flags.verbose),
})
: (new PluginManager(pluginManagerConfig) as unknown as MdlLoader);

Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/utils/module-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ModuleLoader } from '@hypermod/fetcher';
const ModuleLoader = (config: {
npmRegistryUrl?: string;
authToken?: string;
verbose?: boolean;
}): ModuleLoader => {
const getInfo = (packageName: string) => {
const entryPath = require.resolve(packageName);
Expand All @@ -26,6 +27,7 @@ const ModuleLoader = (config: {

const install = async (packageName: string) => {
await installPackage(packageName, {
silent: !config.verbose,
cwd: __dirname,
packageManager: 'npm',
additionalArgs: [
Expand Down
3 changes: 2 additions & 1 deletion packages/core/lib/Worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ function prepareJscodeshift(options) {

function retrieveTransformId(str) {
if (str.includes('#')) return false;
return (str.match(/[^@]*(?:[@](?!.*[@]))(.*)$/) || [, ''])[1];
const match = str.match(/(?<!\/)@([^\/]+)$/);
return match ? match[1] : '';
}
function retrievePresetId(str) {
return (str.match(/[^#]*(?:[#](?!.*[#]))(.*)$/) || [, ''])[1];
Expand Down
Loading