Skip to content

Commit 788ec33

Browse files
committed
Version 0.93.37
1 parent bebd037 commit 788ec33

File tree

7 files changed

+37
-12
lines changed

7 files changed

+37
-12
lines changed

bin/spago.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package:
22
name: spago-bin
33
publish:
4-
version: 0.93.35
4+
version: 0.93.37
55
license: BSD-3-Clause
66
build:
77
strict: true

package-lock.json

Lines changed: 18 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spago",
3-
"version": "0.93.35",
3+
"version": "0.93.37",
44
"license": "BSD-3-Clause",
55
"description": "🍝 PureScript package manager and build tool",
66
"keywords": [
@@ -36,13 +36,13 @@
3636
"dependencies": {
3737
"better-sqlite3": "^11.0.0",
3838
"env-paths": "^3.0.0",
39-
"fast-glob": "^3.3.2",
4039
"fs-extra": "^11.2.0",
4140
"fuse.js": "^7.0.0",
4241
"glob": "^10.4.1",
4342
"markdown-it": "^14.1.0",
4443
"micromatch": "^4.0.7",
4544
"open": "^10.1.0",
45+
"picomatch": "^4.0.2",
4646
"punycode": "^2.3.1",
4747
"semver": "^7.6.2",
4848
"spdx-expression-parse": "^4.0.0",

spago.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package:
22
name: spago
33
publish:
4-
version: 0.93.35
4+
version: 0.93.37
55
license: BSD-3-Clause
66
location:
77
githubOwner: purescript

src/Spago/Command/Build.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Data.Set as Set
1414
import Data.Traversable (sequence)
1515
import Data.Tuple as Tuple
1616
import Record as Record
17+
import Registry.PackageName as PackageName
1718
import Spago.BuildInfo as BuildInfo
1819
import Spago.Cmd as Cmd
1920
import Spago.Command.Fetch as Fetch
@@ -159,8 +160,10 @@ run opts = do
159160
eitherGraph # either (prepareToDie >>> (_ $> false)) \graph -> do
160161
env <- ask
161162
checkResults <- map Array.fold $ for pedanticPkgs \(Tuple selected options) -> do
163+
logDebug $ "Checking imports for " <> PackageName.print selected.package.name
162164
Graph.toImportErrors selected options
163165
<$> runSpago (Record.union { selected, workspacePackages: selectedPackages } env) (Graph.checkImports graph)
166+
logDebug "Finished checking imports."
164167
if Array.null checkResults then
165168
pure true
166169
else

src/Spago/Glob.purs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
-- | We used to just FFI to `fast-glob` for all globbing business, but that was
2+
-- | way too slow. See #1182 for more info and a starting point.
3+
-- | All of this code (and the FFI file) is a series of attempts to make globbing
4+
-- | reasonably performant while still supporting all of our usecases, like ignoring
5+
-- | files based on `.gitignore` files.
16
module Spago.Glob (gitignoringGlob) where
27

38
import Spago.Prelude

src/Spago/Purs/Graph.purs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,20 @@ getModuleGraphWithPackage (ModuleGraph graph) = do
9696
# Map.union (Map.fromFoldable $ map mkPackageEntry selected)
9797
# Map.union testPackages
9898

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

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

186193
let
187194
dropValues = Map.mapMaybe (const (Just Map.empty))

0 commit comments

Comments
 (0)