Skip to content

Commit

Permalink
Update Outlook link base.
Browse files Browse the repository at this point in the history
  • Loading branch information
barinbritva committed Feb 24, 2024
1 parent 84c29e5 commit bdce9e9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 17 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,29 @@ name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v*'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- id: get-package
run: |
echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/} | grep -oP '(?<=\d\.\d\.\d-)\w+' || echo 'latest')"
shell: bash

# Reuse steps from Pull Request workflow
- uses: actions/checkout@v3

- name: Check version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
if [[ "${{steps.get-package.outputs.version}}" != "v${PACKAGE_VERSION}" ]]; then
echo "Tag version ${{steps.get-package.outputs.version}} does not match package version ${PACKAGE_VERSION}."
exit 1
fi
- uses: pnpm/action-setup@v2
with:
version: 8
Expand All @@ -25,13 +40,7 @@ jobs:
- name: Run tests
run: pnpm test

- name: Create .npmrc
run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc

- name: Publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public

- name: Delete .npmrc
run: rm .npmrc
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access=public --tag=${{ steps.get-package.outputs.tag }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.idea
.vscode
coverage
dist
node_modules
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"editor.tabCompletion": "on",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": ["mailgun", "typestyle"]
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@barinbritva/add-to-calendar",
"version": "1.3.1",
"version": "1.3.2-next.0",
"keywords": [
"event",
"add",
Expand Down Expand Up @@ -50,5 +50,9 @@
"typescript": "^5.0.2",
"vite": "^4.2.1",
"vitest": "^0.29.8"
},
"volta": {
"node": "18.19.1",
"pnpm": "8.15.4"
}
}
2 changes: 1 addition & 1 deletion src/Generator/Office365.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Outlook} from './Outlook';

export class Office365 extends Outlook {
protected urlBase = 'https://outlook.office.com/calendar/0/deeplink/compose';
protected urlBase = 'https://outlook.office.com/calendar/deeplink/compose';
}
2 changes: 1 addition & 1 deletion src/Generator/Outlook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface QueryParameters extends QueryObject {
}

export class Outlook extends UrlGenerator {
protected urlBase = 'https://outlook.live.com/calendar/0/deeplink/compose';
protected urlBase = 'https://outlook.live.com/calendar/deeplink/compose';

protected convertEventToQueryObject(event: Event): QueryParameters {
return {
Expand Down
8 changes: 4 additions & 4 deletions tests/multi-generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ describe('class MultiGenerator method createLinks', () => {
clock.restore();

const outlookLink =
'https://outlook.live.com/calendar/0/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Meet%20with%20friends&startdt=2021-06-18&enddt=2021-06-19&allday=true';
'https://outlook.live.com/calendar/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Meet%20with%20friends&startdt=2021-06-18&enddt=2021-06-19&allday=true';
const office365Link =
'https://outlook.office.com/calendar/0/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Meet%20with%20friends&startdt=2021-06-18&enddt=2021-06-19&allday=true';
'https://outlook.office.com/calendar/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Meet%20with%20friends&startdt=2021-06-18&enddt=2021-06-19&allday=true';
const googleLink =
'https://calendar.google.com/calendar/render?action=TEMPLATE&text=Meet%20with%20friends&dates=20210618%2F20210619';
const yahooLink =
Expand Down Expand Up @@ -72,9 +72,9 @@ describe('class MultiGenerator method createLinks', () => {
clock.restore();

const outlookLink =
"https://outlook.live.com/calendar/0/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Meet%20with%20friends&startdt=2021-06-18T15%3A00%3A00Z&enddt=2021-06-18T17%3A00%3A00Z&body=Let's%20grab%20some%20coffee!&location=Blue%20Bottle%20Coffee%2C%20300%20S%20Broadway%2C%20Los%20Angeles&to=Jane%3Cjane%40example.com%3E%2Cfred%40example.com%2Cjoe%40example.com";
"https://outlook.live.com/calendar/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Meet%20with%20friends&startdt=2021-06-18T15%3A00%3A00Z&enddt=2021-06-18T17%3A00%3A00Z&body=Let's%20grab%20some%20coffee!&location=Blue%20Bottle%20Coffee%2C%20300%20S%20Broadway%2C%20Los%20Angeles&to=Jane%3Cjane%40example.com%3E%2Cfred%40example.com%2Cjoe%40example.com";
const office365Link =
"https://outlook.office.com/calendar/0/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Meet%20with%20friends&startdt=2021-06-18T15%3A00%3A00Z&enddt=2021-06-18T17%3A00%3A00Z&body=Let's%20grab%20some%20coffee!&location=Blue%20Bottle%20Coffee%2C%20300%20S%20Broadway%2C%20Los%20Angeles&to=Jane%3Cjane%40example.com%3E%2Cfred%40example.com%2Cjoe%40example.com";
"https://outlook.office.com/calendar/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Meet%20with%20friends&startdt=2021-06-18T15%3A00%3A00Z&enddt=2021-06-18T17%3A00%3A00Z&body=Let's%20grab%20some%20coffee!&location=Blue%20Bottle%20Coffee%2C%20300%20S%20Broadway%2C%20Los%20Angeles&to=Jane%3Cjane%40example.com%3E%2Cfred%40example.com%2Cjoe%40example.com";
const googleLink =
"https://calendar.google.com/calendar/render?action=TEMPLATE&text=Meet%20with%20friends&dates=20210618T150000Z%2F20210618T170000Z&details=Let's%20grab%20some%20coffee!&location=Blue%20Bottle%20Coffee%2C%20300%20S%20Broadway%2C%20Los%20Angeles&add=Jane%3Cjane%40example.com%3E%2Cfred%40example.com%2Cjoe%40example.com";
const yahooLink =
Expand Down

0 comments on commit bdce9e9

Please sign in to comment.