From 7c6d54dabd404ee8883fa4eaecd815a49b0df547 Mon Sep 17 00:00:00 2001 From: Roman Zoller Date: Fri, 25 Jan 2019 09:25:29 +0100 Subject: [PATCH] Add transpiled ES Module build with microbundle - Export EPSG codes everywhere, so they can be accessed as .code instead of .default - Set up index.js that imports and exports EPSG_* - Add build target using microbundle See https://github.com/geoblocks/base/issues/4 --- package.json | 5 +++++ src/EPSG_2056.js | 2 +- src/EPSG_2154.js | 2 +- src/EPSG_21781.js | 2 +- src/EPSG_27572.js | 2 +- src/EPSG_32631.js | 2 +- src/EPSG_3947.js | 2 +- src/index.js | 15 +++++++++++++++ 8 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/index.js diff --git a/package.json b/package.json index 815e36e..ed8afbd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,11 @@ "name": "@geoblocks/proj", "version": "0.3.0", "description": "Geoblocks projections", + "main": "dist/proj.js", + "module": "dist/proj.js", + "source": "src/index.js", "scripts": { + "build": "microbundle --format es", "eslint": "eslint src/*.js", "typecheck": "tsc --pretty", "lint": "npm run eslint && npm run typecheck", @@ -26,6 +30,7 @@ "babel-core": ">=7.0.0-bridge.0", "babel-jest": ">=23.6.0", "jest": ">=23.6.0", + "microbundle": "^0.9.0", "ol": ">=5.3.0", "proj4": ">=2.5.0", "typedoc": ">=0.13.0", diff --git a/src/EPSG_2056.js b/src/EPSG_2056.js index 65f23dc..383fa43 100644 --- a/src/EPSG_2056.js +++ b/src/EPSG_2056.js @@ -4,7 +4,7 @@ import somerc from './somerc.js'; import {create} from './utils.js'; -const code = 'EPSG:2056'; +export const code = 'EPSG:2056'; const def = ` +proj=${somerc} diff --git a/src/EPSG_2154.js b/src/EPSG_2154.js index 936ef02..24c27bf 100644 --- a/src/EPSG_2154.js +++ b/src/EPSG_2154.js @@ -4,7 +4,7 @@ import lcc from './lcc.js'; import {create} from './utils.js'; -const code = 'EPSG:2154'; +export const code = 'EPSG:2154'; const def = ` +proj=${lcc} diff --git a/src/EPSG_21781.js b/src/EPSG_21781.js index a248a67..62e16de 100644 --- a/src/EPSG_21781.js +++ b/src/EPSG_21781.js @@ -4,7 +4,7 @@ import somerc from './somerc.js'; import {create} from './utils.js'; -const code = 'EPSG:21781'; +export const code = 'EPSG:21781'; const def = ` +proj=${somerc} diff --git a/src/EPSG_27572.js b/src/EPSG_27572.js index b618fd5..b81a377 100644 --- a/src/EPSG_27572.js +++ b/src/EPSG_27572.js @@ -4,7 +4,7 @@ import lcc from './lcc.js'; import {create} from './utils.js'; -const code = 'EPSG:27572'; +export const code = 'EPSG:27572'; const def = ` +proj=${lcc} diff --git a/src/EPSG_32631.js b/src/EPSG_32631.js index d5a0fd5..4bccac9 100644 --- a/src/EPSG_32631.js +++ b/src/EPSG_32631.js @@ -4,7 +4,7 @@ import utm from './utm.js'; import {create} from './utils.js'; -const code = 'EPSG:32631'; +export const code = 'EPSG:32631'; const def = ` +proj=${utm} diff --git a/src/EPSG_3947.js b/src/EPSG_3947.js index fecbaed..1606236 100644 --- a/src/EPSG_3947.js +++ b/src/EPSG_3947.js @@ -4,7 +4,7 @@ import lcc from './lcc.js'; import {create} from './utils.js'; -const code = 'EPSG:3947'; +export const code = 'EPSG:3947'; const def = ` +proj=${lcc} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..079aa47 --- /dev/null +++ b/src/index.js @@ -0,0 +1,15 @@ +import * as EPSG_2056 from './EPSG_2056'; +import * as EPSG_2154 from './EPSG_2154'; +import * as EPSG_3947 from './EPSG_3947'; +import * as EPSG_21781 from './EPSG_21781'; +import * as EPSG_27572 from './EPSG_27572'; +import * as EPSG_32631 from './EPSG_32631'; + +export { + EPSG_2056, + EPSG_2154, + EPSG_3947, + EPSG_21781, + EPSG_27572, + EPSG_32631, +};