mapbox / mapbox/martini

NPM package isn't published in es5

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
658
Forks
41
PR merge metrics
No merged PRs in 30d

Description

While trying to use Martini in a deck.gl terrain layer, I discovered the NPM package isn't transpiled to es5 (pure JS developers would run into syntax issues).

Could you publish an es5 version as the default along side es6 distributable?

Screen Shot 2020-02-03 at 6 45 55 PM

You might find [this article](https://www.grzegorowski.com/publishing-npm-package-with-rollup-babel-and) useful, it seems most folks are using babel (and this [plugin](https://github.com/rollup/rollup-plugin-babel)) to do the transpiling.
Here's a snippet of their rollup config.
```
babel({
// ignore node_modules/ in transpilation process
exclude: 'node_modules/**',
// ignore .babelrc (if defined) and use options defined here
babelrc: false,
// use recommended babel-preset-env without es modules enabled
// and with possibility to set custom targets e.g. { node: '8' }
presets: [['env', { modules: false, targets }]],
// solve a problem with spread operator transpilation https://github.com/rollup/rollup/issues/281
plugins: ['babel-plugin-transform-object-rest-spread'],
// removes comments from output
comments: false,
}),
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the package's Rollup publishing configuration and the existing ES6 distributable. Run the package build and verify that the default NPM artifact is transpiled to ES5 while the ES6 distributable remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, rollup
Domain
build-system, release
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.