From c71d200cbf2c7bcb09453500fa3557026734f743 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 27 Jul 2022 15:39:37 -0600 Subject: [PATCH 1/2] Publish untranspiled sources --- config/tsconfig-build.json | 6 +++--- package.json | 2 +- tasks/serialize-workers.cjs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/tsconfig-build.json b/config/tsconfig-build.json index 2f6f543d1a..4daa2fbade 100644 --- a/config/tsconfig-build.json +++ b/config/tsconfig-build.json @@ -1,8 +1,8 @@ { "compilerOptions": { /* Basic Options */ - "target": "ES5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ - "module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ + "module": "es2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ // "lib": [], /* Specify library files to be included in the compilation. */ "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ @@ -58,7 +58,7 @@ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ }, "include": [ - "../build/ol/src/**/*.js" + "../build/ol/**/*.js" ], "exclude": [] } \ No newline at end of file diff --git a/package.json b/package.json index 5c12c1b337..ecd263dd71 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "build-site": "shx rm -rf build/site && npm run build-examples && npm run apidoc && npm run build-legacy && shx mkdir -p build/site && shx cp site/index.html build/site/ && shx mv build/apidoc build/examples build/legacy build/site/", "copy-css": "shx cp src/ol/ol.css build/ol/ol.css", "generate-types": "tsc --project config/tsconfig-build.json --declaration --declarationMap --emitDeclarationOnly --outdir build/ol", - "transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build/ol/src && node tasks/serialize-workers.cjs && tsc --project config/tsconfig-build.json", + "transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build && node tasks/serialize-workers.cjs", "typecheck": "tsc --pretty", "apidoc-debug": "shx rm -rf build/apidoc && node --inspect-brk=9229 ./node_modules/jsdoc/jsdoc.js -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc", "apidoc": "shx rm -rf build/apidoc && jsdoc -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc" diff --git a/tasks/serialize-workers.cjs b/tasks/serialize-workers.cjs index 757ea8a788..5ab7af7ffa 100644 --- a/tasks/serialize-workers.cjs +++ b/tasks/serialize-workers.cjs @@ -80,7 +80,7 @@ exports.build = build; */ async function main() { const inputDir = path.join(__dirname, '../src/ol/worker'); - const outputDir = path.join(__dirname, '../build/ol/src/worker'); + const outputDir = path.join(__dirname, '../build/ol/worker'); await fse.ensureDir(outputDir); From 0f5b273246eb225092fa243a47a8aa8852a9db17 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 28 Jul 2022 13:56:16 -0600 Subject: [PATCH 2/2] Update doc to remove part about extra src folder in the package --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4a612b90a7..a344162edf 100644 --- a/README.md +++ b/README.md @@ -80,19 +80,15 @@ OpenLayers appreciates contributions of all kinds. We especially want to thank See our [GitHub sponsors page](https://github.com/sponsors/openlayers) or [Open Collective](https://opencollective.com/openlayers/contribute/sponsors-214/checkout) if you too are interested in becoming a regular sponsor. -## ES Modules - -The `ol` package contains a `src/` folder with the sources, authored as [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules). To use these untranspiled sources, either import modules from `ol/src` instead of `ol`, or configure your bundler with an alias pointing to `ol/src` for the `ol` package. - ## TypeScript support The [ol package](https://npmjs.com/package/ol) includes auto-generated TypeScript declarations as `*.d.ts` files. ## Supported Browsers -OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](https://262.ecma-international.org/5.1/). This includes Chrome, Firefox, Safari and Edge. +OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 2017](https://262.ecma-international.org/8.0/). This includes Chrome, Firefox, Safari and Edge. -For older browsers and platforms (Internet Explorer, Android 4.x, iOS v12 and older, Safari v12 and older), polyfills may be needed for the following browser features: +For older browsers and platforms (Android 4.x, iOS v12 and older, Safari v12 and older), polyfills may be needed for the following browser features: * [`fetch`](https://caniuse.com/fetch): Available from [polyfill.io](https://polyfill.io/). * [`requestAnimationFrame`](https://caniuse.com/requestanimationframe): Available from [polyfill.io](https://polyfill.io/).