Skip to content
Closed
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
7 changes: 6 additions & 1 deletion generate-md.mjs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems wrong. Why you're changing this?

Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Application } from 'typedoc';
import webpack from './webpack/package.json' with { type: 'json' };
import { major } from 'semver';

import fs from 'fs';

const webpack = JSON.parse(
fs.readFileSync(new URL('./webpack/package.json', import.meta.url))
);

const app = await Application.bootstrapWithPlugins({
entryPoints: ['./webpack/types.d.ts'],
out: `pages/v${major(webpack.version)}.x`,
Expand Down
27 changes: 13 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pages/v5.x/globals.md
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change.

Original file line number Diff line number Diff line change
Expand Up @@ -6649,6 +6649,7 @@ Specify options for each parser.
* `filename` {string}
* `hash` {string}
* `hashWithLength` {object}
* `local` {string}
* `module` {Module|ModulePathData}
* `noChunkHash` {boolean}
* `prepareId` {object}
Expand Down
9 changes: 3 additions & 6 deletions pages/v5.x/index.md
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change.

Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,15 @@ or are automatically applied via regex from your webpack configuration.
| Name | Status | Install Size | Description |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------: | :--------------: | :-------------------------------------------------------------------------------------- |
| <a href="https://github.com/webpack-contrib/html-loader"><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/html5/html5-original.svg"></a> | ![html-npm] | ![html-size] | Exports HTML as string, requires references to static resources |
| <a href="https://github.com/pugjs/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug-npm] | ![pug-size] | Loads Pug templates and returns a function |
| <a href="https://github.com/webdiscus/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug3-npm] | ![pug3-size] | Compiles Pug to a function or HTML string, useful for use with Vue, React, Angular |
| <a href="https://github.com/webdiscus/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug-npm] | ![pug-size] | Compiles Pug to a function or HTML string, useful for use with Vue, React, Angular |
| <a href="https://github.com/peerigon/markdown-loader"><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/markdown/markdown-original.svg"></a> | ![md-npm] | ![md-size] | Compiles Markdown to HTML |
| <a href="https://github.com/posthtml/posthtml-loader"><img width="48" height="48" src="https://posthtml.github.io/posthtml/logo.svg"></a> | ![posthtml-npm] | ![posthtml-size] | Loads and transforms a HTML file using [PostHTML](https://github.com/posthtml/posthtml) |
| <a href="https://github.com/pcardune/handlebars-loader"><img width="48" height="48" src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/handlebars/handlebars-original.svg"></a> | ![hbs-npm] | ![hbs-size] | Compiles Handlebars to HTML |

[html-npm]: https://img.shields.io/npm/v/html-loader.svg
[html-size]: https://packagephobia.com/badge?p=html-loader
[pug-npm]: https://img.shields.io/npm/v/pug-loader.svg
[pug-size]: https://packagephobia.com/badge?p=pug-loader
[pug3-npm]: https://img.shields.io/npm/v/@webdiscus/pug-loader.svg
[pug3-size]: https://packagephobia.com/badge?p=@webdiscus/pug-loader
[pug-npm]: https://img.shields.io/npm/v/@webdiscus/pug-loader.svg
[pug-size]: https://packagephobia.com/badge?p=@webdiscus/pug-loader
[jade-npm]: https://img.shields.io/npm/v/jade-loader.svg
[jade-size]: https://packagephobia.com/badge?p=jade-loader
[md-npm]: https://img.shields.io/npm/v/markdown-loader.svg
Expand Down
1 change: 1 addition & 0 deletions pages/v5.x/type-map.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change.

Original file line number Diff line number Diff line change
Expand Up @@ -3461,6 +3461,7 @@
"PathData.filename": "globals.md#filename",
"PathData.hash": "globals.md#hash",
"PathData.hashWithLength": "globals.md#hashwithlength",
"PathData.local": "globals.md#local",
"PathData.module": "globals.md#module",
"PathData.noChunkHash": "globals.md#nochunkhash",
"PathData.prepareId": "globals.md#prepareid",
Expand Down
20 changes: 14 additions & 6 deletions plugins/processor.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Converter, ReflectionKind, Renderer } from 'typedoc';
import { writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { writeFileSync, mkdirSync } from 'node:fs';
import { join, dirname } from 'node:path';

/**
* @param {import('typedoc-plugin-markdown').MarkdownApplication} app
Expand All @@ -12,6 +12,7 @@ export function load(app) {
.getReflectionsByKind(ReflectionKind.Accessor)
.forEach(accessor => {
accessor.kind = ReflectionKind.Property;

if (accessor.getSignature) {
accessor.type = accessor.getSignature.type;
accessor.comment = accessor.getSignature.comment;
Expand Down Expand Up @@ -45,9 +46,16 @@ export function load(app) {
])
);

writeFileSync(
join(app.options.getValue('out'), 'type-map.json'),
JSON.stringify(typeMap, null, 2)
);
const outputPath = join(app.options.getValue('out'), 'type-map.json');

try {
// Ensure directory exists
mkdirSync(dirname(outputPath), { recursive: true });

// Write file safely
writeFileSync(outputPath, JSON.stringify(typeMap, null, 2));
} catch (err) {
console.error('Failed to write type-map.json:', err);
}
});
}