-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow for build and type check
- Loading branch information
Showing
4 changed files
with
111 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release NPM Package | ||
|
||
on: | ||
push: | ||
tags: '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
scope: '@jawg' | ||
- run: npm install | ||
- run: npm test | ||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_JS_ACCESS_TOKEN }} | ||
- name: Install kokai | ||
run: cargo install kokai | ||
- name: Create Release Note | ||
run: kokai release --ref ${{ github.ref }} --tag-from-ref . > RELEASE_NOTE.md | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body_path: RELEASE_NOTE.md | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,43 @@ | ||
# js-loader | ||
|
||
[![npm](https://img.shields.io/npm/v/@jawg/js-loader)](https://www.npmjs.com/package/@jawg/js-loader) | ||
|
||
Load the Jawg Maps JavaScript libraries dynamically. | ||
|
||
## Install | ||
|
||
Available via npm as the package [@jawg/js-loader](https://www.npmjs.com/package/@jawg/js-loader). | ||
|
||
```sh | ||
npm i @jawg/js-loader | ||
``` | ||
|
||
or | ||
|
||
```sh | ||
yarn add @jawg/js-loader | ||
``` | ||
|
||
Alternatively you may add the umd package directly to the html document using the unpkg link. | ||
|
||
```html | ||
<script src="https://unpkg.com/@jawg/[email protected]/dist/jawg-js-loader.js"></script> | ||
``` | ||
|
||
When adding via unpkg, the loader can be accessed at `JawgJSLoader`. | ||
|
||
## Load Jawg Places JS | ||
|
||
```javascript | ||
import JawgJSLoader from '@jawg/js-loader'; | ||
|
||
let loader = new JawgJSLoader({ accessToken: '<YOUR_ACCESS_TOKEN>' }); | ||
|
||
loader.loadJawgPlaces().then((JawgPlaces) => { | ||
let jawgPlaces = new JawgPlaces.Input({ input: '#my-input' }); | ||
}); | ||
``` | ||
|
||
## Feedback | ||
|
||
Please submint an [issue](https://github.com/jawg/js-loader/issues) for new features or when something is not working properly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
{ | ||
"name": "@jawg/js-loader", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"description": "A library to load jawg js libraries", | ||
"main": "./dist/jawg-js-loader.js", | ||
"types": "./index.d.ts", | ||
"typeScriptVersion": "2.3", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"watch": "rollup -c -w", | ||
"start": "ROLLUP_SERVE=true rollup -c -w" | ||
"start": "ROLLUP_SERVE=true rollup -c -w", | ||
"test": "tsc --noEmit test/*.ts" | ||
}, | ||
"author": "Jawg", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/jawg/js-loader.git" | ||
}, | ||
"keywords": [ | ||
"maps", | ||
"osm", | ||
"api", | ||
"typescript", | ||
"js-loader" | ||
], | ||
"author": "Jawg Maps <[email protected]>", | ||
"license": "MIT", | ||
"files": [ | ||
"src/index.js", | ||
"dist/jawg-js-loader.js", | ||
|
@@ -19,6 +32,10 @@ | |
"index.d.ts", | ||
"packages.json" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/jawg/js-loader/issues" | ||
}, | ||
"homepage": "https://github.com/jawg/js-loader#readme", | ||
"devDependencies": { | ||
"@babel/core": "^7.14.8", | ||
"@babel/plugin-transform-runtime": "^7.14.5", | ||
|
@@ -32,7 +49,8 @@ | |
"rollup": "^2.53.3", | ||
"rollup-plugin-app-utils": "^1.0.6", | ||
"rollup-plugin-serve": "^1.1.0", | ||
"rollup-plugin-terser": "^7.0.2" | ||
"rollup-plugin-terser": "^7.0.2", | ||
"typescript": "^4.3.5" | ||
}, | ||
"dependencies": { | ||
"@jawg/types": "^1.0.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import JawgJSLoader from '../'; | ||
import L = require('leaflet'); | ||
|
||
new JawgJSLoader({ accessToken: 'test' }).loadJawgPlaces().then((JawgPlaces) => { | ||
new JawgPlaces.Input({ input: '#my-input' }); | ||
new JawgPlaces.MapLibre({ searchOnTyping: true }); | ||
new JawgPlaces.Mapbox({ searchOnTyping: true }); | ||
new JawgPlaces.Leaflet({ searchOnTyping: true, L }); | ||
}); |