Commit Graph

697 Commits

Author SHA1 Message Date
Jeshurun Hembd ead80c7783
Merge pull request #11102 from CesiumGS/eslint-updates
Update to the latest version of cesium eslint config
2023-02-22 17:43:32 -06:00
Gabby Getz f4428347a4 Update aws-sdk from v2 to v3 2023-02-22 12:53:42 -05:00
Gabby Getz c4cb602b3c Update to the latest version of cesium eslint config 2023-02-22 12:00:03 -05:00
Gabby Getz 5e4e316226 Update esbuild 2023-02-22 10:11:07 -05:00
onsummer 68056794a4 Upgrade rollup plugin dependency 2023-02-21 15:21:20 +08:00
Gabby Getz 1330875b4c Updates for 1.102 2023-02-01 12:58:23 -05:00
Jeshurun Hembd 1a7c59a4e5 Update rimraf 2023-02-01 10:18:14 -05:00
Jeshurun Hembd 71908d4195 Update mkdirp 2023-02-01 10:14:40 -05:00
Jeshurun Hembd 8f0a65f844 Update markdownlint-cli 2023-02-01 10:12:00 -05:00
Gabby Getz 8f8b95bf23 Merge branch 'main' into readme-revision 2023-01-20 13:19:57 -05:00
Gabby Getz 563476d178 Updates for 1.101 release 2023-01-02 13:32:21 -05:00
Gabby Getz 9f7c5b1160 Rollback rollup for compatability with plugins 2022-12-16 11:17:12 -05:00
Gabby Getz e481f61488 Update aws sdk 2022-12-16 10:40:55 -05:00
Gabby Getz 37c81d44a9 Update esbuild 2022-12-16 10:39:46 -05:00
Gabby Getz 148e213cfb update globby 2022-12-16 10:31:41 -05:00
Gabby Getz bb4eb6f5ac Update husky 2022-12-16 10:18:43 -05:00
Gabby Getz c13b728a1d Update eslint 2022-12-16 10:16:39 -05:00
Gabby Getz 6219c4e344 Update typescript 2022-12-16 10:14:19 -05:00
Gabby Getz 65fed36e18 Update karma runners 2022-12-16 10:11:22 -05:00
Gabby Getz 570ac8692f Update markdowncli 2022-12-16 09:44:47 -05:00
Gabby Getz eeb73c310b Update rollup 2022-12-16 09:22:25 -05:00
Gabby Getz 7047efe78a Cleanup images, spelling 2022-12-14 09:55:08 -05:00
Gabby Getz 8f80885186 markdownlint 2022-12-09 12:54:34 -05:00
Sanjeet Suhag 6f55de9bab Ion.js, CHANGES.md and package.json changes for 1.100 2022-12-01 09:53:00 -05:00
Gabby Getz 93e5ba061b README updates 2022-11-09 14:01:29 -05:00
Sanjeet Suhag aaf6bd8a5c Adds engine and widgets workspaces 2022-11-01 15:39:57 -04:00
Gabby Getz d3d2755ebc Updates for 1.99 release 2022-11-01 10:24:44 -04:00
Gabby Getz 75c9646e76 Unify cesium.com and development deployment code 2022-10-05 12:31:17 -04:00
Sanjeet Suhag d9eeb18af9 Updates package version to 1.98.1 2022-10-03 15:31:00 -04:00
Sanjeet Suhag 99149a9d68 Updates for 1.98 release 2022-10-03 12:29:58 -04:00
Gabby Getz 7d781ea6c6 Update packages, cjs -> esm 2022-09-08 12:43:28 -04:00
Gabby Getz aef65946f6 Update npm dependencies 2022-09-06 09:17:44 -04:00
Gabby Getz 1997a57c1d dependency updates 2022-09-02 13:07:51 -04:00
Gabby Getz e0500309b8 Updates for 1.97 release 2022-09-01 10:48:00 -04:00
Gabby Getz 82f31d7833
Merge branch 'main' into export-non-js 2022-08-31 09:34:21 -07:00
Gabby Getz 06fa2e10b9 Include Specs in sideEffects for esbuild 2022-08-23 13:19:48 -04:00
Gabby Getz 57bf2efe40 Add sideEffects field to package.json 2022-08-22 16:14:53 -04:00
Gabby Getz 6706e1bb4e Allow imports of non-js static files 2022-08-22 14:06:16 -04:00
Gabby Getz aef4d38e5c Fix for NodeJS with ESM modules 2022-08-16 15:51:23 -04:00
Janine Liu fc4f4e4111 Rename / remove animation classes 2022-08-04 15:59:58 -04:00
Gabby Getz b173c1be0f Update deprecated tween usage 2022-08-02 14:58:26 -04:00
Sanjeet Suhag bac00332b0 Updates package.json, Ion.js and CHANGES.md for version 1.96.0 2022-08-01 15:29:54 -04:00
Sanjeet Suhag 4b0245eec8 Update earcut version to latest 2022-07-25 13:31:19 -04:00
Sam Suhag 47f82fc1b0
Merge pull request #10583 from CesiumGS/scripts
Pare down build scripts; naming consistancy
2022-07-22 14:52:27 -04:00
Sanjeet Suhag d60be6f043 Adds markdown files to pre-commit prettier hook 2022-07-22 13:21:33 -04:00
Gabby Getz eba8a84f81 Merge branch 'main' into build-scripts 2022-07-21 09:47:58 -04:00
Gabby Getz 37146f49bc Pare down build scripts; naming consistancy 2022-07-21 09:18:22 -04:00
Gabby Getz 513a14e728
Merge branch 'main' into protobuf-7-0-0 2022-07-20 08:59:35 -04:00
Gabby Getz ee169eb971 Mark true dependencies as such, update CHANGES.md with explicit bundler requirement 2022-07-19 15:59:51 -04:00
Sanjeet Suhag d19bf5d8d8 Updates protobuf version to 7.0.0 2022-07-18 18:20:29 -04:00
Gabby Getz 0a19ae3601 Merge branch 'main' into build 2022-07-13 13:50:38 -04:00
Gabby Getz 747a4adf1c Just-in-time build 2022-07-11 15:39:36 -04:00
Gabby Getz 5f1cac325d Merge branch 'main' into build-scripts 2022-07-08 15:45:38 -04:00
Sanjeet Suhag a03aa5c01b Updates eslint version 2022-07-06 14:33:38 -04:00
Sanjeet Suhag 48601acb56 Merge branch 'main' of https://github.com/CesiumGS/cesium into eslint-test 2022-07-06 12:30:21 -04:00
Gabby Getz 8bc8355d6f Remove worker changes 2022-07-06 11:25:36 -04:00
Gabby Getz e6b37c16dc Update ThirdParty.json to reflect new version 2022-07-01 11:28:14 -04:00
Gabby Getz b669757da4 Updates for 1.95 release 2022-07-01 09:48:18 -04:00
Sanjeet Suhag 2c16bda9b8 Updates to latest eslint-config-cesium 2022-06-24 09:43:03 -04:00
Gabby Getz 213cdfcb34 Rollback script naming changes 2022-06-22 15:33:04 -04:00
Gabby Getz 9905c123f4 Merge branch 'main' into build 2022-06-22 11:34:12 -04:00
Jeshurun Hembd 36be7b412b Import prism files from npm 2022-06-16 14:13:05 -04:00
Gabby Getz 8d7faae3f3 Merge branch 'main' into build 2022-06-15 14:50:52 -04:00
Gabby Getz 318c276c45 Cleanup rollup dependencies 2022-06-14 10:34:59 -04:00
Gabby Getz 4b0b31bb20 Merge branch '1.94.3-release' into main 2022-06-13 09:24:09 -04:00
Gabby Getz 2d96f0e272 Updates for 1.94.3 release 2022-06-10 15:56:44 -04:00
Janine Liu 86ca4b3056 Merge with main 2022-06-08 16:21:13 -04:00
Sanjeet Suhag 9428c2a2fc Changes lint-staged command to prettier instead of pretty-quick 2022-06-08 10:21:02 -04:00
Janine Liu 5ae753463e Merge with main 2022-06-07 15:06:33 -04:00
Gabby Getz 1f99b624e9 Cleanup 2022-06-06 12:28:27 -04:00
Gabby Getz 867ab1acdd Cleanup documentation 2022-06-06 11:47:09 -04:00
Gabby Getz 4ecefb5973 Merge branch 'main' into build 2022-06-06 11:34:36 -04:00
Gabby Getz 634f0f6c6e
Merge pull request #10428 from CesiumGS/lint-hooks
Adds eslint and markdownlint to pre-commit hook
2022-06-06 10:27:39 -04:00
Sanjeet Suhag 36327923a1 Runs eslint before prettier in pre-commit hook 2022-06-06 10:11:20 -04:00
Gabby Getz 74dac36b6b Merge branch '1.94.2-release' into main 2022-06-03 15:07:58 -04:00
Gabby Getz 3a28262bbb Update for 1.94.2 release 2022-06-03 15:00:39 -04:00
Sanjeet Suhag 7594421ce7 Utilizes lint-staged for pre-commit hook 2022-06-03 14:31:13 -04:00
Gabby Getz 445744e3f9
Merge pull request #10411 from CesiumGS/markdown-lint
Adds markdownlint
2022-06-03 14:03:25 -04:00
Gabby Getz bfa1479ac3 1.94.1 updates 2022-06-03 13:33:23 -04:00
Sanjeet Suhag 79562ba016 Merge branch 'main' of https://github.com/CesiumGS/cesium into markdown-lint 2022-06-03 11:05:09 -04:00
Gabby Getz f409126287
Merge pull request #10412 from CesiumGS/karma-config-upgrade
Upgrade to Karma v6.3.20
2022-06-02 12:31:18 -04:00
Gabby Getz 7ac3fd09e0 coverage 2022-06-02 11:24:07 -04:00
Sanjeet Suhag 9ddf451a83 Upgrades package.json to version 1.94.0, updates Ion token for 1.94.0 release. 2022-06-01 12:10:45 -04:00
Sanjeet Suhag 64cd0cd468 Enables markdownlint on root files except README, CHANGES and LICENSE 2022-05-31 16:51:18 -04:00
Sanjeet Suhag 8990cf4c45 Upgrades to Karma v6.3.20 2022-05-31 12:53:20 -04:00
Sanjeet Suhag 39164357e0 Adds markdownlint 2022-05-31 09:50:32 -04:00
Gabby Getz 44b9610b40 karma specs and coverage 2022-05-27 10:42:45 -04:00
Gabby Getz f6cf110957 clean up gulp tasks and naming 2022-05-25 14:35:38 -04:00
Gabby Getz eb60fbf46a cleanup build tasks 2022-05-25 14:20:47 -04:00
Gabby Getz 355dd42838 Updated build process 2022-05-24 08:54:14 -04:00
Gabby Getz ff559c7109 build workers, third party, and combine with eslint 2022-05-11 16:53:41 -04:00
Sam Suhag 50752a47b1
Merge pull request #10295 from CesiumGS/third-party
ThirdParty.json
2022-05-05 09:57:49 -04:00
Gabby Getz 2eda8540f0 Add build-third-party task 2022-05-04 16:13:18 -04:00
Gabby Getz e8598a0f4a 1.93 release updates 2022-05-02 09:16:48 -04:00
Eli Bogomolny bc9e834b2c Remove customEqualityTester arguments 2022-04-05 13:35:51 -04:00
Sanjeet Suhag a02b1a0762 Updates to version 1.92.0 2022-04-01 16:01:14 -04:00
Gabby Getz 31c154a299 Remove when.js and replace with native promises
There were a few areas in Source where a function was assumed to be executed synchronously when a function was resolved. Native Promises however, by spec, will resolve at the end of a frame. There were also some strange handling of promise rejection in imagery providers that I cleaned up a bit in order to make them testable.

