Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
evoactivity committed Jul 2, 2023
0 parents commit 9da80a1
Show file tree
Hide file tree
Showing 34 changed files with 206,327 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "ektotv/playlist" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/friendly-zoos-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@iptv/playlist": patch
---

First release of playlist parser and generator
25 changes: 25 additions & 0 deletions .github/actions/assert-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Assert Assets Exists
description: Build the package and assert that file contents exist as we expect
runs:
using: "composite"
steps:
- name: Build and Assert Output
shell: bash
run: |-
echo '
target: ${{ env.dist }}
setup:
run: pnpm build
cwd: ./
expect: |
index.d.ts
playlist.js
playlist.umd.cjs
' >> assert-contents.config.yml
npx assert-folder-contents
- name: Upload dist assets to cache
uses: actions/upload-artifact@v3
with:
name: dist
path: ${{ env.dist }}
10 changes: 10 additions & 0 deletions .github/actions/download-built-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Download built package from cache
description: Download built package from cache
runs:
using: "composite"
steps:
- name: Download built package from cache
uses: actions/download-artifact@v3
with:
name: dist
path: ${{ env.dist }}
133 changes: 133 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: CI

on:
push:
branches:
- main
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
CI: true
dist: dist

jobs:
install_dependencies:
name: Install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: NullVoxPopuli/action-setup-pnpm@v2

typecheck:
name: "${{ matrix.typescript-scenario }}"
runs-on: ubuntu-latest
timeout-minutes: 2
needs: [build]
continue-on-error: true
strategy:
fail-fast: true
matrix:
typescript-scenario:
- [email protected]
- [email protected]
- [email protected]
steps:
- uses: actions/checkout@v3
- uses: NullVoxPopuli/action-setup-pnpm@v2
- uses: ./.github/actions/download-built-package
- name: "Change TS to ${{ matrix.typescript-scenario }}"
run: "pnpm add --save-dev ${{ matrix.typescript-scenario}}"
working-directory: ./
- name: "Type checking"
run: pnpm lint;

build:
name: Build
needs: [install_dependencies]
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: NullVoxPopuli/action-setup-pnpm@v2
- uses: ./.github/actions/assert-build

tests:
name: Tests
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: NullVoxPopuli/action-setup-pnpm@v2
- run: pnpm run test
- name: Get Coverage for badge
run: |
# var SUMMARY = [
# '',
# '=============================== Coverage summary ===============================',
# 'Statements : 32.5% ( 39/120 )',
# 'Branches : 38.89% ( 21/54 )',
# 'Functions : 21.74% ( 5/23 )',
# 'Lines : 31.93% ( 38/119 )',
# '================================================================================',
# ''
# ];
# SUMMARY = SUMMARY.split('\n')[5]; // 'Lines : 31.93% ( 38/119 )'
# SUMMARY = SUMMARY.split(':')[1].split('(')[0].trim(); // '31.93%'
SUMMARY="$(pnpm run test:ci | tail -2 | head -1)"
TOKENS=($SUMMARY)
# process.env.COVERAGE = '31.93%';
echo "COVERAGE=$(echo ${TOKENS[2]})" >> $GITHUB_ENV
# var REF = 'refs/pull/27/merge.json';
REF=${{ github.ref }}
# console.log('github.ref: ' + REF);
echo "github.ref: $REF"
# var PATHS = REF.split('/');
IFS='/' read -ra PATHS <<< "$REF"
# var BRANCH_NAME = PATHS[1] + PATHS[2];
BRANCH_NAME="${PATHS[1]}_${PATHS[2]}"
# console.log(BRANCH_NAME); // 'pull_27'
echo $BRANCH_NAME
# process.env.BRANCH = 'pull_27';
echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV
- name: Create the Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 7c8deb6342792baafac8834185e96476
filename: iptv_playlist_coverage.json
label: Coverage
message: ${{ env.COVERAGE }}
color: green
namedLogo: vitest

# https://github.com/changesets/action
release:
name: Release
timeout-minutes: 5
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- tests
- typecheck

steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: NullVoxPopuli/action-setup-pnpm@v2
- uses: ./.github/actions/download-built-package
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
title: "Release Preview"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.turbo
coverage
benchmark/results
tests/fixtures/c*_h.m3u8

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @iptv/playlist
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2023 Liam Potter

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 9da80a1

Please sign in to comment.