Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: set NPM package type to module and publish only build artifacts #258

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ole",
"license": "BSD-2-Clause",
"description": "OpenLayers Editor",
"version": "2.4.5",
"version": "3.0.0-beta.5",
"main": "build/index.js",
"dependencies": {},
"peerDependencies": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"vitest": "^2.1.1"
},
"scripts": {
"build": "shx rm -rf build && tsc --project config/tsconfig-build.json && esbuild build/index.js --bundle --global-name=ole --loader:.svg=dataurl --minify --outfile=build/bundle.js",
"build": "shx rm -rf build && tsc --project config/tsconfig-build.json && shx cp -r src/img build/img && esbuild build/index.js --bundle --global-name=ole --loader:.svg=dataurl --minify --outfile=build/bundle.js && node tasks/prepare-package.mjs",
"cy:open": "cypress open",
"cy:run": "cypress run --browser chrome",
"cy:test": "start-server-and-test start http://127.0.0.1:8000 cy:run",
Expand All @@ -50,9 +50,9 @@
"format": "prettier --write 'cypress/integration/*.js' 'src/**/*.js' && eslint 'src/**/*.js' --fix && stylelint 'style/**/*.css' 'src/**/*.css' 'src/**/*.scss' --fix",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint 'cypress/e2e/**/*.js' 'src/**/*.js' && stylelint 'style/**/*.css' 'src/**/*.css' 'src/**/*.scss'",
"prepare": "is-ci || husky",
"publish:beta": "yarn release -- --prerelease beta --skip.changelog && yarn build && git push origin HEAD && git push --tags && yarn publish --tag beta",
"publish:beta": "yarn release -- --prerelease beta --skip.changelog && yarn build && git push origin HEAD && git push --tags && cd build && yarn publish --tag beta",
"publish:beta:dryrun": "yarn release -- --prerelease beta --dry-run --skip.changelog",
"publish:public": "yarn release && yarn build && git push origin HEAD && git push --tags && yarn publish",
"publish:public": "yarn release && yarn build && git push origin HEAD && git push --tags && cd build && yarn publish",
"publish:public:dryrun": "yarn release --dry-run",
"release": "standard-version",
"start": "esbuild src/index.js --bundle --global-name=ole --loader:.svg=dataurl --minify --outfile=index.js --serve=localhost:8000 --servedir=. --sourcemap --watch=forever",
Expand Down
2 changes: 1 addition & 1 deletion src/control/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from 'ol/geom';
import Select from 'ol/interaction/Select';
import Control from './control';
import bufferSVG from '../../img/buffer.svg';
import bufferSVG from '../img/buffer.svg';

/**
* Control for creating buffers.
Expand Down
3 changes: 2 additions & 1 deletion src/control/cad.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Pointer, Snap } from 'ol/interaction';
import { OverlayOp } from 'jsts/org/locationtech/jts/operation/overlay';
import { getUid } from 'ol/util';
import Control from './control';
import cadSVG from '../../img/cad.svg';
import cadSVG from '../img/cad.svg';
import { SnapEvent, SnapEventType } from '../event';
import {
parser,
Expand Down Expand Up @@ -56,6 +56,7 @@ class CadControl extends Control {
* must be an array containing the following values 'ortho', 'segment', 'vh'. Default is ['ortho', 'segment', 'vh', 'custom'].
* @param {Number} [options.snapPointDist] Distance of the
* snap points (default is 30).
* @param {ol.source.Vector} [options.source] Vector source holding edit features.
* @param {Boolean} [options.useMapUnits] Whether to use map units
* as measurement for point snapping. Default is false (pixel are used).
* @param {ol.VectorSource} [options.source] The vector source to retrieve the snappable features from.
Expand Down
5 changes: 2 additions & 3 deletions src/control/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ class Control extends OLControl {
* @param {Image} options.image Control toolbar image.
* @param {HTMLElement} [options.dialogTarget] Specify a target if you want
* the dialog div used by the control to be rendered outside of the map's viewport. Set tio null if you don't want to display the dialog of a control.
* @param {ol.source.Vector} [options.source] Vector source holding
* edit features. If undefined, options.features must be passed.
* @param {ol.source.Vector} [options.source] Vector source holding edit features.
* @param {ol.Collection<ol.Feature>} [options.features] Collection of
* edit features. If undefined, options.source must be set.
* edit features. Requires options.source to be set.
* @param {function} [options.layerFilter] Filter editable layer.
*/
constructor(options) {
Expand Down
2 changes: 1 addition & 1 deletion src/control/difference.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
MultiPolygon,
} from 'ol/geom';
import TopologyControl from './topology';
import diffSVG from '../../img/difference.svg';
import diffSVG from '../img/difference.svg';

/**
* Control for creating a difference of geometries.
Expand Down
6 changes: 3 additions & 3 deletions src/control/draw.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Draw } from 'ol/interaction';
import Control from './control';
import drawPointSVG from '../../img/draw_point.svg';
import drawPolygonSVG from '../../img/draw_polygon.svg';
import drawLineSVG from '../../img/draw_line.svg';
import drawPointSVG from '../img/draw_point.svg';
import drawPolygonSVG from '../img/draw_polygon.svg';
import drawLineSVG from '../img/draw_line.svg';

/**
* Control for drawing features.
Expand Down
2 changes: 1 addition & 1 deletion src/control/intersection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
MultiPolygon,
} from 'ol/geom';
import TopologyControl from './topology';
import intersectionSVG from '../../img/intersection.svg';
import intersectionSVG from '../img/intersection.svg';

/**
* Control for intersection geometries.
Expand Down
2 changes: 1 addition & 1 deletion src/control/modify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { singleClick } from 'ol/events/condition';
import throttle from 'lodash.throttle';
import { unByKey } from 'ol/Observable';
import Control from './control';
import image from '../../img/modify_geometry2.svg';
import image from '../img/modify_geometry2.svg';
import SelectMove from '../interaction/selectmove';
import SelectModify from '../interaction/selectmodify';
import Move from '../interaction/move';
Expand Down
4 changes: 2 additions & 2 deletions src/control/rotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Vector from 'ol/layer/Vector';
import VectorSource from 'ol/source/Vector';
import Pointer from 'ol/interaction/Pointer';
import Control from './control';
import rotateSVG from '../../img/rotate.svg';
import rotateMapSVG from '../../img/rotate_map.svg';
import rotateSVG from '../img/rotate.svg';
import rotateMapSVG from '../img/rotate_map.svg';

/**
* Tool with for rotating geometries.
Expand Down
2 changes: 1 addition & 1 deletion src/control/topology.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Select from 'ol/interaction/Select';
import Control from './control';
import delSVG from '../../img/buffer.svg';
import delSVG from '../img/buffer.svg';

/**
* Control for deleting geometries.
Expand Down
2 changes: 1 addition & 1 deletion src/control/union.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
MultiPolygon,
} from 'ol/geom';
import TopologyControl from './topology';
import unionSVG from '../../img/union.svg';
import unionSVG from '../img/union.svg';

/**
* Control for creating a union of geometries.
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
1 change: 1 addition & 0 deletions tasks/prepare-package.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function main() {

// write out simplified package.json
pkg.main = 'index.js';
pkg.type = 'module';
delete pkg.devDependencies;
delete pkg.scripts;
const data = JSON.stringify(pkg, null, 2);
Expand Down
Loading