Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[AssetMapper] Fix import map package parsing with an @ namespace#50206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@weaverryan
Copy link
Member

QA
Branch?6.3
Bug fix?yes
New feature?no
Deprecations?no
TicketsNone
LicenseMIT
Doc PRNot needed

This method is used with theimportmap:require command - e.g.

./bin/console importmap:require @hotwired/stimulus

It parses the string into the package name and potential version (and something called a "registry" which is specific to jspm). The original regex didn't account for namespaced packages.

Cheers!

@nicolas-grekas
Copy link
Member

Thank you@weaverryan.

@nicolas-grekasnicolas-grekas merged commit2757c2f intosymfony:6.3May 2, 2023
{
// https://regex101.com/r/58bl9L/1
$regex ='/(?:(?P<registry>[^:\n]+):)?(?P<package>[^@\n]+)(?:@(?P<version>[^\s\n]+))?/';
// https://regex101.com/r/d99BEc/1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I would remove this comment entirely. Someone wanting to get the regex explanation on regex101.com can copy-paste the regex instead.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I got this idea from@dunglas - the nice thing about it is that the regex includes a bunch of examples. So if there is a problem in the future, you can quickly open this to see what the passing test cases are and then either validate that (A) the situation you are having trouble with SHOULD be working or (B) that your test case was never included.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Exactly, the main benefit it that we can add tests for the regex.

@weaverryanweaverryan deleted the import-map-fix-package-parsing branchMay 2, 2023 13:01
@fabpotfabpot mentioned this pull requestMay 7, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dunglasdunglasdunglas left review comments

@stofstofstof left review comments

Assignees

No one assigned

Projects

None yet

Milestone

6.3

Development

Successfully merging this pull request may close these issues.

5 participants

@weaverryan@nicolas-grekas@dunglas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp