Skip to content

Commit

Permalink
Version 0.93.37
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f committed Jul 11, 2024
1 parent bebd037 commit 788ec33
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 12 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.35
version: 0.93.37
license: BSD-3-Clause
build:
strict: true
Expand Down
26 changes: 18 additions & 8 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.35",
"version": "0.93.37",
"license": "BSD-3-Clause",
"description": "🍝 PureScript package manager and build tool",
"keywords": [
Expand Down Expand Up @@ -36,13 +36,13 @@
"dependencies": {
"better-sqlite3": "^11.0.0",
"env-paths": "^3.0.0",
"fast-glob": "^3.3.2",
"fs-extra": "^11.2.0",
"fuse.js": "^7.0.0",
"glob": "^10.4.1",
"markdown-it": "^14.1.0",
"micromatch": "^4.0.7",
"open": "^10.1.0",
"picomatch": "^4.0.2",
"punycode": "^2.3.1",
"semver": "^7.6.2",
"spdx-expression-parse": "^4.0.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.35
version: 0.93.37
license: BSD-3-Clause
location:
githubOwner: purescript
Expand Down
3 changes: 3 additions & 0 deletions src/Spago/Command/Build.purs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Data.Set as Set
import Data.Traversable (sequence)
import Data.Tuple as Tuple
import Record as Record
import Registry.PackageName as PackageName
import Spago.BuildInfo as BuildInfo
import Spago.Cmd as Cmd
import Spago.Command.Fetch as Fetch
Expand Down Expand Up @@ -159,8 +160,10 @@ run opts = do
eitherGraph # either (prepareToDie >>> (_ $> false)) \graph -> do
env <- ask
checkResults <- map Array.fold $ for pedanticPkgs \(Tuple selected options) -> do
logDebug $ "Checking imports for " <> PackageName.print selected.package.name
Graph.toImportErrors selected options
<$> runSpago (Record.union { selected, workspacePackages: selectedPackages } env) (Graph.checkImports graph)
logDebug "Finished checking imports."
if Array.null checkResults then
pure true
else
Expand Down
5 changes: 5 additions & 0 deletions src/Spago/Glob.purs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-- | We used to just FFI to `fast-glob` for all globbing business, but that was
-- | way too slow. See #1182 for more info and a starting point.
-- | All of this code (and the FFI file) is a series of attempts to make globbing
-- | reasonably performant while still supporting all of our usecases, like ignoring
-- | files based on `.gitignore` files.
module Spago.Glob (gitignoringGlob) where

import Spago.Prelude
Expand Down
7 changes: 7 additions & 0 deletions src/Spago/Purs/Graph.purs
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,20 @@ getModuleGraphWithPackage (ModuleGraph graph) = do
# Map.union (Map.fromFoldable $ map mkPackageEntry selected)
# Map.union testPackages

-- TODO: here we are calculating the globs for each package, potentially multiple times.
-- We should memoise them, so that when we get the graph for a monorepo we don't evaluate the globs again.
-- Each call is a few milliseconds, but there are potentially hundreds of those, and it adds up.
logDebug "Calling pathToPackage..."
pathToPackage :: Map FilePath PackageName <- map (Map.fromFoldable <<< Array.fold)
$ for (Map.toUnfoldable allPackages)
\(Tuple name package) -> do
-- Basically partition the modules of the current package by in src and test packages
let withTestGlobs = if (Set.member name (Map.keys testPackages)) then OnlyTestGlobs else NoTestGlobs
logDebug $ "Getting globs for package " <> PackageName.print name
globMatches :: Array FilePath <- map Array.fold $ traverse compileGlob (Config.sourceGlob withTestGlobs name package)
pure $ map (\p -> Tuple p name) globMatches

logDebug "Got the pathToPackage map, calling packageGraph"
let
-- Using `pathToPackage`, add the PackageName to each module entry in the graph
addPackageInfo :: ModuleGraphWithPackage -> Tuple ModuleName ModuleGraphNode -> ModuleGraphWithPackage
Expand Down Expand Up @@ -182,6 +188,7 @@ checkImports :: forall a. ModuleGraph -> Spago (ImportsGraphEnv a) ImportCheckRe
checkImports graph = do
env@{ selected, workspacePackages } <- ask
packageGraph <- runSpago (Record.union { selected: workspacePackages } env) $ getModuleGraphWithPackage graph
logDebug $ "Got the package graph for package " <> PackageName.print selected.package.name

let
dropValues = Map.mapMaybe (const (Just Map.empty))
Expand Down

0 comments on commit 788ec33

Please sign in to comment.