composer set a local repository (satis) - repository

I want to set a local Repository, so i set up satis.
I loaded SonataAdminBundle and KnpMenuBundle as an exemple.
satis.json:
{"type": "vcs", "url": "https://github.com/sonata-project/SonataAdminBundle"},{"type": "vcs", "url": "https://github.com/KnpLabs/KnpMenuBundle"}
After that, in my project composer :
{"repositories": [
{
"type": "composer",
"url": "http://my.local.repo/"
},
{ "packagist" : false }
],
"minimum-stability":"dev",
"require": {
"sonata-project/admin-bundle": "dev-master"
},
}
when i do a composer update, i got this error:
Problem 1
- sonata-project/admin-bundle dev-master requires knplabs/knp-menu >=1.1.0,<3.0.0 -> no matching package found.
- sonata-project/admin-bundle dev-master requires knplabs/knp-menu >=1.1.0,<3.0.0 -> no matching package found.
- Installation request for sonata-project/admin-bundle dev-master -> satisfiable by sonata-project/admin-bundle[dev-master].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.
what shall i do ?

I got the solution:
There is two bundles : knplabs/knp-menu-bundle and knplabs/knp-menu , I was downloading the wrong one.

Related

Using renovate to update TYPO3 installations minor/patches only

I have been experimenting with Renovate and would like to use it to auto update TYPO3 to the latest version. v10.4.x - where Renovate should only create MR's whenever the is an update available for the 'X' part.
I am using the following configuration:
config.js
module.exports = {
endpoint: 'https://gitlab.companyname/api/v4/',
token: '**gitlab_token**',
platform: 'gitlab',
baseBranches: ["master"],
assignees: ["Me"],
enabledManagers: "composer",
onboardingConfig: {
extends: ['config:base'],
},
repositories: [
{
repository: 'CMS/sitetemplate',
},
],
};
renovate.json in the project CMS/sitetemplate
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":disableDependencyDashboard",
":separatePatchReleases"
],
"prHourlyLimit": 0,
"prConcurrentLimit": 0,
"baseBranches": [
"master"
],
"enabledManagers": [
"composer"
],
"commitMessagePrefix": "[TASK] ",
"commitMessageTopic": "{{depName}}",
"commitMessageExtra": " ({{{displayFrom}}} => {{{displayTo}}})",
"rangeStrategy": "update-lockfile",
"packageRules": [
{
"matchUpdateTypes": [
"patch"
],
"matchPackagePrefixes": [
"typo3/cms-"
],
"excludePackageNames": [
"typo3/cms-cli",
"typo3/cms-composer-installers"
],
"groupName": "TYPO3 CMS",
"labels": [
"typo3"
]
},
{
"matchUpdateTypes": [
"minor",
"pin",
"digest",
"major"
],
"enabled": false
}
]
}
.gitlab-ci.yaml
Update Web Project:
rules:
- if: $RENOVATE_APPLICATION_TOKEN
when: never
- if: $RENOVATE_WEB_TOKEN
when: manual
variables:
RENOVATE_TOKEN: $RENOVATE_WEB_TOKEN
script:
- renovate $RENOVATE_EXTRA_FLAGS
when: manual
I have played around with the config a bit and it will create MR's, issues etc when i have other settings. So its working. However with the current configuration it does not create a PR.
The sitetemplate currently has TYPO3 V10.4.25 (in lock file) and i want it to create a PR so it will update all typo3/cms-* packages to the lastest TYPO3 V10.4.32
It should only update the lock file.
Currently when i run the CI i get no MR's and the following output
The CI output
PASTEBIN since it was to large
Anyone has any expirience with this, what configuration am i doing wrong?
https://github.com/renovatebot/renovate/discussions/17939
Confirmed working:
At a quick glance I think you're missing a setting of separateMinorPatch=true. You could turn that on globally (if you want to separate patch updates from minor for all packages) or specifically for certain packages by using packageRules.

syntax error, unexpected '#', expecting variable (T_VARIABLE) or '{' or '$'

