-
Notifications
You must be signed in to change notification settings - Fork 846
Build: Do not declare symlink strategy for the Jetpack Logo package #12480
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: June 4, 2019. |
c961853 to
f445ba5
Compare
72307d1 to
8d45e75
Compare
packages/logo/composer.json
Outdated
| "name": "automattic/jetpack-logo", | ||
| "description": "A logo for Jetpack", | ||
| "type": "library", | ||
| "version": "1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note:
When you add a hardcoded version to a VCS, the version will conflict with tag names. Composer will not be able to determine the version number.
via https://getcomposer.org/doc/02-libraries.md#library-versioning (edited)
and
The version of the package. In most cases this is not required and should be omitted
…
Specifying the version yourself will most likely end up creating problems at some point due to human error.
via
https://getcomposer.org/doc/04-schema.md#version
In the publishing scripts, you might actually want to validate that this isn't here.
tyxla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COMPOSER_MIRROR_PATH_REPOS=1 is a nice find 👍 I'd advise against declaring version in composer.json, but we need to change the stability constraint in the main composer.json. I'll handle that.
| "type": "path", | ||
| "url": "./packages/logo", | ||
| "options": { | ||
| "symlink": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
packages/logo/composer.json
Outdated
| "name": "automattic/jetpack-logo", | ||
| "description": "A logo for Jetpack", | ||
| "type": "library", | ||
| "version": "1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By all means, I'd prefer not having to specify this. After all, currently we only need it so composer locally can find the package and symlink/mirror it. Let's avoid that by setting a lower minimum stability for the package (as we don't care about stability - we'll always use the local package). That can happen by specifying @dev as the version/stability constraint.
| } | ||
| yarn --cwd $TARGET_DIR cache clean | ||
| yarn --cwd $TARGET_DIR run build | ||
| COMPOSER_MIRROR_PATH_REPOS=1 yarn --cwd $TARGET_DIR run build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 This seems to work well for me:
- Installing automattic/jetpack-logo (dev-update/dont-symlink-packages): Mirroring from ./packages/logo
while without it for local dev I properly get:
- Installing automattic/jetpack-logo (dev-update/dont-symlink-packages): Symlinking from ./packages/logo
| { | ||
| "name": "automattic/jetpack-logo", | ||
| "version": "1.0.0", | ||
| "version": "dev-update/dont-symlink-packages", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oskosk we'll need to build a new composer.lock when in the master branch to avoid this reference.
|
I've just:
Seems to work well for me both in dev and prod, but it's worth getting some @Automattic/jetpack-crew 👀 to test it better. |
jeherve
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be working now. 🚢 it!
Maybe in a next PR we could consider removing COMPOSER_MIRROR_PATH_REPOS=1 composer install --working-dir $TARGET_DIR altogether, as @oskosk suggested, since we do run composer install later on as part of yarn build.
tyxla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well for me 👍
…12480) * Do not declare symlink strategy * Update bundling scripts to rely on COMPOSER_MIRROR_PATH_REPOS * Lower stability constraint of logo package * Update composer.lock * Add COMPOSER_MIRROR_PATH_REPOS=1 to composer install too * Fix composer install in build jetpack script
|
Cherry-picked to |
When bundling the plugin, we remove
packagesso symlinks are not working there.This will allow us to work locally with symlinked packages, but rely on the environment variable
COMPOSER_MIRROR_PATH_REPOSfor build scriptsCOMPOSER_MIRROR_PATH_REPOSin Composer environment variables.Is this a new feature or does it add/remove features to an existing part of Jetpack?
The latter
Testing instructions:
vendordirectoryCOMPOSER_MIRROR_PATH_REPOS=1 composer installand confirm thejetpack-logopackage is mirroed instead of symlinked.Proposed changelog entry for your changes: