Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages (next) #388

Closed
wants to merge 2 commits into from
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
10 changes: 10 additions & 0 deletions .changeset/polite-planets-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'typedoc-plugin-markdown': major
---

Initial release of next version. In summary includes:

- Removal of handlebars as a dependency.
- MDX2 support as standard (#305, #252).
- Exposes additional output file options (#353, #338, #328, #307).
- Several UI improvements.
8 changes: 6 additions & 2 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"mode": "pre",
"tag": "next",
"initialVersions": {
"typedoc-plugin-markdown": "3.13.4"
"typedoc-plugin-markdown": "3.13.4",
"docusaurus-plugin-typedoc": "0.17.6"
},
"changesets": []
"changesets": [
"polite-planets-knock",
"twenty-moose-promise"
]
}
5 changes: 5 additions & 0 deletions .changeset/twenty-moose-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'docusaurus-plugin-typedoc': major
---

- Compatibility updates for typedoc-plugin-markdown
17 changes: 12 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Release
on: [pull_request]
on:
push:
branches:
- next-release
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
Expand All @@ -8,13 +11,17 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 16
- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 16.x
- name: Install Dependencies
run: yarn
- name: Create Release Pull Request
run: npm install
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
54 changes: 7 additions & 47 deletions package-lock.json

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

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
"private": true,
"workspaces": [
"packages/typedoc-plugin-markdown",
"packages/typedoc-plugin-markdown"
"packages/docusaurus-plugin-typedoc"
],
"scripts": {
"lint": "npm run lint --workspaces",
"build": "npm run build --workspaces",
"test": "npm run test --workspaces"
"test": "npm run test --workspaces",
"prerelease": "npm run build",
"release": "npx changeset publish"
},
"devDependencies": {
"@changesets/cli": "^2.26.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/docusaurus-plugin-typedoc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 1.0.0-next.0

### Major Changes

- Compatibility updates for typedoc-plugin-markdown

### Patch Changes

- Updated peer dependencies
- [email protected]

## [0.17.6](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/[email protected]@0.17.6) (2022-06-27)

**Note:** Version bump only for package docusaurus-plugin-typedoc
Expand Down
7 changes: 2 additions & 5 deletions packages/docusaurus-plugin-typedoc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-plugin-typedoc",
"version": "0.17.6",
"version": "1.0.0-next.0",
"description": "A Docusaurus v2 plugin to build API documentation with TypeDoc.",
"main": "dist/index.js",
"files": [
Expand All @@ -17,10 +17,7 @@
"homepage": "https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/docusaurus-plugin-typedoc",
"peerDependencies": {
"typedoc": ">=0.23.0",
"typedoc-plugin-markdown": ">=3.13.0"
},
"devDependencies": {
"typedoc-plugin-markdown": "^3.13.0"
"typedoc-plugin-markdown": ">=4.0.0-next.0"
},
"scripts": {
"lint": "eslint ./src --ext .ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Plugin: (docs) should render 1`] = `
[
"_category_.yml",
"classes",
"enums",
"functions",
"index.md",
"interfaces",
"Modules.md",
"namespaces",
"variables",
]
`;

exports[`Plugin: (docs) should write category yaml 1`] = `
"label: "Classes"
position: 3"
Expand Down
12 changes: 4 additions & 8 deletions packages/docusaurus-plugin-typedoc/test/specs/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,17 @@ describe(`Plugin:`, () => {
tmpobj = tmp.dirSync();
await bootstrap(tmpobj);
});
test(`should render`, () => {
const files = fs.readdirSync(tmpobj.name + '/docs/api');
expect(files.sort((a, b) => a.localeCompare(b))).toMatchSnapshot();
});

test(`should write doc`, () => {
const sidebar = fs.readFileSync(tmpobj.name + '/docs/api/index.md');
expect(sidebar.toString()).toMatchSnapshot();
const indexDoc = fs.readFileSync(tmpobj.name + '/docs/api/index.md');
expect(indexDoc.toString()).toMatchSnapshot();
});

test(`should write category yaml`, () => {
const sidebar = fs.readFileSync(
const categoryYaml = fs.readFileSync(
tmpobj.name + '/docs/api/classes/_category_.yml',
);
expect(sidebar.toString()).toMatchSnapshot();
expect(categoryYaml.toString()).toMatchSnapshot();
});
});
});
11 changes: 11 additions & 0 deletions packages/typedoc-plugin-markdown/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 4.0.0-next.0

### Major Changes

Initial release of next version. In summary includes:

- Removal of handlebars as a dependency.
- MDX2 support as standard (#305, #252).
- Exposes additional output file options (#353, #338, #328, #307).
- Several UI improvements.

## [3.13.4](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/[email protected]@3.13.4) (2022-07-20)

### Fixes
Expand Down
12 changes: 5 additions & 7 deletions packages/typedoc-plugin-markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ The `--plugin` arg is optional (all plugins are loaded by default), however if u
The following options can be used in addition to relevant [TypeDoc options](https://typedoc.org/guides/options/)
(please note that TypeDoc options specific to the HTML theme will be ignored).

Please read the [documentation](#documentation) for further configuration options.
### File output options

**File output options**
See [File output options](./documentation/file-output-options.md) for further documentation.

- **`--entryDocument`**<br>
The file name of the entry document. Defaults to `README.md`.
Expand All @@ -43,7 +43,7 @@ Please read the [documentation](#documentation) for further configuration option
- **`--fileStructure`**<br>
Specifies how the files should be generated, grouped by modules or symbol types. Expected values [`modules`, `symbols`]. Defaults to `modules`.

**UI options**
### UI options

- **`--hideBreadcrumbs`**<br>
Do not print breadcrumbs header. Defaults to `false`.
Expand All @@ -53,10 +53,8 @@ Please read the [documentation](#documentation) for further configuration option
Do not print the page title. Defaults to `false`.
- **`--hideHierarchy`**<br>
Do not print reflection hierarchy. Defaults to `false`.
- **`--typeDeclarationStyle`**<br>
Specify the render style of type declarations. Expected values [`list`, `table`] Defaults to `list`.

**Utility options**
### Utility options

- **`--namedAnchors`**<br>
Use HTML named anchors tags for implementations that do not assign header ids. Defaults to `false`.
Expand All @@ -65,7 +63,7 @@ Please read the [documentation](#documentation) for further configuration option

## Documentation

- [Output file strategy](./documentation/output-file-strategy.md)
- [File output options](./documentation/file-output-options.md)

## License

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Output file strategy
# File output options

TypeDoc creates documentation according to exports. The modules strucutre will be driven by the implemented an entry point config. https://typedoc.org/guides/options/#entrypointstrategy.

Expand Down Expand Up @@ -41,7 +41,7 @@ _Note when definiting arrays using a json options file is less verbose:_

## Configuring the output directory structure

### Default structure
### Default structure (by symbols)

As per the HTML theme, by default the plugin groups exports in directories following the symbol type producing the following output.

Expand Down
2 changes: 1 addition & 1 deletion packages/typedoc-plugin-markdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typedoc-plugin-markdown",
"version": "3.13.4",
"version": "4.0.0-next.0",
"description": "A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/typedoc-plugin-markdown/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function load(app: Application) {
name: 'fileStructure',
help: '[Markdown Plugin] Specifies how the filesystem should be standard. Hierarchical builds directories as per file system.',
type: ParameterType.String,
defaultValue: 'modules',
defaultValue: 'symbols',
validate: (option) => {
const availableValues = ['modules', 'symbols'];
if (!availableValues.includes(option)) {
Expand Down
4 changes: 2 additions & 2 deletions packages/typedoc-plugin-markdown/src/support/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export function formatContents(contents: string) {

export function escapeChars(str: string) {
return str
.replace(/</g, '\\<')
.replace(/>/g, '\\>')
.replace(/>/g, '\\<')
.replace(/{/g, '\\{')
.replace(/_/g, '\\_')
.replace(/`/g, '\\`')
.replace(/\|/g, '\\|');
Expand Down
Loading