I'am using php 7.4.27, laravel framework 8.83.7 and installed Laravel Jetstream.
Login & Register can show. After registered, Then an error notification appears in Laravel:
syntax error, unexpected '#', expecting variable (T_VARIABLE) or '{' or '$'
and in code line 12 :
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'jetstream::components.dropdown-link','data' => ['href' => $href,'#click.prevent' => $#clickPrevent]]); ?>
I won't update to php 8. What should i do?
=====edited=====
composer.json file :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
"laravel/jetstream": "^2.7",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"livewire/livewire": "^2.5"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-update-cmd": [
"#php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Explanation:
The issue comes from the fact that the compiled view version under storage/framework/views is failing to evaluate $#clickPrevent.
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'jetstream::components.dropdown-link','data' => ['href' => $href,'#click.prevent' => $#clickPrevent]]); ?>
This has nothing to do with your current PHP version.
Solution:
I managed to locally reproduce the issue. Here is how I solved it.
Steps:
Publish the Jetstream Livewire components.
Command:
php artisan vendor:publish --tag=jetstream-views
Open the file resources/views/vendor/jetstream/components/switchable-team.blade.php
In the file contents,
Instead of:
<x-dynamic-component :component="$component" href="#" #click.prevent="$root.submit();"> ❌
Use this:
<x-dynamic-component :component="$component" href="#"> ✅
Disclaimer:
Note that this is a temporary solution. Everything works fine for me. As lamented by #IMSoP in a comment, I'm afraid it may affect some unknown functionality. I've opened an issue against the library here:
switchable-team.blade.php compiled Jetstream component throwing an error: syntax error, unexpected token "#", expecting variable or "{" or "$"
Update 10th/April/2022:
Another "more stable" solution stated by #fabpl on the opened Github issue:
I think it's the same bug like [2.x] Fix parse error caused by alpine
shorthand on dynamic-component
#1032
Try to replace #click with x-on:click
https://github.com/laravel/jetstream/issues/1036#issuecomment-1094253898
Addendum:
The issue seems to have been introduced in laravel/jetstream v2.7.2. More specifically Use Alpine's #click.prevent for switching teams.
The good news is that this has been resolved beginning from laravel/jetstream v2.7.3 onwards. More specifically [2.x] Fix parse error caused by alpine shorthand on dynamic-component.
I just tagged v2.7.3 which should fix this. Thanks all 👍
https://github.com/laravel/jetstream/issues/1036#issuecomment-1094332998
Hence, you may simply just upgrade your Jetstream version to v2.7.3 to get the fix. I.e:
Command:
composer update laravel/jetstream:2.7.3
Sample Output:
PS C:\Users\Ivan\Documents\SteveContents\GITHUB\Laravel-8.83.7\laravel-8.83.7> composer update laravel/jetstream:2.7.3
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
- Upgrading laravel/jetstream (v2.7.2 => v2.7.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Downloading laravel/jetstream (v2.7.3)
- Downloading laravel/jetstream (v2.7.3)
- Downloading laravel/jetstream (v2.7.3)
- Downloading laravel/jetstream (v2.7.3)
- Upgrading laravel/jetstream (v2.7.2 => v2.7.3): Extracting archive
...

How can i custom config CHANGELOG.md using standard-version npm package?

I'm using the command standard-version each time I want to publish new version, but the yielded changes in the CHANGELOG.md look like this:
### [10.1.9](https://github.com/my-project-name/compare/v10.1.8...v10.1.9) (2021-03-29)
### [10.1.8](https://github.com/my-project-name/compare/v10.1.7...v10.1.8) (2021-03-29)
### [10.1.7](https://github.com/my-project-name/compare/v10.1.6...v10.1.7) (2021-03-29)
first the links do not work - the github url is not correct and i want to configure it to the right url, and second, I'd like to configure the link that's shown in the changeslog file (there are some types)
I tried to use this documentation but didn't find anything that can help me
https://github.com/conventional-changelog/conventional-changelog
so how do I configure the way standard-version works on the CHANGELOG.md ? can someone provide example?
yes.
according to doc:
You can configure standard-version either by:
Placing a standard-version stanza in your package.json (assuming your project is JavaScript).
Creating a .versionrc, .versionrc.json or .versionrc.js.
If you are using a .versionrc.js your default export must be a configuration object, or a function returning a configuration object.
Any of the command line parameters accepted by standard-version can instead be provided via configuration.
Please refer to the conventional-changelog-config-spec for details on available configuration options.
example:
.versionrc
{
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"hidden": true
},
{
"type": "docs",
"hidden": true
},
{
"type": "style",
"hidden": true
},
{
"type": "refactor",
"section": "Refactor"
},
{
"type": "perf",
"section": "Performance"
},
{
"type": "test",
"hidden": true
}
]
}

How do I package a node module for BuckleScript / ReasonML?

Background
I'm an absolute beginner in BuckleScript, and while I've downloaded packgages with npm before, I've never written a library.
Goal: installing my new package local package in my project using npm
I am trying to wrap some parts of the service worker api in JavaScript. I have started with a file bs-service-worker/src/ExtendableEvent.re like so
type _extendableEvent('a);
type extendableEvent_like('a) = Dom.event_like(_extendableEvent('a));
type extendableEvent = extendableEvent_like(Dom._baseClass);
[#bs.send] external waitUntil: (extendableEvent, Js.Promise.t('a)) => unit
= "waitUntil";
This compiles and produces ExtendableEvent.bs.js as expected.
Now, though, I'd like to go ahead and test what I have so far by creating a new npm project and importing what I have locally. I created a new sibling directory and did an npm install ../bs-service-worker. That succeeded, and then I did a sanity-check build on my new BuckleScript project. That also succeeded.
The issue: opening my module causes an error
When I add open ExtendableEvent; to Demo.re in the new project, I get the following error:
We've found a bug for you!
/home/el/workbench/bucklescript/bs-service-worker-examples/src/Demo.re 11:6-20
9 │
10 │ /**/
11 │ open ExtendableEvent;
12 │
13 │ /*
The module or file ExtendableEvent can't be found.
- If it's a third-party dependency:
- Did you list it in bsconfig.json?
- Did you run `bsb` instead of `bsb -make-world`
(latter builds third-parties)?
- Did you include the file's directory in bsconfig.json?
What I've tried
I'm guessing I'm misusing BuckleScript here instead of npm because npm is so widely adopted and well documented that I think I'd have found the problem, but I'm definitely not ruling out the possibility that I'm misusing npm, too.
I do have "bs-service-worker" listed as a bs-dependency. I also tried "../bs-service-worker" in case BuckleScript didn't like the virtual directory, but it didn't seem to help.
My npm run build command is indeed npx bsb -make-world.
More code:
bs-service-worker/bs-config.json
{
"name": "bs-service-worker",
"version": "0.1.0",
"sources": {
"dir" : "src",
"subdirs" : true,
"public": "all"
},
"package-specs": {
"module": "commonjs",
"in-source": true
},
"suffix": ".bs.js",
"bs-dependencies": [
],
"warnings": {
"error" : "+101"
},
"namespace": true,
"refmt": 3
}
bs-service-worker-examples/bsconfig.json
{
"name": "bs-service-worker-examples",
"version": "0.1.0",
"sources": {
"dir" : "src",
"subdirs" : true
},
"package-specs": {
"module": "commonjs",
"in-source": true
},
"suffix": ".bs.js",
"bs-dependencies": [
"bs-service-worker",
"bs-fetch",
],
"warnings": {
"error" : "+101"
},
"namespace": true,
"refmt": 3
}
bs-service-worker-examples/package.json
{
"name": "bs-service-worker-examples",
"version": "0.0.1",
"scripts": {
"build": "npx bsb -make-world",
"start": "npx bsb -make-world -w",
"clean": "npx bsb -clean-world"
},
"keywords": [
"BuckleScript"
],
"author": "Eleanor (https://webbureaucrat.bitbucket.io)",
"license": "MIT",
"devDependencies": {
"bs-platform": "^7.3.2"
},
"dependencies": {
"bs-fetch": "^0.6.1",
"bs-service-worker": "file:../bs-service-worker"
}
}
Easy Reproduction of the Issue
The fastest way to reproduce this would be to fork this repository and try to add it as a local npm dependency.
The problem seems to be that you have "namespace": true in your library's bsconfig.json, which will wrap all the modules in a namespace module with a silly generated name based on the name field. In this case it will be BsServiceWorker I think.
You could just remove that setting, or set it to false, but namespacing is a good idea to avoid collisions between modules from different libraries, or your own app, so I would recommend setting it to a custom, sensible name. For example:
"namespace": "ServiceWorker"
You can then open ExtendableEvent in the consumer project with:
open ServiceWorker.ExtendableEvent;
For more details, see the documentation on the namespace field.

composer to disable https completely

my network does not work well with https, so doing
composer.phar install
throws
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: Failed to enable crypto
failed to open stream: operation failed
i used
{
"packagist": false
},
{
"type": "composer",
"url": "http://packagist.org",
"options": {
"ssl": {
"verify_peer": "false"
}
}
}
as a http falback, but again it crashes in some other point:
Installing dependencies
- Installing symfony/translation (v2.4.0)
Downloading: 100%
Downloading: 100%
Downloading: 100%
[Composer\Downloader\TransportException]
The "https://api.github.com/repos/symfony/Translation/zipball/0919e0fc709217f8c9e5049f2603419fdd4a34ff" file could not be downloaded: Failed to
enable crypto
failed to open stream: operation failed
my problem is just with TLSv1, previous SSL versions should work, as the browsers work correctly.
how should i do, the problem also exists in other cmd tools that depend on https like npm, bower, git, curl, ...
composer config --global disable-tls true
composer config --global secure-http false
You can turn off TLS (For your specific project) using your composer.json as such:
{
"require": {
"laravel/framework": "5.2.43"
},
"config": {
"preferred-install": "dist",
"disable-tls": true,
"secure-http": false
}
}
NB: Take not of the "disable-tls": true in the config section.
The problem is simply that you wrapped "false" in quotes, which is true when converted to bool.
Use "verify_peer": false instead of "verify_peer": "false":
{
"repositories": [
{
"type": "composer",
"url": "http://packagist.org",
"options": {
"ssl": {
"verify_peer": false
}
}
}
]
}
It's okey.
It will work. You just have a mismatch:
"options": {
"ssl": {
"verify_peer": false
}
}
in order to disable https totaly (not recommanded)
you need to add "secure-http": false in your composer.json file config key like this:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "5.3.*",
},
...
"config": {
"preferred-install": "dist",
"bin-dir": "vendor/bin/",
"secure-http": false
},
"minimum-stability": "dev"
}
You cannot disable SSL with Composer. Even if it works like in your setup, you cannot control the source URLs of any package you use. Some of them do not offer anything without SSL, so you MUST use SSL.
I think it's the best idea to make SSL work. Did you try composer diag and see where the problem is?