Skip to content
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
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

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

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test -- --coverage

- name: Run build
run: npm run build

- name: Upload coverage to Codecov
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CodeQL

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 0' # Run weekly on Sunday

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to npm

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Build
run: npm run build

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ A lightweight, zero-dependency JavaScript calendar library that can read events
## Installation

```bash
npm install @jscal/calendar
npm install jscal-calendar
```

## Quick Start

### Node.js

```javascript
const JSCal = require('@jscal/calendar');
const JSCal = require('jscal-calendar');

const calendar = new JSCal();

Expand Down Expand Up @@ -60,7 +60,7 @@ console.log(events);
### Browser (UMD)

```html
<script src="node_modules/@jscal/calendar/dist/index.umd.js"></script>
<script src="node_modules/jscal-calendar/dist/index.umd.js"></script>
<script>
const calendar = new JSCal();

Expand All @@ -75,7 +75,7 @@ console.log(events);
### ES Modules

```javascript
import JSCal from '@jscal/calendar';
import JSCal from 'jscal-calendar';

const calendar = new JSCal();
calendar.loadJSON(myEvents);
Expand Down Expand Up @@ -185,7 +185,7 @@ const results = calendar.searchEvents('meeting');
You can also use the parsers independently:

```javascript
const { ICSParser, JSONParser } = require('@jscal/calendar');
const { ICSParser, JSONParser } = require('jscal-calendar');

// Parse ICS
const icsEvents = ICSParser.parse(icsString);
Expand Down Expand Up @@ -272,7 +272,7 @@ JSCal includes a powerful theming system with 5 pre-built themes and support for
### Using Pre-built Themes

```javascript
const { JSCal, Themes } = require('@jscal/calendar');
const { JSCal, Themes } = require('jscal-calendar');

const calendar = new JSCal({ theme: Themes.dark });
calendar.applyTheme(document.getElementById('calendar-container'));
Expand All @@ -288,7 +288,7 @@ calendar.applyTheme(document.getElementById('calendar-container'));
### Creating Custom Themes

```javascript
const { Theme } = require('@jscal/calendar');
const { Theme } = require('jscal-calendar');

const customTheme = new Theme({
name: 'my-theme',
Expand Down Expand Up @@ -336,7 +336,7 @@ See the demo files for a complete example:
## Browser Compatibility

- Modern browsers (ES6+)
- Node.js 14+
- Node.js 16+ (actively supported LTS versions)

## Documentation

Expand Down Expand Up @@ -366,4 +366,4 @@ The demo includes:

- GitHub: https://github.com/GhDj/jscal
- Issues: https://github.com/GhDj/jscal/issues
- npm: https://www.npmjs.com/package/@jscal/calendar
- npm: https://www.npmjs.com/package/jscal-calendar
5 changes: 3 additions & 2 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@jscal/calendar",
"name": "jscal-calendar",
"version": "1.2.0",
"description": "A lightweight JavaScript calendar library with ICS/JSON support, CRUD operations, recurring events (RRULE), categories, priorities, holidays, and conflict detection",
"main": "dist/index.js",
Expand Down Expand Up @@ -59,6 +59,6 @@
"rollup": "^4.0.0"
},
"engines": {
"node": ">=14.0.0"
"node": ">=16.0.0"
}
}
File renamed without changes.
Loading