mirror of
https://github.com/edems-dev/md-discord-syntax.git
synced 2026-07-22 08:37:37 +00:00
ref: finalize package and plugin names
This commit is contained in:
parent
eb90a3edef
commit
a91bc97119
9 changed files with 45 additions and 35 deletions
7
.github/workflows/publish.yml
vendored
7
.github/workflows/publish.yml
vendored
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
- name: Publish @edems-dev/md-discord-syntax-core
|
||||
run: |
|
||||
if [ -n "$NPM_TOKEN" ]; then
|
||||
npm publish --access public --workspace=packages/core
|
||||
npm publish --access public --provenance --workspace=packages/core
|
||||
else
|
||||
echo "NPM_TOKEN not set; skipping publish (dry-run)."
|
||||
npm publish --dry-run --workspace=packages/core
|
||||
|
|
@ -30,10 +30,10 @@ jobs:
|
|||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- name: Publish remark-md-discord-syntax
|
||||
- name: Publish @edems-dev/remark-discord-syntax
|
||||
run: |
|
||||
if [ -n "$NPM_TOKEN" ]; then
|
||||
npm publish --access public --workspace=packages/remark
|
||||
npm publish --access public --provenance --workspace=packages/remark
|
||||
else
|
||||
echo "NPM_TOKEN not set; skipping publish (dry-run)."
|
||||
npm publish --dry-run --workspace=packages/remark
|
||||
|
|
@ -41,3 +41,4 @@ jobs:
|
|||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
|
|
|
|||
14
README.md
14
README.md
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Monorepo bringing Discord-style Markdown formatting (`||spoiler||` and `-# subtext`) to Obsidian, MDX / Next.js, and platform-independent parsers.
|
||||
|
||||
> **Note**: npm packages (`@edems-dev/md-discord-syntax-core` and `remark-md-discord-syntax`) are currently local monorepo packages and not yet published to npm.
|
||||
> **Note**: npm packages (`@edems-dev/md-discord-syntax-core` and `@edems-dev/remark-discord-syntax`) are currently local monorepo packages and not yet published to npm.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -11,8 +11,8 @@ Monorepo bringing Discord-style Markdown formatting (`||spoiler||` and `-# subte
|
|||
| Package | npm Name | Description |
|
||||
| ------- | -------- | ----------- |
|
||||
| [`packages/core`](packages/core) | `@edems-dev/md-discord-syntax-core` | Platform-independent spoiler & subtext rules parser (zero dependencies). |
|
||||
| [`packages/remark`](packages/remark) | `remark-md-discord-syntax` | Remark plugin transforming `||spoiler||` and `-# subtext` for MDX. |
|
||||
| [`packages/obsidian`](packages/obsidian) | — | Obsidian Community Plugin adapter (`Discord Syntax`, plugin ID `md-discord-syntax`). |
|
||||
| [`packages/remark`](packages/remark) | `@edems-dev/remark-discord-syntax` | Remark plugin transforming `||spoiler||` and `-# subtext` for MDX. |
|
||||
| [`packages/obsidian`](packages/obsidian) | — | Obsidian Community Plugin adapter (`Discord Syntax`, plugin ID `obsidian-discord-syntax`). |
|
||||
| [`packages/quartz`](packages/quartz) | `@edems-dev/md-discord-syntax-quartz` | Reserved for future Quartz static site generator integration. |
|
||||
|
||||
---
|
||||
|
|
@ -36,12 +36,12 @@ const spoilers = findSpoilerRanges(text)
|
|||
// [{ from: 6, to: 16, contentFrom: 8, contentTo: 14 }]
|
||||
```
|
||||
|
||||
### 2. Next.js + `@next/mdx` (`remark-md-discord-syntax`)
|
||||
### 2. Next.js + `@next/mdx` (`@edems-dev/remark-discord-syntax`)
|
||||
|
||||
Install the plugin:
|
||||
|
||||
```bash
|
||||
npm install remark-md-discord-syntax
|
||||
npm install @edems-dev/remark-discord-syntax
|
||||
```
|
||||
|
||||
Configure `next.config.mjs`:
|
||||
|
|
@ -51,7 +51,7 @@ import createMDX from '@next/mdx'
|
|||
|
||||
const withMDX = createMDX({
|
||||
options: {
|
||||
remarkPlugins: ['remark-md-discord-syntax'],
|
||||
remarkPlugins: ['@edems-dev/remark-discord-syntax'],
|
||||
},
|
||||
})
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ This is a ||spoiler|| block.
|
|||
```bash
|
||||
npm run build --workspace=packages/obsidian
|
||||
```
|
||||
2. Copy `main.js`, `manifest.json`, and `styles.css` into `<vault>/.obsidian/plugins/md-discord-syntax/`.
|
||||
2. Copy `main.js`, `manifest.json`, and `styles.css` into `<vault>/.obsidian/plugins/obsidian-discord-syntax/`.
|
||||
3. Enable **Discord Syntax** in Obsidian Settings.
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"id": "md-discord-syntax",
|
||||
"id": "obsidian-discord-syntax",
|
||||
"name": "Discord Syntax",
|
||||
"version": "1.0.0",
|
||||
"minAppVersion": "0.15.0",
|
||||
|
|
|
|||
20
package-lock.json
generated
20
package-lock.json
generated
|
|
@ -57,6 +57,10 @@
|
|||
"resolved": "packages/quartz",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@edems-dev/remark-discord-syntax": {
|
||||
"resolved": "packages/remark",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.21.5",
|
||||
"cpu": [
|
||||
|
|
@ -285,10 +289,6 @@
|
|||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/md-discord-syntax-obsidian": {
|
||||
"resolved": "packages/obsidian",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/mdast-util-from-markdown": {
|
||||
"version": "2.0.3",
|
||||
"dev": true,
|
||||
|
|
@ -804,6 +804,10 @@
|
|||
"@codemirror/view": "6.38.6"
|
||||
}
|
||||
},
|
||||
"node_modules/obsidian-discord-syntax": {
|
||||
"resolved": "packages/obsidian",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.9.6",
|
||||
"dev": true,
|
||||
|
|
@ -833,10 +837,6 @@
|
|||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/remark-md-discord-syntax": {
|
||||
"resolved": "packages/remark",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/remark-parse": {
|
||||
"version": "11.0.0",
|
||||
"dev": true,
|
||||
|
|
@ -1081,7 +1081,7 @@
|
|||
"license": "GPL-3.0"
|
||||
},
|
||||
"packages/obsidian": {
|
||||
"name": "md-discord-syntax-obsidian",
|
||||
"name": "obsidian-discord-syntax",
|
||||
"version": "1.0.0",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
|
|
@ -1104,7 +1104,7 @@
|
|||
"license": "GPL-3.0"
|
||||
},
|
||||
"packages/remark": {
|
||||
"name": "remark-md-discord-syntax",
|
||||
"name": "@edems-dev/remark-discord-syntax",
|
||||
"version": "1.0.0",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"id": "md-discord-syntax",
|
||||
"id": "obsidian-discord-syntax",
|
||||
"name": "Discord Syntax",
|
||||
"version": "1.0.0",
|
||||
"minAppVersion": "0.15.0",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "md-discord-syntax-obsidian",
|
||||
"name": "obsidian-discord-syntax",
|
||||
"version": "1.0.0",
|
||||
"description": "Discord Syntax Obsidian plugin adapter",
|
||||
"private": true,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# remark-md-discord-syntax
|
||||
# @edems-dev/remark-discord-syntax
|
||||
|
||||
Remark plugin transforming Discord-style spoiler blocks (`||spoiler||`) and subtext lines (`-# subtext`) for MDX / Markdown.
|
||||
|
||||
|
|
@ -7,13 +7,13 @@ Part of the [md-discord-syntax](https://github.com/Edems-DEV/md-discord-syntax)
|
|||
## Installation
|
||||
|
||||
```bash
|
||||
npm install remark-md-discord-syntax
|
||||
npm install @edems-dev/remark-discord-syntax
|
||||
```
|
||||
|
||||
## Minimal Usage
|
||||
|
||||
```js
|
||||
import { remarkMdDiscordSyntax } from 'remark-md-discord-syntax'
|
||||
import { remarkMdDiscordSyntax } from '@edems-dev/remark-discord-syntax'
|
||||
import { remark } from 'remark'
|
||||
|
||||
const file = await remark()
|
||||
|
|
@ -28,7 +28,7 @@ import createMDX from '@next/mdx'
|
|||
|
||||
const withMDX = createMDX({
|
||||
options: {
|
||||
remarkPlugins: ['remark-md-discord-syntax'],
|
||||
remarkPlugins: ['@edems-dev/remark-discord-syntax'],
|
||||
},
|
||||
})
|
||||
|
||||
|
|
@ -40,3 +40,4 @@ export default withMDX({
|
|||
## License
|
||||
|
||||
[GPL-3.0](LICENSE) © Edems-DEV
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "remark-md-discord-syntax",
|
||||
"name": "@edems-dev/remark-discord-syntax",
|
||||
"version": "1.0.0",
|
||||
"description": "Remark plugin for Discord-style spoiler blocks and subtext lines in MDX",
|
||||
"type": "module",
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ try {
|
|||
}
|
||||
|
||||
// Ensure Obsidian plugin details
|
||||
if (manifest.id !== 'md-discord-syntax') {
|
||||
exitWithError(`manifest.json id must be "md-discord-syntax", got "${manifest.id}"`);
|
||||
if (manifest.id !== 'obsidian-discord-syntax') {
|
||||
exitWithError(`manifest.json id must be "obsidian-discord-syntax", got "${manifest.id}"`);
|
||||
}
|
||||
if (manifest.name !== 'Discord Syntax') {
|
||||
exitWithError(`manifest.json name must be "Discord Syntax", got "${manifest.name}"`);
|
||||
|
|
@ -68,6 +68,10 @@ try {
|
|||
exitWithError(`Failed to read/parse packages/obsidian/package.json: ${e.message}`);
|
||||
}
|
||||
|
||||
if (obsidianPkg.name !== 'obsidian-discord-syntax') {
|
||||
exitWithError(`packages/obsidian/package.json name must be "obsidian-discord-syntax", got "${obsidianPkg.name}"`);
|
||||
}
|
||||
|
||||
if (obsidianPkg.version !== manifest.version) {
|
||||
exitWithError(`packages/obsidian/package.json version (${obsidianPkg.version}) does not match manifest.json version (${manifest.version})`);
|
||||
}
|
||||
|
|
@ -99,25 +103,29 @@ try {
|
|||
exitWithError(`Failed to read/parse packages/remark/package.json: ${e.message}`);
|
||||
}
|
||||
|
||||
if (remarkPkg.name !== '@edems-dev/remark-discord-syntax') {
|
||||
exitWithError(`packages/remark/package.json name must be "@edems-dev/remark-discord-syntax", got "${remarkPkg.name}"`);
|
||||
}
|
||||
|
||||
if (remarkPkg.dependencies?.['@md-discord-syntax/core']) {
|
||||
exitWithError(`remark-md-discord-syntax still has reference to old scope "@md-discord-syntax/core"`);
|
||||
exitWithError(`@edems-dev/remark-discord-syntax still has reference to old scope "@md-discord-syntax/core"`);
|
||||
}
|
||||
|
||||
const remarkCoreDep = remarkPkg.dependencies?.['@edems-dev/md-discord-syntax-core'];
|
||||
if (!remarkCoreDep) {
|
||||
exitWithError(`remark-md-discord-syntax is missing dependency on "@edems-dev/md-discord-syntax-core"`);
|
||||
exitWithError(`@edems-dev/remark-discord-syntax is missing dependency on "@edems-dev/md-discord-syntax-core"`);
|
||||
}
|
||||
if (remarkCoreDep.startsWith('file:')) {
|
||||
exitWithError(`remark-md-discord-syntax depends on local file spec for "@edems-dev/md-discord-syntax-core" ("${remarkCoreDep}"). Must use normal semver.`);
|
||||
exitWithError(`@edems-dev/remark-discord-syntax depends on local file spec for "@edems-dev/md-discord-syntax-core" ("${remarkCoreDep}"). Must use normal semver.`);
|
||||
}
|
||||
|
||||
if (obsidianPkg.dependencies?.['@md-discord-syntax/core']) {
|
||||
exitWithError(`md-discord-syntax-obsidian still has reference to old scope "@md-discord-syntax/core"`);
|
||||
exitWithError(`obsidian-discord-syntax still has reference to old scope "@md-discord-syntax/core"`);
|
||||
}
|
||||
|
||||
const obsidianCoreDep = obsidianPkg.dependencies?.['@edems-dev/md-discord-syntax-core'];
|
||||
if (obsidianCoreDep && obsidianCoreDep.startsWith('file:')) {
|
||||
exitWithError(`md-discord-syntax-obsidian depends on local file spec for "@edems-dev/md-discord-syntax-core" ("${obsidianCoreDep}"). Must use normal semver.`);
|
||||
exitWithError(`obsidian-discord-syntax depends on local file spec for "@edems-dev/md-discord-syntax-core" ("${obsidianCoreDep}"). Must use normal semver.`);
|
||||
}
|
||||
|
||||
// Ensure published npm packages (core & remark) configure tarballs & safe prepack
|
||||
|
|
|
|||
Loading…
Reference in a new issue