Skip to content

Commit

Permalink
Fix the output flag to not provide a default value (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f authored Oct 11, 2023
1 parent 1875379 commit 439ac9c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bin/spago.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: spago-bin
publish:
version: 0.93.15
version: 0.93.17
license: BSD-3-Clause
dependencies:
- aff
Expand Down
27 changes: 12 additions & 15 deletions bin/src/Flags.purs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ import Spago.Prelude

import Data.Array as Array
import Data.List as List
import Data.Set.NonEmpty (NonEmptySet)
import Data.Set.NonEmpty as NonEmptySet
import Options.Applicative (FlagFields, Mod, Parser)
import Options.Applicative as O
import Options.Applicative.Types as O
import Options.Applicative.Types as OT
import Spago.Core.Config as Core

flagMaybe (a Type). a -> Mod FlagFields (Maybe a) -> Parser (Maybe a)
flagMaybe a mod = O.flag Nothing (Just a) mod

selectedPackage :: Parser (Maybe String)
selectedPackage =
O.optional $
OT.optional $
O.strOption
( O.long "package"
<> O.short 'p'
Expand Down Expand Up @@ -52,23 +50,23 @@ minify =

entrypoint :: Parser (Maybe String)
entrypoint =
O.optional
OT.optional
$ O.strOption
( O.long "module"
<> O.help "The module to bundle as the entrypoint"
)

bundleType :: Parser (Maybe String)
bundleType =
O.optional
OT.optional
$ O.strOption
( O.long "bundle-type"
<> O.help "The type of the module produced. 'app' will call main, 'module' will just export the contents."
)

outfile :: Parser (Maybe String)
outfile =
O.optional
OT.optional
$ O.strOption
( O.long "outfile"
<> O.help "Destination path for the bundle"
Expand All @@ -77,7 +75,7 @@ outfile =
-- TODO make an ADT for node and browser
platform :: Parser (Maybe String)
platform =
O.optional
OT.optional
$ O.option
( O.eitherReader
case _ of
Expand All @@ -91,12 +89,11 @@ platform =

output :: Parser (Maybe String)
output =
O.optional
OT.optional
$ O.strOption
( O.long "output"
<> O.help "The output directory for compiled files"
<> O.metavar "DIR"
<> O.value "output"
)

quiet :: Parser Boolean
Expand Down Expand Up @@ -174,7 +171,7 @@ pursArgs =

execArgs :: Parser (Maybe (Array String))
execArgs =
O.optional
OT.optional
$ Array.fromFoldable
<$> O.many
( O.strArgument
Expand All @@ -194,7 +191,7 @@ backendArgs =

moduleName :: Parser (Maybe String)
moduleName =
O.optional
OT.optional
$ O.strOption
( O.long "main"
<> O.short 'm'
Expand Down Expand Up @@ -232,23 +229,23 @@ package =

maybeVersion :: Parser (Maybe String)
maybeVersion =
O.optional $
OT.optional $
O.strArgument
( O.metavar "VERSION"
<> O.help "Package version"
)

maybeSetVersion :: Parser (Maybe String)
maybeSetVersion =
O.optional $
OT.optional $
O.strOption
( O.long "package-set"
<> O.help "Optional package set version to be used instead of the latest one"
)

maybePackageName :: Parser (Maybe String)
maybePackageName =
O.optional $
OT.optional $
O.strOption
( O.long "name"
<> O.help "Optional package name to be used for the new project"
Expand Down
1 change: 0 additions & 1 deletion bin/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Data.JSDate as JSDate
import Data.List as List
import Data.Map as Map
import Data.Maybe as Maybe
import Data.Set.NonEmpty (NonEmptySet)
import Data.String as String
import Effect.Aff as Aff
import Effect.Ref as Ref
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spago",
"version": "0.93.15",
"version": "0.93.17",
"license": "BSD-3-Clause",
"description": "🍝 PureScript package manager and build tool",
"keywords": [
Expand Down Expand Up @@ -29,7 +29,7 @@
"format": "purs-tidy format-in-place core src bin docs-search",
"format:check": "purs-tidy check core src bin docs-search",
"bundle": "spago bundle -p spago-bin",
"prepublishOnly": "./bin/index.dev.js bundle -p spago-bin"
"prepublishOnly": "spago build && ./bin/index.dev.js bundle -p spago-bin"
},
"dependencies": {
"better-sqlite3": "^8.6.0",
Expand Down
2 changes: 1 addition & 1 deletion spago.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: spago
publish:
version: 0.93.15
version: 0.93.17
license: BSD-3-Clause
location:
githubOwner: purescript
Expand Down

0 comments on commit 439ac9c

Please sign in to comment.