- In LabelCollection and EntityCluster, order of execution adjustment where made.
- Added TextureAtlas.addImageSync to support the order of execution fix in LabelCollection
- ArcGisMapServerImageryProvider.readyPromise will not reject if there is a failure unless the request cannot be retried.
- SingleTileImageryProvider.readyPromise will not reject if there is a failure unless the request cannot be retried.

The majority of the changes lie in the Specs, where unresolved promises weren’t being awaited before finishing executions, and where resolved promises are assumed to be synchronous all over the place and needed a good amount of fixes. Another issue which came up was calling Promise.reject in the body of a spec can cause node to halt execution when running via the command line.
2022-03-16 09:38:39 -04:00
Eli Bogomolny 999ee4e6b8 1.91 release updates 2022-03-01 10:02:44 -05:00
Eli Bogomolny c497cdb4d2 Add back quantization 2022-02-22 17:01:42 -05:00
Gabby Getz a11b14cab7 1.90 release updates 2022-02-01 13:57:02 -05:00
Gabby Getz 87fe04415e
Merge pull request #9774 from yukinoda/ci/husky-upgrade
ci: Husky Upgrade from `4.3.8` to `7.0.2`
2022-01-20 09:49:46 -05:00
Eli Bogomolny 3ff462d550
Revert "Lock colors to 1.4.0" 2022-01-10 16:01:26 -05:00
Eli Bogomolny bb660e8cc5 Lock colors to 1.4.0 2022-01-10 12:26:18 -05:00
Eli Bogomolny 12bf7f83f6 Update for 1.89 release 2022-01-03 15:37:40 -05:00
Sanjeet Suhag fbc3f975b6 1.88 package.json 2021-12-01 14:15:52 -05:00
Sanjeet Suhag 185c6effa9 1.88 package and Ion token update 2021-12-01 14:14:48 -05:00
Sanjeet Suhag c199b8bde3 Revert "Upgrades package to 1.88.0, updates Ion token"
This reverts commit e190e8aa0f.
2021-12-01 13:46:51 -05:00
Sanjeet Suhag e190e8aa0f Upgrades package to 1.88.0, updates Ion token 2021-12-01 12:44:28 -05:00
Eli Bogomolny 9ebeea21ac Update package.json version 2021-11-09 13:39:24 -05:00
Eli Bogomolny 3831cb9ff1 Update for 1.87 release 2021-11-01 14:39:24 -04:00
Eli Bogomolny 51e724f962 Update to 2.3.12 2021-10-27 15:13:46 -04:00
Eli Bogomolny e6b2793b25 1.86.1 package.json and CHANGES.md updates 2021-10-15 11:35:01 -04:00
Eli Bogomolny 56ac035357
Merge pull request #9828 from CesiumGS/terser
Switch from uglify to terser
2021-10-05 19:07:35 -04:00
Eli Bogomolny cd144b360c Update Ion.js token, CHANGES.md, and package.json for 1.86.0 release 2021-10-01 11:26:27 -04:00
Eli Bogomolny 53d112e271 use prepare instead of postinstall 2021-10-01 09:56:16 -04:00
Eli Bogomolny 811584e7ff postinstall to copy files from node_modules 2021-09-28 13:36:57 -04:00
Matthew Amato 4fc197f62e Switch from uglify to terser 2021-09-24 08:02:13 -04:00
yukinoda bc03fe0eeb Revert "executed npm audit fix"
This reverts commit 73e8c2cbe3.
2021-09-22 17:25:43 +09:00
yukinoda 73e8c2cbe3 executed npm audit fix 2021-09-22 16:57:11 +09:00
yukinoda d934f151bc upgrade husky version 2021-09-22 16:55:46 +09:00
yukinoda 6f64ca2642 fix CI issue with duplicated prepare script 2021-09-03 13:55:28 +09:00
Yuki Noda bf6b1ca5e7
Merge branch 'main' into ci/husky-upgrade 2021-09-03 12:03:28 +09:00
Peter Gagliardi a020656976 Merge branch 'main' of github.com:CesiumGS/cesium into main 2021-09-01 16:25:27 -04:00
ebogo1 b0625508fb PR feedback 2021-09-01 15:01:13 -04:00
ebogo1 26716a82e1 Merge remote-tracking branch 'origin/main' into draco-prepare 2021-09-01 13:40:40 -04:00
Peter Gagliardi c0c0017862 Merge branch 'main' of github.com:CesiumGS/cesium into main 2021-09-01 13:15:04 -04:00
ebogo1 a1441494f6 First pass with npm prepare 2021-09-01 09:04:06 -04:00
Peter Gagliardi 2688bae4b6 Update Ion.js, CHANGES.md and package.json 2021-09-01 08:52:23 -04:00
yukinoda 9b8e4e96a6 husky upgrade 2021-08-31 21:24:57 +09:00
ebogo1 4ed739465e Merge remote-tracking branch 'origin/main' into uri-js 2021-08-29 11:51:13 -04:00
ebogo1 edefb597b3 add meshoptimizer npm module 2021-08-27 11:13:34 -04:00
ebogo1 0d2b579786 Merge remote-tracking branch 'origin/npm-third-party-staging' into uri-js 2021-08-23 13:05:59 -04:00
Matthew Amato 974bb42a99 Use protobufjs from npm
Locked to version 6.7.0 since that is the version we are already using and
updating it requires additinal work because of the use of util.lazyResolve
in the GoogleEarthEnterpriceMetadata root parser code.
2021-08-22 15:08:43 -04:00
ebogo1 a5d7070f26 first pass 2021-08-18 23:18:11 -04:00
Sean Lilley 2ccf0fdb2f
Merge branch 'main' into npm-third-party-staging 2021-08-02 21:13:17 -04:00
srothst1 ffcc025a9e updated CHANGES.md, ion.js, and package.json 2021-08-02 13:38:42 -04:00
ebogo1 74b874a73f Merge remote-tracking branch 'origin/main' into npm-third-party-staging 2021-08-01 12:00:17 -04:00
ebogo1 65f59241e3 zip.js in exportKml 2021-07-26 17:05:12 -04:00
ebogo1 4012e2e6bb ktx-parse to npm 2021-07-23 16:34:05 -04:00
ebogo1 e1228598c8 add npm packages pt 1 2021-07-20 17:15:17 -04:00
Sean Lilley fe8fec2d51 master -> main 2021-07-16 19:01:30 -04:00
ebogo1 73e00e1e91 Merge remote-tracking branch 'origin/master' into npm-third-party-staging 2021-07-15 11:31:02 -04:00
ebogo1 52ed1012bc Update Ion token, CHANGES.md, and package.json version 2021-07-01 17:54:56 -04:00
Sean Lilley 61559cd2ac Downgrade husky 2021-06-23 09:19:56 -04:00
Sean Lilley 931593c801 Downgrade karma 2021-06-22 13:54:30 -04:00
Sean Lilley 22b347b0a3 Update husky from 4 to 6 2021-06-21 22:46:59 -04:00
Sean Lilley 8dfd3f1258 Update packages 2021-06-21 22:34:56 -04:00
Matthew Amato 540cac6a58 Bump version to 1.82.1 to fix improperly published 1.82.0
Also fix bad version for loadCRN/loadKTX deprecations.
2021-06-01 18:03:38 -04:00
Samuel Vargas 80ceefef2e
Update Ion token, update version to 1.82 2021-06-01 15:34:12 -04:00
Matthew Amato 829ca79d38 Update version, ion token, and CHANGES for 1.81 release. 2021-05-03 09:33:50 -04:00
Matthew Amato f594b3c99b Start of replacing submitted third party libraries with npm modules
Rather than submit libraries to Source/ThirdParty, which always end up
being modified for our build system and quickly go out of date, this
change starts to use libraries via npm instead. Currently Autolinker,
earcut, when, tween.js, rbush, kdbush, quickselect, and topojson are
ported.

