Skip to content

Commit a9a5996

Browse files
committed
feat!: de-mavenize the build
Replace Maven with a Node.js/Gulp build modeled on eXist-db/monex@aa11953, and wire in semantic-release for automated releases. - Remove pom.xml, xar-assembly.xml, xquery-license-style.xml - Rewrite gulpfile.js to assemble the XAR end-to-end: stage src/main/xar-resources/ into .build/, compile sass, copy vendor assets, expand *.tmpl tokens via @existdb/gulp-replace-tmpl, and zip to dist/exist-function-documentation-<version>.xar - Add expath-pkg.xml.tmpl and repo.xml.tmpl as the single source of truth for package metadata, matching the deps declared in the prior xar-assembly.xml (exist 6.2.0 + html-templating 1.2.1). Move app fields (target, namespace, title, etc.) into package.json under "app" - Add .releaserc, commitlint.config.js, .husky/commit-msg, and scripts/update-repo-changelog.js for semantic-release - Replace Maven CI workflow with a Node build, install via @existdb/xst, Cypress test, and semantic-release job on master; add commitlint workflow - Add build.xml shim for downstream tooling that calls Ant - Drop maven ecosystem from dependabot.yml - Ignore .build/, dist/, .env, .claude/ BREAKING CHANGE: builds now require Node.js (lts/*) instead of Maven. Use \`npm ci && npm run build\` to produce the XAR.
1 parent f475d21 commit a9a5996

18 files changed

Lines changed: 12171 additions & 4759 deletions

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
EXISTDB_SERVER=http://localhost:8080
2+
EXISTDB_USER=admin
3+
EXISTDB_PASS=

.github/dependabot.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
version: 2
22
updates:
3-
- package-ecosystem: maven
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: "03:00"
8-
open-pull-requests-limit: 10
93
- package-ecosystem: npm
104
directory: "/"
115
schedule:

.github/workflows/ci.yml

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,72 @@
1-
name: CI
1+
name: Build
2+
23
on: [push, pull_request]
4+
35
jobs:
46
build:
5-
name: Exist ${{ matrix.exist-version }} (Java ${{ matrix.java-version }}) build and test
6-
strategy:
7-
fail-fast: false
8-
matrix:
9-
exist-version: [latest, 6.2.0]
10-
java-version: ['8', '21']
11-
os: [ubuntu-latest]
12-
exclude:
13-
- exist-version: 6.2.0
14-
java-version: 21
15-
- exist-version: latest
16-
java-version: 8
17-
18-
runs-on: ${{ matrix.os }}
7+
name: Build XAR
8+
runs-on: ubuntu-latest
199
steps:
2010
- uses: actions/checkout@v6
21-
- name: Set up JDK ${{ matrix.java-version }}
22-
uses: actions/setup-java@v5
11+
- uses: actions/setup-node@v6
2312
with:
24-
distribution: temurin
25-
cache: maven
26-
java-version: ${{ matrix.java-version }}
27-
- name: Install Test Dependencies
28-
run: |
29-
sudo apt-get update
30-
sudo apt-get install -y bats
31-
32-
- name: Maven Build
33-
run: mvn clean package
34-
35-
- name: set min templating version from pom
36-
run: |
37-
echo "TEMPLATING_VERSION=$(mvn help:evaluate -Dexpression=templating.version -q -DforceStdout)" >> $GITHUB_ENV
38-
39-
- name: Add expath dependencies
40-
working-directory: target
41-
run: |
42-
wget http://exist-db.org/exist/apps/public-repo/public/templating-${{ env.TEMPLATING_VERSION }}.xar -O 001.xar
43-
13+
node-version: 'lts/*'
14+
- run: npm ci --ignore-scripts
15+
- run: npm run build
16+
- name: Upload XAR
17+
uses: actions/upload-artifact@v4
18+
with:
19+
name: exist-function-documentation-xar
20+
path: dist/*.xar
4421

45-
# Install
46-
- name: Start exist-ci containers
47-
run: |
48-
docker run -dit -p 8080:8080 -v ${{ github.workspace }}/target:/exist/autodeploy \
49-
--name exist --rm --health-interval=1s --health-start-period=1s \
50-
duncdrum/existdb:${{ matrix.exist-version }}
51-
52-
- name: wait for install to finish
53-
timeout-minutes: 5
22+
test:
23+
name: Test (eXist latest)
24+
needs: build
25+
runs-on: ubuntu-latest
26+
services:
27+
exist:
28+
image: existdb/existdb:latest
29+
ports:
30+
- 8080:8080
31+
- 8443:8443
32+
steps:
33+
- uses: actions/checkout@v6
34+
- uses: actions/setup-node@v6
35+
with:
36+
node-version: 'lts/*'
37+
- run: npm ci --ignore-scripts
38+
- name: Install Cypress binary
39+
run: npx cypress install
40+
- run: npm run build
41+
- name: Install dependency XARs
5442
run: |
55-
while ! docker logs exist | grep -q "Server has started"; \
56-
do sleep 6s; \
57-
done
58-
59-
# Test
60-
- name: Run smoke test
61-
run: bats --tap src/test/bats/*.bats
62-
63-
- name: Run e2e test
43+
TEMPLATING_VERSION=$(node -p "require('./package.json').app.templatingVersion || '1.2.1'")
44+
wget -q "http://exist-db.org/exist/apps/public-repo/public/templating-${TEMPLATING_VERSION}.xar"
45+
npx --yes @existdb/xst package install "templating-${TEMPLATING_VERSION}.xar"
46+
env:
47+
EXISTDB_USER: admin
48+
EXISTDB_PASS:
49+
- name: Install XAR
50+
run: npx --yes @existdb/xst package install dist/exist-function-documentation-*.xar
51+
env:
52+
EXISTDB_USER: admin
53+
EXISTDB_PASS:
54+
- name: Run Cypress tests
6455
run: npx cypress run
6556

66-
# - name: Test
67-
# env:
68-
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
69-
# run: mvn verify
57+
release:
58+
name: Release
59+
runs-on: ubuntu-latest
60+
needs: test
61+
if: github.ref == 'refs/heads/master'
62+
steps:
63+
- uses: actions/checkout@v6
64+
with:
65+
fetch-depth: 0
66+
- uses: actions/setup-node@v6
67+
with:
68+
node-version: 'lts/*'
69+
- run: npm ci --ignore-scripts
70+
- run: npx semantic-release
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/commitlint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Commitlint
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v6
12+
with:
13+
fetch-depth: 0
14+
- uses: actions/setup-node@v6
15+
with:
16+
node-version: 'lts/*'
17+
- run: npm ci --ignore-scripts
18+
- run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
target/
2+
.build/
3+
dist/
24
node_modules/
35
node/
6+
.env
7+
.claude/
48
*.iml
59
.idea/
610
.settings/

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

.releaserc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"plugins": [
3+
["@semantic-release/commit-analyzer", {
4+
"preset": "conventionalcommits"
5+
}],
6+
["@semantic-release/release-notes-generator", {
7+
"preset": "conventionalcommits"
8+
}],
9+
["@semantic-release/exec", {
10+
"prepareCmd": "npm version ${nextRelease.version} --no-git-tag-version --allow-same-version && node scripts/update-repo-changelog.js --version=${nextRelease.version} --prev-tag=${lastRelease.version}",
11+
"publishCmd": "npm run build"
12+
}],
13+
["@semantic-release/github", {
14+
"assets": [{
15+
"path": "dist/exist-function-documentation-*.xar",
16+
"name": "exist-function-documentation-${nextRelease.version}.xar",
17+
"label": "Expath package (exist-function-documentation-${nextRelease.version}.xar)"
18+
}]
19+
}]
20+
]
21+
}

build.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project default="xar" name="exist-function-documentation">
3+
<target name="dependencies">
4+
<exec executable="npm"><arg value="install"/></exec>
5+
</target>
6+
<target name="xar" depends="dependencies">
7+
<exec executable="npm"><arg value="run"/><arg value="build"/></exec>
8+
</target>
9+
</project>

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default { extends: ['@commitlint/config-conventional'] }

expath-pkg.xml.tmpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<package xmlns="http://expath.org/ns/pkg"
3+
name="@namespace@"
4+
abbrev="@abbrev@"
5+
version="@version@"
6+
spec="1.0">
7+
<title>@title@</title>
8+
<dependency processor="http://exist-db.org" semver-min="@existVersion@"/>
9+
<dependency package="http://exist-db.org/html-templating" semver-min="@templatingVersion@"/>
10+
</package>

0 commit comments

Comments
 (0)