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

General improvements to code structure #38

Merged
merged 7 commits into from
Sep 20, 2024
Merged
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
28 changes: 14 additions & 14 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@

Please select an option

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Other (please provide a description below)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Other (please provide a description below)

## Testing Instructions

Please provide testing instructions for the reviewer here

- [ ] Manual testing (Please provide the testing instructions)
- [ ] Automated testing
- [ ] Manual testing (Please provide the testing instructions)
- [ ] Automated testing

## Screenshots

<!-- Please provide any screenshots here -->

## Review Checklist

- [ ] Code follows style & code guidelines
- [ ] Has linked issue
- [ ] Pull request includes description
- [ ] Version and changelog were updated
- [ ] Testing Instructions are provided
- [ ] Tests are verified
- [ ] Commits follow our [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines
- [ ] Code follows style & code guidelines
- [ ] Has linked issue
- [ ] Pull request includes description
- [ ] Version and changelog were updated
- [ ] Testing Instructions are provided
- [ ] Tests are verified
- [ ] Commits follow our [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines
154 changes: 77 additions & 77 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
name: Release Plugin

on:
push:
tags:
- "*"
push:
tags:
- '*'
jobs:
define-variables:
name: Defining and extracting Variables
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
label: ${{ steps.get_label.outputs.LABEL }}
pre_release: ${{ steps.prerelease_check.outputs.PRE_RELEASE }}
steps:
- uses: actions/checkout@v3
- name: Get Version
id: get_version
# E.g. converts ref/tags/v0.0.1 -> 0.0.1
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 1-)" >> $GITHUB_OUTPUT
- name: Get Label
id: get_label
# E.g. converts 0.0.1-beta.1 -> beta
run: echo "LABEL=$(echo ${{ steps.get_version.outputs.VERSION }} | awk -F '-' '{split($2, arr, "."); print arr[1]}')" >> $GITHUB_OUTPUT
- name: Check for Pre-Release or Release
id: prerelease_check
# perform secret check & put boolean result as an output
run: |
if [ "${{ steps.get_label.outputs.LABEL }}" != '' ]; then
echo "PRE_RELEASE=true" >> $GITHUB_OUTPUT
else
echo "PRE_RELEASE=false" >> $GITHUB_OUTPUT
fi
create-release:
needs: [define-variables]
name: Create Github Release
if: needs.define-variables.outputs.pre_release == 'false'
runs-on: ubuntu-latest
env:
NPM_PACKAGE_VERSION: ${{ needs.define-variables.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Build Plugin
run: |
npm install
npm run version
npm run build
- uses: "marvinpinto/action-automatic-releases@latest"
name: Publish Release
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: ${{ needs.define-variables.outputs.version }}
files: |
main.js
manifest.json
styles.css
create-prerelease:
needs: [define-variables]
name: Create Github Pre-Release
if: needs.define-variables.outputs.pre_release == 'true'
runs-on: ubuntu-latest
env:
NPM_PACKAGE_VERSION: ${{ needs.define-variables.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Build Plugin
run: |
npm install
npm run version
npm run build
- uses: "marvinpinto/action-automatic-releases@latest"
name: Publish Release
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
title: ${{ needs.define-variables.outputs.version }}
files: |
main.js
manifest.json
styles.css
define-variables:
name: Defining and extracting Variables
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
label: ${{ steps.get_label.outputs.LABEL }}
pre_release: ${{ steps.prerelease_check.outputs.PRE_RELEASE }}
steps:
- uses: actions/checkout@v3
- name: Get Version
id: get_version
# E.g. converts ref/tags/v0.0.1 -> 0.0.1
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 1-)" >> $GITHUB_OUTPUT
- name: Get Label
id: get_label
# E.g. converts 0.0.1-beta.1 -> beta
run: echo "LABEL=$(echo ${{ steps.get_version.outputs.VERSION }} | awk -F '-' '{split($2, arr, "."); print arr[1]}')" >> $GITHUB_OUTPUT
- name: Check for Pre-Release or Release
id: prerelease_check
# perform secret check & put boolean result as an output
run: |
if [ "${{ steps.get_label.outputs.LABEL }}" != '' ]; then
echo "PRE_RELEASE=true" >> $GITHUB_OUTPUT
else
echo "PRE_RELEASE=false" >> $GITHUB_OUTPUT
fi
create-release:
needs: [define-variables]
name: Create Github Release
if: needs.define-variables.outputs.pre_release == 'false'
runs-on: ubuntu-latest
env:
NPM_PACKAGE_VERSION: ${{ needs.define-variables.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Build Plugin
run: |
npm install
npm run version
npm run build
- uses: 'marvinpinto/action-automatic-releases@latest'
name: Publish Release
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: false
title: ${{ needs.define-variables.outputs.version }}
files: |
main.js
manifest.json
styles.css
create-prerelease:
needs: [define-variables]
name: Create Github Pre-Release
if: needs.define-variables.outputs.pre_release == 'true'
runs-on: ubuntu-latest
env:
NPM_PACKAGE_VERSION: ${{ needs.define-variables.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Build Plugin
run: |
npm install
npm run version
npm run build
- uses: 'marvinpinto/action-automatic-releases@latest'
name: Publish Release
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: true
title: ${{ needs.define-variables.outputs.version }}
files: |
main.js
manifest.json
styles.css
80 changes: 41 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
name: Build

on:
pull_request:
branches:
- main
push:
branches:
- main
pull_request:
branches:
- main
- feature/v2
push:
branches:
- main
- feature/v2

jobs:
build-library:
name: Build Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Build plugin
run: npm run build
run-validations:
name: Validate Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Validate code format
run: npm run check
- name: Validate changelog
uses: mindsers/[email protected]
with:
# Path to the CHANGELOG file containing the log entries
path: ./CHANGELOG.md
# Specifies if the CHANGELOG.md file should be validated and the behavior of the action
validation_level: error
build-library:
name: Build Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Build plugin
run: npm run build
run-validations:
name: Validate Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Validate code format
run: npm run check
- name: Validate changelog
uses: mindsers/[email protected]
with:
# Path to the CHANGELOG file containing the log entries
path: ./CHANGELOG.md
# Specifies if the CHANGELOG.md file should be validated and the behavior of the action
validation_level: error
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 100,
"singleQuote": true,
"useTabs": true,
"tabWidth": 2,
"semi": true,
"endOfLine": "lf"
}
32 changes: 20 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,48 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Next] - 2024-09-20

### Changed

- [⚙️] Code structure to support new processor blocks
- [⚙️] Added `.prettierrc` config to force correct formatting (e.g. single quotes)
- [⚙️] Adde better typings for some functions

## [1.3.0] - 2024-08-06

### Added

- [🚀] Added option to search for a location inside location block (@nehnehneh)
- [🚀] Supporting alternate syntax using [latitude, longitude] array (#18)
- [🚀] Allow reverse order of coordinates (e.g. if copied from Google Maps) via setting (#21)
- [🚀] Added option to search for a location inside location block (@nehnehneh)
- [🚀] Supporting alternate syntax using [latitude, longitude] array (#18)
- [🚀] Allow reverse order of coordinates (e.g. if copied from Google Maps) via setting (#21)

### Changed

- [⚙️] ci: added step to check commit messages on build workflow
- [⚙️] ci: added step to check commit messages on build workflow

### Fixed

- [🐛] Fixed issue with custom marker icon not being displayed correctly
- [🐛] Fixed issue with custom marker icon not being displayed correctly

## [1.2.0] - 2024-07-26

### Added

- [🚀] Adding support for custom zoom level (thanks to @nehnehneh)
- [🚀] Adding support for custom zoom level (thanks to @nehnehneh)

## [1.1.1] - 2024-06-11

### Fixed

- [💎] Renaming `Custom Marker Icon URL` to `Custom marker URL` to follow Obsidian guidelines
- [💎] Showing a toast notice if the user uses an invalid combination of maki icon and custom marker url
- [💎] Showing a notice if the plugin has updated so that the user may check for new features
- [💎] Renaming `Custom Marker Icon URL` to `Custom marker URL` to follow Obsidian guidelines
- [💎] Showing a toast notice if the user uses an invalid combination of maki icon and custom marker url
- [💎] Showing a notice if the plugin has updated so that the user may check for new features

## [1.1.0] - 2024-05-14

### Added

- [🚀] Adding support for custom icons and different maki icons (#15)
- [🚀] Adding support for different map styles (#17)
- [📚] Adding documentation new documentation file
- [🚀] Adding support for custom icons and different maki icons (#15)
- [🚀] Adding support for different map styles (#17)
- [📚] Adding documentation new documentation file
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@aaronczichon
Loading
Loading