Skip to content

πŸ€– A CLI tool for generating satis.json.

License

Notifications You must be signed in to change notification settings

jmerilainen/satis-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Satis.json builder

Latest Version on Packagist Tests Total Downloads

The tool will generate a satis.json file for Satis by scanning archives based on the folder structure.

Satis is a composer's static repository generator. Read more about Satis and satis.json from the composer's documentation: https://getcomposer.org/doc/articles/handling-private-packages.md

Example repository using the tool: satis.jmerilainen.fi.

Installation

Note: The package has not yet been published to packagist

You can install the package via composer:

composer require jmerilainen/satis-builder

Usage

vendor/bin/satis-builder build [options]

Options:
    --from          Root of the folder to build from (required, default: ./packages)
    --external      JSON file including any additional/exterenal repsoitories to include (required, default: ./packages/external.jspn)
    --output        JSON file to generate (required, default: satis.json)
    --name          Name of the satis repository package, exmpale vendor/satis (required)
    --homepage      Homepage of the output satis repository package (required)

Folder structure

The tool will be generate the json based on the following folder structure:

./                      # Root
└── packages/           # All included packages, --from option
    β”œβ”€β”€ <type>          # First level: package type
    β”‚   β”œβ”€β”€ <vendor>/   # Second level: vendor namespace
    β”‚   β”‚   β”œβ”€β”€ <package-name>-<version>.zip #: Third level: package archive
    β”‚   β”‚   └── ...
    β”‚   └── ...
    β”œβ”€β”€ ...
    └── external.json # json file with additional repositories

All naming should follow the composer.json's schema: The composer.json schema.

See tests/fixtures/case1 for working example.

Usage with Satis repository

In the Satis repository project use the satis-builder build command to generate satis.json for Satis to consume.

Example composer.json file:

{
    "name": "vendor/satis",
    "description": "oSatis Repository",
    "type": "project",
    "require": {
        "jmerilainen/satis-builder": "dev-main",
        "composer/satis": "dev-main",
    },
    "require-dev": {},
    "scripts": {
        "build-json": "vendor/bin/satis-builder build --from=packages --external=packages/external.json --name=vendor/satis --homepage=https://satis.vendor.fi --output=satis.json",
        "build-satis": "vendor/bin/satis build satis.json dist",
        "build": [
            "@build-json",
            "@build-satis",
            "rm satis.json"
        ]
    }
}

Running the composer build will then generate the satis.json and the repository with compiled assets and archives.

See also: composer/satis

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Roadmap

  • Get the name and homepage defaults from the repository project's composer.json
  • Validate structure and package names based on composer.json schema
  • Add more options and modification possibilities based on satis.json schema
  • Publish to packagist

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

πŸ€– A CLI tool for generating satis.json.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages