Skip to content

Commit

Permalink
Merge branch 'main' into ISSUE_#32_prev_and_next_tree_button
Browse files Browse the repository at this point in the history
  • Loading branch information
VWRoli authored Dec 21, 2021
2 parents aa4c621 + f86ec48 commit f7360dc
Show file tree
Hide file tree
Showing 35 changed files with 3,915 additions and 988 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
coverage/
mapTools.cy.js
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
env: {
browser: true,
es2021: true,
'jest/globals': true,
'cypress/globals': true,
node: true,
},
plugins: ['jest', 'cypress'],
extends: [
'eslint:recommended',
'plugin:import/recommended',
'prettier', // must be last
],
parserOptions: {
ecmaVersion: 13,
sourceType: 'module',
},
rules: {
'no-unused-vars': 'warn',
},
}
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/basic-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Almost a blank issue with some generic guides/hints.
title: ''
labels: ''
assignees: ''

---

---
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
description: 'git-tag'
required: true


env:
project-directory: ./

Expand All @@ -24,22 +23,26 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.git-tag }}
ref: ${{ github.event.inputs.git-tag }}
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: npm clean install
run: npm ci
working-directory: ${{ env.project-directory }}


- name: ESLint
run: npm run lint
working-directory: ${{ env.project-directory }}

- run: npm i -g semantic-release @semantic-release/{git,exec,changelog}

- run: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
42 changes: 42 additions & 0 deletions .github/workflows/npm-module-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on: [push, pull_request]
name: Build and Publish
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js '16.x'
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v1
with:
path: node_modules
key: 16.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }}
- name: Build
if: steps.cache-modules.outputs.cache-hit != 'true'
run: npm install
publish:
name: Publish
runs-on: ubuntu-latest
if: github.event_name == 'push' && ( github.ref == 'refs/heads/main' )
steps:
- uses: actions/checkout@v2
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v1
with:
path: node_modules
key: 16.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }}
- name: Build
if: steps.cache-modules.outputs.cache-hit != 'true'
run: npm install

- name: Publish
uses: mikeal/merge-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.eslintcache
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
14 changes: 14 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
// sort package.json if changed
'package.json': 'sort-package-json',

// format all file types recognized by prettier
'*': 'prettier --ignore-unknown --write',

// lint typescript files and run related unit tests
'*.js': 'eslint --fix',

// lint entire project if eslint settings or ignore file changed
// do not pass filename arguments
'.eslint*': () => 'eslint .',
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist
package-lock.json
16 changes: 16 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
arrowParens: 'always', // include parens around sole arrow function parameters
bracketSpacing: true,
embeddedLanguageFormatting: 'auto', // format md code blocks based on language
endOfLine: 'lf',
insertPragma: false,
printWidth: 80,
proseWrap: 'preserve', // format long lines in md files
quoteProps: 'as-needed', // add quotes to js object property names
requirePragma: false, // enable to restrict prettier to specified files
semi: false, // use semicolons
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
}
56 changes: 25 additions & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,52 @@
## [1.0.4](https://github.com/Greenstand/treetracker-web-map-core/compare/v1.0.3...v1.0.4) (2021-12-13)


### Bug Fixes

