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

Feature/use maplibrejs #51

Open
wants to merge 9 commits into
base: develop
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
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- Addresses xxxxxx
- Depends on xxxxxx

## Changes

* Detailed list or prose of changes
* Breaking changes
* Changes to configurations

## This PR doesn't introduce any:

- [ ] temporary files, auto-generated files or secret keys
- [ ] build works
- [ ] eslint issues
- [ ] typescript issues
- [ ] `console.log` meant for debugging
- [ ] typos
- [ ] unwanted comments
46 changes: 46 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/chromatic.yml

# name of our action
name: 'Chromatic'
# the event that will trigger the action
on: push

# what the action will do
jobs:
publish-chromatic:
# the operating system it will run on
runs-on: ubuntu-latest
# the list of steps that the action will go through
steps:
- uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/checkout@v1

- name: Install Dependencies on Library
run: yarn install
working-directory: lib

- name: Install Dependencies
run: yarn install

- name: 🤞 Build Library 🧪
run: yarn build
working-directory: lib

- name: 🤞 Run Typecheck 🧪
run: yarn typecheck
working-directory: storybook

- name: 🤞 Run Lint 🧪
run: yarn lint
working-directory: storybook

- name: 🤞 Publish to Chromatic 🧪
uses: chromaui/action@v1
# options required to the GitHub chromatic action
with:
workingDir: storybook
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# .github/workflows/chromatic.yml

# name of our action
name: 'CI'
# the event that will trigger the action
on: push

# what the action will do
jobs:
build:
# the operating system it will run on
runs-on: ubuntu-latest
# the list of steps that the action will go through
steps:
- uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/checkout@v1

- name: Install Dependencies on Library
run: yarn install
working-directory: lib

- name: Install Dependencies
run: yarn install

- name: 🤞 Run Typecheck 🧪
run: yarn typecheck
working-directory: lib

- name: 🤞 Run Lint 🧪
run: yarn lint
working-directory: lib

- name: 🤞 Build 🧪
run: yarn build
working-directory: lib
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# dependencies
/node_modules
node_modules/

# testing
/coverage
coverage/

# production
/build
build/

# misc
.DS_Store
Expand All @@ -21,3 +21,5 @@ yarn-error.log*
*.tmp
*.bak
*.swp

storybook-static/
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
# Re-map

React wrapper for Mapboxgl-js
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Re-map

React wrapper for Maplibre
76 changes: 76 additions & 0 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "@togglecorp/re-map",
"version": "0.3.0",
"description": "Maplibre wrapper for React",
"files": [
"/build"
],
"type": "module",
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
"typings": "build/esm/index.d.ts",
"scripts": {
"prepare": "install-peers",
"build": "rm -rf ./build && tsc --project tsconfig-typings.json && rollup -c",
"watch": "tsc --project tsconfig-typings.json && rollup -c -w",
"prepack": "yarn build",
"typecheck": "tsc",
"lint": "eslint ./src --report-unused-disable-directives --ignore-pattern '**/*.test.ts'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/toggle-corp/re-map.git"
},
"author": "tnagorra",
"license": "ISC",
"bugs": {
"url": "https://github.com/toggle-corp/re-map/issues"
},
"homepage": "https://github.com/toggle-corp/re-map#readme",
"dependencies": {
"@babel/runtime-corejs3": "^7.22.3",
"@togglecorp/fujs": "^2.1.0"
},
"peerDependencies": {
"@mapbox/mapbox-gl-draw": "^1.4.3",
"maplibre-gl": "^3.5.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"peerDependenciesMeta": {
"@mapbox/mapbox-gl-draw": {
"optional": true
}
},
"devDependencies": {
"@babel/core": "^7.22.8",
"@babel/plugin-transform-runtime": "^7.22.7",
"@babel/preset-env": "^7.22.7",
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.2",
"@rollup/plugin-eslint": "^9.0.4",
"@rollup/plugin-node-resolve": "^15.1.0",
"@types/mapbox__mapbox-gl-draw": "^1.4.6",
"@types/node": "^20.4.1",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"babel-loader": "^9.1.3",
"babel-plugin-polyfill-corejs3": "^0.8.2",
"eslint": "^8.44.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-import-resolver-babel-module": "^5.3.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"install-peers-cli": "^2.2.0",
"rollup": "^3.26.2",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-progress": "^1.1.2",
"typescript": "^5.1.6"
}
}
2 changes: 1 addition & 1 deletion rollup.config.js → lib/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import filesize from 'rollup-plugin-filesize';

import pkg from './package.json' assert { type: 'json' };

const INPUT_FILE_PATH = 'src/index.tsx';
const INPUT_FILE_PATH = ['src/index.tsx', 'src/MapShapeEditor.tsx'];

const PLUGINS = [
eslint({
Expand Down
Loading