These are unofficial bundles for Oskari created by the Oskari community. Many of them add value to your Oskari install, but they come with no official support from the core Oskari team.
To use bundles from this repo in your application (see sample-application
as a template for customized application repository):
- Add dependency like
oskari-frontend
in your applicationspackage.json
:
"oskari-frontend-contrib": "https://git@github.com/oskariorg/oskari-frontend-contrib.git#2.0.0"
Where 2.0.0
at the end is a tag in the repository. Tags are used to mark versions. Use the same version that you use for oskari-frontend
for best compatibility.
-
Run
npm install
on your app -
In your applications
main.js
import the bundles the same way you would import bundles fromoskari-frontend
but just with a different path:
import 'oskari-loader!oskari-frontend-contrib/packages/analysis/ol/analyse/bundle.js';
import 'oskari-loader!oskari-frontend-contrib/packages/mapping/ol/mapanalysis/bundle.js';
If you want to develop the contrib bundles or contribute a new one you will need to set up the dependency in dev-mode
like you would do with oskari-frontend
.
This repository, the main oskari-frontend repository and your applications repository should be located side by side on your filesystem. Here are the steps to setup the build environment:
- Make sure you have the command line programs
git
, andnode
version 10 or greater - Clone the main frontend repository:
git clone https://github.com/oskariorg/oskari-frontend.git
- Clone the contrib repository (this one):
git clone https://github.com/oskariorg/oskari-frontend-contrib.git
- Now we have directories
oskari-frontend
andoskari-frontend-contrib
side by side
- Now we have directories
- Run
npm install
inoskari-frontend
folder - Run
npm install ../oskari-frontend
in your applications folder (for examplesample-application
) - Run
npm install ../oskari-frontend-contrib
in your applications folder (for examplesample-application
)
In this model, it's left to the developer to checkout the correct branches/versions of the above repos.
With the symlinks in place import-statements and other path references to oskari-frontend
will resolve to the appropriate directories.
If you would like to contribute your own bundles to this repo, please make a Pull request. Each bundle should have a README stating:
- Which versions of Oskari the bundle is compatible with
- Who is the maintainer of the bundle (contact information)
Before adding a library dependency (either under libraries/
or via NPM), you should check if the library is already included in oskari-frontend
repo. If it is, you can reference it in your bundle.js with eg. oskari-frontend/libraries/geostats/1.5.0/lib/geostats.min.js
. NPM package dependencies defined in oskari-frontend
repo can be imported directly in code found in this repo eg. Open Layers import olMap from 'ol/Map';
. Note: this is not how node module resolution usually works; it's a special feature of the Oskari build system aimed to avoid library code duplication & version conflicts. To see which packages can be used in this way, see dependencies
in oskari-frontend package.json.
This work is dual-licensed under MIT and EUPL v1.1 (any language version applies, English version is included in https://github.com/oskariorg/oskari-docs/blob/master/documents/LICENSE-EUPL.pdf). You can choose between one of them if you use this work.
SPDX-License-Identifier: MIT OR EUPL-1.1
Copyright (c) 2014-present National Land Survey of Finland