chore: upgrade SvelteKit 2 + Svelte 5 (mode compat) + nettoyage packaging
- svelte 5.56, kit 2.70, adapter-static 3, vite 6, svelte-check 4, TS 5.9 - Syntaxe legacy conservée (on:click, $:, export let) — compile en mode compat - Load RSS : +page.ts → +page.server.ts (XML de 10,9 Mo hors du HTML, page podcast 11,9 Mo → 1,5 Mo ; règle au passage le CORS en navigation client) - package.json : renommé oki-podcast-reader, champs de librairie retirés, deps mortes supprimées (changesets, publint, highlights, meta-tags) - check 0/0, build vert, radio Funkwhale et flux Syntax.fm fonctionnels
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
# 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)
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
name: 'CI'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
# cancel in-progress runs on new commits to same PR (gitub.event.number)
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup Enviroment
|
||||
timeout-minutes: 4
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
cache_name: ${{ steps.cache.outputs.name }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Node to v18.13.0
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: v18.13.0
|
||||
|
||||
- name: Get Node version
|
||||
id: node
|
||||
run: echo "version=$(node -v)" >> $GITHUB_OUTPUT
|
||||
#run: echo "::set-output name=version::$(node --v)"
|
||||
|
||||
- name: Get Cache Name
|
||||
id: cache
|
||||
run: echo "name=${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get node_modules cache
|
||||
uses: actions/cache@v3
|
||||
id: node_modules
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
**/.svelte-kit
|
||||
|
||||
key: ${{ steps.cache.outputs.name }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Sync generated typings
|
||||
run: yarn run sync
|
||||
|
||||
linting:
|
||||
name: Linting Checks
|
||||
needs: setup
|
||||
timeout-minutes: 4
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get node_modules cache
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
**/.svelte-kit
|
||||
key: ${{ needs.setup.outputs.cache_name }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Lint prettier
|
||||
run: yarn run lint:prettier
|
||||
|
||||
- name: Lint eslint
|
||||
run: yarn run lint:eslint
|
||||
|
||||
type_check:
|
||||
name: Typescript Checks
|
||||
needs: setup
|
||||
timeout-minutes: 4
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get node_modules cache
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
**/.svelte-kit
|
||||
key: ${{ needs.setup.outputs.cache_name }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Check for type errors
|
||||
run: yarn run ts
|
||||
# svelte_check:
|
||||
# name: Svelte Checks
|
||||
# needs: setup
|
||||
# timeout-minutes: 4
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v3
|
||||
#
|
||||
# - name: Get node_modules cache
|
||||
# uses: actions/cache/restore@v3
|
||||
# id: cache
|
||||
# with:
|
||||
# path: |
|
||||
# **/node_modules
|
||||
# **/.svelte-kit
|
||||
# key: ${{ needs.setup.outputs.cache_name }}
|
||||
#
|
||||
# - name: Install dependencies
|
||||
# run: yarn install --frozen-lockfile
|
||||
#
|
||||
# - name: Check for best practices
|
||||
# run: yarn run check
|
||||
@@ -1,89 +0,0 @@
|
||||
name: 'Publish to NPM'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup Enviroment
|
||||
timeout-minutes: 4
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
cache_name: ${{ steps.cache.outputs.name }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Node to v18.13.0
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: v18.13.0
|
||||
|
||||
- name: Get Node version
|
||||
id: node
|
||||
run: echo "version=$(node -v)" >> $GITHUB_OUTPUT
|
||||
#run: echo "::set-output name=version::$(node --v)"
|
||||
|
||||
- name: Get Cache Name
|
||||
id: cache
|
||||
run: echo "name=${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get node_modules cache
|
||||
uses: actions/cache@v3
|
||||
id: node_modules
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
**/.svelte-kit
|
||||
|
||||
key: ${{ steps.cache.outputs.name }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Sync generated typings
|
||||
run: yarn run sync
|
||||
release:
|
||||
if: github.repository == 'OllieJT/svelte-podcast'
|
||||
name: Release
|
||||
needs: setup
|
||||
timeout-minutes: 5
|
||||
runs-on: ubuntu-latest
|
||||
# prevents this action from running on forks
|
||||
permissions:
|
||||
contents: write # to create release (changesets/action)
|
||||
pull-requests: write # to create pull request (changesets/action)
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get node_modules cache
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
**/.svelte-kit
|
||||
key: ${{ needs.setup.outputs.cache_name }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Package svelte src/lib
|
||||
run: yarn run package
|
||||
|
||||
- name: Create Release Pull Request or Publish to npm
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
publish: yarn run release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
UPDATE_TEMPLATE_SSH_KEY: ${{ secrets.UPDATE_TEMPLATE_SSH_KEY }}
|
||||
+11
-42
@@ -1,22 +1,13 @@
|
||||
{
|
||||
"name": "radyobokaz-player",
|
||||
"version": "0.1.0",
|
||||
"name": "oki-podcast-reader",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "Lecteur web pour la radio Radyobòkaz (mizik.o-k-i.net), basé sur svelte-podcast.",
|
||||
"license": "MIT",
|
||||
"author": "Ollie Taylor (https://olliejt.com)",
|
||||
"homepage": "https://github.com/OllieJT/svelte-podcast/blob/main/README.md",
|
||||
"bugs": {
|
||||
"url": "https://github.com/OllieJT/svelte-podcast/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/OllieJT/svelte-podcast.git"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"package": "svelte-kit sync && svelte-package && publint",
|
||||
"sync": "svelte-kit sync",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
@@ -24,35 +15,20 @@
|
||||
"lint:eslint": "TIMING=1 eslint . --ext .ts,.tsx,.svelte --cache",
|
||||
"lint": "yarn lint:prettier && yarn lint:eslint",
|
||||
"format": "prettier --write --plugin-search-dir=. .",
|
||||
"release": "changeset publish",
|
||||
"ts": "tsc --pretty --noImplicitAny --noEmit"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"svelte": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"@sveltejs/kit": ">=1.0.0",
|
||||
"svelte": ">=3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@inqling/svelte-icons": "^3.3.2",
|
||||
"clsx": "^1.2.1",
|
||||
"esm-env": "^1.0.0",
|
||||
"fast-xml-parser": "^5.10.1",
|
||||
"just-clamp": "^4.2.0",
|
||||
"svelte-local-storage-store": "^0.5.0"
|
||||
"svelte-local-storage-store": "^0.6.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.26.2",
|
||||
"@sveltejs/adapter-static": "^2.0.2",
|
||||
"@sveltejs/kit": "^1.22.1",
|
||||
"@sveltejs/package": "^2.1.0",
|
||||
"@sveltejs/adapter-static": "^3",
|
||||
"@sveltejs/kit": "^2",
|
||||
"@sveltejs/vite-plugin-svelte": "^5",
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@tailwindcss/typography": "^0.5.9",
|
||||
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
||||
@@ -67,19 +43,12 @@
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-svelte": "^2.10.1",
|
||||
"prettier-plugin-tailwindcss": "^0.3.0",
|
||||
"publint": "^0.1.16",
|
||||
"svelte": "^4.0.5",
|
||||
"svelte-check": "^3.4.5",
|
||||
"svelte-highlight": "^7.3.0",
|
||||
"svelte-meta-tags": "^2.8.0",
|
||||
"svelte-preprocess": "^5.0.4",
|
||||
"svhighlight": "^0.7.1",
|
||||
"svelte": "^5",
|
||||
"svelte-check": "^4",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"tslib": "^2.6.0",
|
||||
"typescript": "^5.1.6",
|
||||
"vite": "^4.4.2"
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^6"
|
||||
},
|
||||
"svelte": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"type": "module"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { fetch_podcast_feed } from '$lib/rss';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
const FEED_URL = 'https://feed.syntax.fm/rss';
|
||||
|
||||
export const load: PageServerLoad = async ({ fetch }) => {
|
||||
const feed = await fetch_podcast_feed(FEED_URL, fetch);
|
||||
return {
|
||||
feed: {
|
||||
...feed,
|
||||
// Les notes d'épisode (HTML complet) ne sont affichées nulle part :
|
||||
// on ne les sérialise pas dans la page (plusieurs Mo pour ~1000 épisodes).
|
||||
episodes: feed.episodes.map(({ description: _description, ...episode }) => episode),
|
||||
},
|
||||
feed_url: FEED_URL,
|
||||
};
|
||||
};
|
||||
@@ -14,7 +14,7 @@
|
||||
$: feed = data.feed;
|
||||
|
||||
/** Maps a podcast episode to a track playable by the queue. */
|
||||
function to_track(episode: PodcastEpisode): PlayableTrack {
|
||||
function to_track(episode: Omit<PodcastEpisode, 'description'>): PlayableTrack {
|
||||
return {
|
||||
id: episode.id,
|
||||
title: episode.title,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { fetch_podcast_feed } from '$lib/rss';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
const FEED_URL = 'https://feed.syntax.fm/rss';
|
||||
|
||||
export const load: PageLoad = async ({ fetch }) => {
|
||||
const feed = await fetch_podcast_feed(FEED_URL, fetch);
|
||||
return { feed, feed_url: FEED_URL };
|
||||
};
|
||||
+3
-4
@@ -1,14 +1,13 @@
|
||||
import adapter from '@sveltejs/adapter-static';
|
||||
import { vitePreprocess } from '@sveltejs/kit/vite';
|
||||
import preprocess from 'svelte-preprocess';
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
extensions: ['.svelte'],
|
||||
|
||||
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
||||
// Consult https://svelte.dev/docs/kit/integrations
|
||||
// for more information about preprocessors
|
||||
preprocess: [vitePreprocess(), preprocess({ postcss: true })],
|
||||
preprocess: vitePreprocess(),
|
||||
|
||||
kit: {
|
||||
adapter: adapter(),
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
"skipLibCheck": true,
|
||||
|
||||
"strict": true,
|
||||
// Error when a value import is only used as a type.
|
||||
"importsNotUsedAsValues": "error",
|
||||
|
||||
// Report errors for fallthrough cases in switch statements
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
|
||||
Reference in New Issue
Block a user