Fix nodeModules scope to avoid polluting TL namespace

Ref: https://github.com/dagger/dagger/issues/1711
Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
Marcos Lilljedahl 2022-03-23 11:31:26 -03:00
parent 85b044ebf4
commit 2da7056ebe

View File

@ -8,16 +8,15 @@ import (
"universe.dagger.io/netlify"
)
nodeModulesMount: "/src/node_modules": dagger.#Mount & {
dagger.#Plan & {
_nodeModulesMount: "/src/node_modules": dagger.#Mount & {
dest: "/src/node_modules"
type: "cache"
contents: dagger.#CacheDir & {
id: "todoapp-modules-cache"
}
}
dagger.#Plan & {
}
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