https://github.com/atomjoy/dev-package
Development of the compositor package in repository (Laravel packages).
https://github.com/atomjoy/dev-package
dev-composer-package laravel-dev-package laravel-package-dev laravel-packages package-in-repo
Last synced: 6 days ago
JSON representation
Development of the compositor package in repository (Laravel packages).
- Host: GitHub
- URL: https://github.com/atomjoy/dev-package
- Owner: atomjoy
- Created: 2024-01-17T18:03:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-20T12:09:58.000Z (over 2 years ago)
- Last Synced: 2025-02-25T04:32:24.964Z (over 1 year ago)
- Topics: dev-composer-package, laravel-dev-package, laravel-package-dev, laravel-packages, package-in-repo
- Language: Shell
- Homepage: https://github.com/atomjoy/dev-package
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to dev package in repository
Development of the compositor package in repository (Laravel packages).
## Add dev packages
When the **apilogin** package requires **proton** package version 1.0, create a composer.json alias.
```json
{
"repositories": [
{
"type": "path",
"url": "packages/atomjoy/apilogin"
},
{
"type": "path",
"url": "packages/atomjoy/proton"
}
],
"require": {
"atomjoy/proton": "dev-main as 1.0",
"atomjoy/apilogin": "dev-main"
}
}
```
## Git repo hooks
Add this files in main repository **.git/hooks** directory
### Pre-commit
```sh
#!/bin/sh
# Main repo file .git/hooks/pre-commit
# Rename packages .git to .git2 before push
[ -d "packages/atomjoy/apilogin/.git" ] && mv -f packages/atomjoy/apilogin/.git packages/atomjoy/apilogin/.git2
[ -d "packages/atomjoy/proton/.git" ] && mv -f packages/atomjoy/proton/.git packages/atomjoy/proton/.git2
```
### Post-commit
```sh
#!/bin/sh
# Main repo file .git/hooks/post-commit
# Rename packages .git2 to .git after push
[ -d "packages/atomjoy/apilogin/.git2" ] && mv -f packages/atomjoy/apilogin/.git2 packages/atomjoy/apilogin/.git
[ -d "packages/atomjoy/proton/.git2" ] && mv -f packages/atomjoy/proton/.git2 packages/atomjoy/proton/.git
```
### Make executable
```sh
chmod +x .git/hooks/pre-commit
chmod +x .git/hooks/post-commit
```
### Add .gitignore
Add file in package /package/atomjoy/[repo-name]/.gitignore
```sh
# Ignore Git here
.git
.git2
# But not these files...
!.gitignore
```
## Update repo with app packages directory
```sh
git add .
git commit -m "Update repo with packages"
git push
```
## Database
```sh
CREATE DATABASE IF NOT EXISTS laravel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE IF NOT EXISTS laravel_testing CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'toor' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO root@127.0.0.1 IDENTIFIED BY 'toor' WITH GRANT OPTION;
```
## Links
-
-