Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-cup committed Feb 27, 2025
1 parent 194f5ae commit c71a6b3
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@
"step": "packages:mise"
},
{
"include": [
"/app/node_modules"
],
"step": "prune"
},
{
"exclude": [
"node_modules"
],
"include": [
"."
],
Expand Down Expand Up @@ -126,23 +117,15 @@
}
},
{
"caches": [
"npm-install"
],
"commands": [
{
"cmd": "npm prune --omit=dev"
}
],
"inputs": [
{
"step": "install"
}
],
"name": "prune",
"variables": {
"NPM_CONFIG_PRODUCTION": "true"
}
"secrets": [
"*"
]
},
{
"caches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
"step": "packages:mise"
},
{
"include": [
"/app/node_modules"
],
"step": "prune"
},
{
"exclude": [
"node_modules"
],
"include": [
"."
],
Expand Down Expand Up @@ -125,24 +116,15 @@
}
},
{
"caches": [
"bun-install"
],
"commands": [
{
"cmd": "sh -c 'rm -rf node_modules \u0026\u0026 bun install --production'",
"customName": "rm -rf node_modules \u0026\u0026 bun install --production"
}
],
"inputs": [
{
"step": "install"
}
],
"name": "prune",
"variables": {
"NPM_CONFIG_PRODUCTION": "true"
}
"secrets": [
"*"
]
},
{
"caches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
"step": "packages:mise"
},
{
"include": [
"/app/node_modules"
],
"step": "prune"
},
{
"exclude": [
"node_modules"
],
"include": [
".",
"/root/.cache"
Expand Down Expand Up @@ -137,23 +128,15 @@
}
},
{
"caches": [
"pnpm-install"
],
"commands": [
{
"cmd": "pnpm prune --prod"
}
],
"inputs": [
{
"step": "install"
}
],
"name": "prune",
"variables": {
"NPM_CONFIG_PRODUCTION": "true"
}
"secrets": [
"*"
]
},
{
"caches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@
"step": "packages:mise"
},
{
"include": [
"/app/node_modules"
],
"step": "prune"
},
{
"exclude": [
"node_modules"
],
"include": [
"."
],
Expand Down Expand Up @@ -129,23 +120,15 @@
}
},
{
"caches": [
"npm-install"
],
"commands": [
{
"cmd": "npm prune --omit=dev"
}
],
"inputs": [
{
"step": "install"
}
],
"name": "prune",
"variables": {
"NPM_CONFIG_PRODUCTION": "true"
}
"secrets": [
"*"
]
},
{
"caches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
"step": "packages:mise"
},
{
"include": [
"/app/node_modules"
],
"step": "prune"
},
{
"exclude": [
"node_modules"
],
"include": [
"."
],
Expand Down Expand Up @@ -133,23 +124,15 @@
}
},
{
"caches": [
"npm-install"
],
"commands": [
{
"cmd": "npm prune --omit=dev"
}
],
"inputs": [
{
"step": "install"
}
],
"name": "prune",
"variables": {
"NPM_CONFIG_PRODUCTION": "true"
}
"secrets": [
"*"
]
},
{
"caches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
"step": "packages:mise"
},
{
"include": [
"/app/node_modules"
],
"step": "prune"
},
{
"exclude": [
"node_modules"
],
"include": [
"."
],
Expand Down Expand Up @@ -125,23 +116,15 @@
}
},
{
"caches": [
"npm-install"
],
"commands": [
{
"cmd": "npm prune --omit=dev"
}
],
"inputs": [
{
"step": "install"
}
],
"name": "prune",
"variables": {
"NPM_CONFIG_PRODUCTION": "true"
}
"secrets": [
"*"
]
},
{
"caches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
"step": "packages:mise"
},
{
"include": [
"/app/node_modules"
],
"step": "prune"
},
{
"exclude": [
"node_modules"
],
"include": [
"."
],
Expand Down Expand Up @@ -137,23 +128,15 @@
}
},
{
"caches": [
"pnpm-install"
],
"commands": [
{
"cmd": "pnpm prune --prod"
}
],
"inputs": [
{
"step": "install"
}
],
"name": "prune",
"variables": {
"NPM_CONFIG_PRODUCTION": "true"
}
"secrets": [
"*"
]
},
{
"caches": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
"step": "packages:mise"
},
{
"include": [
"/app/node_modules"
],
"step": "prune"
},
{
"exclude": [
"node_modules"
],
"include": [
".",
"/root/.cache"
Expand Down Expand Up @@ -168,23 +159,15 @@
}
},
{
"caches": [
"npm-install"
],
"commands": [
{
"cmd": "npm prune --omit=dev"
}
],
"inputs": [
{
"step": "install"
}
],
"name": "prune",
"variables": {
"NPM_CONFIG_PRODUCTION": "true"
}
"secrets": [
"*"
]
},
{
"caches": [
Expand Down
8 changes: 3 additions & 5 deletions core/providers/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ func (p *NodeProvider) Plan(ctx *generate.GenerateContext) error {
// Prune
prune := ctx.NewCommandStep("prune")
prune.AddInput(plan.NewStepInput(install.Name()))
p.PruneNodeDeps(ctx, prune)
if p.shouldPrune(ctx) {
p.PruneNodeDeps(ctx, prune)
}

// Build
build := ctx.NewCommandStep("build")
Expand Down Expand Up @@ -154,10 +156,6 @@ func (p *NodeProvider) shouldPrune(ctx *generate.GenerateContext) bool {
}

func (p *NodeProvider) PruneNodeDeps(ctx *generate.GenerateContext, prune *generate.CommandStepBuilder) {
if !p.shouldPrune(ctx) {
return
}

prune.Variables["NPM_CONFIG_PRODUCTION"] = "true"
prune.Secrets = []string{}
p.packageManager.PruneDeps(ctx, prune)
Expand Down

0 comments on commit c71a6b3

Please sign in to comment.