You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable spago init and spago upgrade-set to use user-specified package-set tag rather than latest release (#680)
* Enable user to specify a tag when initializing project via --tag
* Add --tag option to `upgrade-set` command
* Only notify user that package set doesn't exist if Dhall gets a 404
* Move useLatestRelease to where clause in updatePackageSetVersion
* Inline shared code into updatePackageSetVersion
* Implement tests for `--tag` parameter
* Update changelog: add --tag as new feature and 'breaking changes'
* Update readme to document --tag argument
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
Breaking changes (😱!!!):
11
+
-**Specify the package set version via `--tag` (#680)**
12
+
13
+
Example usage: `spago init --tag psc-0.13.2-20190725` and `spago upgrade-set --tag psc-0.13.2-20190725`. This is a breaking change because we are removing support for the old spacchetti/spacchetti-style location (i.e. in the src/packages.dhall) for the upgrade-set command.
Copy file name to clipboardExpand all lines: README.md
+47-7Lines changed: 47 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,6 @@ you'll have to carefully:
233
233
- try to run `spago install some-package` for packages in the set
234
234
-[add the missing packages](#add-a-package-to-the-package-set) if not in the set
235
235
236
-
237
236
### See what commands and flags are supported
238
237
239
238
For an overview of the available commands, run:
@@ -252,6 +251,14 @@ $ spago build --help
252
251
This will give a detailed view of the command, and list any command-specific
253
252
(vs global) flags.
254
253
254
+
### Setup a new project using a specific package set
255
+
256
+
Since `spago init` does not necessarily use the latest package set. Fortunately, you can specify which package set to use via the `--tag` argument. See the [`purescript/package-sets` repo's releases](https://github.com/purescript/package-sets/releases) for tags you can use:
257
+
258
+
```bash
259
+
$ spago init --tag "psc-0.13.8-20200822"
260
+
```
261
+
255
262
256
263
### Install a direct dependency
257
264
@@ -557,23 +564,47 @@ if you could pull request it to the [Upstream package-set][package-sets] ❤️
557
564
If you decide so, you can read up on how to do it [here][package-sets-contributing].
558
565
559
566
560
-
### Automagically upgrade the package set
567
+
### Upgrade the package set...
561
568
562
569
The version of the package-set you depend on is fixed in the `packages.dhall` file
563
570
(look for the `upstream` var).
564
571
565
572
You can upgrade to the latest version of the package-set with the `upgrade-set`
566
-
command, that will automatically find out the latest version, download it, and write
573
+
command. It will download the package set and write
567
574
the new url and hashes in the `packages.dhall` file for you.
568
575
576
+
Spago can update the package set to the latest release or to a specific release automagically. If you wish to use a specific commit, you will have to manually edit one part of your `packages.dhall` file. Each is covered below.
577
+
578
+
#### ...to the latest release automatically
579
+
569
580
Running it would look something like this:
570
581
571
582
```bash
572
-
$ spago upgrade-set
573
-
Found the most recent tag for"purescript/package-sets": "psc-0.12.3-20190227"
574
-
Package-set upgraded to latest tag "psc-0.12.3-20190227"
583
+
$ spago upgrade-set
584
+
[info] Updating package-set tag to "psc-0.13.8-20200822"
585
+
Fetching the new one and generating hashes.. (this might take some time)
586
+
[info] Generating new hashes for the package set file so it will be cached.. (this might take some time)
587
+
```
588
+
589
+
#### ...to a specific release automatically
590
+
591
+
If the package set exists, running `upgrade-set` would look something like this:
592
+
593
+
```bash
594
+
$ spago upgrade-set --tag "psc-0.13.8-20200822"
595
+
[info] Updating package-set tag to "psc-0.13.8-20200822"
575
596
Fetching the new one and generating hashes.. (this might take some time)
576
-
Done. Updating the local package-set file..
597
+
[info] Generating new hashes for the package set file so it will be cached.. (this might take some time)
598
+
```
599
+
600
+
If the package set does not exist, your `packages.dhall` file will not be touched and you will see a warning:
Copy file name to clipboardExpand all lines: src/Spago/CLI.hs
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ data Command
26
26
=DefaultShowVersion
27
27
28
28
--| Initialize a new project
29
-
| InitForceTemplateComments
29
+
| InitForceTemplateComments (MaybeText)
30
30
31
31
--| Install (download) dependencies defined in spago.dhall
32
32
| Install [PackageName]
@@ -47,7 +47,7 @@ data Command
47
47
| Login
48
48
49
49
--| Upgrade the package-set to the latest release
50
-
| PackageSetUpgrade
50
+
| PackageSetUpgrade (MaybeText)
51
51
52
52
--| Freeze the package-set so it will be cached
53
53
| Freeze
@@ -148,6 +148,7 @@ parser = do
148
148
usePsa = bool UsePsaNoPsa<$>CLI.switch "no-psa"'P'"Don't build with `psa`, but use `purs`"
149
149
openDocs = bool NoOpenDocsDoOpenDocs<$>CLI.switch "open"'o'"Open generated documentation in browser (for HTML format only)"
150
150
noComments = bool WithCommentsNoComments<$>CLI.switch "no-comments"'C'"Generate package.dhall and spago.dhall files without tutorial comments"
151
+
tag =CLI.optional $Opts.strOption (Opts.long "tag"<>Opts.help "Optional package set tag to be used instead of the latest one.")
151
152
configPath =CLI.optional $CLI.optText "config"'x'"Optional config path to be used instead of the default spago.dhall"
152
153
chkModsUniq = bool DoCheckModulesUniqueNoCheckModulesUnique<$>CLI.switch "no-check-modules-unique"'M'"Skip checking whether modules names are unique across all packages."
0 commit comments