Skip to content

Commit

Permalink
feat: first version
Browse files Browse the repository at this point in the history
  • Loading branch information
markusahlstrand committed Mar 14, 2024
0 parents commit 6f647fe
Show file tree
Hide file tree
Showing 32 changed files with 5,347 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.github
.vscode
dist
node_modules
18 changes: 18 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"browser": true,
"node": true
},
"rules": {
"prettier/prettier": "error"
}
}
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- run: yarn
- run: yarn build:prod
- run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
build
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.0
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github
.vscode
dist
node_modules
CHANGELOG.md
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"arrowParens": "avoid",
"printWidth": 120
}
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# podcast-types

A set of zod schemas and types for podcast feeds with support for the following extensions:

- itunes
- googleplay
- content
- atom
- sesamy
- acast
- spotify
- podaccess

It also provides a set of schemas for json versions of podcast feeds:

- xml-to-json. A direct mapping of the xml feed to json
- jsonfeed
- sesamy. A json feed with support for products
28 changes: 28 additions & 0 deletions demo/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import './style.css';
import sesamyLogo from '/sesamy.png';

/**
* This class is only used for rendering the UI and not shipped in the bundle
*/

class SesamyAppComponent extends HTMLElement {
constructor() {
super();
}

render() {
this.innerHTML = `
<div>
<a href="https://docs.sesamy.com" target="_blank">
<img src="${sesamyLogo}" class="logo" alt="Vite logo" />
</a>
<h1>Sesamy JS</h1>
<p class="read-the-docs">
Click on the Sesamy logo to learn more
</p>
</div>
`;
}
}

customElements.define('sesamy-app', SesamyAppComponent);
99 changes: 99 additions & 0 deletions demo/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

sesamy-app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vanilla:hover {
filter: drop-shadow(0 0 2em #3178c6aa);
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
.hidden {
display: none;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
11 changes: 11 additions & 0 deletions dts-bundle-generator.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const config = {
entries: [
{
filePath: './src/index.ts',
outFile: './build/dist/sesamy-js.d.ts',
noCheck: false,
},
],
};

module.exports = config;
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/sesamy.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sesamy Podcast Schemas</title>
</head>

<body>
<div id="app"></div>
<sesamy-app></sesamy-app>
<script type="module" src="/src/index.ts"></script>
<script type="module" src="/demo/app.ts"></script>
</body>
</html>
79 changes: 79 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "@sesamy/podcast-schemas",
"private": false,
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/",
"tag": "latest"
},
"version": "1.0.0",
"main": "dist/podcast-schemas.cjs",
"module": "dist/podcast-schemas.mjs",
"types": "dist/podcast-schemas.d.ts",
"exports": {
".": {
"require": "./dist/podcast-schemas.cjs",
"import": "./dist/podcast-schemas.mjs",
"types": "./dist/podcast-schemas.d.ts"
}
},
"scripts": {
"dev": "vite",
"build": "rimraf build/**/* && tsc && vite build --config vite.dev.config.ts",
"build:prod": "rimraf build/**/* && tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts && copyfiles ./package.json build && copyfiles ./README.md build",
"preview": "vite preview",
"type-check": "tsc",
"semantic-release": "semantic-release",
"lint": "eslint . --ext .ts",
"format": "prettier . --write"
},
"release": {
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": true,
"tarballDir": "dist",
"pkgRoot": "build"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"copyfiles": "^2.4.1",
"dts-bundle-generator": "^9.3.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"semantic-release": "^23.0.2",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vitest": "^1.1.3"
},
"dependencies": {
"zod": "^3.22.4"
}
}
Binary file added public/sesamy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"]
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { RssBooleanSchema, itemSchema, channelSchema, rssSchema } from './rss/rss';
Loading

0 comments on commit 6f647fe

Please sign in to comment.