* release test ([13f11be](https://github.com/Greenstand/treetracker-web-map-core/commit/13f11be139a1bcdd9011a0481e4c870a8c031d6e))
- release test ([13f11be](https://github.com/Greenstand/treetracker-web-map-core/commit/13f11be139a1bcdd9011a0481e4c870a8c031d6e))

## [1.0.3](https://github.com/Greenstand/treetracker-web-map-core/compare/v1.0.2...v1.0.3) (2021-12-11)


### Bug Fixes

* test version ([b1834ae](https://github.com/Greenstand/treetracker-web-map-core/commit/b1834ae7346d4fa6cfaba7d51b8e9bc2756ba332))
* test version ([ca5d804](https://github.com/Greenstand/treetracker-web-map-core/commit/ca5d804538130b2ac233f701eb8eafc3b4331129))
- test version ([b1834ae](https://github.com/Greenstand/treetracker-web-map-core/commit/b1834ae7346d4fa6cfaba7d51b8e9bc2756ba332))
- test version ([ca5d804](https://github.com/Greenstand/treetracker-web-map-core/commit/ca5d804538130b2ac233f701eb8eafc3b4331129))

## [1.0.2](https://github.com/Greenstand/treetracker-web-map-core/compare/v1.0.1...v1.0.2) (2021-12-11)


### Bug Fixes

* build ([fc7be86](https://github.com/Greenstand/treetracker-web-map-core/commit/fc7be86200679c9f65d7505d6a4e0da138de2a6d))
* build ([93f386e](https://github.com/Greenstand/treetracker-web-map-core/commit/93f386e29739013984d09c1b98d0d643acf07391))
- build ([fc7be86](https://github.com/Greenstand/treetracker-web-map-core/commit/fc7be86200679c9f65d7505d6a4e0da138de2a6d))
- build ([93f386e](https://github.com/Greenstand/treetracker-web-map-core/commit/93f386e29739013984d09c1b98d0d643acf07391))

## [1.0.1](https://github.com/Greenstand/treetracker-web-map-core/compare/v1.0.0...v1.0.1) (2021-12-11)


### Bug Fixes

* wrong readme ([b6d6805](https://github.com/Greenstand/treetracker-web-map-core/commit/b6d680500548ed178f8d4b0e4116cd64883cd4b6))
- wrong readme ([b6d6805](https://github.com/Greenstand/treetracker-web-map-core/commit/b6d680500548ed178f8d4b0e4116cd64883cd4b6))

# 1.0.0 (2021-12-10)


### Bug Fixes

* add node_modules to .gitignore ([fee9c96](https://github.com/Greenstand/treetracker-web-map-core/commit/fee9c969f45a3a7f4e289354662a129253a7a4bc))
* webpack config ([0984aa4](https://github.com/Greenstand/treetracker-web-map-core/commit/0984aa462886faca530368ccaee25f0173503b68))

- add node_modules to .gitignore ([fee9c96](https://github.com/Greenstand/treetracker-web-map-core/commit/fee9c969f45a3a7f4e289354662a129253a7a4bc))
- webpack config ([0984aa4](https://github.com/Greenstand/treetracker-web-map-core/commit/0984aa462886faca530368ccaee25f0173503b68))

### Features

* add and configure cypress-watch-and-reload ([8525f0d](https://github.com/Greenstand/treetracker-web-map-core/commit/8525f0d7642fe2b9cb3b2d826579d90e1a7dcafc))
* add test file ([a8de139](https://github.com/Greenstand/treetracker-web-map-core/commit/a8de1394994d60095369e4f83f08c16a1d67f094))
* be able to output greenstand.Map ([2c67a53](https://github.com/Greenstand/treetracker-web-map-core/commit/2c67a535658562e1f9d0bc241e709580e4cecaea))
* be able to switch initial view ([ebe22dc](https://github.com/Greenstand/treetracker-web-map-core/commit/ebe22dcbac86a65c0f3aec177bfd1f63c0539593))
* can build with webpack ([30783db](https://github.com/Greenstand/treetracker-web-map-core/commit/30783db1212ea8990eb929b9dfbfb4db4684fb69))
* can display map in sandbox ([bb081b2](https://github.com/Greenstand/treetracker-web-map-core/commit/bb081b2736d3482b755b0d047462cd914cf4162d))
* can load html page with js ([d8aedc6](https://github.com/Greenstand/treetracker-web-map-core/commit/d8aedc666bbc5265849e52f9818fe9eebe9d5556))
* can load the part of the map, but can not work well ([2a481ce](https://github.com/Greenstand/treetracker-web-map-core/commit/2a481ce21e36ef454d413f9db08490d56506686d))
* can run dev server with webpack ([f3e9d43](https://github.com/Greenstand/treetracker-web-map-core/commit/f3e9d439ff534eb6cbf26f44cb9feeb1e4cebfff))
* change api for event listner ([c97fcda](https://github.com/Greenstand/treetracker-web-map-core/commit/c97fcda42f71e899cb8cf04c73d41520c7664774))
* cy test pass, welcome page ([887d053](https://github.com/Greenstand/treetracker-web-map-core/commit/887d053ba08b15a53c9c21d959067bbc14b06ed4))
* cypress first test ([703e70c](https://github.com/Greenstand/treetracker-web-map-core/commit/703e70c8a80cd389189f02c8bfd71cb1afba061c))
* index page for test ([bc64ac1](https://github.com/Greenstand/treetracker-web-map-core/commit/bc64ac1a9c3d0da69d79f3712124ffef93b4def7))
* install cypress ([179e1a2](https://github.com/Greenstand/treetracker-web-map-core/commit/179e1a20ce3a8e19d7f58efc1dc86135c1380d5c))
* prepublish script ([459b6c3](https://github.com/Greenstand/treetracker-web-map-core/commit/459b6c3b749bf27d1e3142be83a08661487cd0d1))
* support onMoveEnd event ([6ffc3e3](https://github.com/Greenstand/treetracker-web-map-core/commit/6ffc3e33355b7282a898afd60da0ca529ea9905f))
* the loading feedback ([b8a05fd](https://github.com/Greenstand/treetracker-web-map-core/commit/b8a05fd356b2beaa8d4cd982eb2fb5b5251f1eaa))
- add and configure cypress-watch-and-reload ([8525f0d](https://github.com/Greenstand/treetracker-web-map-core/commit/8525f0d7642fe2b9cb3b2d826579d90e1a7dcafc))
- add test file ([a8de139](https://github.com/Greenstand/treetracker-web-map-core/commit/a8de1394994d60095369e4f83f08c16a1d67f094))
- be able to output greenstand.Map ([2c67a53](https://github.com/Greenstand/treetracker-web-map-core/commit/2c67a535658562e1f9d0bc241e709580e4cecaea))
- be able to switch initial view ([ebe22dc](https://github.com/Greenstand/treetracker-web-map-core/commit/ebe22dcbac86a65c0f3aec177bfd1f63c0539593))
- can build with webpack ([30783db](https://github.com/Greenstand/treetracker-web-map-core/commit/30783db1212ea8990eb929b9dfbfb4db4684fb69))
- can display map in sandbox ([bb081b2](https://github.com/Greenstand/treetracker-web-map-core/commit/bb081b2736d3482b755b0d047462cd914cf4162d))
- can load html page with js ([d8aedc6](https://github.com/Greenstand/treetracker-web-map-core/commit/d8aedc666bbc5265849e52f9818fe9eebe9d5556))
- can load the part of the map, but can not work well ([2a481ce](https://github.com/Greenstand/treetracker-web-map-core/commit/2a481ce21e36ef454d413f9db08490d56506686d))
- can run dev server with webpack ([f3e9d43](https://github.com/Greenstand/treetracker-web-map-core/commit/f3e9d439ff534eb6cbf26f44cb9feeb1e4cebfff))
- change api for event listner ([c97fcda](https://github.com/Greenstand/treetracker-web-map-core/commit/c97fcda42f71e899cb8cf04c73d41520c7664774))
- cy test pass, welcome page ([887d053](https://github.com/Greenstand/treetracker-web-map-core/commit/887d053ba08b15a53c9c21d959067bbc14b06ed4))
- cypress first test ([703e70c](https://github.com/Greenstand/treetracker-web-map-core/commit/703e70c8a80cd389189f02c8bfd71cb1afba061c))
- index page for test ([bc64ac1](https://github.com/Greenstand/treetracker-web-map-core/commit/bc64ac1a9c3d0da69d79f3712124ffef93b4def7))
- install cypress ([179e1a2](https://github.com/Greenstand/treetracker-web-map-core/commit/179e1a20ce3a8e19d7f58efc1dc86135c1380d5c))
- prepublish script ([459b6c3](https://github.com/Greenstand/treetracker-web-map-core/commit/459b6c3b749bf27d1e3142be83a08661487cd0d1))
- support onMoveEnd event ([6ffc3e3](https://github.com/Greenstand/treetracker-web-map-core/commit/6ffc3e33355b7282a898afd60da0ca529ea9905f))
- the loading feedback ([b8a05fd](https://github.com/Greenstand/treetracker-web-map-core/commit/b8a05fd356b2beaa8d4cd982eb2fb5b5251f1eaa))
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ npm run dev
npm run cy
```

## Linting and Formatting

**_Note: All of these actions will be automatically run when appropriate with lint-staged during the git pre-commit stage._**

check for lint errors

```sh
npm run lint
```

check for lint errors with auto fix

```sh
npm run lint:fix
```

format with prettier

```sh
npm run format
```

sort package.json

```sh
npx sort-package-json
```

## Publishing

build project as production module
Expand All @@ -33,6 +61,5 @@ check issue 41 [here](https://github.com/Greenstand/treetracker-web-map-core/iss
import module in different app

```js
import { Map } from 'treetracker-web-map-core';
import { Map } from 'treetracker-web-map-core'
```

2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
module.exports = { extends: ['@commitlint/config-conventional'] }
8 changes: 4 additions & 4 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cypress-watch-and-reload": {
"watch": "src/*"
}
}
"cypress-watch-and-reload": {
"watch": "src/*"
}
}
44 changes: 16 additions & 28 deletions cypress/integration/components.spec.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@

describe("Components", () => {

it("Spin", () => {
cy.visit("http://localhost:5000/test_components.html");
cy.wait(1000);
cy.contains("mount spin")
.click();
describe('Components', () => {
it('Spin', () => {
cy.visit('http://localhost:5000/test_components.html')
cy.wait(1000)
cy.contains('mount spin').click()

// expect the spinner to be visible
cy.get(".spin")
.should("not.be.visible");
cy.contains("show spin")
.click();
cy.get(".spin")
.should("be.visible");
cy.contains("hide spin")
.click();
cy.get(".spin")
.should("not.be.visible");

cy.get('.spin').should('not.be.visible')
cy.contains('show spin').click()
cy.get('.spin').should('be.visible')
cy.contains('hide spin').click()
cy.get('.spin').should('not.be.visible')
})

it("Alert", () => {
cy.visit("http://localhost:5000/test_components.html");
cy.contains("show alert")
.click();
it('Alert', () => {
cy.visit('http://localhost:5000/test_components.html')
cy.contains('show alert').click()
// cy.get(".alert")
// .should("not.be.visible");
cy.contains("An alert message");

// .should("not.be.visible");
cy.contains('An alert message')
})

})
})
Loading

0 comments on commit f7360dc

Please sign in to comment.