* Updated tape, tsup, tsx, and tslib dependencies in monorepo packages.
* Updated other build dependencies such as monorepolint, babel, rollup, and lerna. Removed MRL rule for rollup version as we only use it in one package.
* Upgraded eslint dependencies and config file.
Updating Turf packags to be ESM modules rather than a CommonJS project. The build still generates and packages both ESM and CJS variants of implementation and types. From a client perspective, nothing should change about the way Turf modules are loaded or called.
* Marking all packages as "ESM first", with additional CJS files for compatibility. Flow on changes from that include requiring a js extension for relative includes, and workarounds for a couple of older third party libraries that were no longer importing smoothly. Builds successfully. Updating tests next.
* Adding js extension to more local imports in tests, and removing references to __dirname. Added some re-exporting wrapper files for older packages like rbush and sweepline-intersections. See turf-line-intersects for an example.
* Disabling some type tests in packages we were having export / import issues in post type: module. Maybe someone in future can exercise some typescript jujitsu to re-enable them.
* Reverting dist/ generated JS to .js extension where possible. Was identified that the .cjs extension was causing problems for some consumers. Would have like to use .d.ts rather .d.cts for CJS type defs, but there's a but in tsup at the moment that won't allow that to be customised.
* Reintroducing __dirname references, though need to add implementation as not supplied automatically by node any more. Updating benchmark tests. Adding some missing bench and tape @types libraries.
* Added a few __dirname references that should have been included, and removed a few that had inadvertently been added.
* Explicitly using cjs extension for CommonJS distributed source files. Got disabled types tests working again by adjusting tsc command (needed to include node16 module and moduleResolution switched on command line). Also needed to refer to "index", etc as "index.js", etc from test.ts files to avoid "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16'" errors.
* Missed a .js -> .cjs in turf/turf last-checks target.
* Removing hacky cjs/esm export/import wrappers in favour of defaultImport library which takes care of finding the correct default to import from CJS packages.
* Revert "Removing hacky cjs/esm export/import wrappers in favour of defaultImport library which takes care of finding the correct default to import from CJS packages."
This reverts commit f8184c3fb124369b36fb9afa4e1aa83543417e42.
* Found a few more spots to add a js extension to satisfy newer node16 module resolution.
* Moving to pnpm as package manager. Also taking the opportunity to tidy up our cjs / esm situation using tsup (instead of tsc and rollup). Can't get monorepolint to work with new setup so disabling for the time being.
* Changing all Turf imports to use named imports. Adding a few missing named exports. Updating github workflow actions to pnpm instead of yarn.
* Updating typescript module and moduleResolution mechanisms to "node16". Not tracking nodenext just yet. Changing tsup command to generate d.ts files that arethetypeswrong approves of.
* Tweaking github workflows to explicitely install pnpm.
* Looks like node needs the chosen cache binary installed first. Trying without cache as a first step.
* Seem to be hitting the tsx bug described here: https://github.com/privatenumber/tsx/issues/421 Upgrading to latest tsx to remedy.
* Forgot to update lock file after updating tsx dep in package.json files.
* Sorting modules exported from @turf/turf alphabetically. Preparatory commit to add unexported modules.
* Converting index.mjs to typescript, and simplifying re-exported imports, and ordering alphabetically. Added in a couple of packages - convex, booleanValid and nearestNeighbourAnalysis. Rollup now only used in packages/turf so merging project root base config into there. Also now only using rollup in packages/turf to do final conversion to web module. JS and d.ts files generated the same as other modules, using tsup.
* Including tslib in @turf/turf build now that it's a TS module.
* Lot of per-package tsconfig items now on the tsup command line, so stripping back tsconfig.json to the bare minimum. Adding tsconfig.json to packages that while still only JS, are now processed by tsup.
* Same as last commit - simplifying tsconfig.json - except these are the subset of packages that had multiple entry points e.g. 3rd party code hosted locally in lib/
* Incorporating some suggestions from @favna on being more explicit with d.ts entries. https://github.com/Turfjs/turf/issues/2307#issuecomment-1858653048 Specifying overall module type as commonjs explicitly.
* Reapplying cjsInterop / splitting workaround for CJS exports that we had on build target command line earlier in this PR in to tsup config file. Also disabling treeshaking as this was generating a warning for CJS files and causing the workaround above to not work.
* Upgrading rollup and related plugins. Updating to recommended modern browserslist config in babel.config.json e.g. previous chrome 67 and edge 17 are 5 years old, ie11 is just ... ugh
* Fluffed the browserslist config - need to cover es5 as well.
* Update .github/workflows/turf.yml to use actions/checkout v4.
Co-authored-by: Jeroen Claassens <jeroen.claassens@live.nl>
---------
Co-authored-by: Jeroen Claassens <jeroen.claassens@live.nl>
* Converting bench.js and test.js to Typescript. Adding along as a named export as well as the default.
* Converting bench.js and test.js to Typescript and ESM import. Adding angle as a named export as well as the default.
* Converting bench.js and test.js to Typescript and ESM import. Adding area as a named export as well as the default.
* Making turf last-checks a bit more flexible as we will have a mix of JS and TS test files for a while.
* Converting bench.js and test.js to Typescript and ESM import, and adding named exports as well as the default export for modules:
bbox
bboxCliip
bboxPolygon
bearing
bezierSpline
booleanClockwise
booleanConcave
booleanContains
booleanCrosses
booleanDisjoint
booleanEqual
booleanIntersect
booleanOverlap
booleanParallel
booleanPointInPolygon
booleanPointOnLine
booleanTouches
booleanValid
booleanWithin
* Converting bench.js and test.js to Typescript and ESM import for remaining Typescript modules. Also adding named exports in addition to the default export for those same modules.
* Proceeding with migrating remaining tests to Typescript. Still a few to do - waiting for PR #2543 to merge first to avoid conflicts.
* Converting bench.js and test.js to Typescript and ESM import for some more Typescript modules (postponed until recent PRs merged). Also adding named exports in addition to the default export for those same modules.
* Banishing a couple more require() calls from module code.
* Retiring custom rollup typescript plugin. Problem it was designed to address probably fixed by a previous typescript upgrade. Removing redundant es5 checking script that hasn't been used for a while as well.
* Fix generate-docs to work with tsx (add extension, fix a few TS errors). monorepolint rule changed to reflect ts file extension. Add node to eslint env config so editors can find definitions of node variables (such as __dirname) used in scripts.
* Change project root docs target to use tsx and generate-docs.ts. Tighten up gnerates-docs.ts folder globbing - was inadvertently matching when my working parent directory was named something like ~/code/turf-docs-test/... interpreting docs-test as a package name. Reworded readme postfix content to be clearer on the different ways of installing. Updated a few links from http to https.
* Result of running yarn docs from the project root with the previously committed changes.
* Applying recently merged changes (from PR #2523) to this new module.
* Simplify nx config (no point separately caching es and js builds - they both need to be done for any code changes). Fix some no-op type definitions i.e. X extends any, and enforce templated property types as having to extend GeoJsonProperties throughout.
* Upgrade typescript. Had to update topojson-* type defs to avoid the P = GeoJsonProperties problem in geojson-rbush. Also fix a couple of floating point precision related issues that eslint now apparently catches!
* Retire tslint.
* Upgrade eslint and prettier. Add minimal prettier config (defaults have changed) to avoid widespread, minor formatting changes (trailing commas mostly).
* Upgrading to newest @types/node for the typescript version we currently use (3.8.3). https://www.npmjs.com/package/@types/node?activeTab=versions
* Big update to lerna to address security vulnerabilities. bootstrap command no longer required. Seems to build and test ok. May need some tweaking. Will add build caching at a later date.
* Updating documentation (the NPM library) to address security vulnerabilities. Had to wrap body of script so as be async, though otherwise unchanged.
* Updating es-check to address security vulnerabilities.
* Updating tape library to address security vulnerabilities.
* Add lerna caching (via nx). Simplistic setup so will need some tweaking. Remove redundant packages setting from lerna.json (will default to packages setting in package.json instead). Have to add --npm-path to all npm-run-all calls so that lerna doesn't accidentally end up being used as the npm binary. https://github.com/mysticatea/npm-run-all/issues/218 and https://github.com/lerna/lerna/issues/1842 have more details.
* Missed a couple of carats in package.json dependency specs.
* Also need to commit a new yarn.lock file to reflect version spec changes in previous commit.
---------
Co-authored-by: mfedderly <mdfedderly@mdfedderly.com>
* MRL configuration changes to replace ts-node with tsx, a more robust TS runtime. Will run MRL --fix and commit per-package changes next.
* JS projects can also rely on tsx to run scripts that used to be run by node.
* Need to keep ts-node around (at the monorepo level at least) for monorepolint.
* Almost entirely MRL automatic fixes for tsx dev dependencies, bench, doc, and test:tape. Hand edited last-checks scripts in packages/turf/
* Support TS node16, nodenext and bundler module resoutions
Support TypeScript node16, nodenext and bundler module resolutions.
* Fix mrl config to require exports.types
* Fix all packages to have exports.types
* (huge) changelog
* v7.0.0-alpha.0
* Update yarn.lock to handle the fact that our dependencies take dependencies on turf itself
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
* Use tslib so that the typescript shims can be imported instead of inlined [manual change]
* Add tslib dependency via monorepolint run
* yarn.lock
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
* Update changelog for 6.2.0-alpha.3 changes
* Update changelog
* v6.2.0-alpha.3
* v6.2.0-alpha.3
* Looks like prettier and lerna are fighting, let lerna win.
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
- No longer have bench and test call prepare explicitly
- bench.js, test.js, types.ts all use the local copy of the code, not the built copy
- Fixed quite a few bench.js files that were just broken
- Rework root package.json for build clarity
- Change prepare scripts to build so that they don't run on publish
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
Co-authored-by: Rowan Winsemius <rowanwins@yahoo.com.au>
Writes a package.json to each dist/es/ directory, which ensures that
Node loads adjacent files as ES modules.
close#1940
Co-authored-by: mfedderly <mdfedderly@mdfedderly.com>
- Set lerna publish registry
- Force publishConfig.access to be public so new packages will publish
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
Further build standardization
- Typescript publishes modules
- All packages have sideEffects: false to enable tree shaking
- All projects use prepare instead of duplicating in the pretest command
- Standardize order of package.json files
- turf-bbox export hack to fix @turf/turf build
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
- Enforce some TS configurations that we already standardized
- Standardize rollup builds to put artifacts under dist
- Standardize test scripts with tape and tsc testing
- Small bench/test fixes
- Standardize packages/turf builds
- Move turf-difference and turf-meta from index.mjs to index.js
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
Configure monorepolint
- Monorepolint lets us easily manage all of our subpackages declaratively
- Husky installs commit hooks to prevent invalid commits from even merging
- lint-staged gives us rules for custom linting depending on what files changed
- Alphabetize the package.json scripts
- Change travis node version from 9->12 to get to a supported version
- Bump all of the typescript dependencies to the latest, fixes a build error with some types in our dependencies being 3.x dependent.
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
* Standardize on a single tsconfig
* Standardize tsconfig output
- Move output of es5 code into dist/js (leaves room for dist/es for modules)
- Update references from ./index over to ./dist/js/index.js
- Seems like this will publish types for several new packages
- A few packages needed to be slightly modified to publish correctly to dist
- Small fixes to @turf/turf due to the file path changes
- Note: not currently using types.ts for testing (next commit)
* Re-enable testing using types.ts in packages where that exists
* Run packages/turf tests after everything else has built
* Enforce tsc before bench
* nearest-neighbor-analysis test updates from rowanwins