Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
env: {
browser: true,
es6: true,
node: true
},
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
package-lock.json
dist/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing newline?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, this is great - thanks for doing this. I think only very small changes stand between the current state and merging this PR.

Cool.

I do have some higher level feedback / questions:

  • I understand why individual developers might want to use yarn, but I don't see a strong reason to force people to use it. Everyone should have npm and they have essentially the same features and performance these days. Alternatively, yarn could be installed as a dev dependency so people can just run npx yarn.

OK, I've ported it back to npm.

  • It would be useful to add some guidance to the README regarding how non-TypeScript users could import only part of the project. Alternatively, it'd be nice if the build process emitted separate files for each source file (in addition to a combined file) so that non-TypeScript users could use parts of the project without needing a TypeScript compiler / bundler.

I will have to think about this.

  • It seems that build files are omitted from this PR; how would you then propose that the demo remain functional, and how would you propose doing releases of this library? (Understanding this is a merge blocker.)

The demo simply runs as before. I changed almost nothing in the demo files. Just try

npm run build
npm run serve
  • It looks like source maps aren't emitted? That seems like a significant regression, probably a merge blocker. Should be a small change to add that.

Yes, I'll re-enable them.

  • Is the idea with ESM that a consumer will use Rollup or something like it, with their own custom config, to consume the imports, bundle everything up, and eventually minify it? As is, the UMD version is a much smaller file than the ESM version.

Exactly. People who use modules will have their own bundler, like webpack or similar. They will run their own minifier, of course.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-enabled sourcemaps, now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The demo simply runs as before. I changed almost nothing in the demo files. Just try
npm run build
npm run serve

Since the artifacts produced by npm run build are not tracked by git, the demo will not run on GitHub Pages. (Previously the artifacts were tracked in the build folder, whereas with this PR they're in the dist folder which is in .gitignore.) Similarly, I think library releases would require an additional packaging step so that consumers would not have to build this project in order to make use of it as a dependency.

66 changes: 0 additions & 66 deletions .jscs.json

This file was deleted.

121 changes: 0 additions & 121 deletions Gruntfile.js

This file was deleted.

19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@

## Usage

You can download the script normally, install it with Bower (`bower install
THREE.Terrain`), or install it with npm (`npm install three.terrain.js`). To
include it on a page client-side without a module loader:
You can download the script normally, or install it with npm or yarn
(`npm install three.terrain.js`). To include it on a page client-side
without a module loader:

```html
<!-- from a direct download or git clone -->
<script src="build/THREE.Terrain.min.js"></script>
<script src="dist/THREE.Terrain.umd.js"></script>

<!-- from Bower -->
<script src="bower_components/THREE.Terrain/build/THREE.Terrain.min.js"></script>

<!-- from npm -->
<script src="node_modules/three.terrain.js/build/THREE.Terrain.min.js"></script>
<!-- from npm or yarn -->
<script src="node_modules/three.terrain.js/dist/THREE.Terrain.umd.js"></script>
```

You then have access to the `THREE.Terrain` object. (Make sure the `three.js`
Expand Down Expand Up @@ -65,7 +62,7 @@ terrainScene.add(decoScene);
```

All parameters are optional and thoroughly documented in the
[source code](https://github.com/IceCreamYou/THREE.Terrain/blob/gh-pages/build/THREE.Terrain.js).
[source code](https://github.com/IceCreamYou/THREE.Terrain/blob/gh-pages/src/).
You can play around with some of the parameters and see what happens in the
[demo](https://icecreamyou.github.io/THREE.Terrain/).

Expand Down Expand Up @@ -146,7 +143,7 @@ Many other utilities are provided, for example for compositing different
terrain generation methods; creating islands, cliffs, canyons, and plateaus;
manually influencing the terrain's shape at different locations; different
kinds of smoothing; and more. These features are all fully documented in the
[source code](https://github.com/IceCreamYou/THREE.Terrain/blob/gh-pages/build/THREE.Terrain.js).
[source code](https://github.com/IceCreamYou/THREE.Terrain/blob/gh-pages/src/).
Additionally, you can create custom methods for generating terrain or affecting
other processes.

Expand Down
8 changes: 0 additions & 8 deletions bower.json

This file was deleted.

Loading