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

Next major version release #701

Merged
merged 9 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 5 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: ['12', '14', '16']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test
release:
Expand All @@ -30,9 +31,10 @@ jobs:
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Release
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,30 +88,30 @@ Since if would be impractical to go through all possible combinations of option
├── LICENSE
├── README.md
├── admin
│   ├── controller.xql
│   ├── controller.xq
│   ├── index.html
│   └── security.html
├── build
│   ├── exide_demo-1.0.0-dev.xar
│   └── exide_demo-1.0.0.xar
├── build.xml
├── collection.xconf
├── controller.xql
├── controller.xq
├── cypress.json
├── error-page.html
├── expath-pkg.xml
├── icon.png
├── index.html
├── modules
│   ├── app.xql
│   ├── app.xqm
│   ├── config.xqm
│   └── view.xql
├── node_modules
│   └── pruned …
├── package-lock.json
├── package.json
├── post-install.xql
├── pre-install.xql
├── post-install.xq
├── pre-install.xq
├── repo.xml
├── reports
│   ├── screenshots
Expand Down Expand Up @@ -160,7 +160,7 @@ Since if would be impractical to go through all possible combinations of option
│   └── rest_spec.js
└── xqs
├── test-runner.xq
├── test-suite.xql
├── test-suite.xqm
└── xqSuite.js
```

Expand All @@ -174,22 +174,22 @@ Since if would be impractical to go through all possible combinations of option
│   └── plain_demo-1.0.0.xar
├── build.xml
├── collection.xconf
├── controller.xql
├── controller.xq
├── cypress.json
├── error-page.html
├── expath-pkg.xml
├── icon.png
├── index.html
├── modules
│   ├── app.xql
│   ├── app.xqm
│   ├── config.xqm
│   └── view.xql
├── node_modules
│   └── pruned …
├── package-lock.json
├── package.json
├── post-install.xql
├── pre-install.xql
├── post-install.xq
├── pre-install.xq
├── repo.xml
├── reports
│   ├── screenshots
Expand All @@ -215,7 +215,7 @@ Since if would be impractical to go through all possible combinations of option
│   └── rest_spec.js
└── xqs
├── test-runner.xq
├── test-suite.xql
├── test-suite.xqm
└── xqSuite.js
```

Expand Down Expand Up @@ -254,7 +254,7 @@ Since if would be impractical to go through all possible combinations of option
│   └── rest_spec.js
└── xqs
├── test-runner.xq
├── test-suite.xql
├── test-suite.xqm
└── xqSuite.js
```

Expand All @@ -272,16 +272,16 @@ Since if would be impractical to go through all possible combinations of option
│   └── pruned …
├── package-lock.json
├── package.json
├── post-install.xql
├── pre-install.xql
├── post-install.xq
├── pre-install.xq
├── repo.xml
└── test
├── mocha
│   ├── app_spec.js
│   └── rest_spec.js
└── xqs
├── test-runner.xq
├── test-suite.xql
├── test-suite.xqm
└── xqSuite.js
```