The main hurdle that prevented us from doing this sooner was the fact that
Cesium has a long history of not requiring a build step after every code
change and has a goal of writing valid JS code, unlike many libraries today
 that mandate a bundler to turn invalid JS code into valid code.

Rather than mandate a bundler during development, this initial step adds a
"buildThirdyParty" function to the current "build" step. This function runs
third party libraries (defined in the ThirdParty/npm/ folder) through
RollUp and creates an equivalent file in `Source/ThirdPartyNpm`.

The change to end users will be non-existent, especially since the combined
Cesium.js will still re-export any third party modules as part of the
private API just like it used to.

This doesn't prevent code duplication for users using some of the same
third party libraries as Cesium. This is just an improvement as to how
depend on third party libraries internally.

I think Cesium's days of being "bundler free" are probably limited long
term, performance is the main hurdle and newer tools like esbuild may make
that no longer a problem. But that's outside the scope of this initial
goal.
2021-04-11 15:02:36 -04:00
hpinkos fc926f5a0d update for release 2021-04-01 15:42:32 -04:00
Kevin Ring c5db0d038f Bump version to 1.79.1. 2021-03-02 10:25:58 +11:00
Kevin Ring 528813ceb3 Updates for 1.79 release. 2021-03-01 18:02:07 +11:00
Kevin Ring 25585356e8 Merge remote-tracking branch 'origin/master' into eslint-gulpfile 2021-03-01 08:57:44 +11:00
Ian Lilley 85d9e19be0 prepare for 1.78 release 2021-02-01 12:43:21 -05:00
hpinkos 6113d463a3 Merge branch 'master' into eslint-gulpfile 2021-01-19 13:30:59 -05:00
Ian Lilley 06f5a625ba reverted eslint min version 2021-01-12 15:43:10 -05:00
Ian Lilley 009c6d1b6c eslint fixes 2021-01-12 15:10:38 -05:00
hpinkos f5a17527c6 Merge branch 'master' into eslint-gulpfile 2021-01-05 17:16:24 -05:00
Kangning Li 26e2c44a61 Update version and ion token for 1.77 release 2021-01-04 10:59:13 -05:00
hpinkos a2a0d73fe2 run eslint on cjs files 2020-12-18 14:53:33 -05:00
Sean Lilley 01a40073f4 Update package.json to 1.76.0 2020-12-01 14:04:22 -05:00
Omar Shehata 9949ddab92 Update version and ion token for 1.75 release 2020-11-02 09:17:06 -05:00
Matthew Amato 4467ccc6ba Update version and ion token for 1.74.0 release 2020-10-01 12:28:11 -04:00
Matthew Amato 09f87a6bea Update npm major version changes (and pinned prettier)
1. No code change required on our end at all. These were mostly dropping
support for Node 8, which is end-of-life.

