Slackbot
05/30/2022, 7:21 PMChris Lee
05/30/2022, 7:40 PMnisse
05/30/2022, 7:43 PMnisse
05/30/2022, 7:44 PMnisse
05/30/2022, 7:44 PMChris Lee
05/30/2022, 7:45 PMoutputs.upToDateWhen {}
that returns true when all expected symlinks exist.nisse
05/30/2022, 7:48 PMa
. The pnpm install
task will be the one creating all the files, so I don't know which files will be created by the pnpm install
task. I don't understand how I can avoid having outputs.dir("node_modules")
?nisse
05/30/2022, 7:49 PMoutput.files()
change the behaviour of the symlink logic in Gradle's up to date check?Chris Lee
05/30/2022, 7:51 PMnisse
05/30/2022, 7:52 PMnisse
05/30/2022, 7:53 PM@types/bar
differs when it's linked to /home/user/.pnpm/@types/bar/0.0.1
vs /home/user/.pnpm/@types/bar/0.0.2
Chris Lee
05/30/2022, 7:56 PMnisse
05/30/2022, 8:00 PMpnpm run build
getting triggered since Gradle will believe that the output of pnpm install
has changed? Do the same thing with the outputs (i.e. custom provider) ? Never used a custom provider with files, so I'm not sure about the pitfallsnisse
05/30/2022, 8:03 PMpnpm install
to be a guard file with the hash or something of all the symlinks and their targetsnisse
05/30/2022, 8:05 PMThomas Broyer
05/31/2022, 8:45 AMpnpm install
is really fast, then maybe you could do it in the same task as pnpm run build
, and then use the pnpm-lock.yaml
as input rather than the node_modules
.nisse
05/31/2022, 8:47 AMpnpm install
(as opposed to how it used to be with npm ci
), that should always be correct. Thanks!nisse
05/31/2022, 8:48 AMinput.file()
. I like thisnisse
05/31/2022, 10:03 AMpnpm-lock.yaml
will probably not be updated when an upstream workspace dependency is changed, thus not triggering the build of this subproject. I will most likely have to do tasks.named("pnpmBuild") { inputs.dir("../../other-project/src/main/javascript") }
to get this to work reliably 😞nisse
05/31/2022, 10:07 AMother-project
pnpmBuild
-task will export a consumable configuration (non-cached) with the javascript output just so I can have that as input for the pnpmInstall
-taskdeepy
05/31/2022, 10:13 AMpackages.json
as an input and the install task as a dependency and reap the benefits of cachingnisse
05/31/2022, 11:27 AMpnpm-lock.yaml
I assume (until I've tested it) that pnpm workspaces will not update neither pnpm-lock.yaml
nor package.json
when just a workspace dependency changes.nisse
06/02/2022, 5:20 PMpnpm install
is necessary by checking the correct importers
section of the pnpm-lock.yaml, because pnpm install
takes about 40 secs. For some reason it's much faster when doing every repo by itself compared to all together. Probably something O(N²) in there somewhere with dependencies.deepy
06/13/2022, 8:30 AMnisse
06/13/2022, 8:35 AMdeepy
06/13/2022, 8:38 AMnisse
06/13/2022, 8:39 AMnisse
06/13/2022, 8:48 AM:nodeSetup
:npmSetup
:pnpmSetup
:pnpmInstall
:project1:frontend:nodeSetup
:project1:frontend:npmSetup
:project1:frontend:pnpm_build
:project1:frotnend:assemble
nisse
06/13/2022, 8:51 AMnpx
with pnpm exec
to avoid themdeepy
06/13/2022, 8:54 AM(p)npmInstall
is going to incur a cost, at least until I get around to finishing the build service/worker api stuffnisse
06/13/2022, 9:01 AMpnpmInstall
parallelized if you run it per project with Gradle. It also allows for better granularity so that I don't need to pnpm install in the project that I don't care about right now. Because even if pnpm just symlinks, any dependency only available in those projects are obviously downloaded only if those projects are pnpmInstall'ed. But meh, moot point. CI will take 30 seconds per job longer and they'll be happy.
As a bonus I can rub their nose in it every time they complain about build times. 😉
Just to be clear, I'm talking about setting the flag in the root .npmrc recursive-install=true
nisse
06/13/2022, 9:17 AMpnpmInstall
👍
I would've like to have an option for --frozen-lockfile for pnpmInstall
, but that's something that isn't available in the plugin's yarnInstall
either (only available for npmInstall
via node { npmInstallCommand = "ci" }
), so that's nothing new.deepy
06/13/2022, 9:21 AMPnpmExecRunner
is the "Run something through pnpm" and not necessarily a pnpm exec
, it's the core functionality that wraps Gradle's exec
And unfortunately, unlike npx
and pnpm dlx
I think pnpm exec
would depend on pnpmInstall
since it runs something from the context of node_modules
, but pnpm exec
could probably easily be implemented through a PnpmTask
nisse
06/13/2022, 9:38 AM:project1:frontend:pnpmInstall
, we must depend on the root :pnpmInstall
. But I agree, a pnpmExec {}
construct that does "the right thing" would be very easy to implement for us, especially as we already have that 😃nisse
06/13/2022, 9:40 AMnisse
06/13/2022, 9:58 AMCannot include build 'gradle-node-plugin' in build 'buildSrc'. This is not supported yet.
deepy
06/13/2022, 10:36 AMdeepy
06/13/2022, 10:36 AMbuildSrc
to a composite build 😉nisse
06/13/2022, 10:37 AMapply(plugin = "org.gradle.maven-publish")
and the run ./gradlew publishToMavenLocal
nisse
06/13/2022, 10:37 AMnisse
06/13/2022, 11:20 AMtasks
.withType(PnpmTask::class.java)
.configureEach {
execOverrides = {
standardOutput = LogOutputStream(<http://LogLevel.INFO|LogLevel.INFO>, logger)
errorOutput = LogOutputStream(LogLevel.ERROR, logger)
}
}
tasks.withType(PnpmSetupTask::class.java)
.configureEach {
execOverrides = {
standardOutput = NullOutputStream.NULL_OUTPUT_STREAM
}
}
nisse
06/13/2022, 12:59 PM--silent
seems to do the trick, and everything works well with new plugin. 👍deepy
06/27/2022, 7:49 AMnisse
06/27/2022, 8:21 AM