Expand All @@ -305,5 +305,5 @@ MIT © [Duncan Paterson](https://github.com/duncdrum)
[npm-url]: https://www.npmjs.com/package/@existdb/generator-exist
[sem-rel-img]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[sem-rel-url]: https://github.com/semantic-release/semantic-release
[codacy-image]: https://api.codacy.com/project/badge/Grade/a03a4fbd291a48739e69cdd2af50df05
[codacy-url]: https://www.codacy.com/app/eXist-db/generator-exist?utm_source=github.com&utm_medium=referral&utm_content=eXist-db/generator-exist&utm_campaign=Badge_Grade
[codacy-image]: https://api.codacy.com/project/badge/Grade/340ad1d77d624bcf8edf036c181d4459
[codacy-url]: https://app.codacy.com/gh/eXist-db/generator-exist?utm_source=github.com&utm_medium=referral&utm_content=eXist-db/generator-exist&utm_campaign=Badge_Grade_Settings
26 changes: 13 additions & 13 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module.exports = class extends Generator {
type: 'confirm',
name: 'post',
message: 'Would you like to generate a post-install script?',
default: 'post-install.xql'
default: 'post-install.xq'
},
// TODO multi authors see #41
{
Expand Down Expand Up @@ -414,9 +414,9 @@ module.exports = class extends Generator {
apptype: this.props.apptype[1],
status: this.props.status,
pre: this.props.pre,
prexq: 'pre-install.xql',
prexq: 'pre-install.xq',
post: this.props.post,
postxq: 'post-install.xql',
postxq: 'post-install.xq',
setperm: this.props.setperm,
website: this.props.website,
license: this.props.license[0],
Expand All @@ -439,8 +439,8 @@ module.exports = class extends Generator {

// Unit Test
this.fs.copyTpl(
this.templatePath('specs/xqs/test-suite.xql'),
this.destinationPath('test/xqs/test-suite.xql'), {
this.templatePath('specs/xqs/test-suite.xqm'),
this.destinationPath('test/xqs/test-suite.xqm'), {
apptype: this.props.apptype[0],
short: this.props.short,
defcoll: this.props.defcoll,
Expand Down Expand Up @@ -553,8 +553,8 @@ module.exports = class extends Generator {

// XQuery
this.fs.copyTpl(
this.templatePath('xq/controller.xql'),
this.destinationPath('controller.xql'), {
this.templatePath('xq/controller.xq'),
this.destinationPath('controller.xq'), {
apptype: this.props.apptype[0],
mysec: this.props.mysec
})
Expand All @@ -569,8 +569,8 @@ module.exports = class extends Generator {
version: this.props.version
})
this.fs.copyTpl(
this.templatePath('xq/app.xql'),
this.destinationPath('modules/app.xql'), {
this.templatePath('xq/app.xqm'),
this.destinationPath('modules/app.xqm'), {
short: this.props.short,
defcoll: this.props.defcoll,
defuri: this.props.defuri,
Expand Down Expand Up @@ -643,8 +643,8 @@ module.exports = class extends Generator {
// Pre-install
if (this.props.pre) {
this.fs.copyTpl(
this.templatePath('xq/pre-install.xql'),
this.destinationPath('pre-install.xql'), {
this.templatePath('xq/pre-install.xq'),
this.destinationPath('pre-install.xq'), {
version: this.props.version,
author: this.props.author,
website: this.props.website
Expand All @@ -654,8 +654,8 @@ module.exports = class extends Generator {
// Post-install
if (this.props.post) {
this.fs.copyTpl(
this.templatePath('xq/post-install.xql'),
this.destinationPath('post-install.xql'), {
this.templatePath('xq/post-install.xq'),
this.destinationPath('post-install.xq'), {
apptype: this.props.apptype[0],
version: this.props.version,
author: this.props.author,
Expand Down
2 changes: 2 additions & 0 deletions generators/app/templates/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
<target name="init" description="create build directory">
<tstamp />
<mkdir dir="${build.dir}" />
<%_ if (apptype !== 'empty') { %>
<copy file="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" todir="resources/scripts" />
<copy file="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map" todir="resources/scripts" />
<copy file="node_modules/bootstrap/dist/css/bootstrap.min.css" todir="resources/css" />
<copy file="node_modules/bootstrap/dist/css/bootstrap.min.css.map" todir="resources/css" />
<% } -%>
</target>

<!-- Dev build (includes everything unoptimized) -->
Expand Down
21 changes: 5 additions & 16 deletions generators/app/templates/ci/exist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
exist-version: [latest, release]
java-version: [8]
node-version: [12.x, 14.x]
node-version: ['12', '14']
# TODO: see #563 could still be usefull for gulp builds
# services:
# # Label used to access the service container
Expand All @@ -25,19 +25,6 @@ jobs:
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:
Expand All @@ -48,9 +35,10 @@ jobs:

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

# Build Expath Package
Expand Down Expand Up @@ -93,9 +81,10 @@ jobs:
# with:
# fetch-depth: 0
# - name: Setup Node.js
# uses: actions/setup-node@v1
# uses: actions/setup-node@v2
# with:
# node-version: 14
# cache: 'npm'
# - name: Install dependencies
# run: npm ci
# - name: Create package
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/expath-pkg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<package xmlns="http://expath.org/ns/pkg" name="<%- defuri %>/<%- defcoll %>/<%- short %>"
abbrev="<%- short %>" version="<%- version %>" spec="1.0">
<title><%- desc %></title>
<dependency processor="http://exist-db.org" semver-min="5.0.0"/>
<dependency processor="http://exist-db.org" semver-min="5.3.0"/>
<%_ if (apptype !== 'empty') { %><dependency package="http://exist-db.org/html-templating" semver-min="1.0.2"/><% } -%>
</package>
2 changes: 1 addition & 1 deletion generators/app/templates/github/__gitignore__
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ nb-configuration.xml
## Visual Studio Code
##############################
.vscode/
.code-workspace
*.code-workspace
2 changes: 1 addition & 1 deletion generators/app/templates/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 data-template="config:app-title">Generated page</h1>
<p>
This is the entry page into your application and was generated by yeoman. It uses HTML templates for a clean separation of HTML views and application logic.</p>
<p>To add your own template functions, start by editing the XQuery module:
<pre>app.xql</pre>.</p>
<pre>app.xqm</pre>.</p>
</div>
<div class="row">
<div class="col-md-6">
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/specs/integration/landing_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('The landing page', function () {
it <%_ if (apptype == 'empty') { %>.skip <% } _%> ('should load ', function () {
cy.visit('/exist/<%- defcoll %>/<%- short %>/index.html')
.get('.alert')
.contains('app.xql')
.contains('app.xqm')
})

<%_ if (mysec) { %>
Expand Down
4 changes: 2 additions & 2 deletions generators/app/templates/specs/xqs/test-runner.xq
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ xquery version "3.1";
: @see http://www.exist-db.org/exist/apps/doc/xqsuite
:)
import module namespace test="http://exist-db.org/xquery/xqsuite" at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql";
import module namespace tests="<%- defuri %>/<%- defcoll %>/<%- short %>/tests" at "test-suite.xql";
import module namespace tests="<%- defuri %>/<%- defcoll %>/<%- short %>/tests" at "test-suite.xqm";

declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "json";
declare option output:media-type "application/json";

test:suite(
inspect:module-functions(xs:anyURI("test-suite.xql"))
inspect:module-functions(xs:anyURI("test-suite.xqm"))
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ xquery version "3.1";

module namespace tests = "<%- defuri %>/<%- defcoll %>/<%- short %>/tests";
<%_ if (apptype !== 'empty') { %>
import module namespace app = "<%- defuri %>/<%- defcoll %>/<%- short %>/templates" at "../../modules/app.xql";
import module namespace app = "<%- defuri %>/<%- defcoll %>/<%- short %>/templates" at "../../modules/app.xqm";
<% } -%>

declare namespace test="http://exist-db.org/xquery/xqsuite";
Expand Down
4 changes: 2 additions & 2 deletions generators/app/templates/xq/view.xql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(:~
: This is the main XQuery which will (by default) be called by controller.xql
: This is the main XQuery which will (by default) be called by controller.xq
: to process any URI ending with ".html". It receives the HTML from
: the controller and passes it to the templating system.
:
Expand All @@ -16,7 +16,7 @@ import module namespace lib="http://exist-db.org/xquery/html-templating/lib";
:)

import module namespace config="<%- defuri %>/<%- defcoll %>/<%- short %>/config" at "config.xqm";
import module namespace app="<%- defuri %>/<%- defcoll %>/<%- short %>/templates" at "app.xql";
import module namespace app="<%- defuri %>/<%- defcoll %>/<%- short %>/templates" at "app.xqm";


declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
Expand Down
Loading