2. I did not update to TypeScript 4.x, because I'm actually not sure what
that would mean for the definition files and something we should probably
look into separately.
2020-09-30 20:47:58 -04:00
Kevin Ring 6c0a0f89be Bump to v1.73.0. 2020-09-01 15:28:38 +10:00
Kevin Ring aaf7d72b6f
Use an exact version of prettier
As recommended by the prettier project.
2020-08-30 22:43:50 +10:00
Frederic Junod 241a27edf8 Update prettier to version ^2.1.1 2020-08-28 10:15:42 +02:00
William Wall 9046bd2c22 Add package.json to exports so it can be resolved
Many tools attempt to require.resolve package.json, and in the latest
versions of node that is not possible if the package specifies exports.
The solution is to simply add package.json to exports.

Resolves #8992
2020-08-19 12:08:31 -06:00
Bao 5c98e4268a update ion token and package.json version to 1.72 2020-08-03 11:00:24 -04:00
Matthew Amato 21c07cb6f4 Update outdated npm modules
1. Only code change was a harmless bug in Expression.js that new eslint
detected.

2. rollup-plugin-uglify and rollup-plugin-external-globals complain they
want rollup 1.x, but they work fine with 2 so it's a harmless warning.
2020-07-21 15:04:04 -04:00
Sanjeet Suhag bfdd1050bb Updates ion token, bump to version 1.71.0 2020-07-01 15:06:30 -04:00
Matthew Amato c6a993f472 Bump version and cleanup CHANGES for 1.70.1 release. 2020-06-10 09:38:24 -04:00
Ian Lilley 2d3852c31c updated tokens, version, and changes.md 2020-06-01 14:37:16 -04:00
Matthew Amato 85c78edf31 Generate official TypeScript type definitions
It's been a long requested feature for us to have official TypeScript type
definitions.  While the community has done a yeoman's job of manually
supporting various efforts, the most recent incarnation of which is
`@types/cesium`, the sheer scale and ever-evolving nature of Cesium's code
base makes manual maintenance a Sisyphean task.

