felangel / mason

Tools which allow developers to create and consume reusable templates called bricks.
https://docs.brickhub.dev
958 stars 98 forks source link

I cannot publish my mason brick #1372

Closed saddemYassin closed 1 month ago

saddemYassin commented 1 month ago

Description

I tried to publish my brick on brickHub after login, but an error occurred.

Steps To Reproduce

  1. I just run mason publish --directory ./

Expected Behavior

Publish successfully.

Actual result

yassinsaddem@yassins-MBP custom_stacked_project_starter % mason publish --directory ./
✓ Bundled custom_stacked_project_starter (0.5s)

Publishing is forever; bricks cannot be unpublished.
See policy details at https://brickhub.dev/policy

Do you want to publish custom_stacked_project_starter 0.1.0+1? (y/N) Yes
✗ Publishing custom_stacked_project_starter 0.1.0+1 (0.6s)
Malformed bundle.
The brick.yaml repository field must be provided.
yassinsaddem@yassins-MBP custom_stacked_project_starter % ls                          
CHANGELOG.md                            README.md                               brick.yaml                              hooks
LICENSE                                 __brick__                               custom_stacked_project_starter.bundle

Additional Context

And this my brick.yaml file

name: custom_stacked_project_starter
description: A mason brick created with the Mason CLI to generate a custom stacked starter project.

version: 0.1.0+1

environment:
  mason: ">=0.1.0-dev.57 <0.1.0"

vars:
  uses_test:
    type: boolean
    description: A flag to indicate if the project uses unit test and widget test
    default: true
    prompt: Do you use unit test and widget test?
felangel commented 1 month ago

Hi @saddemYassin 👋 Thanks for opening an issue!

As the error message mentions, you're missing a repository field in your brick.yaml:

name: custom_stacked_project_starter
description: A mason brick created with the Mason CLI to generate a custom stacked starter project.
+ repository: https://github.com/user/repo
version: 0.1.0+1

environment:
  mason: ">=0.1.0-dev.57 <0.1.0"

vars:
  uses_test:
    type: boolean
    description: A flag to indicate if the project uses unit test and widget test
    default: true
    prompt: Do you use unit test and widget test?

Hope that helps 👍

saddemYassin commented 1 month ago

@felangel thank you that's work. I created a pull request in the doc repo Pull Request to enhance the documentation