From 15060056e26426d8eae8e89275c57d1e3873cdbd Mon Sep 17 00:00:00 2001 From: Mylothros-Charalampos <69667373+Mylothros-Charalampos@users.noreply.github.com> Date: Thu, 8 Jul 2021 14:40:08 +0300 Subject: [PATCH] fix: change-path-for-npm-package #21 fix: change-path-for-npm-package #21 --- .gitignore | 3 +++ dist/GeoSearchControl.js | 31 ---------------------- dist/Providers/bingProvider.js | 17 ------------- dist/Providers/esriProvider.js | 17 ------------- dist/Providers/googleProvider.js | 17 ------------- dist/Providers/locationIQProvider.js | 17 ------------- dist/Providers/openCageProvider.js | 17 ------------- dist/Providers/openStreetMapProvider.js | 13 ---------- dist/index.js | 34 ------------------------- example/geosearch.js | 2 +- package.json | 3 +-- 11 files changed, 5 insertions(+), 166 deletions(-) delete mode 100644 dist/GeoSearchControl.js delete mode 100644 dist/Providers/bingProvider.js delete mode 100644 dist/Providers/esriProvider.js delete mode 100644 dist/Providers/googleProvider.js delete mode 100644 dist/Providers/locationIQProvider.js delete mode 100644 dist/Providers/openCageProvider.js delete mode 100644 dist/Providers/openStreetMapProvider.js delete mode 100644 dist/index.js diff --git a/.gitignore b/.gitignore index ad46b30..09fb298 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +#webpack generated +dist +lib # Runtime data pids *.pid diff --git a/dist/GeoSearchControl.js b/dist/GeoSearchControl.js deleted file mode 100644 index e34fd7e..0000000 --- a/dist/GeoSearchControl.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - -exports.__esModule = true; -exports.default = void 0; - -var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); - -var _react = require("react"); - -var _reactLeaflet = require("react-leaflet"); - -var _leafletGeosearch = require("leaflet-geosearch"); - -var SearchControl = function SearchControl(props) { - var map = (0, _reactLeaflet.useMap)(); - (0, _react.useEffect)(function () { - var searchControl = new _leafletGeosearch.GeoSearchControl((0, _extends2.default)({ - provider: props.provider - }, props)); - map.addControl(searchControl); - return function () { - return map.removeControl(searchControl); - }; - }, [props]); - return null; -}; - -var _default = SearchControl; -exports.default = _default; \ No newline at end of file diff --git a/dist/Providers/bingProvider.js b/dist/Providers/bingProvider.js deleted file mode 100644 index ff8630a..0000000 --- a/dist/Providers/bingProvider.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; - -var _leafletGeosearch = require("leaflet-geosearch"); - -var BingProvider = function BingProvider(key) { - return new _leafletGeosearch.BingProvider({ - params: { - key: key - } - }); -}; - -var _default = BingProvider; -exports.default = _default; \ No newline at end of file diff --git a/dist/Providers/esriProvider.js b/dist/Providers/esriProvider.js deleted file mode 100644 index 597eb51..0000000 --- a/dist/Providers/esriProvider.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; - -var _leafletGeosearch = require("leaflet-geosearch"); - -var EsriProvider = function EsriProvider(key) { - return new _leafletGeosearch.EsriProvider({ - params: { - key: key - } - }); -}; - -var _default = EsriProvider; -exports.default = _default; \ No newline at end of file diff --git a/dist/Providers/googleProvider.js b/dist/Providers/googleProvider.js deleted file mode 100644 index 77afe6e..0000000 --- a/dist/Providers/googleProvider.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; - -var _leafletGeosearch = require("leaflet-geosearch"); - -var GoogleProvider = function GoogleProvider(key) { - return new _leafletGeosearch.GoogleProvider({ - params: { - key: key - } - }); -}; - -var _default = GoogleProvider; -exports.default = _default; \ No newline at end of file diff --git a/dist/Providers/locationIQProvider.js b/dist/Providers/locationIQProvider.js deleted file mode 100644 index 19fec27..0000000 --- a/dist/Providers/locationIQProvider.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; - -var _leafletGeosearch = require("leaflet-geosearch"); - -var LocationIQProvider = function LocationIQProvider(key) { - return new _leafletGeosearch.LocationIQProvider({ - params: { - key: key - } - }); -}; - -var _default = LocationIQProvider; -exports.default = _default; \ No newline at end of file diff --git a/dist/Providers/openCageProvider.js b/dist/Providers/openCageProvider.js deleted file mode 100644 index 2dbc79d..0000000 --- a/dist/Providers/openCageProvider.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; - -var _leafletGeosearch = require("leaflet-geosearch"); - -var OpenCageProvider = function OpenCageProvider(key) { - return new _leafletGeosearch.OpenCageProvider({ - params: { - key: key - } - }); -}; - -var _default = OpenCageProvider; -exports.default = _default; \ No newline at end of file diff --git a/dist/Providers/openStreetMapProvider.js b/dist/Providers/openStreetMapProvider.js deleted file mode 100644 index a3af528..0000000 --- a/dist/Providers/openStreetMapProvider.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -exports.__esModule = true; -exports.default = void 0; - -var _leafletGeosearch = require("leaflet-geosearch"); - -var OpenStreetMapProvider = function OpenStreetMapProvider() { - return new _leafletGeosearch.OpenStreetMapProvider(); -}; - -var _default = OpenStreetMapProvider; -exports.default = _default; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 0c2af22..0000000 --- a/dist/index.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - -exports.__esModule = true; -exports.OpenCageProvider = exports.LocationIQProvider = exports.OpenStreetMapProvider = exports.GoogleProvider = exports.EsriProvider = exports.BingProvider = exports.SearchControl = void 0; - -var _GeoSearchControl = _interopRequireDefault(require("./GeoSearchControl")); - -exports.SearchControl = _GeoSearchControl.default; - -var _bingProvider = _interopRequireDefault(require("./Providers/bingProvider")); - -exports.BingProvider = _bingProvider.default; - -var _esriProvider = _interopRequireDefault(require("./Providers/esriProvider")); - -exports.EsriProvider = _esriProvider.default; - -var _googleProvider = _interopRequireDefault(require("./Providers/googleProvider")); - -exports.GoogleProvider = _googleProvider.default; - -var _openStreetMapProvider = _interopRequireDefault(require("./Providers/openStreetMapProvider")); - -exports.OpenStreetMapProvider = _openStreetMapProvider.default; - -var _locationIQProvider = _interopRequireDefault(require("./Providers/locationIQProvider")); - -exports.LocationIQProvider = _locationIQProvider.default; - -var _openCageProvider = _interopRequireDefault(require("./Providers/openCageProvider")); - -exports.OpenCageProvider = _openCageProvider.default; \ No newline at end of file diff --git a/example/geosearch.js b/example/geosearch.js index 6a514d0..eebc194 100644 --- a/example/geosearch.js +++ b/example/geosearch.js @@ -1,6 +1,6 @@ import React from "react"; import { MapContainer, TileLayer } from "react-leaflet"; -import { SearchControl, OpenStreetMapProvider } from "../src/index"; +import { SearchControl, OpenStreetMapProvider } from "../lib/index"; import './react-leaflet-geosearch.css'; export default class GeoSearchExample extends React.Component { diff --git a/package.json b/package.json index 04c1741..1e089de 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,10 @@ "build:lib": "npm run compile:lib", "clean:lib": "rm -Rf ./lib", "compile:lib": "babel src --out-dir lib", - "prepublishOnly": "npm run transpile", + "prepublishOnly": "npm run build", "example": "webpack-dev-server --config ./example/webpack.config.js", "lint": "eslint ./src", "pretty": "prettier --write \"{src,example}/**/*.js\"", - "transpile": "babel src -d dist --copy-files" }, "files": [ "src",