Skip to content

Commit 314d738

Browse files
authored
Merge pull request #35 from taj54/main
chore: improve CI/CD and add linting
2 parents d2e2a0c + 11d0e8d commit 314d738

File tree

16 files changed

+2460
-510
lines changed

16 files changed

+2460
-510
lines changed

.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 renamed to .github/workflows/version-bump.yml

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
All notable changes to this project will be documented in this file.
44

55
## [0.1.0] - 2025-08-19
6+
67
### Added
8+
79
- new tag release action added
810

911
## [0.0.2] - 2025-08-17
@@ -25,4 +27,4 @@ All notable changes to this project will be documented in this file.
2527

2628
### Changed
2729

28-
- Converted the project from a Svelte component to a Svelte action.
30+
- Converted the project from a Svelte component to a Svelte action.

CODE_OF_CONDUCT.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
24-
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
26-
overall community
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
37-
professional setting
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
3838

3939
## Enforcement Responsibilities
4040

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Before contributing, please take a moment to review this document. It outlines t
2222

2323
## Code of Conduct
2424

25-
This project adheres to the [CODE\_OF\_CONDUCT.md](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [insert contact email or method here, e.g., `support@example.com`].
25+
This project adheres to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [insert contact email or method here, e.g., `support@example.com`].
2626

2727
## How Can I Contribute?
2828

@@ -100,4 +100,3 @@ We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0
100100
## License
101101

102102
By contributing to `@interactive-video-labs/svelte`, you agree that your contributions will be licensed under its MIT License. See the [LICENSE](LICENSE) file for details.
103-

DEVELOPER.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This document provides essential information for developers looking to contribut
77
To get started with local development, follow these steps:
88

99
1. **Clone the repository:**
10+
1011
```bash
1112
git clone https://github.com/interactive-video-labs/interactive-video-svelte-wrapper.git
1213
cd interactive-video-svelte-wrapper
@@ -26,35 +27,35 @@ To get started with local development, follow these steps:
2627
2728
Here are the common development scripts available:
2829
29-
- **`pnpm build`**: Compiles the TypeScript + Svelte source code into JavaScript (ESM and CommonJS formats) and generates declaration files (`.d.ts`). This command is run before publishing.
30+
- **`pnpm build`**: Compiles the TypeScript + Svelte source code into JavaScript (ESM and CommonJS formats) and generates declaration files (`.d.ts`). This command is run before publishing.
3031
31-
```bash
32-
pnpm build
33-
```
32+
```bash
33+
pnpm build
34+
```
3435
35-
- **`pnpm dev`**: Starts the TypeScript compiler and Svelte build in watch mode, recompiling files on changes. Useful for active development.
36+
- **`pnpm dev`**: Starts the TypeScript compiler and Svelte build in watch mode, recompiling files on changes. Useful for active development.
3637
37-
```bash
38-
pnpm dev
39-
```
38+
```bash
39+
pnpm dev
40+
```
4041
41-
- **`pnpm test`**: Runs the unit tests using Vitest.
42+
- **`pnpm test`**: Runs the unit tests using Vitest.
4243
43-
```bash
44-
pnpm test
45-
```
44+
```bash
45+
pnpm test
46+
```
4647
47-
- **`pnpm clean`**: Removes the `dist` directory, clearing all compiled output.
48+
- **`pnpm clean`**: Removes the `dist` directory, clearing all compiled output.
4849
49-
```bash
50-
pnpm clean
51-
```
50+
```bash
51+
pnpm clean
52+
```
5253
53-
- **`pnpm prepare`**: This script is typically run after `pnpm install` and before `pnpm publish`. In this project, it simply runs `pnpm build`.
54+
- **`pnpm prepare`**: This script is typically run after `pnpm install` and before `pnpm publish`. In this project, it simply runs `pnpm build`.
5455
55-
```bash
56-
pnpm prepare
57-
```
56+
```bash
57+
pnpm prepare
58+
```
5859
5960
## Testing
6061
@@ -77,4 +78,3 @@ This project uses an automated release workflow via GitHub Actions (`.github/wor
7778
## Contributing
7879
7980
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) file for detailed guidelines on how to submit issues, propose features, and make pull requests.
80-

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# @interactive-video-labs/svelte
2+
23
<p align="center">
34
<img src="https://raw.githubusercontent.com/interactive-video-labs/docs/main/logo.svg" width="200px" alt="Interactive Video Labs Logo" />
45
</p>
@@ -79,15 +80,15 @@ Here’s a simple example of how to use the `<InteractiveVideo />` component in
7980