Thankfully, our decision to maintain meticulous JSDoc API documentation
continues to pay dividends and is what makes automatically generating
TypeScript definitions possible. Using the excellent
https://github.com/englercj/tsd-jsdoc project we can now automatically
generate and even partially validate official definitions as part of the
build process. (Thanks to @bampakoa who contributed some early PRs to both
CesiumJS and tsd-jsdoc over a year ago and is how I learned about
tsd-jsdoc)

While tsd-jsdoc output is mostly where we need it to be, we do
post-processing on it as well. This lets us clean up the output and also
make sure these definitions work whether users include cesium via module,
i.e. `import { Cartesian3 } from 'cesium'`, or individual files, i.e.
`'import Cartesian3 from 'cesium/Source/Core/Cartesian3'`. There were also
some quirks of tsd-jsdoc output we fixed that may eventually turn into a PR
into that project from us. The post-processing is part typescript compiler
API, part string manipulation. It works and is straightforward but we might
want to go full TS api in the future if we decide we need to do more
complicated tasks. The output of tsd-jsdoc is currently a little noisy
because of some incorrect error reporting, but I'm talking with the
maintainer in https://github.com/englercj/tsd-jsdoc/issues/133 to get them
fixed. No need to hold up this PR for it though.

The definition is generated as a single `Cesium.d.ts` file in Source, so it
lives alongside Cesium.js. It is ignored by git but generated by a separate
`build-ts` task as part of CI and makeZipFile. This task also validates the
file by compiling it with TypeScript, so if a developer does anything too
egregious, the build will fail. Definitions are automatically included in
our npm packages and release zips and will be automatically used by IDEs
thanks to the `types` setting in package.json. This means that IDEs such as
VS Code will prefer these types over the existing `@types/cesium` version
by default.

