Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt generator-exist, add tests #15

Merged
merged 27 commits into from
Feb 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c3881ed
Regenerate app scaffolding using generator-exist
joewiz Feb 5, 2022
4e03938
Adapt test.md to XQSuite
joewiz Feb 5, 2022
fe09373
Regenerate with generator-exist main branch
joewiz Feb 6, 2022
99ff276
Ditch ant, use gulp for build, deploy, test
joewiz Feb 6, 2022
a5f01e3
Remove unneeded file
joewiz Feb 6, 2022
1e6ca05
Minor textual fixes
joewiz Feb 7, 2022
1a468cb
Update test-suite.xqm
lguariento Feb 7, 2022
b0d1421
Update test-suite.xqm
lguariento Feb 7, 2022
b2a0e01
Place tests in order of test.md
joewiz Feb 7, 2022
645dc51
Reformat function signatures
joewiz Feb 8, 2022
24d7b9e
Add missing code block test
joewiz Feb 8, 2022
dc0b858
Align test names & functions with test.md
joewiz Feb 8, 2022
78ffefb
Fix tests involving reference-style links
joewiz Feb 8, 2022
740d89b
Supply expected result for HTML containing md
joewiz Feb 8, 2022
8b0c7d1
Fix whitespace in expected results
joewiz Feb 8, 2022
0ce5068
Add h2 section headings in comments
joewiz Feb 8, 2022
d481c70
Remove boilerplate test
joewiz Feb 8, 2022
4ff9e6d
Add test for headers & section nesting
joewiz Feb 8, 2022
f7af6e1
Align test name with test.md
joewiz Feb 8, 2022
4bfaa59
Add comment about source of tests
joewiz Feb 8, 2022
d78223a
Port gulp-exist fix from templating
joewiz Feb 8, 2022
c00f03d
Add test for TEI output
joewiz Feb 8, 2022
2921a3a
Remove link to ?mode=tei since now only a library
joewiz Feb 8, 2022
c9dc495
Markdown is capitalized
joewiz Feb 8, 2022
0495a76
Note breaking change in release notes for 1.0.0
joewiz Feb 8, 2022
e1ac0d4
Markdown is capitalized
joewiz Feb 8, 2022
173e01f
Revert inadvertent change
joewiz Feb 8, 2022
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
30 changes: 30 additions & 0 deletions .existdb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"servers": {
"localhost": {
"server": "http://localhost:8080/exist",
"user": "admin",
"password": "",
"root": "/db/system/repo/markdown"
}
},
"sync": {
"server": "localhost",
"ignore": [
".existdb.json",
".git/**",
"node_modules/**",
"package*.json",
".vscode/**"
]
},
"package": {
"author": "eXist-db Project",
"target": "markdown",
"description": "Markdown Parser in XQuery",
"namespace": "http://exist-db.org/apps/markdown",
"website": "https://github.com/eXist-db/exist-markdown",
"status": "beta",
"title": "Markdown Parser in XQuery",
"license": "LGPL-2.1"
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
29 changes: 29 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing

:balloon: First off, thank you for considering contributing to exist-markdown. :balloon:

All pull-requests are welcome. File a bug report, fix a typo, improve the documentation, or add a new feature. All are helpful, and make exist-markdown better.

Please have a quick look at these guidelines to help both you and the developers to keep things moving smoothly.

## Basic Conduct

* Please be respectful when discussing changes and issues. Consider that not everyone's first language is english.
* Create an issue for any major changes and enhancements that you wish to make.

If this is your first time contributing to a project you might want to take a look [here](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).

## Getting started
1. Create your own fork of the code.

2. Do the changes in your fork.
* Minor changes that don't impact code functionality (typos, inline comments, … ) can be done in the master branch.
* Functional changes should be collected in their own branch.

3. If you like the change and think the project could use it:
* Open a pull request referencing the issue describing the new feature in the comment section \([how-to](https://github.com/blog/1506-closing-issues-via-pull-requests)\).

Once your pull request has been reviewed it will be merged. You can greatly help the reviewer by:
* sticking to one feature per pull request.
* use [meaningful](https://chris.beams.io/posts/git-commit/) commit messages inside your feature branch.
* filling out the pull request & issue templates.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''

---

### Expected behavior

### Actual behavior

### Reproduction steps

### Please provide the following
* Java Version:
* exist-db version:
* exist-markdown version:
* OS version:
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest an idea
title: ''
labels: enhancement
assignees: ''

---

### Your Ideal Solution

### Any Alternative Options

### Additional Context
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Thank you for your Pull Request

If you're adding a new feature, please adjust / add tests covering your code changes. You can reference any related issues below.

Fixes #
98 changes: 98 additions & 0 deletions .github/workflows/exist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# This workflow builds a xar archive, deploys it into exist and execute its test suites.
# It also includes code for using semantic-release to upload packages as part of GitHub releases
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: exist-db CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
exist-version: [latest, release]
node-version: [14.x]
# TODO: see #563 could still be usefull for gulp builds
# services:
# # Label used to access the service container
# exist:
# image: existdb/existdb:${{ matrix.exist-version}}
# ports:
# - 8080:8080

steps:
# Checkout code
- uses: actions/checkout@v2
# set-up caches
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

# Build Frontend
- name: Build Frontend Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci

- run: npm run build:all

# Deploy Package in Container
- name: Pull Base Image
run: docker pull existdb/existdb:${{ matrix.exist-version }}

- name: Create CI Container
run: docker create --name exist-ci -p 8080:8080 existdb/existdb:${{ matrix.exist-version }}

- name: Prep CI Container
run: docker cp ./markdown-*.xar exist-ci:exist/autodeploy

- name: Start Exist Container
run: docker start exist-ci && sleep 30

# Testing
- name: Run Unit Tests
run: npm test

# TODO: Add upload to dockerhub
# release:
# name: Release
# runs-on: ubuntu-latest
# needs: build
# if: github.ref == 'refs/heads/master'
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Setup Node.js
# uses: actions/setup-node@v1
# with:
# node-version: 14
# - name: Install dependencies
# run: npm ci
# - name: Create package
# run: npm run build
# - name: Release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: npx semantic-release


167 changes: 165 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,165 @@
build
expath-pkg.xml
# =========================
# Operating System Files
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# =========================
# Files that might appear in the root of a volume
# =========================

.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
# Network Trash Folder
Temporary Items
.apdisk


# =========================
# Application Files
# =========================

~$*.xlsx
.~lock*

# =========================
# exist-db specific files
# =========================

*.xar
# .existdb.json
query-results

# =========================
# other
# =========================
.env
.yo-rc.json
node_modules/
coverage/
build/
bower_components/
reports/

# =========================
# tei-pub (gulp)
# =========================
webtest/bin
webtest/reports
webtest/errorShots

##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*

##############################
## Maven
##############################
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
pom.xml.bak
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

##############################
## Gradle
##############################
bin/
build/
.gradle
.gradletasknamecache
gradle-app.setting
!gradle-wrapper.jar

##############################
## IntelliJ
##############################
out/
.idea/
.idea_modules/
*.iml
*.ipr
*.iws

##############################
## Eclipse
##############################
.settings/
bin/
tmp/
.metadata
.classpath
.project
*.tmp
*.bak
*.swp
*~.nib
local.properties
.loadpath
.factorypath

##############################
## NetBeans
##############################
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml

##############################
## Visual Studio Code
##############################
.vscode/
.code-workspace
Loading