Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to latest dependencies #97

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
db9b05b
removed yarn.lock
ildella Aug 28, 2024
83b7203
upgrading packages, now at marked 7 and all other deps have fixed ver…
ildella Aug 28, 2024
45d421a
bump to marked 14, and using github-slugger as the internal one has b…
ildella Aug 28, 2024
9442dc4
cleanup
ildella Aug 28, 2024
76a4720
bump all deps to latest available version
ildella Aug 29, 2024
2f9b3c4
removed old unused code
ildella Aug 29, 2024
125c558
removed micromark which was used for testing only
ildella Aug 29, 2024
eb9d347
accept node 18
ildella Aug 29, 2024
7c19e85
migrated to svelte-marked so I can release it as the PRs are not bein…
ildella Sep 1, 2024
916f5d8
build and publish npm artifact on tags
ildella Sep 1, 2024
8f304e3
bump dep to trigger release
ildella Sep 1, 2024
4344548
using latest github actions in the test action script
ildella Sep 1, 2024
608c36e
bump test action script code to latest versions
ildella Sep 1, 2024
61255b7
had GPT fix it for me
ildella Sep 1, 2024
95afe5e
yarn.lock is required
ildella Sep 1, 2024
4f4c415
bump version for release
ildella Sep 1, 2024
0a43b85
re-fixed the other github script as well
ildella Sep 1, 2024
72e3750
fixed package.json repository with most recent syntax
ildella Sep 1, 2024
7b1d697
removed useless console.log
ildella Sep 4, 2024
6cbcf0e
bump to latet deps
ildella Sep 4, 2024
bb4a24f
remove useless console output
ildella Sep 18, 2024
ffc180a
a test for markdown with paragraphs
ildella Nov 8, 2024
f95fe39
added link to marked
ildella Nov 8, 2024
89d6ace
bump all deps to latest version including svelte 5, marked 15 and esl…
ildella Nov 11, 2024
d33bd71
update test to latest vite, but something is wrong
ildella Nov 11, 2024
5a5ffa7
re-ordered alphabetically
ildella Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .eslintrc.js

This file was deleted.

66 changes: 36 additions & 30 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish to NPM

on:
release:
types: [created]
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Checkout code
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- run: yarn
- run: yarn test
node-version: 22
cache: 'yarn'

- name: Install dependencies
run: yarn

- name: Run tests
run: yarn test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Checkout code
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
cache: 'yarn'
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn publish

- name: Install production dependencies
run: yarn workspaces focus --all --production

- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

# publish-gpr:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v1
# with:
# node-version: 12
# registry-url: https://npm.pkg.github.com/
# - run: yarn
# - run: yarn publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
23 changes: 14 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Tests

on:
Expand All @@ -11,18 +8,26 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [20, 22]

steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn test

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn

- name: Run tests
run: yarn test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
.tern-port
dist/
.log/
.yarn/

vite.config.js.timestamp*
4 changes: 0 additions & 4 deletions .prettierrc.json

This file was deleted.

37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
# Svelte Markdown

