Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
67eb76d4
Unverified
Commit
67eb76d4
authored
3 years ago
by
Martin Herndl
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(composer): support composer platform package constraint (#13186)
parent
1f1c86a4
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/manager/composer/utils.spec.ts
+12
-0
12 additions, 0 deletions
lib/manager/composer/utils.spec.ts
lib/manager/composer/utils.ts
+6
-0
6 additions, 0 deletions
lib/manager/composer/utils.ts
with
18 additions
and
0 deletions
lib/manager/composer/utils.spec.ts
+
12
−
0
View file @
67eb76d4
...
@@ -27,6 +27,18 @@ describe('manager/composer/utils', () => {
...
@@ -27,6 +27,18 @@ describe('manager/composer/utils', () => {
).
toEqual
({
composer
:
'
1.1.0
'
});
).
toEqual
({
composer
:
'
1.1.0
'
});
});
});
it
(
'
returns from composer platform require
'
,
()
=>
{
expect
(
extractContraints
({
require
:
{
php
:
'
^8.1
'
,
composer
:
'
2.2.0
'
}
},
{})
).
toEqual
({
php
:
'
^8.1
'
,
composer
:
'
2.2.0
'
});
});
it
(
'
returns from composer platform require-dev
'
,
()
=>
{
expect
(
extractContraints
({
'
require-dev
'
:
{
composer
:
'
^2.2
'
}
},
{})
).
toEqual
({
composer
:
'
^2.2
'
});
});
it
(
'
returns from composer-runtime-api
'
,
()
=>
{
it
(
'
returns from composer-runtime-api
'
,
()
=>
{
expect
(
expect
(
extractContraints
({
require
:
{
'
composer-runtime-api
'
:
'
^1.1.0
'
}
},
{})
extractContraints
({
require
:
{
'
composer-runtime-api
'
:
'
^1.1.0
'
}
},
{})
...
...
This diff is collapsed.
Click to expand it.
lib/manager/composer/utils.ts
+
6
−
0
View file @
67eb76d4
...
@@ -71,6 +71,12 @@ export function extractContraints(
...
@@ -71,6 +71,12 @@ export function extractContraints(
}
else
if
(
composerJson
[
'
require-dev
'
]?.[
'
composer/composer
'
])
{
}
else
if
(
composerJson
[
'
require-dev
'
]?.[
'
composer/composer
'
])
{
res
.
composer
=
composerJson
[
'
require-dev
'
]?.[
'
composer/composer
'
];
res
.
composer
=
composerJson
[
'
require-dev
'
]?.[
'
composer/composer
'
];
}
}
// composer platform package
else
if
(
composerJson
.
require
?.[
'
composer
'
])
{
res
.
composer
=
composerJson
.
require
?.[
'
composer
'
];
}
else
if
(
composerJson
[
'
require-dev
'
]?.[
'
composer
'
])
{
res
.
composer
=
composerJson
[
'
require-dev
'
]?.[
'
composer
'
];
}
// check last used composer version
// check last used composer version
else
if
(
lockParsed
?.[
'
plugin-api-version
'
])
{
else
if
(
lockParsed
?.[
'
plugin-api-version
'
])
{
const
major
=
api
.
getMajor
(
lockParsed
?.[
'
plugin-api-version
'
]);
const
major
=
api
.
getMajor
(
lockParsed
?.[
'
plugin-api-version
'
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment