Skip to content

chore: don't ship composer.lock in the starter - #9

Merged
simonhamp merged 4 commits into
NativePHP:mainfrom
vipertecpro:fix/composer-install-out-of-box
Aug 30, 2026
Merged

chore: don't ship composer.lock in the starter#9
simonhamp merged 4 commits into
NativePHP:mainfrom
vipertecpro:fix/composer-install-out-of-box

Conversation

@vipertecpro

@vipertecpro vipertecpro commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What

Remove the committed composer.lock from the starter so a fresh clone installs cleanly:

git clone git@github.com:NativePHP/mobile-starter.git && cd mobile-starter
composer install

Why

composer install reads download URLs straight from composer.lock, and the committed lock pinned nativephp/mobile-ui to the private plugins registry — so a fresh clone without registry credentials hit an auth prompt on the very first install.

Rather than keep regenerating a pinned lock, this follows the standard skeleton convention (e.g. laravel/laravel ships no composer.lock): a starter is a template, so each new project should resolve its dependencies fresh from their current sources at creation time. mobile-ui is now on public Packagist, so a fresh resolve pulls it (and everything else) with no auth. The lock then becomes the derived project's responsibility, which is where it belongs.

Change

  • Remove composer.lock.
  • composer.json is untouched — the nativephp-plugins repository block stays in place for premium plugins.

Verified

Fresh clone with no credentials configured → composer install resolves and installs cleanly, mobile-ui pulled from public GitHub.

🤖 Generated with Claude Code

@vipertecpro
vipertecpro marked this pull request as ready for review August 2, 2026 05:22
Comment thread composer.json
@vipertecpro
vipertecpro force-pushed the fix/composer-install-out-of-box branch from 5f047d9 to f75053c Compare August 2, 2026 05:31
@vipertecpro vipertecpro changed the title fix: make composer install work out of the box on a fresh clone fix: regenerate composer.lock so a fresh composer install needs no auth Aug 2, 2026
Remove the committed composer.lock so a fresh clone resolves dependencies
from their current sources instead of a pinned (and now stale) lock file.
This matches the skeleton convention (laravel/laravel ships no lock) and
fixes a fresh 'composer install' prompting for auth on nativephp/mobile-ui,
which is now published on public Packagist. The nativephp-plugins
repository block stays in place for premium plugins; the lock becomes the
derived project's responsibility.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vipertecpro
vipertecpro force-pushed the fix/composer-install-out-of-box branch from f75053c to 924fcdb Compare August 2, 2026 05:55
@vipertecpro vipertecpro changed the title fix: regenerate composer.lock so a fresh composer install needs no auth chore: don't ship composer.lock in the starter Aug 2, 2026
simonhamp and others added 3 commits August 28, 2026 22:31
The daily job ran `composer update` and pushed the resulting composer.lock
to main. With the lock file no longer shipped, committing it back is the
one thing the job must not do - and once it can't, running an update
purely to discard it buys nothing.

Repurpose it instead. Because the starter ships no lock and every
constraint is a caret range, what a fresh clone resolves changes daily
with no commit to this repository: an upstream release alone can break
`create-project`. Only a scheduled run catches that, so the cron slot is
worth keeping - it just needs to assert something.

The job now does what a new user does: resolve dependencies, generate a
key, migrate a real SQLite file (matching how NativePHP runs migrations
on device rather than the suite's in-memory database), and run the test
suite. It also runs on pull requests, which this repository had no CI
for at all despite shipping a test suite.

Nothing is committed: the generated composer.lock is discarded explicitly
and `contents: read` leaves the job no token to push with. Composer auth
degrades gracefully when secrets are absent, so pull requests from forks
still run - plugins.nativephp.com serves packages.json anonymously.

Renamed from update-dependencies.yml, which drops that workflow's run
history from the Actions tab.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mz8swSX1LGafnvRhcfT7xf
@simonhamp
simonhamp merged commit 20e77fe into NativePHP:main Aug 30, 2026
1 check passed
@simonhamp

Copy link
Copy Markdown
Member

Thanks @vipertecpro I resolved some conflicts and improved the GH action to give us an early warning if things start failing

@vipertecpro

Copy link
Copy Markdown
Contributor Author

Now everything works on the first attempt without requiring any additional steps. Simply following the documentation and running laravel new my-app --using=nativephp/mobile-starter would be a great starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants