Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Sep 22, 2024
1 parent 06a211f commit 1366ddd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 73 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ junit.xml

# Yarn
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
.yarnrc.yml
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
Expand All @@ -78,7 +76,4 @@ node/
node_modules/

# Generated JavaScript Bundles
jsbundles

# In case someone accidentally runs npm install instead of yarn install
package-lock.json
war/src/main/webapp/jsbundles/
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ node/

.git

.yarnrc.yml

# libraries / external deps / generated files
war/src/main/js/plugin-setup-wizard/bootstrap-detached.js
war/src/main/webapp/scripts/yui
Expand Down
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enableGlobalCache: false
nodeLinker: node-modules
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ MAVEN_OPTS='--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/ja
### Running the Yarn frontend build

> [!TIP]
> If you already have Node.js installed, you do not need to change your path. Start using `yarn` by enabling [Corepack](https://yarnpkg.com/corepack) with `corepack enable`, if it isn't already; this will add the `yarn` binary to your PATH.
> If you already have Node.js 20.x LTS installed, you do not need to change your path. Start using Yarn by enabling [Corepack](https://yarnpkg.com/corepack) with `corepack enable`, if it isn't already; this will add the `yarn` binary to your path.
To run the Yarn frontend build, after [building the WAR file](#building-the-war-file), add the downloaded versions of Node and Yarn to your path:

```sh
export PATH=$PWD/node:$PWD/node/yarn/dist/bin:$PATH
export PATH=$PWD/node:$PWD/node/node_modules/corepack/shims:$PATH
```

Then you can run Yarn with e.g.
Expand Down
55 changes: 12 additions & 43 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ THE SOFTWARE.
<!-- Make sure to keep the jetty-ee9-maven-plugin version in war/pom.xml in sync with the Jetty release in Winstone: -->
<winstone.version>8.1</winstone.version>
<node.version>20.17.0</node.version>
<!-- frontend-maven-plugin will install this Yarn version as bootstrap, then hand over control to Yarn Berry. -->
<yarn.version>1.22.19</yarn.version>
<!-- maven-antrun-plugin will download this Yarn version. -->
<yarn-berry.version>4.5.0</yarn-berry.version>
<yarn-berry.sha256sum>cc00dce5de4f68d11450519a0f69eadf2a1cbe5cc0d8e740bfac817a31d76874</yarn-berry.sha256sum>
</properties>

<!--
Expand Down Expand Up @@ -430,66 +425,40 @@ THE SOFTWARE.
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>download-yarn</id>
<goals>
<goal>run</goal>
</goals>
<phase>initialize</phase>
<configuration>
<target>
<property name="yarn.dest" value="${project.basedir}/.yarn/releases/yarn-${yarn-berry.version}.cjs" />
<dirname file="${yarn.dest}" property="yarn.dest.dir" />
<mkdir dir="${yarn.dest.dir}" />
<get dest="${yarn.dest}" src="https://repo.yarnpkg.com/${yarn-berry.version}/packages/yarnpkg-cli/bin/yarn.js" usetimestamp="true" />
<checksum algorithm="SHA-256" file="${yarn.dest}" property="${yarn-berry.sha256sum}" verifyProperty="yarn.checksum.matches" />
<condition property="yarn.checksum.matches.fail">
<equals arg1="${yarn.checksum.matches}" arg2="false" />
</condition>
<fail if="yarn.checksum.matches.fail">Checksum error</fail>
<echo file="${project.basedir}/.yarnrc.yml">yarnPath: ${yarn.dest}</echo>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.15.1</version>
<executions>
<execution>
<id>install node and yarn</id>
<id>install node and corepack</id>
<goals>
<goal>install-node-and-yarn</goal>
<goal>install-node-and-corepack</goal>
</goals>
<phase>initialize</phase>
<configuration>
<nodeVersion>v${node.version}</nodeVersion>
<yarnVersion>v${yarn.version}</yarnVersion>
<nodeDownloadRoot>https://repo.jenkins-ci.org/nodejs-dist/</nodeDownloadRoot>
<!-- tried to create a mirror for yarnDownloadRoot but it did not work -->
</configuration>
</execution>
<execution>
<id>yarn install</id>
<goals>
<goal>yarn</goal>
<goal>corepack</goal>
</goals>
<phase>initialize</phase>
<configuration>
<arguments>yarn install</arguments>
</configuration>
</execution>
<execution>
<id>yarn build</id>
<goals>
<goal>yarn</goal>
<goal>corepack</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<arguments>build</arguments>
<arguments>yarn build</arguments>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -517,11 +486,11 @@ THE SOFTWARE.
<execution>
<id>yarn lint:ci</id>
<goals>
<goal>yarn</goal>
<goal>corepack</goal>
</goals>
<phase>test</phase>
<configuration>
<arguments>lint:ci</arguments>
<arguments>yarn lint:ci</arguments>
<skip>${yarn.lint.skip}</skip>
</configuration>
</execution>
Expand Down Expand Up @@ -550,11 +519,11 @@ THE SOFTWARE.
<execution>
<id>yarn lint</id>
<goals>
<goal>yarn</goal>
<goal>corepack</goal>
</goals>
<phase>test</phase>
<configuration>
<arguments>lint</arguments>
<arguments>yarn lint</arguments>
<skip>${yarn.lint.skip}</skip>
</configuration>
</execution>
Expand Down
20 changes: 0 additions & 20 deletions war/.gitignore

This file was deleted.

0 comments on commit 1366ddd

Please sign in to comment.