From f7562f6f46094ac64d57ba5900f8b0d81f96dbfb Mon Sep 17 00:00:00 2001 From: Rastislav Date: Fri, 1 Mar 2024 21:42:01 +0100 Subject: [PATCH] Updates --- .github/workflows/publish.yml | 6 +++++- README.md | 22 +++++++++++++--------- package.json | 8 ++++++-- tsconfig.json | 4 ++-- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a9a9007..1668d5e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,10 @@ on: release: types: [created] +permissions: + id-token: write + contents: write + jobs: build-and-publish: runs-on: ubuntu-latest @@ -26,6 +30,6 @@ jobs: run: npm run build - name: Publish package on NPM 📦 - run: npm publish --access public + run: npm publish --provenance --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 0d83528..83858cb 100644 --- a/README.md +++ b/README.md @@ -20,16 +20,20 @@ yarn add remark-corepass Integrate the plugin into your Remark processing pipeline to automatically convert CorePass notations and optionally validate ICAN (International Core Asset Number) identifiers: -```javascript -const remark = require('remark'); -const remarkCorepass = require('remark-corepass'); - -remark() - .use(remarkCorepass, { enableIcanCheck: true }) - .process('Your markdown text here', (err, file) => { - if (err) throw err; +```typescript +import remark from 'remark'; +import remarkCorepass from 'remark-corepass'; + +(async () => { + try { + const file = await remark() + .use(remarkCorepass, { enableIcanCheck: true }) + .process('Your markdown text here'); console.log(String(file)); - }); + } catch (err) { + console.error(err); + } +})(); ``` 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. diff --git a/package.json b/package.json index e92f731..594fd20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remark-corepass", - "version": "0.1.3", + "version": "0.1.4", "description": "A Remark plugin to transform CorePass notations into markdown links.", "main": "dist/index.js", "types": "types/index.d.ts", @@ -11,6 +11,10 @@ "dev": "node --loader ts-node/esm --inspect src/index.ts", "start": "node --loader ts-node/esm src/index.ts" }, + "repository": { + "type": "git", + "url": "https://github.com/bchainhub/remark-corepass" + }, "files": [ "src/", "dist/", @@ -21,6 +25,7 @@ "keywords": [ "remark", "plugin", + "remark-plugin", "markdown", "links", "transform", @@ -53,7 +58,6 @@ "exports": { ".": { "import": "./dist/index.js", - "require": "./dist/index.js", "types": "./types/index.d.ts" } } diff --git a/tsconfig.json b/tsconfig.json index 7b40f3a..12eae6f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "ES2020", - "module": "ESNext", - "moduleResolution": "node", + "module": "Node16", + "moduleResolution": "Node16", "outDir": "./dist", "strict": true, "esModuleInterop": true,