8081
### Props
8182

82-
| Prop | Type | Required | Default | Description |
83-
|--------------------|----------------------------------------------------------------|----------|---------|-----------------------------------------------------------------------------|
84-
| `videoUrl` | `string` | `true` || The URL of the video to be loaded. |
85-
| `cues` | `CuePoint[]` | `false` | `[]` | An array of cue points for interactive events. Reactive/updated at runtime. |
86-
| `translations` | `Translations` | `false` | `{}` | Translations for the player UI. |
87-
| `autoplay` | `boolean` | `false` | `false` | Whether the video should start playing automatically. |
88-
| `loop` | `boolean` | `false` | `false` | Whether the video should loop. |
89-
| `locale` | `string` | `false` | `'en'` | The locale to be used for the player (e.g., `'en'`, `'es'`). |
90-
| `bind:playerRef` | `Player` (`@interactive-video-labs/core`) | `false` || Two-way bind to access the underlying core player instance. |
83+
| Prop | Type | Required | Default | Description |
84+
| ---------------- | ----------------------------------------- | -------- | ------- | --------------------------------------------------------------------------- |
85+
| `videoUrl` | `string` | `true` || The URL of the video to be loaded. |
86+
| `cues` | `CuePoint[]` | `false` | `[]` | An array of cue points for interactive events. Reactive/updated at runtime. |
87+
| `translations` | `Translations` | `false` | `{}` | Translations for the player UI. |
88+
| `autoplay` | `boolean` | `false` | `false` | Whether the video should start playing automatically. |
89+
| `loop` | `boolean` | `false` | `false` | Whether the video should loop. |
90+
| `locale` | `string` | `false` | `'en'` | The locale to be used for the player (e.g., `'en'`, `'es'`). |
91+
| `bind:playerRef` | `Player` (`@interactive-video-labs/core`) | `false` || Two-way bind to access the underlying core player instance. |
9192

9293
> Any additional attributes supported by `@interactive-video-labs/core` will be forwarded to the player configuration.
9394
@@ -99,8 +100,14 @@ Player analytics/events are dispatched as a Svelte DOM event named `analyticsEve
99100

100101
```ts
101102
type AnalyticsDetail = {
102-
event: 'PLAYER_LOADED' | 'VIDEO_STARTED' | 'VIDEO_PAUSED' | 'VIDEO_ENDED' |
103-
'CUE_TRIGGERED' | 'INTERACTION_COMPLETED' | 'ERROR';
103+
event:
104+
| 'PLAYER_LOADED'
105+
| 'VIDEO_STARTED'
106+
| 'VIDEO_PAUSED'
107+
| 'VIDEO_ENDED'
108+
| 'CUE_TRIGGERED'
109+
| 'INTERACTION_COMPLETED'
110+
| 'ERROR';
104111
payload?: any;
105112
};
106113
```
@@ -171,4 +178,3 @@ Contributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTIN
171178
## License
172179

173180
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
174-

eslint.config.mjs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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: ['node_modules/*', 'dist/*', '.svelte-kit/*', 'scripts/*', 'test/*'],
21+
},
22+
{
23+
extends: compat.extends(
24+
'eslint:recommended',
25+
'plugin:@typescript-eslint/recommended',
26+
'prettier',
27+
),
28+
29+
plugins: {
30+
'@typescript-eslint': typescriptEslint,
31+
prettier,
32+
},
33+
34+
languageOptions: {
35+
parser: tsParser,
36+
},
37+
38+
rules: {
39+
...typescriptEslint.configs.recommended.rules,
40+
'prettier/prettier': 'error',
41+
},
42+
},
43+
]);

0 commit comments

Comments
 (0)