I didn't want to slow the `build` step down, so I made this a separate
step, but in the future we could consider running it by default and we
could also unignore this file in Git so that PR reviewers can see the
impact, if any, our code changes have on the generated definitions. This
might be a good idea as an additional sanity check and should only actually
change when the public API itself changes. But the issue would be
remembering to run it before submitting the code (or we could use git hooks
I suppose?) I just don't want to slow down devs so I'm hesitant to do
anything like this out of the gate. We can definitely revisit in the
future.

A particular exciting thing about this approach is that it exposed a ton of
badness in our current JSDoc markup, which is now fixed. Previously, our
only concern was "does the doc look right" and we didn't pay attention to
whether the meta information generated by JSDoc correctly captured type
information (because up until it didn't matter). We leaned particular hard
on `@exports` which acted as a catch-all but has now been completely
removed from the codebase. All this means is that our documentation as a
whole has now improved greatly and will continue to be maintained at this
new higher level thanks to incorporating TS definition creation into our
pipeline!

One minor caveat here is that obviously we changed our JSDoc usage to both
make it correct and also accommodate TypeScript. The main drawback to these
fixes is that enums are now generated as globals in the doc, rather than
modules. This means they no longer have their own dedicated page and are
instead on the globals page, but I changed the code to ensure they are
still in the table of contents that we generate. I think this trade-off is
perfectly fine, but I wanted to mention it since it does change the doc
some. We can certainly look into whether we can generate enums on their own
page if we think that makes sense. (I actually like this approach a little
better personally).

Last major piece, the actual code. 99% of the changes in this PR only
affect the JSDoc. There are two exceptions:

A few of our enums also have private functions tacked onto them. I had to
move these functions to be outside the initializer but otherwise they are
unchanged.  This ensures that a valid TS enum is generated from our code, since you can't have functions globbed onto enums in the TS world. If we were writing TS code by hand, we could use  declaration merging with a namespace, but the toolchain we are using doesn't have a way to express that right now.  There were two cases where these extra functions weren't private, `ComponentDataType` and `IndexDataType`. That means that as far as the TS definitions goes, the helper methods don't exist.  I consder this an edge case and we can write up issues to investigate later.  I'm actually not even sure if these functions are public on purposes, @lilleyse can you confirm?

We had a few places where we had method signatures with optional parameters
that came _before_ required parameters, which is silly. This is invalid
TypeScript (and not good API design no matter the language). In 99% of
cases this was `equalsEpsilon` style functions where the lhs/rhs were
optional but the epsilon was not. I remember the discussion around this
when we first did it because we were paranoid about defaulting to 0, but
it's an edge case and it's silly so I just changed the epsilon functions
to default to zero now, problem solved.

Here's a high level summary of the JS changes:

* Use proper `@enum` notation instead of `@exports` for enums.

* Use proper `@namespace` instead of `@exports` for static classes.

* Use proper `@function` instead of `@exports` for standalone functions.

* Fix `Promise` markup to actually include the type in all cases, i.e.
`Promise` => `Promise<void>` or `Promise<Cartesian3[]>`.

* Fix bad markup that referenced types that do not exist (or no longer
exist) at the spec level, `Image` => `HTMLImageElement`,
`Canvas` => `HTMLCanvasElement`, etc.. `TypedArray` in particular does not
exist and much be expressed as a lsit of all applicable types,
`Int8Array|Uint8Array|Int16Array|Uint16Array...`.

* Use dot notation instead of tilde in callbacks, to better support
TypeScript, i.e. `EasingFunction~Callback` becomes
`EasingFunction.Callback`. The only exception is when we had a callback
type that was i.e. `exportKml~ModelCallback` becomes
`exportKmlModelCallback` (a module global type rather than a type on
exportKml). This is because it's not possible to have exportKml be both a
function and a namespace in this current toolchain.  Not a big deal either
way since these are meta-types used for defining callbacks but I wanted to
mention it.

* There were some edge cases where private types that were referenced in
the public API but don't exist in the JSDoc. These were trivial to fix by
either tweaking the JSDoc to avoid leaking the type or in some cases, just
as `PixelDataType`, simply exposing the private type as public.  I also
found a few cases where things were accidentally public, I marked these as
private (these were extreme edge cases so I'm not concerned about breaking
changes). Appearances took an optional `RenderState` in their options, I
just changed the type to `Object` which we can clean up further later if
we need to.

* Lots of other little misc JSDoc issues that became obvious once we
started to generate definitions (duplicate parameters for example).

Thanks again to the community for helping generate ideas and discussions
around TS definitions over the last few years and a big thanks to @javagl
for helping behind the scenes on this specific effort by evaluating a few
different approaches and workaround before we settled on this one (I'm
working on a blog with all of the gory details for those interested).

Finally, while I'm thrilled with how this turned out (all ~41000 lines
and 1.9MB of it), I can guarantee we will uncover some issues with the
type definitions as more people use it. The good news is that improving it
is now just a matter of fixing the JSDoc, which will benefit the community
as a whole and not just TS users.


