Skip to content

Commit 0726659

Browse files
Merge pull request #249 from hypermod-io/match-app-dls
Fixes app module dls + silences experimental loader logs
2 parents 4c744ae + 24e7380 commit 0726659

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

packages/cli/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default async function main(
4343
? ModuleLoader({
4444
authToken: flags.registryToken,
4545
npmRegistryUrl: flags.registry,
46+
verbose: Boolean(flags.verbose),
4647
})
4748
: (new PluginManager(pluginManagerConfig) as unknown as MdlLoader);
4849

packages/cli/src/utils/module-loader.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ModuleLoader } from '@hypermod/fetcher';
77
const ModuleLoader = (config: {
88
npmRegistryUrl?: string;
99
authToken?: string;
10+
verbose?: boolean;
1011
}): ModuleLoader => {
1112
const getInfo = (packageName: string) => {
1213
const entryPath = require.resolve(packageName);
@@ -26,6 +27,7 @@ const ModuleLoader = (config: {
2627

2728
const install = async (packageName: string) => {
2829
await installPackage(packageName, {
30+
silent: !config.verbose,
2931
cwd: __dirname,
3032
packageManager: 'npm',
3133
additionalArgs: [

packages/core/lib/Worker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function prepareJscodeshift(options) {
4848

4949
function retrieveTransformId(str) {
5050
if (str.includes('#')) return false;
51-
return (str.match(/[^@]*(?:[@](?!.*[@]))(.*)$/) || [, ''])[1];
51+
const match = str.match(/(?<!\/)@([^\/]+)$/);
52+
return match ? match[1] : '';
5253
}
5354
function retrievePresetId(str) {
5455
return (str.match(/[^#]*(?:[#](?!.*[#]))(.*)$/) || [, ''])[1];

0 commit comments

Comments
 (0)