File tree 4 files changed +111
-5
lines changed
4 files changed +111
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : Release NPM Package
2
+
3
+ on :
4
+ push :
5
+ tags : ' *'
6
+
7
+ jobs :
8
+ release :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - uses : actions/checkout@v2
12
+ with :
13
+ fetch-depth : 0
14
+ - uses : actions/setup-node@v2
15
+ with :
16
+ node-version : ' 12.x'
17
+ registry-url : ' https://registry.npmjs.org'
18
+ scope : ' @jawg'
19
+ - run : npm install
20
+ - run : npm test
21
+ - run : npm publish --access public
22
+ env :
23
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_JS_ACCESS_TOKEN }}
24
+ - name : Install kokai
25
+ run : cargo install kokai
26
+ - name : Create Release Note
27
+ run : kokai release --ref ${{ github.ref }} --tag-from-ref . > RELEASE_NOTE.md
28
+ - name : Create Release
29
+ id : create_release
30
+ uses : actions/create-release@v1
31
+ env :
32
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33
+ with :
34
+ tag_name : ${{ github.ref }}
35
+ release_name : Release ${{ github.ref }}
36
+ body_path : RELEASE_NOTE.md
37
+ draft : false
38
+ prerelease : false
Original file line number Diff line number Diff line change 1
1
# js-loader
2
+
3
+ [ ![ npm] ( https://img.shields.io/npm/v/@jawg/js-loader )] ( https://www.npmjs.com/package/@jawg/js-loader )
4
+
2
5
Load the Jawg Maps JavaScript libraries dynamically.
6
+
7
+ ## Install
8
+
9
+ Available via npm as the package [ @jawg/js-loader ] ( https://www.npmjs.com/package/@jawg/js-loader ) .
10
+
11
+ ``` sh
12
+ npm i @jawg/js-loader
13
+ ```
14
+
15
+ or
16
+
17
+ ``` sh
18
+ yarn add @jawg/js-loader
19
+ ```
20
+
21
+ Alternatively you may add the umd package directly to the html document using the unpkg link.
22
+
23
+ ``` html
24
+ <
script src =
" https://unpkg.com/@jawg/[email protected] /dist/jawg-js-loader.js" ></
script >
25
+ ```
26
+
27
+ When adding via unpkg, the loader can be accessed at ` JawgJSLoader ` .
28
+
29
+ ## Load Jawg Places JS
30
+
31
+ ``` javascript
32
+ import JawgJSLoader from ' @jawg/js-loader' ;
33
+
34
+ let loader = new JawgJSLoader ({ accessToken: ' <YOUR_ACCESS_TOKEN>' });
35
+
36
+ loader .loadJawgPlaces ().then ((JawgPlaces ) => {
37
+ let jawgPlaces = new JawgPlaces.Input ({ input: ' #my-input' });
38
+ });
39
+ ```
40
+
41
+ ## Feedback
42
+
43
+ Please submint an [ issue] ( https://github.com/jawg/js-loader/issues ) for new features or when something is not working properly.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @jawg/js-loader" ,
3
- "version" : " 0 .0.0" ,
3
+ "version" : " 1 .0.0" ,
4
4
"description" : " A library to load jawg js libraries" ,
5
5
"main" : " ./dist/jawg-js-loader.js" ,
6
6
"types" : " ./index.d.ts" ,
7
+ "typeScriptVersion" : " 2.3" ,
7
8
"scripts" : {
8
9
"build" : " rollup -c" ,
9
10
"watch" : " rollup -c -w" ,
10
- "start" : " ROLLUP_SERVE=true rollup -c -w"
11
+ "start" : " ROLLUP_SERVE=true rollup -c -w" ,
12
+ "test" : " tsc --noEmit test/*.ts"
11
13
},
12
- "author" : " Jawg" ,
13
- "license" : " SEE LICENSE IN LICENSE" ,
14
+ "repository" : {
15
+ "type" : " git" ,
16
+ "url" : " git+https://github.com/jawg/js-loader.git"
17
+ },
18
+ "keywords" : [
19
+ " maps" ,
20
+ " osm" ,
21
+ " api" ,
22
+ " typescript" ,
23
+ " js-loader"
24
+ ],
25
+ "author" :
" Jawg Maps <[email protected] >" ,
26
+ "license" : " MIT" ,
14
27
"files" : [
15
28
" src/index.js" ,
16
29
" dist/jawg-js-loader.js" ,
19
32
" index.d.ts" ,
20
33
" packages.json"
21
34
],
35
+ "bugs" : {
36
+ "url" : " https://github.com/jawg/js-loader/issues"
37
+ },
38
+ "homepage" : " https://github.com/jawg/js-loader#readme" ,
22
39
"devDependencies" : {
23
40
"@babel/core" : " ^7.14.8" ,
24
41
"@babel/plugin-transform-runtime" : " ^7.14.5" ,
32
49
"rollup" : " ^2.53.3" ,
33
50
"rollup-plugin-app-utils" : " ^1.0.6" ,
34
51
"rollup-plugin-serve" : " ^1.1.0" ,
35
- "rollup-plugin-terser" : " ^7.0.2"
52
+ "rollup-plugin-terser" : " ^7.0.2" ,
53
+ "typescript" : " ^4.3.5"
36
54
},
37
55
"dependencies" : {
38
56
"@jawg/types" : " ^1.0.0"
Original file line number Diff line number Diff line change
1
+ import JawgJSLoader from '../' ;
2
+ import L = require( 'leaflet' ) ;
3
+
4
+ new JawgJSLoader ( { accessToken : 'test' } ) . loadJawgPlaces ( ) . then ( ( JawgPlaces ) => {
5
+ new JawgPlaces . Input ( { input : '#my-input' } ) ;
6
+ new JawgPlaces . MapLibre ( { searchOnTyping : true } ) ;
7
+ new JawgPlaces . Mapbox ( { searchOnTyping : true } ) ;
8
+ new JawgPlaces . Leaflet ( { searchOnTyping : true , L } ) ;
9
+ } ) ;
You can’t perform that action at this time.
0 commit comments