junobuild / cli

The Juno command-line interface
MIT License
2 stars 2 forks source link

juno deploy pre-build #142

Closed peterpeterparker closed 3 weeks ago

peterpeterparker commented 2 months ago

We can add an option to the CLI to run npm run build (or yarn or pnpm) before juno deploy.

However, given that I think that other JS cli (Firebase etc.) does not do so, this should be an opt-in feature.

e.g. juno deploy -> do you want to build it -> y/n -> want to remember this option -> y/n

divin3circle commented 1 month ago

Yeah, I think that would help. Or maybe throw an error when juno deploy doesn't find a build folder.

peterpeterparker commented 4 weeks ago

After giving it some thought, long story short, the idea would be to be more generic and future proof by supporting various predeploy scripts at the project level.

e.g.

import { defineConfig } from "@junobuild/config";

export default defineConfig({
  satellite: {
    id: "qsgjb-riaaa-aaaaa-aaaga-cai",
    source: "dist",
    predeploy: [
      "./run-this-script.sh",
      "npm run do-something",
      "npm run build"
    ]
  }
});