Skip to content

Commit

Permalink
Merge branch 'main' into es6-invalid-rrule-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leftmostcat committed Apr 17, 2024
2 parents 377646b + 3724e72 commit 42e16f1
Show file tree
Hide file tree
Showing 30 changed files with 7,576 additions and 13,274 deletions.
465 changes: 0 additions & 465 deletions .eslintrc

This file was deleted.

33 changes: 20 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16', '17']
node:
- lts/*
- node
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Setup node"
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm

- name: "npm ci"
run: npm ci
Expand All @@ -48,17 +51,19 @@ jobs:
# run: npm run test-browser

- name: "Coverage Push"
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: unit-${{ matrix.node }}
parallel: true

- name: "Artifacts"
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: matrix.node == 'node'
with:
name: distribution
path: dist/*.js
if-no-files-found: error


ghpages:
Expand All @@ -67,12 +72,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Setup node"
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 17
node-version: latest
cache: npm

- name: "npm ci"
run: npm ci
Expand All @@ -91,12 +97,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Setup node"
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 17
node-version: latest
cache: npm

- name: "npm ci"
run: npm ci
Expand Down Expand Up @@ -124,7 +131,7 @@ jobs:
node tools/scriptutils.js generate-zones tools/tzdb > dist/ical.timezones.js
- name: "Artifacts"
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: timezones
path: dist/ical.timezones.js
Expand All @@ -134,7 +141,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: "javascript"
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -44,4 +44,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
25 changes: 25 additions & 0 deletions .github/workflows/needinfo-remove.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Remove needinfo label

on:
issue_comment:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
if: |
github.event.comment.author_association != 'OWNER' &&
github.event.comment.author_association != 'COLLABORATOR'
steps:
- name: Remove needinfo label
uses: octokit/[email protected]
continue-on-error: true
with:
route: DELETE /repos/:repository/issues/:issue/labels/:label
repository: ${{ github.repository }}
issue: ${{ github.event.issue.number }}
label: needinfo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/needinfo-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Close old issues with the needinfo tag

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Close old issues with the needinfo tag
uses: dwieeb/needs-reply@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-label: needinfo
close-message: >
It looks like we haven't heard back on this issue, therefore we are
closing this issue. If this problem persists in the latest version
of ical.js, please re-open this issue.
53 changes: 53 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---

name: "Publish"
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Setup Node"
uses: actions/setup-node@v4
with:
node-version: node
registry-url: "https://registry.npmjs.org"

- name: "npm ci"
run: npm ci

- name: "Build"
run: npm run build

- name: "Linters"
run: npm run lint

- name: "Node Unit Tests"
run: npm run test-unit

- name: "Node Acceptance Tests"
run: npm run test-acceptance

- name: "Attach release assets"
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ github.event.release.tag_name }} \
dist/ical.js \
dist/ical.min.js \
dist/ical.es5.cjs \
dist/ical.es5.min.cjs
- name: "npm publish"
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,48 @@ and example links.
There is also a validator that demonstrates how to use the library in a webpage in the
[tools/](https://github.com/kewisch/ical.js/tree/main/tools) subdirectory.

[Try the validator online](http://kewisch.github.io/ical.js/validator.html), it always uses the latest release of ICAL.js.
[Try the validator online](http://kewisch.github.io/ical.js/validator.html), it always uses the
latest release of ICAL.js.

## Installing

You can install ICAL.js via [npm](https://www.npmjs.com/), if you would like to use it in Node.js:
```
ICAL.js has no dependencies and is written in modern JavaScript. You can install ICAL.js via
[npm](https://www.npmjs.com/), if you would like to use it in Node.js:
```bash
npm install ical.js
```
Then simply import it for use:
```javascript
import ICAL from "ical.js";
```

ICAL.js has no dependencies and is written in modern JavaScript. A version transpiled to ES5 is
available as well. It should work in all versions of Node.js and modern browsers.
If you are working with a browser, be aware this is an ES6 module:

```html
<script type="module">
import ICAL from "https://unpkg.com/ical.js";
document.querySelector("button").addEventListener("click", () => {
ICAL.parse(document.getElementById("txt").value);
});
</script>
```

If you need to make use of a script tag, you can use the transpiled ES5 version:
```html
<script src="https://unpkg.com/ical.js/dist/ical.es5.cjs"></script>
<textarea id="txt"></textarea>
<button onclick="ICAL.parse(document.getElementById('txt').value)"></button>
```

## Timezones
The stock ical.js does not register any timezones, due to the additional size it brings. If you'd
like to do timezone conversion, and the timezone definitions are not included in the respective ics
files, you'll need to use `ical.timezones.js` or its minified counterpart.

This file is not included in the distribution since it pulls in IANA timezones that might change
regularly. See the github actions on building your own timezones during CI, or grab a recent build
from main.

## Documentation

For a few guides with code samples, please check out
Expand Down
Loading

0 comments on commit 42e16f1

Please sign in to comment.