@chirag127/omni-publish 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +66 -0
- package/package.json +29 -0
- package/src/__tests__/smoke.test.ts +12 -0
- package/src/index.ts +15 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Chirag Singhal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @chirag127/omni-publish
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@chirag127/omni-publish)
|
|
4
|
+
[](https://github.com/chirag127/omni-publish-npm-pkg/actions/workflows/ci.yml)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
|
|
7
|
+
Auto-publish release notes / blog posts to multiple platforms on tag push or release create. Platform fan-out is filtered by which env vars are set — if only `DEVTO_API_KEY` exists, only dev.to is targeted.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i -D @chirag127/omni-publish
|
|
13
|
+
# or
|
|
14
|
+
pnpm add -D @chirag127/omni-publish
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Supported platforms / env vars
|
|
18
|
+
|
|
19
|
+
Set the env var for each platform you want to publish to. Unset = skipped.
|
|
20
|
+
|
|
21
|
+
| Platform | Env var |
|
|
22
|
+
|--------------|----------------------|
|
|
23
|
+
| dev.to | `DEVTO_API_KEY` |
|
|
24
|
+
| Hashnode | `HASHNODE_API_KEY` |
|
|
25
|
+
| Medium | `MEDIUM_API_KEY` |
|
|
26
|
+
| X / Twitter | `X_API_KEY` |
|
|
27
|
+
| LinkedIn | `LINKEDIN_API_KEY` |
|
|
28
|
+
| Bluesky | `BLUESKY_API_KEY` |
|
|
29
|
+
| Mastodon | `MASTODON_API_KEY` |
|
|
30
|
+
| Reddit | `REDDIT_API_KEY` |
|
|
31
|
+
|
|
32
|
+
## GitHub Actions
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
name: Cross-post release
|
|
36
|
+
on:
|
|
37
|
+
release: { types: [published] }
|
|
38
|
+
push: { tags: ['v*.*.*'] }
|
|
39
|
+
jobs:
|
|
40
|
+
publish:
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
- uses: actions/setup-node@v4
|
|
45
|
+
with: { node-version: 22 }
|
|
46
|
+
- run: npx -y @chirag127/omni-publish
|
|
47
|
+
env:
|
|
48
|
+
DEVTO_API_KEY: ${{ secrets.DEVTO_API_KEY }}
|
|
49
|
+
HASHNODE_API_KEY: ${{ secrets.HASHNODE_API_KEY }}
|
|
50
|
+
MEDIUM_API_KEY: ${{ secrets.MEDIUM_API_KEY }}
|
|
51
|
+
X_API_KEY: ${{ secrets.X_API_KEY }}
|
|
52
|
+
LINKEDIN_API_KEY: ${{ secrets.LINKEDIN_API_KEY }}
|
|
53
|
+
BLUESKY_API_KEY: ${{ secrets.BLUESKY_API_KEY }}
|
|
54
|
+
MASTODON_API_KEY: ${{ secrets.MASTODON_API_KEY }}
|
|
55
|
+
REDDIT_API_KEY: ${{ secrets.REDDIT_API_KEY }}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Status
|
|
59
|
+
|
|
60
|
+
`v0.1.x` — slug reservation + stub. Per-platform adapters land in `v0.1.1`.
|
|
61
|
+
|
|
62
|
+
Part of the [`chirag127/oriz`](https://github.com/chirag127/oriz) family.
|
|
63
|
+
|
|
64
|
+
## Cross-refs
|
|
65
|
+
|
|
66
|
+
- [security policy](./SECURITY.md) · [code of conduct](./CODE_OF_CONDUCT.md) · [contributing](./CONTRIBUTING.md)
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chirag127/omni-publish",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Auto-publish release notes / blog posts to multiple platforms (dev.to, hashnode, medium, X/Twitter, LinkedIn, Bluesky, Mastodon, Reddit) on tag push or release create. Platform fan-out filtered by which env vars are set.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Chirag Singhal <chirag@oriz.in>",
|
|
8
|
+
"homepage": "https://github.com/chirag127/omni-publish-npm-pkg#readme",
|
|
9
|
+
"repository": { "type": "git", "url": "git+https://github.com/chirag127/omni-publish-npm-pkg.git" },
|
|
10
|
+
"bugs": { "url": "https://github.com/chirag127/omni-publish-npm-pkg/issues" },
|
|
11
|
+
"keywords": ["chirag127", "oriz", "release-notes", "devto", "hashnode", "medium", "twitter", "linkedin", "bluesky", "mastodon", "reddit", "cross-post"],
|
|
12
|
+
"files": ["src", "LICENSE", "README.md"],
|
|
13
|
+
"main": "./src/index.ts",
|
|
14
|
+
"types": "./src/index.ts",
|
|
15
|
+
"bin": { "omni-publish": "./src/index.ts" },
|
|
16
|
+
"exports": { ".": "./src/index.ts" },
|
|
17
|
+
"publishConfig": { "access": "public" },
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "vitest run",
|
|
20
|
+
"test:watch": "vitest",
|
|
21
|
+
"test:coverage": "vitest run --coverage"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"vitest": "^2.0.0",
|
|
25
|
+
"@vitest/coverage-v8": "^2.0.0",
|
|
26
|
+
"happy-dom": "^15.0.0",
|
|
27
|
+
"typescript": "^5.6.0"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { __pkg, publish } from '../index'
|
|
3
|
+
|
|
4
|
+
describe('package smoke', () => {
|
|
5
|
+
it('exports __pkg constant', () => {
|
|
6
|
+
expect(__pkg).toMatch(/^@chirag127\//)
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
it('publish() resolves without throwing on empty config', async () => {
|
|
10
|
+
await expect(publish({ platforms: [], title: 't', body: 'b' })).resolves.toBeUndefined()
|
|
11
|
+
})
|
|
12
|
+
})
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// @chirag127/omni-publish
|
|
3
|
+
// v0.1.0 stub. See README for status.
|
|
4
|
+
export const __pkg = '@chirag127/omni-publish' as const
|
|
5
|
+
|
|
6
|
+
export type OmniPublishConfig = {
|
|
7
|
+
platforms: string[]
|
|
8
|
+
title: string
|
|
9
|
+
body: string
|
|
10
|
+
canonicalUrl?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function publish(_cfg: OmniPublishConfig): Promise<void> {
|
|
14
|
+
/* TODO: implement per-platform adapters in v0.1.1 */
|
|
15
|
+
}
|