@altano/remark-mdx-toc-with-slugs 2.0.1 → 3.0.1

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Summary
4
4
 
5
- This is a [remark](https://remark.js.org/) plugin that exports a table of contents. It is similar to the [remark-mdx-toc](https://github.com/DCsunset/remark-mdx-toc) plugin but has an additional `slug` property.
5
+ This is a [remark](https://remark.js.org/) plugin that exports a table of contents. It is similar to the [@altano/remark-mdx-toc](https://www.npmjs.com/package/@altano/remark-mdx-toc) plugin but has an additional `slug` property.
6
6
 
7
7
  Given this mdx:
8
8
 
@@ -58,5 +58,5 @@ export const toc = [
58
58
 
59
59
  ## Misc
60
60
 
61
- - If you don't need the slug, consider using [remark-mdx-toc](https://github.com/DCsunset/remark-mdx-toc).
61
+ - If you don't need the slug, consider using [@altano/remark-mdx-toc](https://www.npmjs.com/package/@altano/remark-mdx-toc).
62
62
  - Slugs are generated using [`github-slugger`](https://www.npmjs.com/package/github-slugger) and should therefore match the [`rehype-slug`](https://www.npmjs.com/package/rehype-slug) package
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RemarkMdxTocOptions, TocEntry } from "remark-mdx-toc";
1
+ import type { RemarkMdxTocOptions, TocEntry } from "@altano/remark-mdx-toc";
2
2
  import type { Plugin } from "unified";
3
3
  export type TableOfContentsEntry = TocEntry & {
4
4
  slug: string;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { generate } from "astring";
2
2
  import { valueToEstree } from "estree-util-value-to-estree";
3
3
  import { EXIT, visit as estreeVisit } from "estree-util-visit";
4
4
  import GithubSlugger from "github-slugger";
5
- import { remarkMdxToc } from "remark-mdx-toc";
5
+ import remarkMdxToc from "@altano/remark-mdx-toc";
6
6
  import { visit } from "unist-util-visit";
7
7
  function sluggifyTocEntries(entries, headingSlugger = new GithubSlugger()) {
8
8
  return entries.map((entry) => sluggifyTocEntry(entry, headingSlugger));
@@ -21,9 +21,6 @@ function assertMdxjsEsmNode(node) {
21
21
  }
22
22
  const remarkMdxTocWithSlugs = function(options = {}) {
23
23
  const mdxTocTransformer = remarkMdxToc.call(this, options);
24
- if (mdxTocTransformer == null) {
25
- throw new Error(`Couldn't create mdxTocTransformer function`);
26
- }
27
24
  const name = options.name ?? "toc";
28
25
  return function mdxTocWithSlugsTransformer(ast, ...args) {
29
26
  const result = mdxTocTransformer(ast, ...args);
package/package.json CHANGED
@@ -1,53 +1,59 @@
1
1
  {
2
2
  "name": "@altano/remark-mdx-toc-with-slugs",
3
- "version": "2.0.1",
3
+ "version": "3.0.1",
4
4
  "description": "A remark plugin to generate a table of contents (including slugs) and convert it into MDX export",
5
- "type": "module",
6
- "sideEffects": false,
7
- "exports": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "author": {
10
- "name": "Alan Norbauer",
11
- "email": "altano@gmail.com",
12
- "url": "https://alan.norbauer.com"
13
- },
14
- "license": "ISC",
5
+ "keywords": [
6
+ "mdx",
7
+ "remark",
8
+ "toc",
9
+ "slug",
10
+ "remark-plugin"
11
+ ],
12
+ "homepage": "https://github.com/altano/npm-packages/tree/main/packages/remark-mdx-toc-with-slugs",
15
13
  "repository": {
16
14
  "type": "git",
17
15
  "url": "https://github.com/altano/npm-packages",
18
16
  "directory": "packages/remark-mdx-toc-with-slugs"
19
17
  },
20
- "homepage": "https://github.com/altano/npm-packages/tree/main/packages/remark-mdx-toc-with-slugs",
18
+ "license": "ISC",
19
+ "author": {
20
+ "name": "Alan Norbauer",
21
+ "email": "altano@gmail.com",
22
+ "url": "https://alan.norbauer.com"
23
+ },
24
+ "sideEffects": false,
25
+ "type": "module",
26
+ "exports": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
21
28
  "files": [
22
29
  "dist/**/*.js",
23
30
  "dist/**/*.d.ts"
24
31
  ],
25
- "keywords": [
26
- "remark",
27
- "remark-plugin",
28
- "mdx"
29
- ],
30
32
  "dependencies": {
31
- "astring": "^1.8.6",
32
- "estree-util-value-to-estree": "^3.0.1",
33
+ "astring": "^1.9.0",
34
+ "estree-util-value-to-estree": "^3.1.2",
33
35
  "estree-util-visit": "^2.0.0",
34
36
  "github-slugger": "^2.0.0",
35
37
  "mdast-util-mdxjs-esm": "^2.0.1",
36
- "remark-mdx-toc": "^0.3.1",
37
- "unified": "^10.1.2",
38
- "unist-util-visit": "^5.0.0"
38
+ "unified": "^11.0.5",
39
+ "unist-util-visit": "^5.0.0",
40
+ "@altano/remark-mdx-toc": "0.0.2"
39
41
  },
40
42
  "devDependencies": {
41
- "@types/node": "^20.11.25",
43
+ "@arethetypeswrong/cli": "^0.15.4",
44
+ "@types/node": "^22.13.10",
42
45
  "@types/unist": "^3.0.2",
43
- "@vitest/coverage-v8": "^1.4.0",
44
- "prettier": "^3.2.5",
45
- "typescript": "^5.4.2",
46
- "vite": "^5.2.8",
47
- "vitest": "^1.4.0",
46
+ "@vitest/coverage-v8": "^3.0.9",
47
+ "depcheck": "^1.4.7",
48
+ "prettier": "^3.3.3",
49
+ "typescript": "^5.8.2",
50
+ "vite": "^6.2.3",
51
+ "vitest": "^3.0.9",
52
+ "@altano/build-config": "0.0.0",
48
53
  "@altano/remark-plugin-test-util": "0.0.0",
54
+ "@altano/testing": "0.0.0",
49
55
  "@altano/tsconfig": "0.0.0",
50
- "@altano/vitest-plugins": "0.1.1"
56
+ "@altano/vitest-plugins": "1.0.0"
51
57
  },
52
58
  "publishConfig": {
53
59
  "access": "public"
@@ -55,16 +61,18 @@
55
61
  "scripts": {
56
62
  "build": "tsup --config build-config/tsup.config.node.ts",
57
63
  "build:types": "tsc --project tsconfig.declarations.json",
64
+ "check:exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
65
+ "check:types:src": "tsc --noEmit",
66
+ "check:types:test": "tsc --noEmit --project ./tests/tsconfig.json",
67
+ "check:unused-dependencies": "depcheck",
58
68
  "clean": "rm -rf .turbo && rm -rf .tsbuildinfo && rm -rf node_modules && rm -rf dist",
59
69
  "dev": "pnpm run build --watch",
60
70
  "format": "prettier --check src",
61
71
  "format:fix": "prettier --write src",
62
- "lint": "eslint package.json src/**/*.ts*",
72
+ "lint": "eslint",
63
73
  "lint:fix": "TIMING=1 pnpm lint --fix",
64
74
  "lint:timing": "TIMING=1 pnpm lint",
65
75
  "test:unit": "vitest --run",
66
- "test:unit:watch": "vitest",
67
- "typecheck:src": "tsc --noEmit",
68
- "typecheck:test": "tsc --noEmit --project ./tests/tsconfig.json"
76
+ "test:unit:watch": "vitest"
69
77
  }
70
78
  }