From 2da7056ebe38074b8997eb125dbd1fc19abceeb9 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Wed, 23 Mar 2022 11:31:26 -0300 Subject: [PATCH] Fix nodeModules scope to avoid polluting TL namespace Ref: https://github.com/dagger/dagger/issues/1711 Signed-off-by: Marcos Lilljedahl --- .../examples/todoapp/netlify.cue | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pkg/universe.dagger.io/examples/todoapp/netlify.cue b/pkg/universe.dagger.io/examples/todoapp/netlify.cue index 3e764954..0c5cda96 100644 --- a/pkg/universe.dagger.io/examples/todoapp/netlify.cue +++ b/pkg/universe.dagger.io/examples/todoapp/netlify.cue @@ -8,16 +8,15 @@ import ( "universe.dagger.io/netlify" ) -nodeModulesMount: "/src/node_modules": dagger.#Mount & { - dest: "/src/node_modules" - type: "cache" - contents: dagger.#CacheDir & { - id: "todoapp-modules-cache" - } - -} - dagger.#Plan & { + _nodeModulesMount: "/src/node_modules": dagger.#Mount & { + dest: "/src/node_modules" + type: "cache" + contents: dagger.#CacheDir & { + id: "todoapp-modules-cache" + } + + } client: { filesystem: { ".": read: { @@ -63,7 +62,7 @@ dagger.#Plan & { id: "todoapp-yarn-cache" } } - nodeModulesMount + _nodeModulesMount } script: contents: #""" yarn config set cache-folder /cache/yarn @@ -76,7 +75,7 @@ dagger.#Plan & { test: bash.#Run & { input: deps.output workdir: "/src" - mounts: nodeModulesMount + mounts: _nodeModulesMount script: contents: #""" yarn run test """# @@ -85,7 +84,7 @@ dagger.#Plan & { build: { run: bash.#Run & { input: test.output - mounts: nodeModulesMount + mounts: _nodeModulesMount workdir: "/src" script: contents: #""" yarn run build