Skip to content

Commit 689b51b

Browse files
authored
Merge pull request #39 from taj54/main
chore: improve release and CI workflows
2 parents e22d349 + 0268179 commit 689b51b

23 files changed

Lines changed: 6827 additions & 2253 deletions

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ jobs:
3636
run: pnpm publish --access public --no-git-checks
3737
env:
3838
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39-

.github/workflows/tag-after-merge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
run: |
6868
# Match lines starting with "## vX.Y.Z " until the next "## "
6969
awk "/^## v${{ env.version }}[[:space:]]/{flag=1; next} /^## /{flag=0} flag" CHANGELOG.md > RELEASE_NOTES.md
70-
70+
7171
echo "notes<<EOF" >> $GITHUB_ENV
7272
if [ "${{ env.release_type }}" = "major" ]; then
7373
echo "## 🚀 Major Release" >> $GITHUB_ENV
@@ -83,7 +83,7 @@ jobs:
8383
uses: softprops/action-gh-release@v2
8484
with:
8585
tag_name: v${{ env.version }}
86-
name: "Release v${{ env.version }}"
86+
name: 'Release v${{ env.version }}'
8787
body: ${{ env.notes }}
8888
env:
8989
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/version-bump.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ on:
1717
- minor
1818
- major
1919

20-
21-
2220
jobs:
2321
bump:
2422
runs-on: ubuntu-latest

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"ignores": ["node_modules", "dist"]
8+
}

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
### Features
66

7-
* Add Vitest test for InteractiveVideoComponent (3c5c55b)
8-
* Add Angular wrapper for interactive video player (480f53c)
7+
- Add Vitest test for InteractiveVideoComponent (3c5c55b)
8+
- Add Angular wrapper for interactive video player (480f53c)
99

1010
### Documentation
1111

12-
* Add DEVELOPER.md for project setup and development (f13178f)
13-
* Add README.md for interactive-video-angular-wrapper (9383cce)
14-
* Add CONTRIBUTING.md for Angular wrapper (0f19b25)
12+
- Add DEVELOPER.md for project setup and development (f13178f)
13+
- Add README.md for interactive-video-angular-wrapper (9383cce)
14+
- Add CONTRIBUTING.md for Angular wrapper (0f19b25)

CODE_OF_CONDUCT.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div
1010

1111
Examples of behavior that contributes to a positive environment for our community include:
1212

13-
* Demonstrating empathy and kindness toward other people
14-
* Being respectful of differing opinions, viewpoints, and experiences
15-
* Giving and gracefully accepting constructive feedback
16-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17-
* Focusing on what is best not just for us as individuals, but for the overall community
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
1818

1919
Examples of unacceptable behavior include:
2020

21-
* The use of sexualized language or imagery, and sexual attention or advances of any kind
22-
* Trolling, insulting or derogatory comments, and personal or political attacks
23-
* Public or private harassment
24-
* Publishing others' private information, such as a physical or email address, without their explicit permission
25-
* Other conduct which can reasonably be considered inappropriate in a professional setting
21+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
- Trolling, insulting or derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others' private information, such as a physical or email address, without their explicit permission
25+
- Other conduct which can reasonably be considered inappropriate in a professional setting
2626

2727
## Enforcement Responsibilities
2828

@@ -67,4 +67,4 @@ Community leaders will follow these Community Impact Guidelines in determining t
6767
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
6868

6969
[homepage]: https://www.contributor-covenant.org
70-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
70+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

CONTRIBUTING.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ This project adheres to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). By partici
3030

