ol-stac 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +1 -1
  2. package/events/ErrorEvent.d.ts +17 -0
  3. package/events/ErrorEvent.d.ts.map +1 -0
  4. package/{src/ol/events → events}/ErrorEvent.js +9 -11
  5. package/events/ErrorEvent.js.map +1 -0
  6. package/layer/STAC.d.ts +422 -0
  7. package/layer/STAC.d.ts.map +1 -0
  8. package/layer/STAC.js +698 -0
  9. package/layer/STAC.js.map +1 -0
  10. package/layer/stacUtil.d.ts +46 -0
  11. package/layer/stacUtil.d.ts.map +1 -0
  12. package/layer/stacUtil.js +154 -0
  13. package/layer/stacUtil.js.map +1 -0
  14. package/package.json +3 -85
  15. package/source/GeoTIFF2.d.ts +35 -0
  16. package/source/GeoTIFF2.d.ts.map +1 -0
  17. package/{src/ol/source → source}/GeoTIFF2.js +9 -16
  18. package/source/GeoTIFF2.js.map +1 -0
  19. package/.eslintignore +0 -2
  20. package/.github/workflows/deploy.yml +0 -67
  21. package/.github/workflows/publish.yml +0 -32
  22. package/.github/workflows/release.yml +0 -21
  23. package/.github/workflows/test.yml +0 -85
  24. package/CHANGELOG.md +0 -14
  25. package/DEVELOPING.md +0 -104
  26. package/config/jsdoc/api/conf.json +0 -38
  27. package/config/jsdoc/api/index.md +0 -1
  28. package/config/jsdoc/api/readme.md +0 -65
  29. package/config/jsdoc/api/template/README.md +0 -3
  30. package/config/jsdoc/api/template/publish.js +0 -743
  31. package/config/jsdoc/api/template/static/scripts/linenumber.js +0 -11
  32. package/config/jsdoc/api/template/static/scripts/main.js +0 -305
  33. package/config/jsdoc/api/template/static/scripts/prettify/Apache-License-2.0.txt +0 -202
  34. package/config/jsdoc/api/template/static/scripts/prettify/lang-css.js +0 -2
  35. package/config/jsdoc/api/template/static/scripts/prettify/prettify.js +0 -28
  36. package/config/jsdoc/api/template/static/styles/carbon.css +0 -65
  37. package/config/jsdoc/api/template/static/styles/jaguar.css +0 -512
  38. package/config/jsdoc/api/template/static/styles/prettify-jsdoc.css +0 -111
  39. package/config/jsdoc/api/template/static/styles/prettify-tomorrow.css +0 -132
  40. package/config/jsdoc/api/template/static/theme +0 -1
  41. package/config/jsdoc/api/template/tmpl/container.tmpl +0 -205
  42. package/config/jsdoc/api/template/tmpl/details.tmpl +0 -84
  43. package/config/jsdoc/api/template/tmpl/example.tmpl +0 -2
  44. package/config/jsdoc/api/template/tmpl/examples.tmpl +0 -16
  45. package/config/jsdoc/api/template/tmpl/exceptions.tmpl +0 -30
  46. package/config/jsdoc/api/template/tmpl/layout.tmpl +0 -92
  47. package/config/jsdoc/api/template/tmpl/mainpage.tmpl +0 -14
  48. package/config/jsdoc/api/template/tmpl/members.tmpl +0 -38
  49. package/config/jsdoc/api/template/tmpl/method.tmpl +0 -132
  50. package/config/jsdoc/api/template/tmpl/navigation.tmpl +0 -59
  51. package/config/jsdoc/api/template/tmpl/observables.tmpl +0 -39
  52. package/config/jsdoc/api/template/tmpl/params.tmpl +0 -109
  53. package/config/jsdoc/api/template/tmpl/properties.tmpl +0 -85
  54. package/config/jsdoc/api/template/tmpl/returns.tmpl +0 -72
  55. package/config/jsdoc/api/template/tmpl/source.tmpl +0 -8
  56. package/config/jsdoc/api/template/tmpl/stability.tmpl +0 -7
  57. package/config/jsdoc/api/template/tmpl/tutorial.tmpl +0 -19
  58. package/config/jsdoc/api/template/tmpl/type.tmpl +0 -7
  59. package/config/jsdoc/info/conf.json +0 -22
  60. package/config/jsdoc/info/publish.js +0 -175
  61. package/config/jsdoc/package.json +0 -4
  62. package/config/jsdoc/plugins/api.cjs +0 -181
  63. package/config/jsdoc/plugins/default-export.cjs +0 -35
  64. package/config/jsdoc/plugins/define-plugin.cjs +0 -33
  65. package/config/jsdoc/plugins/events.cjs +0 -39
  66. package/config/jsdoc/plugins/inline-options.cjs +0 -102
  67. package/config/jsdoc/plugins/markdown.cjs +0 -119
  68. package/config/jsdoc/plugins/observable.cjs +0 -69
  69. package/config/jsdoc/plugins/virtual-plugin.cjs +0 -16
  70. package/config/rollup-full-build.js +0 -24
  71. package/config/tsconfig-build.json +0 -25
  72. package/examples/.eslintrc +0 -29
  73. package/examples/index.html +0 -100
  74. package/examples/index.js +0 -109
  75. package/examples/planetary-computer.html +0 -14
  76. package/examples/planetary-computer.js +0 -53
  77. package/examples/resources/Jugl.js +0 -15
  78. package/examples/resources/common.js +0 -111
  79. package/examples/stac-collection-webmaplinks.html +0 -9
  80. package/examples/stac-collection-webmaplinks.js +0 -55
  81. package/examples/stac-item-from-object.html +0 -9
  82. package/examples/stac-item-from-object.js +0 -102
  83. package/examples/stac-item-tileserver.html +0 -9
  84. package/examples/stac-item-tileserver.js +0 -34
  85. package/examples/stac-item.html +0 -9
  86. package/examples/stac-item.js +0 -45
  87. package/examples/stac-itemcollection.html +0 -11
  88. package/examples/stac-itemcollection.js +0 -39
  89. package/examples/templates/example.html +0 -206
  90. package/examples/templates/readme.md +0 -3
  91. package/examples/webpack/config.mjs +0 -69
  92. package/examples/webpack/example-builder.js +0 -410
  93. package/site/build.js +0 -26
  94. package/site/layouts/default.hbs +0 -78
  95. package/site/src/doc/faq.md +0 -8
  96. package/site/src/doc/index.md +0 -22
  97. package/site/src/doc/quickstart.md +0 -121
  98. package/site/src/doc/tutorials/index.md +0 -8
  99. package/site/src/download/index.hbs +0 -62
  100. package/site/src/favicon.ico +0 -0
  101. package/site/src/index.hbs +0 -71
  102. package/site/src/theme/index.css +0 -26
  103. package/site/src/theme/site.css +0 -531
  104. package/src/ol/layer/STAC.js +0 -780
  105. package/src/ol/layer/stacUtil.js +0 -169
  106. package/tasks/.eslintrc +0 -5
  107. package/tasks/build-website.sh +0 -90
  108. package/tasks/create-release.js +0 -107
  109. package/tasks/generate-index.js +0 -125
  110. package/tasks/generate-info.js +0 -189
  111. package/tasks/get-latest-release.js +0 -36
  112. package/tasks/newest-tag.js +0 -52
  113. package/tasks/prepare-package.js +0 -46
  114. package/tasks/publish.sh +0 -90
  115. package/test/README.md +0 -56
  116. package/test/browser/.eslintrc +0 -14
  117. package/test/browser/karma.config.cjs +0 -94
  118. package/test/browser/spec/ol/layer/STAC.test.js +0 -18
  119. package/test/browser/test-extensions.js +0 -419
  120. package/tsconfig.json +0 -62
