Skip to content

Commit

Permalink
Merge pull request #696 from duncdrum/shared-resources
Browse files Browse the repository at this point in the history
Shared resources
  • Loading branch information
line-o authored Jun 30, 2021
2 parents eb633bd + aeb8d9a commit b578495
Show file tree
Hide file tree
Showing 49 changed files with 4,318 additions and 1,740 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
generators/app/templates/specs/integration/landing_spec.js
generators/app/templates/specs/mocha/rest_spec.js
generators/app/templates/specs/xqs/xqSuite.js

node_modules/
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
- name: Install dependencies
run: npm ci
- name: Release
Expand Down
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-standard"
}
21 changes: 19 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ module.exports = class extends Generator {
apptype: this.props.apptype[0]
})
this.fs.copyTpl(
this.templatePath('style.css'),
this.templatePath('styles/style.css'),
this.destinationPath('resources/css/style.css'), {
apptype: this.props.apptype[0]
})
Expand Down Expand Up @@ -595,6 +595,18 @@ module.exports = class extends Generator {
odd: this.props.odd
})

// #36 shared-resources
this.fs.copy(
this.templatePath('img/exist_icon_16x16.ico'),
this.destinationPath('resources/images/exist_icon_16x16.ico')
)
this.fs.copy(
this.templatePath('img/powered-by.svg'),
this.destinationPath('resources/images/powered-by.svg')
)

this.npmInstall(['bootstrap@5'])

// distinct contents (flexible)
// see #28
switch (this.props.apptype[0]) {
Expand All @@ -606,9 +618,14 @@ module.exports = class extends Generator {
mysec: this.props.mysec
})
this.fs.copy(
this.templatePath('exist-design/images/**'),
this.templatePath('img/exist-design/**'),
this.destinationPath('resources/images/')
)
// #36
this.fs.copy(
this.templatePath('styles/exist-2.2.css'),
this.destinationPath('resources/css/exist-2.2.css')
)
break
case 'plain':
this.fs.copyTpl(
Expand Down
46 changes: 25 additions & 21 deletions generators/app/templates/build.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="all" name="<%- title %>">
<description><%- desc %></description>
<xmlproperty file="expath-pkg.xml"/>
<property name="project.version" value="${package(version)}"/>
<property name="project.app" value="<%- title %>"/>
<property name="build.dir" value="build"/>
<description><%- desc %></description>
<xmlproperty file="expath-pkg.xml" />
<property name="project.version" value="${package(version)}" />
<property name="project.app" value="<%- title %>" />
<property name="build.dir" value="build" />

<!-- Start it -->
<target name="init" description="create build directory">
<tstamp/>
<mkdir dir="${build.dir}"/>
</target>
<!-- Start it -->
<target name="init" description="create build directory">
<tstamp />
<mkdir dir="${build.dir}" />
<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) -->
<target name="dev" depends="init" description="compile all source files">
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}-dev.xar" excludes="**/${build.dir}/**, **/node_modules/**"/>
</target>
<!-- Dev build (includes everything unoptimized) -->
<target name="dev" depends="init" description="compile all source files">
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}-dev.xar" excludes="**/${build.dir}/**, **/node_modules/**" />
</target>

<!-- Release build -->
<target name="deploy" depends="init" description="compile release build">
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}.xar" excludes="**/${build.dir}/**, .existdb.json, .yo-rc.json, **/node_modules/**, **/reports/**<% if (github) { -%><%- gitfiles -%><% } -%> <% if (docker) { -%><%- dockerfiles -%><% } -%>"/>
</target>
<!-- Release build -->
<target name="deploy" depends="init" description="compile release build">
<zip basedir="." destfile="${build.dir}/${project.app}-${project.version}.xar" excludes="**/${build.dir}/**, .existdb.json, .yo-rc.json, **/node_modules/**, **/reports/**<% if (github) { -%><%- gitfiles -%><% } -%> <% if (docker) { -%><%- dockerfiles -%><% } -%>" />
</target>

<target name="all" depends="dev, deploy">
<tstamp/>
</target>
<target name="all" depends="dev, deploy">
<tstamp />
</target>
</project>
Binary file removed generators/app/templates/exist-design/images/bold.gif
Binary file not shown.
Binary file removed generators/app/templates/exist-design/images/code.gif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion generators/app/templates/expath-pkg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
abbrev="<%- short %>" version="<%- version %>" spec="1.0">
<title><%- desc %></title>
<dependency processor="http://exist-db.org" semver-min="5.0.0"/>
<%_ if (apptype !== 'empty') { %><dependency package="http://exist-db.org/apps/shared" semver-min="0.8.4"/><% } -%>
<%_ if (apptype !== 'empty') { %><dependency package="http://exist-db.org/html-templating" semver-min="1.0.2"/><% } -%>
</package>
5 changes: 1 addition & 4 deletions generators/app/templates/github/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<%_ } else { _%>
![exist-db CI](https://github.com/<%- ghuser %>/<%- title %>/workflows/exist-db%20CI/badge.svg)
<% } -%>
[![Coverage percentage][coveralls-image]][coveralls-url]

<img src="icon.png" align="left" width="25%"/>

Expand Down Expand Up @@ -107,6 +106,4 @@ You can take a look at the [Contribution guidelines for this project](.github/CO
<%_ if (ci == 'travis') { %>
[travis-image]: https://travis-ci.com/<%- ghuser %>/<%- title %>.svg?branch=master
[travis-url]: https://travis-ci.com/<%- ghuser %>/<%- title %>
<% } -%>
[coveralls-image]: https://coveralls.io/repos/<%- ghuser %>/<%- title %>/badge.svg
[coveralls-url]: https://coveralls.io/r/<%- ghuser %>/<%- title %>
<% } -%>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added generators/app/templates/img/exist_icon_16x16.ico
Binary file not shown.
32 changes: 32 additions & 0 deletions generators/app/templates/img/existdb-web.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b578495

Please sign in to comment.