Skip to content

Commit

Permalink
Implement threads.js and parcel-bundler (#131)
Browse files Browse the repository at this point in the history
* refactor: implement Pool with threads.js

* test: add worker pool test

* refactor: implement pool with threadjs

* chore: remove worker-loader

* tests: force tests to fail at the right step

* chore: lint

* fix: build
chore: upgrade dependencies

* chore: add browser target to package.json

* chore: configure polyfill with core-js instead of @babel/polyfill

* tests: disable worker test, not working with mocha 7.1

* feat: parcel-bundler working with same features as webpack

* chore: cleanup webpack artifacts

* chore: cleanup and small fixes

* chore: remove core-js (not necessary with parcel)

* chore: set prepublish to prepublishOnly to prevent double build on npm install, expose GeoTIFF as global variable for browser build

* doc: update README to match parcel-bundler configuration

* chore: upgrade thread.js dependency to 1.3.1

* chore: remove regenerator-runtime and swithc back to babel plugin-transform-runtime

* chore: remove unecessary index from import

* chore: add missing changes to babelrc and main, set dev port to 8090

* chore: remove unused lzw test file

* chore: remove unnecessary *tif from test/.gitignore

* chore: remove eslint fix quirks

* chore: apply eslint rule curly 'all' and brace-style 1tbs
  • Loading branch information
PacoDu authored Mar 25, 2020
1 parent fae3129 commit d3b0958
Show file tree
Hide file tree
Showing 25 changed files with 7,704 additions and 8,855 deletions.
12 changes: 2 additions & 10 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"presets": ["env"],
"plugins": [
[
"transform-runtime",
{
"polyfill": false,
"regenerator": true
}
]
]
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-runtime"]
}
8 changes: 3 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
module.exports = {
'extends': 'airbnb',
'parser': 'babel-eslint',
'parserOptions': {
'sourceType': 'module',
'allowImportExportEverywhere': false
},
'env': {
'mocha': true,
'browser': true,
Expand Down Expand Up @@ -34,6 +29,7 @@ module.exports = {
],
'no-console': 0,
'no-bitwise': 0,
'max-classes-per-file': 0,
'import/prefer-default-export': 0,
'prefer-default-export': 0,
'func-names': 0,
Expand All @@ -42,5 +38,7 @@ module.exports = {
'object-curly-newline': 0,
'no-await-in-loop': 0,
'prefer-destructuring': ['error', { 'object': true, 'array': false }],
'curly': ['error', 'all'],
'brace-style': ['error', '1tbs', { 'allowSingleLine': false }]
}
};
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
node_modules
dist/
.cache
dist
dist-node
dist-browser
.DS_Store
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ To do some in-browser testing do:
npm run dev
```

and navigate to `http://localhost:8090/`
and navigate to `http://localhost:8090/index.html`

To build the library do:

```bash
npm run build
```

The output is written to `dist/geotiff.browserify.js` and `dist/geotiff.browserify.min.js`.
The output is written to `dist-browser/main.js` and `dist-node/main.js`.

## Usage

Expand All @@ -117,10 +117,7 @@ import GeoTIFF from 'geotiff';
or:

```html
<script src="dist/geotiff.bundle.js"></script>
<!-- or use the minified version:
<script src="dist/geotiff.bundle.min.js"></script>
-->
<script src="dist-browser/main.js"></script>
<script>
console.log(GeoTIFF);
</script>
Expand Down
Loading

0 comments on commit d3b0958

Please sign in to comment.