@@ -1,36 +0,0 @@
1
- import esMain from 'es-main';
2
- import semver from 'semver';
3
- import {Octokit} from '@octokit/rest';
4
-
5
- export async function getLatestRelease() {
6
- const client = new Octokit();
7
-
8
- let latest = '0.0.0';
9
- await client.paginate(
10
- client.rest.repos.listReleases,
11
- {
12
- owner: 'm-mohr',
13
- repo: 'ol-stac',
14
- },
15
- (response) => {
16
- for (const release of response.data) {
17
- const version = semver.valid(release.name);
18
- if (version && semver.gt(version, latest)) {
19
- latest = version;
20
- }
21
- }
22
- }
23
- );
24
-
25
- return latest;
26
- }
27
-
28
- if (esMain(import.meta)) {
29
- getLatestRelease()
30
- .then((latest) => {
31
- process.stdout.write(`v${latest}\n`, () => process.exit(0));
32
- })
33
- .catch((err) => {
34
- process.stderr.write(`${err.message}\n`, () => process.exit(1));
35
- });
36
- }
@@ -1,52 +0,0 @@
1
- import esMain from 'es-main';
2
- import semver from 'semver';
3
- import yargs from 'yargs';
4
- import {getLatestRelease} from './get-latest-release.js';
5
- import {hideBin} from 'yargs/helpers';
6
-
7
- /**
8
- * @typedef {Object} Options
9
- * @property {string} tag The tag.
10
- */
11
-
12
- /**
13
- * Check if a tag is ahead of the latest release.
14
- * @param {Options} options The options.
15
- * @return {boolean} The provided tag is ahead of or equal to the latest release.
16
- */
17
- async function main(options) {
18
- const version = semver.valid(options.tag);
19
- if (!version) {
20
- return false;
21
- }
22
-
23
- const parsed = semver.parse(version);
24
- if (parsed.prerelease.length) {
25
- return false;
26
- }
27
-
28
- const latest = await getLatestRelease();
29
- return semver.gte(version, latest);
30
- }
31
-
32
- if (esMain(import.meta)) {
33
- const options = yargs(hideBin(process.argv))
34
- .option('tag', {
35
- describe: 'The tag to test (e.g. v1.2.3)',
36
- type: 'string',
37
- })
38
- .demandOption('tag')
39
- .parse();
40
-
41
- main(options)
42
- .then((newest) => {
43
- if (newest) {
44
- process.stdout.write('true\n', () => process.exit(0));
45
- } else {
46
- process.stderr.write('false\n', () => process.exit(1));
47
- }
48
- })
49
- .catch((err) => {
50
- process.stderr.write(`${err.stack}\n`, () => process.exit(1));
51
- });
52
- }
@@ -1,46 +0,0 @@
1
- import esMain from 'es-main';
2
- import fse from 'fs-extra';
3
- import path, {dirname} from 'path';
4
- import {fileURLToPath} from 'url';
5
-
6
- const baseDir = dirname(fileURLToPath(import.meta.url));
7
- const buildDir = path.resolve(baseDir, '../build/ol');
8
-
9
- async function main() {
10
- const pkg = await fse.readJSON(path.resolve(baseDir, '../package.json'));
11
-
12
- // write out simplified package.json
13
- pkg.main = 'index.js';
14
- delete pkg.scripts;
15
- delete pkg.devDependencies;
16
- delete pkg.style;
17
- delete pkg.eslintConfig;
18
- delete pkg.private;
19
- await fse.writeJSON(path.join(buildDir, 'package.json'), pkg, {spaces: 2});
20
-
21
- // copy in readme and license files
22
- await fse.copyFile(
23
- path.resolve(baseDir, '../README.md'),
24
- path.join(buildDir, 'README.md')
25
- );
26
-
27
- await fse.copyFile(
28
- path.resolve(baseDir, '../LICENSE.md'),
29
- path.join(buildDir, 'LICENSE.md')
30
- );
31
-
32
- await fse.copy(
33
- path.resolve(baseDir, '../build/full/'),
34
- path.join(buildDir, 'dist')
35
- );
36
- }
37
-
38
- /**
39
- * If running this module directly, read the config file, call the main
40
- * function, and write the output file.
41
- */
42
- if (esMain(import.meta)) {
43
- main().catch((err) => {
44
- process.stderr.write(`${err.message}\n`, () => process.exit(1));
45
- });
46
- }
package/tasks/publish.sh DELETED
@@ -1,90 +0,0 @@
1
- #!/bin/bash
2
-
3
- #
4
- # Run this script to publish a new version of the library to npm. This requires
5
- # that you have a clean working directory and have created a tag that matches
6
- # the version number in package.json.
7
- #
8
- set -o errexit
9
-
10
- #
11
- # Destination directory for the package.
12
- #
13
- BUILT_PACKAGE=build/ol
14
-
15
- #
16
- # URL for canonical repo.
17
- #
18
- REMOTE=https://github.com/m-mohr/ol-stac.git
19
-
20
- #
21
- # Display usage and exit.
22
- #
23
- display_usage() {
24
- cat <<-EOF
25
-
26
- Usage: ${1} <version> [options]
27
-
28
- To publish a new release, update the version number in package.json and
29
- create a tag for the release.
30
-
31
- The tag name must match the version number prefixed by a "v" (for example,
32
- version 3.2.1 would be tagged v3.2.1).
33
-
34
- The tag must be pushed to ${REMOTE} before the release can be published.
35
-
36
- Additional args after <version> will be passed to "npm publish" (e.g. "--tag beta").
37
-
38
- EOF
39
- }
40
-
41
- #
42
- # Exit if the current working tree is not clean.
43
- #
44
- assert_clean() {
45
- source `git --exec-path`/git-sh-setup && \
46
- require_clean_work_tree "publish" "Please commit or stash them."
47
- }
48
-
49
- #
50
- # Exit if the requested version doesn't match package.json.
51
- #
52
- assert_version_match() {
53
- v=`grep -o '"version":.*' package.json | sed 's/"version": *"\(.*\)",/\1/'`
54
- if test "${1}" != "${v}"; then
55
- echo "Version mismatch: requested '${1}', but package.json specifies '${v}'"
56
- exit 1
57
- fi
58
- }
59
-
60
- #
61
- # Check out the provided tag. This ensures that the tag has been pushed to
62
- # the canonical remote.
63
- #
64
- checkout_tag() {
65
- git fetch ${REMOTE} refs/tags/v${1}:refs/tags/v${1}
66
- git checkout refs/tags/v${1}
67
- }
68
-
69
- #
70
- # Build the package and publish.
71
- #
72
- main() {
73
- root=$(cd -P -- "$(dirname -- "${0}")" && pwd -P)/..
74
- cd ${root}
75
- assert_clean
76
- checkout_tag ${1}
77
- assert_version_match ${1}
78
- npm install
79
- npm run build-package
80
- cd ${BUILT_PACKAGE}
81
- shift
82
- npm publish ${@}
83
- }
84
-
85
- if test ${#} -lt 1; then
86
- display_usage ${0}
87
- exit 1
88
- else
89
- main ${@}
90
- fi
package/test/README.md DELETED
@@ -1,56 +0,0 @@
1
- ## Included in this directory
2
-
3
- - browser - Unit/integration tests run in a browser
4
- - node - Unit tests run with Node.js
5
- - rendering - Tests that make assertions about rendered map output
6
-
7
-
8
- ## Run the test suite
9
-
10
- Install the test dependencies (from the root of the repository):
11
-
12
- npm install
13
-
14
- Run the tests once:
15
-
16
- npm test
17
-
18
- This will run tests in (headless) Chrome. If you do not have Chrome installed, you can run tests on Firefox instead:
19
-
20
- npm test -- --browsers Firefox
21
-
22
- To run tests in other browsers, you need to install [additional Karma launchers](https://karma-runner.github.io/1.0/config/browsers.html).
23
-
24
- To run the tests continuously:
25
-
26
- npm run karma
27
-
28
- After this, you can attach any browser and debug the tests like this:
29
-
30
- * open http://localhost:9876/debug.html
31
- * open the developer tools
32
- * add a breakpoint
33
- * refresh the page
34
-
35
- # Rendering tests
36
-
37
- The `test/rendering` directory contains rendering tests which compare a rendered map with a
38
- reference image using [pixelmatch](https://github.com/mapbox/pixelmatch).
39
-
40
- To run the tests in the browser, make sure the development server is running
41
- (`make serve`) and open the URL
42
- [http://localhost:3000/test_rendering/index.html](http://localhost:3000/test_rendering/index.html).
43
-
44
- From the command-line the tests can be run with the build target `make test-rendering`.
45
-
46
- ## Adding new tests
47
- When creating a new test case, a reference image has to be created. By appending `?generate`
48
- to the URL, a canvas with the rendered map will be shown on the page when calling
49
- `expectResemble`. Then the reference image can simply be created with a right-click
50
- and "Save image as".
51
-
52
- It is recommended to only run a single test case when generating the reference image.
53
-
54
- ## Image difference
55
- When a test fails, an image showing the difference between the reference image and the
56
- rendered map can be displayed by appending `?showdiff` to the URL.
@@ -1,14 +0,0 @@
1
- {
2
- "env": {
3
- "mocha": true
4
- },
5
- "globals": {
6
- "afterLoadText": false,
7
- "createMapDiv": true,
8
- "disposeMap": true,
9
- "expect": false,
10
- "proj4": false,
11
- "sinon": false,
12
- "where": false
13
- }
14
- }
@@ -1,94 +0,0 @@
1
- /* eslint-disable import/no-commonjs */
2
-
3
- const path = require('path');
4
-
5
- module.exports = function (karma) {
6
- karma.set({
7
- browsers: ['ChromeHeadlessLauncher'],
8
- customLaunchers: {
9
- ChromeHeadlessLauncher: {
10
- base: 'Chrome',
11
- flags: ['--headless=new'],
12
- },
13
- },
14
- browserDisconnectTolerance: 2,
15
- frameworks: ['webpack', 'mocha', 'source-map-support'],
16
- client: {
17
- runInParent: true,
18
- mocha: {
19
- timeout: 2500,
20
- },
21
- },
22
- files: [
23
- {
24
- pattern: path.resolve(__dirname, require.resolve('expect.js/index.js')),
25
- watched: false,
26
- },
27
- {
28
- pattern: path.resolve(
29
- __dirname,
30
- require.resolve('../../node_modules/sinon/pkg/sinon.js')
31
- ),
32
- watched: false,
33
- },
34
- {
35
- pattern: path.resolve(
36
- __dirname,
37
- require.resolve('ol/dist/ol.js')
38
- ),
39
- watched: false,
40
- },
41
- {
42
- pattern: path.resolve(
43
- __dirname,
44
- require.resolve('proj4/dist/proj4.js')
45
- ),
46
- watched: false,
47
- },
48
- {
49
- pattern: path.resolve(__dirname, './test-extensions.js'),
50
- },
51
- {
52
- pattern: 'spec/**/*.test.js',
53
- watched: false,
54
- },
55
- {
56
- pattern: '**/*',
57
- included: false,
58
- watched: false,
59
- },
60
- ],
61
- proxies: {
62
- '/spec/': '/base/spec/'
63
- },
64
- preprocessors: {
65
- '**/*.js': ['webpack'], //, 'sourcemap'],
66
- },
67
- reporters: ['dots'],
68
- webpack: {
69
- devtool: 'inline-source-map',
70
- mode: 'development',
71
- resolve: {
72
- fallback: {
73
- fs: false,
74
- http: false,
75
- https: false,
76
- },
77
- },
78
- module: {
79
- rules: [
80
- {
81
- test: /\.js$/,
82
- enforce: 'pre',
83
- use: ['source-map-loader'],
84
- },
85
- ],
86
- },
87
- },
88
- webpackMiddleware: {
89
- noInfo: true,
90
- },
91
- });
92
-
93
- process.env.CHROME_BIN = require('puppeteer').executablePath();
94
- };
@@ -1,18 +0,0 @@
1
- import STAC from '../../../../../src/ol/layer/STAC.js';
2
-
3
- describe('ol/layer/STAC', function () {
4
- describe('constructor (defaults)', function () {
5
- /** @type {STAC} */
6
- let group;
7
-
8
- beforeEach(function () {
9
- group = new STAC({
10
- url: 'https://s3.us-west-2.amazonaws.com/sentinel-cogs/sentinel-s2-l2a-cogs/10/T/ES/2022/7/S2A_10TES_20220726_0_L2A/S2A_10TES_20220726_0_L2A.json',
11
- });
12
- });
13
-
14
- it('creates an instance', function () {
15
- expect(group).to.be.a(STAC);
16
- });
17
- });
18
- });