Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build/
lib/
10 changes: 9 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"extends": "./node_modules/gts/"
"extends": "./node_modules/gts/",
"overrides": [
{
"files": ["tsup.config.ts"],
"rules": {
"node/no-unpublished-import": "off"
}
}
]
}
38 changes: 23 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
# 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: Node.js CI
name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:

test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [18.x, 20.x, 22.x, 24.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Check build output
run: |
ls -la lib/
test -f lib/index.js
test -f lib/index.mjs
test -f lib/index.d.ts
44 changes: 32 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,60 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish-npm:
name: Publish on NPM
name: Publish to NPM
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Node.js for NPM
uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run compile

- run: npm ci
- run: npm publish
- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-gpr:
name: Publish on GPR
name: Publish to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Node.js for GPR
uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com/'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run compile

- run: npm ci
- run: npm publish
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build/
/lib/
/node_modules/
/.idea/
/.playwright-mcp
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Changelog

All notable changes to this project will be documented in this file.

## [1.0.0] - 2025-11-13

### Added

**Native Slack Block Support**
- Lists now render using Slack's `rich_text_list` format with proper visual structure
- Code blocks use `rich_text_preformatted` for improved syntax presentation
- Blockquotes converted to `rich_text_quote` for cleaner formatting
- Checkbox lists display with tick (✅) and empty box (☐) emoji indicators
- Inline formatting (bold, italic, code) preserved within list items and quotes

**Media and File Handling**
- Video block support for embedding media content
- Automatic file attachment detection based on file extensions
- File links converted to native Slack file blocks

**Table Rendering**
- Native Slack table blocks for both Markdown and HTML tables
- Column alignment support (left, centre, right)
- Rich text formatting within table cells
- HTML table parsing with graceful handling of malformed markup

### Changed

**Breaking Changes**
- List rendering now outputs `rich_text` blocks instead of section blocks with markdown text
- Blockquote rendering uses `rich_text_quote` for simple quotes (maintains backward compatibility for complex quotes)
- Package renamed to `@mherod/mack` namespace
- Build output relocated from `/build/src` to `/lib`

**Build System**
- Migrated from TypeScript compiler to tsup for faster builds
- Dual-package support (CommonJS and ESM)

### Fixed

- Nested list rendering now processes all content correctly
- Blockquotes support multiple content types (lists, code, headings)
- Character escaping limited to Slack requirements (&, <, >)
- Horizontal rule placement no longer affects adjacent list formatting
- Markdown parsing API updated to current marked library standards

### Technical Improvements

- Comprehensive error handling with custom error classes
- Input validation and URL verification
- UTF-8 aware text truncation
- Recursion depth protection
- XML parsing security (XXE protection)
- 223 test cases with comprehensive coverage
- TypeScript strict mode compliance
Loading