Skip to content

Commit

Permalink
Merge pull request #4413 from camptocamp/api_build
Browse files Browse the repository at this point in the history
API build and gh-pages update
  • Loading branch information
fredj committed Nov 28, 2018
2 parents 6b8e06d + 6b52477 commit b682131
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.pyc
.*.swp
/apidoc/
/api/dist/api.*
/.transifexrc
/package-lock.json
/.build/
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ script:
- buildtools/test_examples.py 1/1
# Generate API doc
- npm run doc
- npm run build-api

deploy:
- provider: script
Expand Down
7 changes: 6 additions & 1 deletion api/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

import EPSG21781 from '@geoblocks/sources/EPSG21781.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';

/**
* @type {string}
*/
export const themesUrl = 'https://geomapfish-demo-dc.camptocamp.com/2.4/themes?version=2&background=background';

/**
* @type {Array<string>}
*/
export const supportedProjections = [EPSG21781, EPSG2056];

/**
* @type {string}
Expand Down
1 change: 1 addition & 0 deletions buildtools/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ popd
mkdir -p ${TMP}/${GIT_BRANCH}/examples
cp -r .build/examples-hosted/* ${TMP}/${GIT_BRANCH}/examples/
cp -r apidoc ${TMP}/${GIT_BRANCH}/
cp -r api/dist ${TMP}/${GIT_BRANCH}/api

# Rewrite root commit and force push
pushd ${TMP}
Expand Down
16 changes: 14 additions & 2 deletions buildtools/webpack.api.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');


const dest = path.resolve(__dirname, 'api/dist/');
const dest = path.resolve(__dirname, '../api/dist/');

module.exports = (env, argv) => {
const library = argv.library ? argv.library : 'demo';
return {
entry: './api/index.js',
devtool: 'source-map',
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [require.resolve('@babel/preset-env')]
}
}
}]
},
output: {
filename: 'api.js',
path: dest,
Expand Down

0 comments on commit b682131

Please sign in to comment.