Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. App packaging tip for easier building

App packaging tip for easier building

Scheduled Pinned Locked Moved App Packaging & Development
4 Posts 3 Posters 740 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • LanhildL Online
    LanhildL Online
    Lanhild
    App Dev
    wrote on last edited by
    #1

    Wanted to share something I do for my packages; Using a package.json to manage various scripts

    I use a package.json file with different scripts to achieve common Cloudron packaging tasks:

    • Building and pushing the Docker image
    • Installing my application (Production or test)
    • Updating my application (Production or test)
    • Linting the code related to my package

    It also offers a better portability for other potential developers (providing the Cloudron CLI as a dependency, etc.)

    Here is an example of one:

    {
      "name": "io.cloudron.yourapp",
      "description": "Cloudron Yourapp application",
      "scripts": {
        "build": "bash scripts/build.sh",
        "format": "npx prettier . --write",
        "lint:shell": "npx shellcheck -x scripts/*.sh",
        "lint:apply": "npx shellcheck -f diff scripts/*.sh | git apply",
        "update:prod": "bash scripts/update.sh -l prod",
        "update:test": "bash scripts/update.sh -l test",
        "prepare": "husky"
      },
      "devDependencies": {
        "husky": "^9.0.11",
        "prettier": "^3.3.1",
        "cloudron": "^5.5.0",
        "shellcheck": "^2.2.0"
      }
    }
    

    Apart from a package.json, I also ship all of my packages repos with files such as .editorconfig and .prettierrc to help uniformize my different packages.

    1 Reply Last reply
    4
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      @Lanhild what is .editorconfig and .prettierrc ?

      BrutalBirdieB 1 Reply Last reply
      0
      • girishG girish

        @Lanhild what is .editorconfig and .prettierrc ?

        BrutalBirdieB Offline
        BrutalBirdieB Offline
        BrutalBirdie
        Partner
        wrote on last edited by BrutalBirdie
        #3

        @girish .editorconfig for => https://editorconfig.org/ && VSCODE and .prettierrc for => https://prettier.io/docs/en/configuration.html
        Some quality of life files that makes coding and style consistent with editor automation.
        They are considered personnel files, since another user fight have different preferences about style and so on.
        But in a given shared project sense this can also be a foundation on how the style is meant to be.

        Like my work? Consider donating a drink. Cheers!

        1 Reply Last reply
        2
        • LanhildL Online
          LanhildL Online
          Lanhild
          App Dev
          wrote on last edited by Lanhild
          #4

          @girish

          To make it more clear, I have made a template repository with all the files and scripts I usually use for my Cloudron apps.

          In the future, we might benefit from adopting such a strategy for the Cloudron CLI init script by using these files as a template/starter Cloudron app project. It'd make maintenance easier, more uniform, and make the process less daunting for new app devs.

          https://github.com/Lanhild/starter-cloudron

          1 Reply Last reply
          3
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Bookmarks
          • Search