Coder Social home page Coder Social logo

recast-utils's Introduction

Geoblocks

Description

Geoblocks are pieces of code:

  • with minimal dependencies choosing versions;
  • independant;
  • easy to use;
  • tested and documented testing;
  • maintained by the people who use them;
  • written in plain ES6 or typescript;
  • distributed as ES6 modules + typescript d.ts typing.

Github / Npm

Each block is maintained in its own independant github repository in the github geoblocks organisation.

Blocks are published on npm in the npm geoblocks organisation.

Usage

The proj block exposes OpenLayers projections. To use them:

  • npm i --save @geoblocks/proj
  • import EPSG_2056 from '@geoblocks/proj/src/EPSG_2056.js';
  • you are done!

Contributing

  • Create issue / PR in the block;
  • A block maintainer will review and merge;
  • To create new blocks get in touch with us.

Choosing dependency versions

Each block has a package.json file specifying the dependencies of the block. For each dependency, the block author must specify a range starting at the smallest usable version.

Let's take an example. The proj block depends on OpenLayers 5. It is usable with all the versions in the range [5.3.0, current] so the package.json file must contain:

ol": ">=5.3.0",

During the CI tests, both version 5.3.0 and the latest version are tested. Here is how it is handled.

Typing

Blocks can be written as plain ES6 modules. But to catch errors early and to benefit from modern Javascript editing in code editors like VSCode, it is required to:

  • publish typescript definition files (d.ts);
  • define typescript interfaces when implementing a generic feature.

With proper annotations, note that plain ES6 modules blocks can use typescript as a typechecker.

Testing

  • enable CI with tests and coverage example with JEST;
  • publish a documentation;
  • eventually publish examples.

See the sources block.

recast-utils's People

Contributors

gberaudo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.