[![Tests](https://github.com/pablo-abc/svelte-markdown/workflows/Tests/badge.svg?branch=master)](https://github.com/pablo-abc/svelte-markdown/actions?query=workflow%3ATests)
[![npm](https://img.shields.io/npm/v/svelte-markdown)](https://www.npmjs.com/package/svelte-markdown)
[![npm](https://img.shields.io/npm/dw/svelte-markdown)](https://www.npmjs.com/package/svelte-markdown)
![NPM](https://img.shields.io/npm/l/svelte-markdown)
[![Tests](https://github.com/ildella/svelte-marked/workflows/Tests/badge.svg?branch=master)](https://github.com/ildella/svelte-marked/actions?query=workflow%3ATests)
[![npm](https://img.shields.io/npm/v/svelte-marked)](https://www.npmjs.com/package/svelte-marked)
[![npm](https://img.shields.io/npm/dw/svelte-marked)](https://www.npmjs.com/package/svelte-marked)
![NPM](https://img.shields.io/npm/l/svelte-marked)

A markdown parser that renders into Svelte Components. Inspired by [ReactMarkdown](https://github.com/remarkjs/react-markdown).
A markdown parser that renders into Svelte Components. Forked from [svelte-markdown](https://github.com/pablo-abc/svelte-markdown/pulls) cause it was not merging PRs or upadting the project since December 2023.

This is the same code as `svelte-markdown` with up-to-date dependencies and removed deprecated dependencies. It keeps using [marked](https://github.com/markedjs/marked/).

## Installation

You can install it with
Install it with npm

```console
$ npm i -S svelte-markdown
$ npm i -S svelte-marked
```

If you use npm or if you prefer yarn
or yarn

```console
$ yarn add svelte-markdown
```
$ yarn add svelte-marked

If you're using Sapper you might need to install it as a dev dependency.
## With SvelteKit add it as a dev dependency
$ yarn add -D svelte-marked
```

## Usage

```html
<script>
import SvelteMarkdown from 'svelte-markdown'
import SvelteMarkdown from 'svelte-marked'
const source = `
# This is a header

Expand Down Expand Up @@ -120,7 +123,7 @@ So you can import the component and pass to the `renderers` props:

```svelte
<script>
import SvelteMarkdown from "svelte-markdown";
import SvelteMarkdown from "svelte-marked";
import ImageComponent from "./renderers/ImageComponent.svelte";
export let content;
</script>
Expand All @@ -136,7 +139,7 @@ For greater flexibility, an array of tokens may be given as `source`, in which c

```html
<script>
import SvelteMarkdown from 'svelte-markdown'
import SvelteMarkdown from 'svelte-marked'
import { marked } from 'marked'

const tokens = marked.lexer('this is an **example**')
Expand All @@ -162,7 +165,7 @@ A `parsed` event will be fired when the final tokens have been calculated, allow

```html
<script>
import SvelteMarkdown from 'svelte-markdown'
import SvelteMarkdown from 'svelte-marked'

const source = `# This is a header`

Expand Down Expand Up @@ -259,7 +262,7 @@ $ yarn dev
This will watch all changes and make the project linkable. Now on the app you created you can link it with:

```console
$ yarn link svelte-markdown
$ yarn link svelte-marked
```

And then import it like in the example above.
Expand All @@ -268,6 +271,6 @@ As of now the only external dependency of this project is `marked`.

## Related

- [ReactMarkdown](https://github.com/remarkjs/react-markdown) - React library to render markdown using React components. Inspiration for this library.
- [Svelte](https://svelte.dev) - JavaScript front-end framework.
- [Marked](https://marked.js.org/) - Markdown parser
- [ReactMarkdown](https://github.com/remarkjs/react-markdown) - React library to render markdown using React components. Inspiration for this library.
40 changes: 40 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import globals from "globals"
import pluginJs from "@eslint/js"
import svelteParser from 'svelte-eslint-parser'
import sveltePlugin from 'eslint-plugin-svelte'

export default [
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
{
name: 'Frankie WebApp',
ignores: [
'vite.config.js.*',
'more.eslint.config.js',
],
},
{
name: 'Svelte files',
files: [
'src/**/*.svelte',
'src/routes/**/*page.js',
'src/routes/**/*layout.js',
],
languageOptions: {
parser: svelteParser,
globals: {...globals.browser},
},
plugins: {
// '@stylistic/js': stylisticJs,
svelte: sveltePlugin,
},
rules: {
// ...pluginJs.configs.recommended.rules,
// ...recommended.rules,
// '@stylistic/js/max-len': ['warn', {code: 250}],
'no-undefined': 'off',
'svelte/no-at-html-tags': 'off',
'svelte/valid-compile': 'off',
},
},
]
Loading