-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Dunkan <[email protected]> Co-authored-by: Wojciech Pawlik <[email protected]>
- Loading branch information
1 parent
ceb7d19
commit c1c3bbf
Showing
17 changed files
with
254 additions
and
235 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
38 changes: 27 additions & 11 deletions
38
.github/workflows/nodejs.yml → .github/workflows/deno.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,60 @@ | ||
name: Node.js | ||
name: Deno | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
# Check if it works with current dependencies | ||
# Check if it works with current versions | ||
- cron: '42 2 * * 6' # weekly on Saturday 2:42 UTC | ||
|
||
jobs: | ||
denofmt-and-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
- uses: actions/checkout@v4 | ||
|
||
- run: deno lint | ||
- run: deno fmt --check | ||
|
||
test: | ||
name: Node.js | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
node-version: 'lts/*' | ||
deno-version: v1.x | ||
- uses: actions/checkout@v4 | ||
- run: npm install | ||
- run: npm test | ||
- run: npm pack | ||
|
||
publish: | ||
- run: deno cache source/*.ts | ||
- run: deno check source/*.ts | ||
- run: deno test | ||
|
||
npm: | ||
name: Publish on NPM | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
needs: test | ||
needs: [denofmt-and-lint, test] | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: npm install | ||
- run: npm pack | ||
- run: npm publish | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_CONFIG_ACCESS: public | ||
NPM_CONFIG_PROVENANCE: true | ||
- name: Create GitHub release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: softprops/action-gh-release@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/*-*.*.*.tgz | ||
coverage | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"deno.enable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"lock": false, | ||
"fmt": { | ||
"useTabs": true | ||
}, | ||
"exclude": [ | ||
"./dist/", | ||
"./node_modules/" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,70 @@ | ||
import test from 'ava'; | ||
import {html as format} from './html.js'; | ||
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { html as format } from "./html.ts"; | ||
|
||
test('bold', t => { | ||
t.is(format.bold('bold'), '<b>bold</b>'); | ||
Deno.test("bold", () => { | ||
assertEquals(format.bold("bold"), "<b>bold</b>"); | ||
}); | ||
|
||
test('italic', t => { | ||
t.is(format.italic('italic'), '<i>italic</i>'); | ||
Deno.test("italic", () => { | ||
assertEquals(format.italic("italic"), "<i>italic</i>"); | ||
}); | ||
|
||
test('strikethrough', t => { | ||
t.is(format.strikethrough('strikethrough'), '<s>strikethrough</s>'); | ||
Deno.test("strikethrough", () => { | ||
assertEquals(format.strikethrough("strikethrough"), "<s>strikethrough</s>"); | ||
}); | ||
|
||
test('underline', t => { | ||
t.is(format.underline('underline'), '<u>underline</u>'); | ||
Deno.test("underline", () => { | ||
assertEquals(format.underline("underline"), "<u>underline</u>"); | ||
}); | ||
|
||
test('spoiler', t => { | ||
t.is(format.spoiler('spoiler'), '<span class="tg-spoiler">spoiler</span>'); | ||
Deno.test("spoiler", () => { | ||
assertEquals( | ||
format.spoiler("spoiler"), | ||
'<span class="tg-spoiler">spoiler</span>', | ||
); | ||
}); | ||
|
||
test('url', t => { | ||
t.is( | ||
format.url('me', 'https://edjopato.de'), | ||
Deno.test("url", () => { | ||
assertEquals( | ||
format.url("me", "https://edjopato.de"), | ||
'<a href="https://edjopato.de">me</a>', | ||
); | ||
}); | ||
|
||
test('escape', t => { | ||
t.is(format.escape('h<e>y'), 'h<e>y'); | ||
Deno.test("escape", () => { | ||
assertEquals(format.escape("h<e>y"), "h<e>y"); | ||
}); | ||
|
||
test('bold italic', t => { | ||
t.is(format.bold(format.italic('green')), '<b><i>green</i></b>'); | ||
Deno.test("bold italic", () => { | ||
assertEquals(format.bold(format.italic("green")), "<b><i>green</i></b>"); | ||
}); | ||
|
||
test('user mention', t => { | ||
t.is( | ||
format.userMention('inline mention of a user', 123_456_789), | ||
Deno.test("user mention", () => { | ||
assertEquals( | ||
format.userMention("inline mention of a user", 123_456_789), | ||
'<a href="tg://user?id=123456789">inline mention of a user</a>', | ||
); | ||
}); | ||
|
||
test('monospace', t => { | ||
t.is( | ||
format.monospace('inline fixed-width code'), | ||
'<code>inline fixed-width code</code>', | ||
Deno.test("monospace", () => { | ||
assertEquals( | ||
format.monospace("inline fixed-width code"), | ||
"<code>inline fixed-width code</code>", | ||
); | ||
}); | ||
|
||
test('monospaceBlock w/o language', t => { | ||
t.is( | ||
format.monospaceBlock('pre-formatted fixed-width code block'), | ||
'<pre>pre-formatted fixed-width code block</pre>', | ||
Deno.test("monospaceBlock w/o language", () => { | ||
assertEquals( | ||
format.monospaceBlock("pre-formatted fixed-width code block"), | ||
"<pre>pre-formatted fixed-width code block</pre>", | ||
); | ||
}); | ||
|
||
test('monospaceBlock w/ language', t => { | ||
t.is( | ||
Deno.test("monospaceBlock w/ language", () => { | ||
assertEquals( | ||
format.monospaceBlock( | ||
'pre-formatted fixed-width code block written in the Python programming language', | ||
'python', | ||
"pre-formatted fixed-width code block written in the Python programming language", | ||
"python", | ||
), | ||
'<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>', | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.