Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions changelog/unreleased/SOLR-18593-js-client-prod-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
title:
The generated JS client's build (solr/webapp/js-client) now installs with --include=dev, so it no
longer fails when the builder's environment has NODE_ENV=production set - npm would otherwise
skip the devDependencies (Babel and its plugins) that the build's own "prepare" script needs.
type: fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe user "other" for non-product fixes?

authors:
- name: Eric Pugh
nick: epugh
links:
- name: SOLR-18593
url: https://issues.apache.org/jira/browse/SOLR-18593
7 changes: 6 additions & 1 deletion solr/webapp/js-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ val syncJSClientSourceCode = tasks.register<Sync>("syncJSClientSourceCode") {
val jsClientDownloadDeps = tasks.register<NpmTask>("jsClientDownloadDeps") {
dependsOn(syncJSClientSourceCode)

args.set(listOf("install"))
// The 'prepare' lifecycle script (npm run build, i.e. babel) needs the devDependencies
// (@babel/core, presets, plugins) to run. --include=dev installs them regardless of a
// NODE_ENV=production in the caller's environment, which would otherwise make npm skip them
// and break this build - this workspace is purely a build-time code generator, not a published
// package, so there's no "production" artifact here to keep lean by omitting dev tooling.
args.set(listOf("install", "--include=dev"))
workingDir.set(jsClientWorkspace)

inputs.dir("$jsClientWorkspace/src")
Expand Down
Loading