Fixes #2730
Fixes #5717
2020-05-26 22:40:05 -04:00
Sean Lilley 65a079abf1 Update package.json to 1.69 and update default Ion access token 2020-05-01 09:53:25 -04:00
Frederic Junod 4323909b21 Remove sortRequires from package.json and doc 2020-04-24 15:34:11 +02:00
Kevin Ring 1117a6871f Improve consistency between prettier and pretty-quick. 2020-04-17 12:30:15 +10:00
Matthew Amato 1b16c31941 Add configuration for prettier code formatting
1. Add prettier and configuration files, but do not format code yet.
2. Configure it for all html|css|js|md code.
3. Fix a bug it found in `CZML Custom Properties.html`
4. Add a pre-commit hook via husky and pretty-quick which will
automatically format changed files when they are staged on the client.
5. Run `prettier-check` during CI and fail the build of code is not
formatted properly.
6. Install eslint config for prettier. This does not enable prettier
checking in eslint (it's unusably slow) but instead just makes sure that
no eslint rules conflict with prettier formatting.
7. Update .editorconfig to match (since prettier respects it)
8. Tweak Sandcastle to handle prettier formated examples
2020-04-13 17:19:59 -04:00
Omar Shehata 70478525bd Update version, CHANGES, and ion token for 1.68 release 2020-04-01 09:13:13 -04:00
Kevin Ring f67eb82ac8 Remove esm dependency, update CHANGES.md. 2020-03-19 23:45:13 +11:00
Kevin Ring 6eafc26c85 Add .gulp.json instead of explicitly specifying cjs in npm cmds. 2020-03-19 20:42:36 +11:00
Kevin Ring 47fa26074b Fix Cesium in Node.js 12+. 2020-03-04 20:18:08 +11:00
Matthew Amato 77d4f155a9 Update version, CHANGES, and ion token for 1.68 release. 2020-03-02 10:39:21 -05:00
Matthew Amato c276f0263b Make Cesium release server work on Node 12.
While we still can't use Node 12 for Cesium development, this change is
to make sure Cesium release zips can actually work under Node 12.
2020-03-02 09:39:37 -05:00
Matthew Amato 06a7763933 AnalyticalGraphicsInc -> CesiumGS
1. Update relevant AnalyticalGraphicsInc organization links to CesiumGS.

2. Remove Webstorm guide since it's unmaintained and reference an
unmaintained plugin

3. Update outdated email address in CODE_OF_CONDUCT.
2020-02-18 13:19:12 -05:00
greenkeeper[bot] 525595311e
chore(package): update karma-jasmine to version 3.1.1 2020-02-11 00:42:17 +00:00
Sean Lilley be4d7bb30e Update package.json to 1.66 2020-02-03 11:16:37 -05:00
greenkeeper[bot] 66371f75ab
chore(package): update mkdirp to version 1.0.0 2020-01-24 20:25:31 +00:00
Kevin Ring cb0f31c0bd Changes for January 2019 release (1.65). 2020-01-06 10:22:19 -05:00
Matthew Amato 456045f713
Merge pull request #8434 from AnalyticalGraphicsInc/greenkeeper/gulp-rename-2.0.0
Update gulp-rename to the latest version 🚀
2019-12-19 08:06:52 -05:00
Matthew Amato a9a8ade465
Merge pull request #8446 from AnalyticalGraphicsInc/greenkeeper/rollup-plugin-external-globals-0.5.0
Update rollup-plugin-external-globals to the latest version 🚀
2019-12-19 07:52:02 -05:00
Matthew Amato 2632a74225
Merge pull request #8402 from AnalyticalGraphicsInc/greenkeeper/yargs-15.0.1
Update yargs to the latest version 🚀
2019-12-19 07:51:32 -05:00
greenkeeper[bot] 6b65d33fb5
chore(package): update rollup-plugin-external-globals to version 0.5.0 2019-12-08 13:28:39 +00:00
greenkeeper[bot] d7a8de61d3
chore(package): update gulp-rename to version 2.0.0 2019-12-04 16:53:12 +00:00
Gabrielle Getz aed09e827d Updates for 1.64 release 2019-12-02 08:43:47 -05:00
greenkeeper[bot] 1ccdce059e
chore(package): update yargs to version 15.0.1 2019-11-16 22:59:32 +00:00
Matthew Amato 3f6ce5fda9 Bump version for 1.63.1 release 2019-11-06 08:32:17 -05:00
Matthew Amato 0697cb1d63 Update version, demo token, and CHANGES for release 2019-11-01 13:22:52 -04:00