Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Wassup789 committed Apr 15, 2024
0 parents commit 026372f
Show file tree
Hide file tree
Showing 78 changed files with 7,217 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/00-bug-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Bug Report
description: Report a bug in Enhancements for Garmin Connect
labels:
- bug
body:
- type: textarea
id: description
attributes:
label: Description
placeholder: |
Provide a general description of the bug
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction steps
placeholder: |
1.
2.
3.
...
validations:
required: true
- type: dropdown
id: platform
attributes:
label: Which platform did you discover this bug?
options:
- UserScript (Violentmonkey, Tampermonkey, etc)
- Chrome Web Store
- Firefox Add-ons
validations:
required: true
- type: textarea
id: environment
attributes:
label: Please provide the environment you discovered this bug
render: true
placeholder: |
Version: 1.0.0
Browser: Chrome 123.0.6312
OS: macOS 14.3
- type: textarea
id: other
attributes:
label: Additional information
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/01-feature-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Feature Request
description: Request a feature to be added to Enhancements for Garmin Connect
labels:
- enhancement
body:
- type: textarea
id: description
attributes:
label: Description of the problem to be solved
validations:
required: true
- type: textarea
id: solution
attributes:
label: Solution to the problem
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Description

<!--- Describe your PR changes here, in detail -->

## PR Type
- [ ] Bug fix
- [ ] Feature
- [ ] Code-style update
- [ ] Refactoring
- [ ] Documentation update
- [ ] Build related changes
- [ ] CI / CD related changes
- [ ] Other, describe here:

## Tests performed

<!--- Describe in detail, how you tested your changes -->

## Screenshots

<!--- Add screenshots here, if appropriate -->

## Additional information

<!--- Add additional information here, if appropriate -->
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [ 20.x ]
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: corepack enable
- run: yarn install
- run: yarn run prod
- run: zip -r dist/browser/browser.zip dist/browser/*
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist/browser/browser.zip
dist/userscript/garmin-connect-enhancements.user.js
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Lint

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
lint:
runs-on: self-hosted
strategy:
matrix:
node-version: [ 20.x ]
steps:
- name: Setup repo
uses: actions/checkout@v4
with:
fetch-depth: 50
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
**.ts
**.js
- name: Has changed files
if: steps.changed-files.outputs.any_changed != 'true'
run: echo "No changed files found, aborting action"
- name: Setup node ${{ matrix.node-version }}
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: corepack enable
if: steps.changed-files.outputs.any_changed == 'true'
- run: yarn install
if: steps.changed-files.outputs.any_changed == 'true'
- name: Run ESLint
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn eslint ${{ steps.changed-files.outputs.all_changed_files }}
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
workflow_dispatch:
if: github.ref_name == github.event.repository.default_branch
inputs:
version:
description: The version to publish (i.e. "v1.2.3").
type: string
required: true
prerelease:
description: Is this version a prerelease?
type: boolean
default: 'false'
required: true

permissions:
actions: read

jobs:
release:
runs-on: self-hosted
environment: production
steps:
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
with:
workflow: build.yml
workflow_conclusion: success
branch: main
allow_forks: false
- name: Release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
with:
tag_name: ${{ inputs.version }}
prerelease: ${{ inputs.prerelease }}
token: ${{ secrets.PAT }}
fail_on_unmatched_files: true
files: |
dist/browser/browser.zip
dist/userscript/garmin-connect-enhancements.user.js
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

## Node
node_modules/

## Project-specific
build/
dist/
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/webResources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: pnpm
23 changes: 23 additions & 0 deletions Enhancements for Garmin Connect Web.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/scripts" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/dist" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/.yarn" />
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/templates" />
</list>
</option>
</component>
</module>
33 changes: 33 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Installation

## Prerequisites

1. Install [Node](https://nodejs.org/) v20 or later.
2. Enable Corepack for [Yarn](https://yarnpkg.com/) v4
3. Run `yarn install`

## Build

#### Development Build
Run `yarn run build:dev`

#### Production Build
Run `yarn run build:prod`

## Packaging
* To build for UserScript: `yarn run package:add-userscript-header`
* To build for Chrome extension / Firefox add-on `yarn run package:setup-browser`

## Complete production build
* Alternatively, to build for production against all platforms, run `yarn run prod`

## Build and distributable directories breakdown
* `build/` _(contains the raw build files)_
* `dist/`
* `browser/` _(contains the browser extension distributables)_
* `userscript/` _(contains the UserScript distributable)_

## Build & Watch For Changes
For use during development:

1. Run `yarn run dev`
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Wilson La

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 026372f

Please sign in to comment.