Commit a4a6254
authored
refactor: split into monorepo with core library and action packages (#19)
* refactor: split into monorepo with core library and action packages
Extract Slack message composition and posting logic into a standalone
`@sixt/slack-message` core package with zero dependencies (native fetch
only). The GitHub Action is refactored to depend on the core package for
block composition and message posting, removing the `@slack/web-api`
dependency entirely.
- packages/core: @sixt/slack-message with compose(), postMessage(), and
block builder functions
- packages/action: GitHub Action using @actions/core + core package
- Upgrade Jest 26 -> 29, @vercel/ncc 0.26 -> 0.38 for Node 18+
compatibility
- All 43 existing tests preserved and passing
* chore: update all dependencies to latest versions
- TypeScript 4.1 → 5.9
- ESLint 7 → 9 (migrate .eslintrc.js to flat config eslint.config.js)
- @typescript-eslint 4 → 8
- Jest 29.7 (latest 29.x, ts-jest doesn't support 30 yet)
- Prettier 2 → 3
- nock 13 → 14
- @actions/core 1.9 → 1.11 (latest CJS-compatible)
- @actions/github 4 → 6 (latest CJS-compatible, .rest.* API)
- @vercel/ncc 0.38 (already updated)
- Drop @slack/web-api, eslint-config-prettier/typescript, jest-circus
- 0 npm audit vulnerabilities (down from 31)
- Bundle size 894KB → 602KB
* ci: add e2e test workflow for manual validation
workflow_dispatch workflow that posts test messages to a Slack channel,
covering: basic messages, field enrichment, buttons + changelog,
mention injection, and custom blocks.
* fix: branch field not clickable on pull request events
The ref check used `ref.includes('pulls')` but PR refs are
`refs/pull/N/merge` (singular), so the condition never matched.
Changed to `ref.includes('pull/')`.
* feat: add field() and link() helpers to core package
Convenience functions so core package callers can produce the same
rich mrkdwn formatting (bold labels, 2-column grid, clickable links)
as the GitHub Action without manual string construction.
* chore: commit core package dist for git dependency consumers
Remove packages/core/dist from .gitignore so that consumers installing
@sixt/slack-message as a git dependency get the pre-built output.
* feat: add core tests, return ts from postMessage, fix orphaned divider
- Add 46 unit tests for core package covering block builders,
compose(), mention/injectMention, iconForStatus, and postMessage
- postMessage now returns { ts, channel } for threading/updating
- Divider is only added when footerText is provided (no orphan)
- Export PostMessageResult type
* chore: remove e2e test workflow
* chore: drop source maps from core dist
* fix: validate postMessage response, remove redundant re-export
- Replace non-null assertions with explicit validation in postMessage
- Remove redundant iconForStatus re-export from action client
- Update test helper to import iconForStatus from core package
* feat: add /core subpath export for clean consumer imports
* ci: add github packages publishing for @sixt/slack-message
- Add publishConfig, files, repository, prepublishOnly to core package
- Add workflow_dispatch publish workflow (manual trigger with version input)
- Published package is 3.4KB — just dist/ with zero dependencies
Consumers add to .npmrc:
@Sixt:registry=https://npm.pkg.github.com
Then install normally:
npm install @sixt/slack-message
* fix: simplify publish workflow, remove git push step1 parent 4cf3b1f commit a4a6254
48 files changed
Lines changed: 4227 additions & 11785 deletions
File tree
- .github/workflows
- dist
- packages
- action
- __tests__
- fixtures
- dist
- src
- core
- __tests__
- dist
- src
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 2 | + | |
15 | 3 | | |
0 commit comments