3131
If you find a bug, please open an issue on our [GitHub Issues page](https://github.com/interactive-video-labs/interactive-video-angular-wrapper/issues). When reporting a bug, please include:
3232

33-
- A clear and concise description of the bug.
34-
- Steps to reproduce the behavior.
35-
- Expected behavior.
36-
- Actual behavior.
37-
- Screenshots or videos if applicable.
38-
- Your environment (Angular version, browser, OS, etc.).
33+
- A clear and concise description of the bug.
34+
- Steps to reproduce the behavior.
35+
- Expected behavior.
36+
- Actual behavior.
37+
- Screenshots or videos if applicable.
38+
- Your environment (Angular version, browser, OS, etc.).
3939

4040
### Suggesting Enhancements
4141

4242
If you have an idea for a new feature or an improvement, please open an issue on our [GitHub Issues page](https://github.com/interactive-video-labs/interactive-video-angular-wrapper/issues). When suggesting an enhancement, please include:
4343

44-
- A clear and concise description of the proposed enhancement.
45-
- The problem it solves or the benefit it provides.
46-
- Any alternative solutions you've considered.
44+
- A clear and concise description of the proposed enhancement.
45+
- The problem it solves or the benefit it provides.
46+
- Any alternative solutions you've considered.
4747

4848
### Your First Code Contribution
4949

@@ -70,9 +70,9 @@ If you're looking to make your first code contribution, look for issues labeled
7070
7171
In your pull request description, please:
7272
73-
- Reference any related issues (e.g., `Fixes #123`, `Closes #456`).
74-
- Provide a clear explanation of your changes.
75-
- Include screenshots or GIFs if your changes affect the UI.
73+
- Reference any related issues (e.g., `Fixes #123`, `Closes #456`).
74+
- Provide a clear explanation of your changes.
75+
- Include screenshots or GIFs if your changes affect the UI.
7676
7777
## Development Setup
7878
@@ -84,18 +84,18 @@ For detailed instructions on setting up your development environment, installing
8484
8585
We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for our commit messages. This helps with automated changelog generation and semantic versioning. Examples:
8686
87-
- `feat: add new video playback controls`
88-
- `fix: resolve autoplay issue on iOS`
89-
- `docs: update installation instructions`
90-
- `refactor: improve player initialization logic`
91-
- `test: add unit tests for cue points`
87+
- `feat: add new video playback controls`
88+
- `fix: resolve autoplay issue on iOS`
89+
- `docs: update installation instructions`
90+
- `refactor: improve player initialization logic`
91+
- `test: add unit tests for cue points`
9292
9393
### TypeScript Styleguide
9494
95-
- Follow existing code style and formatting.
96-
- Use clear and descriptive variable and function names.
97-
- Ensure proper type annotations for all functions, variables, and parameters.
98-
- Avoid `any` type unless absolutely necessary.
95+
- Follow existing code style and formatting.
96+
- Use clear and descriptive variable and function names.
97+
- Ensure proper type annotations for all functions, variables, and parameters.
98+
- Avoid `any` type unless absolutely necessary.
9999
100100
## License
101101

DEVELOPER.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ This document provides detailed instructions for developers who want to set up,
2020

2121
Before you begin, ensure you have the following installed:
2222

23-
- **Node.js**: Version 18 or higher. You can download it from [nodejs.org](https://nodejs.org/).
24-
- **pnpm**: Our preferred package manager. If you don't have it, install it globally:
25-
```bash
26-
npm install -g pnpm
27-
```
28-
Alternatively, you can use `npm` or `yarn`, but `pnpm` is recommended for consistent dependency management.
23+
- **Node.js**: Version 18 or higher. You can download it from [nodejs.org](https://nodejs.org/).
24+
- **pnpm**: Our preferred package manager. If you don't have it, install it globally:
25+
```bash
26+
npm install -g pnpm
27+
```
28+
Alternatively, you can use `npm` or `yarn`, but `pnpm` is recommended for consistent dependency management.
2929

3030
## Getting Started
3131

3232
1. **Clone the repository:**
33+
3334
```bash
3435
git clone https://github.com/interactive-video-labs/interactive-video-angular-wrapper.git
3536
cd interactive-video-angular-wrapper
@@ -43,14 +44,14 @@ Before you begin, ensure you have the following installed:
4344

4445
## Project Structure
4546

46-
- `src/`: Contains the source code for the Angular wrapper component.
47-
- `index.ts`: The main entry point for the library, exporting `InteractiveVideoComponent` and related types.
48-
- `test/`: Contains unit tests for the components.
49-
- `interactive-video.test.ts`: Tests for the `InteractiveVideoComponent`.
50-
- `dist/`: (Generated after build) Contains the compiled output of the library (ESM, CJS, and declaration files).
51-
- `examples/`: Contains example usage of the Angular wrapper.
52-
- `tsup.config.ts`: Configuration for `tsup`, used to bundle the TypeScript library.
53-
- `vitest.config.ts`: Configuration for `Vitest`, our testing framework.
47+
- `src/`: Contains the source code for the Angular wrapper component.
48+
- `index.ts`: The main entry point for the library, exporting `InteractiveVideoComponent` and related types.
49+
- `test/`: Contains unit tests for the components.
50+
- `interactive-video.test.ts`: Tests for the `InteractiveVideoComponent`.
51+
- `dist/`: (Generated after build) Contains the compiled output of the library (ESM, CJS, and declaration files).
52+
- `examples/`: Contains example usage of the Angular wrapper.
53+
- `tsup.config.ts`: Configuration for `tsup`, used to bundle the TypeScript library.
54+
- `vitest.config.ts`: Configuration for `Vitest`, our testing framework.
5455

5556
## Development Scripts
5657

@@ -102,7 +103,7 @@ Removes the `dist/` directory, effectively cleaning up all compiled output.
102103

103104
## Troubleshooting
104105

105-
- **`pnpm install` fails**: Ensure you have Node.js and pnpm installed correctly. Check your internet connection.
106-
- **Build errors**: Verify that all dependencies are installed (`pnpm install`) and that your TypeScript code has no compilation errors.
107-
- **Tests failing**: Run `pnpm test` to see detailed error messages. Ensure your changes haven't introduced regressions.
108-
- **Peer dependency issues**: If you encounter issues related to `@angular/core` or `@angular/common`, ensure that the versions installed in your consuming application match the peer dependency ranges specified in `package.json` (`^15.0.0 || ^16.0.0 || ^17.0.0`).
106+
- **`pnpm install` fails**: Ensure you have Node.js and pnpm installed correctly. Check your internet connection.
107+
- **Build errors**: Verify that all dependencies are installed (`pnpm install`) and that your TypeScript code has no compilation errors.
108+
- **Tests failing**: Run `pnpm test` to see detailed error messages. Ensure your changes haven't introduced regressions.
109+
- **Peer dependency issues**: If you encounter issues related to `@angular/core` or `@angular/common`, ensure that the versions installed in your consuming application match the peer dependency ranges specified in `package.json` (`^15.0.0 || ^16.0.0 || ^17.0.0`).

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ import { InteractiveVideoComponent } from '@interactive-video-labs/angular';
6363
selector: 'app-my-component',
6464
standalone: true,
6565
imports: [InteractiveVideoComponent],
66-
template: `
67-
<iv-interactive-video videoUrl="your-video-url.mp4"></iv-interactive-video>
68-
`,
66+
template: ` <iv-interactive-video videoUrl="your-video-url.mp4"></iv-interactive-video> `,
6967
})
7068
export class MyComponent {}
7169
```
@@ -132,7 +130,11 @@ export class TranslationExampleComponent {
132130

133131
```typescript
134132
import { Component } from '@angular/core';
135-
import { InteractiveVideoComponent, AnalyticsEvent, AnalyticsPayload } from '@interactive-video-labs/angular';
133+
import {
134+
InteractiveVideoComponent,
135+
AnalyticsEvent,
136+
AnalyticsPayload,
137+
} from '@interactive-video-labs/angular';
136138

137139
@Component({
138140
selector: 'app-analytics-example',
@@ -170,21 +172,21 @@ You can mount the player to an existing HTML element by providing its ID to the
170172

171173
### Inputs
172174

173-
| Name | Type | Description | Default | Required |
174-
| :-------------- | :--------------------------------------- | :------------------------------------------------------------------------ | :---------- | :------- |
175-
| `videoUrl` | `string` | The URL of the video to be loaded. | `undefined` | Yes |
176-
| `cues` | `CuePoint[]` | An array of cue points for interactive events. | `undefined` | No |
177-
| `translations` | `Translations` | An object containing translations for the player. | `undefined` | No |
178-
| `autoplay` | `boolean` | Whether the video should start playing automatically. | `false` | No |
179-
| `loop` | `boolean` | Whether the video should loop. | `false` | No |
180-
| `locale` | `string` | The locale to be used for the player. | `'en'` | No |
181-
| `targetElementId` | `string` | The ID of an external HTML element where the player will be mounted. | `undefined` | No |
175+
| Name | Type | Description | Default | Required |
176+
| :---------------- | :------------- | :------------------------------------------------------------------- | :---------- | :------- |
177+
| `videoUrl` | `string` | The URL of the video to be loaded. | `undefined` | Yes |
178+
| `cues` | `CuePoint[]` | An array of cue points for interactive events. | `undefined` | No |
179+
| `translations` | `Translations` | An object containing translations for the player. | `undefined` | No |
180+
| `autoplay` | `boolean` | Whether the video should start playing automatically. | `false` | No |
181+
| `loop` | `boolean` | Whether the video should loop. | `false` | No |
182+
| `locale` | `string` | The locale to be used for the player. | `'en'` | No |
183+
| `targetElementId` | `string` | The ID of an external HTML element where the player will be mounted. | `undefined` | No |
182184

183185
### Outputs
184186

185-
| Name | Type | Description |
186-
| :--------------- | :----------------------------------------------------------------- | :---------------------------------------------- |
187-
| `analyticsEvent` | `EventEmitter<[event: AnalyticsEvent, payload?: AnalyticsPayload]>` | Emits analytics events from the player. |
187+
| Name | Type | Description |
188+
| :--------------- | :------------------------------------------------------------------ | :-------------------------------------- |
189+
| `analyticsEvent` | `EventEmitter<[event: AnalyticsEvent, payload?: AnalyticsPayload]>` | Emits analytics events from the player. |
188190

189191
## Development
190192

eslint.config.mjs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { defineConfig } from 'eslint/config';
2+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
3+
import prettier from 'eslint-plugin-prettier';
4+
import tsParser from '@typescript-eslint/parser';
5+
import path from 'node:path';
6+
import { fileURLToPath } from 'node:url';
7+
import js from '@eslint/js';
8+
import { FlatCompat } from '@eslint/eslintrc';
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all,
16+
});
17+
18+
export default defineConfig([
19+
{
20+
ignores: [
21+
'node_modules/*',
22+
'dist/*',
23+
'examples/*',
24+
'scripts/*',
25+
'dist/*',
26+
'examples/*',
27+
'scripts/*',
28+
'test/*',
29+
],
30+
},
31+
{
32+
extends: compat.extends(
33+
'eslint:recommended',
34+
'plugin:@typescript-eslint/recommended',
35+
'prettier',
36+
),
37+
38+
plugins: {
39+
'@typescript-eslint': typescriptEslint,
40+
prettier,
41+
},
42+
43+
languageOptions: {
44+
parser: tsParser,
45+
},
46+
47+
rules: {
48+
...typescriptEslint.configs.recommended.rules,
49+
'prettier/prettier': 'error',
50+
},
51+
},
52+
]);

0 commit comments

Comments
 (0)