Skip to content

Commit f9d5f56

Browse files
Merge pull request #6 from bchainhub/update/fixes-01
Updates
2 parents e9f4247 + f7562f6 commit f9d5f56

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
release:
55
types: [created]
66

7+
permissions:
8+
id-token: write
9+
contents: write
10+
711
jobs:
812
build-and-publish:
913
runs-on: ubuntu-latest
@@ -26,6 +30,6 @@ jobs:
2630
run: npm run build
2731

2832
- name: Publish package on NPM 📦
29-
run: npm publish --access public
33+
run: npm publish --provenance --access public
3034
env:
3135
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@ yarn add remark-corepass
2020

2121
Integrate the plugin into your Remark processing pipeline to automatically convert CorePass notations and optionally validate ICAN (International Core Asset Number) identifiers:
2222

23-
```javascript
24-
const remark = require('remark');
25-
const remarkCorepass = require('remark-corepass');
26-
27-
remark()
28-
.use(remarkCorepass, { enableIcanCheck: true })
29-
.process('Your markdown text here', (err, file) => {
30-
if (err) throw err;
23+
```typescript
24+
import remark from 'remark';
25+
import remarkCorepass from 'remark-corepass';
26+
27+
(async () => {
28+
try {
29+
const file = await remark()
30+
.use(remarkCorepass, { enableIcanCheck: true })
31+
.process('Your markdown text here');
3132
console.log(String(file));
32-
});
33+
} catch (err) {
34+
console.error(err);
35+
}
36+
})();
3337
```
3438

3539
The plugin searches for CorePass notations in the format `[domain@coreid]` or `[!cb1234...@coreid]` in your markdown content, converting them into clickable links and validating ICAN identifiers when enabled.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remark-corepass",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "A Remark plugin to transform CorePass notations into markdown links.",
55
"main": "dist/index.js",
66
"types": "types/index.d.ts",
@@ -11,6 +11,10 @@
1111
"dev": "node --loader ts-node/esm --inspect src/index.ts",
1212
"start": "node --loader ts-node/esm src/index.ts"
1313
},
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/bchainhub/remark-corepass"
17+
},
1418
"files": [
1519
"src/",
1620
"dist/",
@@ -21,6 +25,7 @@
2125
"keywords": [
2226
"remark",
2327
"plugin",
28+
"remark-plugin",
2429
"markdown",
2530
"links",
2631
"transform",
@@ -53,7 +58,6 @@
5358
"exports": {
5459
".": {
5560
"import": "./dist/index.js",
56-
"require": "./dist/index.js",
5761
"types": "./types/index.d.ts"
5862
}
5963
}

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"module": "ESNext",
5-
"moduleResolution": "node",
4+
"module": "Node16",
5+
"moduleResolution": "Node16",
66
"outDir": "./dist",
77
"strict": true,
88
"esModuleInterop": true,

0 commit comments

Comments
 (0)