Skip to content

Commit

Permalink
chore: re enabled specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Nov 1, 2023
1 parent 29857f5 commit 04368cf
Show file tree
Hide file tree
Showing 16 changed files with 1,119 additions and 11,152 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
run: yarn install
- name: Install
run: yarn
- name: Lint
run: yarn run lint
- name: Lint Code
run: yarn run lint:code
- name: Build
run: yarn run build
- name: Markdownlint
run: yarn run markdownlint
#- name: Test
# run: yarn test
- name: Lint Markdown
run: yarn run lint:md
- name: Test
run: yarn test
12 changes: 6 additions & 6 deletions jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ const path = require('path');
module.exports = {
modulePaths: ['<rootDir>/dist'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.test.json',
},
],
},
verbose: true,
setupFiles: [path.join(__dirname, 'jest.helpers.ts')],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.test.json',
},
},
maxWorkers: '1',
testTimeout: 30000,
updateSnapshot: false,
Expand Down
8 changes: 1 addition & 7 deletions jest.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
TypeDocReader,
UrlMapping,
} from 'typedoc';
import { load } from 'typedoc-plugin-markdown';
import { formatContents } from 'typedoc-plugin-markdown/src/utils';

const STUBS_SRC_PATH = path.join(__dirname, 'stub-project', 'src');
Expand All @@ -24,10 +23,6 @@ const STUBS_TSCONFIG_PATH = path.join(
);

global.bootstrap = async (entryPoints: string[] = [], options: any = {}) => {
//const app = new Application();

//app.options.addReader(new TypeDocReader());
//app.options.addReader(new TSConfigReader());
const app = await Application.bootstrapWithPlugins(
{
logLevel: 'None',
Expand All @@ -38,6 +33,7 @@ global.bootstrap = async (entryPoints: string[] = [], options: any = {}) => {
)
: [STUBS_SRC_PATH],
tsconfig: STUBS_TSCONFIG_PATH,
plugin: ['./dist'],
},
[
new ArgumentsReader(0),
Expand All @@ -48,8 +44,6 @@ global.bootstrap = async (entryPoints: string[] = [], options: any = {}) => {
],
);

load(app);

setOptions(app, options);

app.renderer.render = render;
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"private": true,
"workspaces": [
"packages/*",
"examples/*"
"packages/*"
],
"scripts": {
"lint": "lerna run lint",
"build": "lerna run build",
"lint:code": "lerna run lint",
"lint:md": "lerna run lint:md",
"markdownlint": "lerna run markdownlint",
"test": "lerna run test --parallel",
"deploy": "lerna publish from-package",
Expand All @@ -21,12 +21,16 @@
"copyfiles": "^2.4.1",
"eslint": "^8.28.0",
"fs-extra": "^11.1.0",
"glob": "^10.3.10",
"jest": "^29.3.1",
"lerna": "^6.1.0",
"markdownlint": "^0.26.2",
"markdownlint-cli": "^0.32.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.0",
"remark": "^15.0.1",
"remark-mdx": "^3.0.0",
"to-vfile": "^8.0.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typedoc": "^0.25.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-plugin-typedoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"typedoc-plugin-markdown": ">=3.15.0"
},
"devDependencies": {
"typedoc-plugin-markdown": "^3.15.0"
"typedoc-plugin-markdown": "^3.15.0",
"@docusaurus/types": "^3.0.0"
},
"scripts": {
"lint": "eslint ./src --ext .ts",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-typedoc/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ async function generateTypedoc(

const app = await Application.bootstrapWithPlugins(optionsPassedToTypeDoc);

// fix Docusaurus v2 double backslash escape
if (context.siteConfig?.markdown?.format !== 'mdx') {
app.renderer.on(PageEvent.END, (event: PageEvent) => {
event.contents = event.contents?.replace(/\\</g, '<');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ custom_edit_url: null
> Some block quote
<!-- some comments -->
Some text
"
`;
2 changes: 1 addition & 1 deletion packages/typedoc-plugin-markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"lint": "eslint ./src --ext .ts",
"prelint:docs": "yarn run docs:md",
"lint:docs": "yarn run lint:markdown && yarn run lint:mdx",
"lint:md": "yarn run lint:markdown && yarn run lint:mdx",
"lint:markdown": " markdownlint ./docs/md",
"lint:mdx": "node ./lint.mdx.mjs",
"prepublishOnly": "yarn run lint && yarn run build && yarn run test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`Declarations: (Render Type Literal as List) should use correct list sty
| \`valueB\` | \`boolean\` |
| \`valueC\` | {} |
| \`valueD\` | \`string\` |
| \`valueX\` | { \`valueA\`: \`number\`[] ; \`valueZ\`: \`string\` = 'foo' } |
| \`valueX\` | \\{ \`valueA\`: \`number\`[] ; \`valueZ\`: \`string\` = 'foo' } |
| \`valueX.valueA\` | \`number\`[] |
| \`valueX.valueZ\` | \`string\` |
| \`valueY\` | () => \`string\` |
Expand Down Expand Up @@ -51,7 +51,7 @@ console.log("This is a multi line comment with code - line3")
-----
**valueX**: { \`valueA\`: \`number\`[] ; \`valueZ\`: \`string\` = 'foo' }
**valueX**: \\{ \`valueA\`: \`number\`[] ; \`valueZ\`: \`string\` = 'foo' }
Comment for valueX
Expand Down Expand Up @@ -94,11 +94,11 @@ exports[`Declarations: (Render Type Literal as List) should use correct list sty
| :------ | :------ |
| \`valueA?\` | \`number\` |
| \`valueB?\` | \`boolean\` |
| \`valueC\` | { \`[dataId: string]\`: \`\`"ok"\`\` \\| \`\`"ko"\`\`; } |
| \`valueC\` | \\{ \`[dataId: string]\`: \`\`"ok"\`\` \\| \`\`"ko"\`\`; } |
| \`valueD\` | \`unknown\` |
| \`valueX\` | { \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` } |
| \`valueX\` | \\{ \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => \\{ \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` } |
| \`valueX.valueA\` | \`number\`[] |
| \`valueX.valueY\` | (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` } |
| \`valueX.valueY\` | (\`z\`: \`string\`) => \\{ \`a\`: \`string\` ; \`b\`: \`string\` } |
| \`valueX.valueZ\` | \`string\` |
| \`valueY\` | () => \`string\` |
| \`valueZ\` | \`string\` |
Expand All @@ -115,7 +115,7 @@ Comments for valueA
-----
**valueC**: { \`[dataId: string]\`: \`\`"ok"\`\` \\| \`\`"ko"\`\`; }
**valueC**: \\{ \`[dataId: string]\`: \`\`"ok"\`\` \\| \`\`"ko"\`\`; }
\\-
Expand All @@ -137,7 +137,7 @@ console.log("This is a multi line comment with code - line3")
-----
**valueX**: { \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` }
**valueX**: \\{ \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => \\{ \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` }
Comment for valueX
Expand All @@ -149,7 +149,7 @@ Comment for valueX
-----
**valueX.valueY**: (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` }
**valueX.valueY**: (\`z\`: \`string\`) => \\{ \`a\`: \`string\` ; \`b\`: \`string\` }
\\-
Expand Down Expand Up @@ -199,7 +199,7 @@ exports[`Declarations: should compile an undefined declaration 1`] = `
`;
exports[`Declarations: should compile any function type 1`] = `
"Ƭ **AnyFunctionType**<\`A\`\\>: (...\`input\`: \`any\`[]) => \`A\`
"Ƭ **AnyFunctionType**\\<\`A\`\\>: (...\`input\`: \`any\`[]) => \`A\`
#### Type parameters
Expand Down Expand Up @@ -239,7 +239,7 @@ exports[`Declarations: should compile declaration with accessors 1`] = `
| Name | Type |
| :------ | :------ |
| \`get getMe()\` | \`Promise\`<\`string\`\\> |
| \`get getMe()\` | \`Promise\`\\<\`string\`\\> |
| \`set setMe(x:string)\` | \`void\` |
[partial: member.sources]
Expand Down Expand Up @@ -324,7 +324,7 @@ exports[`Declarations: should compile object literal declaration 1`] = `
| \`valueB\` | \`boolean\` | - |
| \`valueC\` | {} | - |
| \`valueD\` | \`string\` | Multiline Comments for valueD Multiline Comments for valueD - line2 **\`Example\`** \`\`\`typescript console.log("This is a multi line comment with code") console.log("This is a multi line comment with code - line2") console.log("This is a multi line comment with code - line3") \`\`\` |
| \`valueX\` | { \`valueA\`: \`number\`[] ; \`valueZ\`: \`string\` = 'foo' } | Comment for valueX |
| \`valueX\` | \\{ \`valueA\`: \`number\`[] ; \`valueZ\`: \`string\` = 'foo' } | Comment for valueX |
| \`valueX.valueA\` | \`number\`[] | - |
| \`valueX.valueZ\` | \`string\` | - |
| \`valueY\` | () => \`string\` | Comment for value Y |
Expand All @@ -343,11 +343,11 @@ exports[`Declarations: should compile type literal declaration 1`] = `
| :------ | :------ | :------ |
| \`valueA?\` | \`number\` | Comments for valueA |
| \`valueB?\` | \`boolean\` | - |
| \`valueC\` | { \`[dataId: string]\`: \`\`"ok"\`\` \\| \`\`"ko"\`\`; } | - |
| \`valueC\` | \\{ \`[dataId: string]\`: \`\`"ok"\`\` \\| \`\`"ko"\`\`; } | - |
| \`valueD\` | \`unknown\` | Multiline Comments for valueD Multiline Comments for valueD - line2 **\`Example\`** \`\`\`typescript console.log("This is a multi line comment with code") console.log("This is a multi line comment with code - line2") console.log("This is a multi line comment with code - line3") \`\`\` |
| \`valueX\` | { \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` } | Comment for valueX |
| \`valueX\` | \\{ \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => \\{ \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` } | Comment for valueX |
| \`valueX.valueA\` | \`number\`[] | - |
| \`valueX.valueY\` | (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` } | - |
| \`valueX.valueY\` | (\`z\`: \`string\`) => \\{ \`a\`: \`string\` ; \`b\`: \`string\` } | - |
| \`valueX.valueZ\` | \`string\` | Nested comment for valueZ |
| \`valueY\` | () => \`string\` | - |
| \`valueZ\` | \`string\` | Comment for valueZ |
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Generics: should compile class with type params 1`] = `
"[helper: breadcrumbs]
# Class: ClassWithTypeParams<T, V\\>
# Class: ClassWithTypeParams\\<T, V\\>
[partial: comment]
Expand All @@ -21,7 +21,7 @@ exports[`Generics: should compile class with type params 1`] = `
`;

exports[`Generics: should compile function with a simple type param' 1`] = `
"▸ **functionWithTypeParam**<\`A\`\\>(): \`boolean\`
"▸ **functionWithTypeParam**\\<\`A\`\\>(): \`boolean\`
##### Type parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ exports[`Index: should compile readme 1`] = `
> Some block quote
<!-- some comments -->
Some text
"
`;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Signatures: should compile a promise that returns an object' 1`] = `
"▸ **promiseReturningAnObject**(): \`Promise\`<{ \`data\`: \`string\` ; \`id\`: \`string\` }\\>
"▸ **promiseReturningAnObject**(): \`Promise\`\\<\\{ \`data\`: \`string\` ; \`id\`: \`string\` }\\>
##### Returns
\`Promise\`<{ \`data\`: \`string\` ; \`id\`: \`string\` }\\>
\`Promise\`\\<\\{ \`data\`: \`string\` ; \`id\`: \`string\` }\\>
"
`;
Expand All @@ -31,7 +31,7 @@ exports[`Signatures: should compile class with constructor' 1`] = `
`;
exports[`Signatures: should compile function that returns a function' 1`] = `
"▸ **functionReturningAFunction**(): <T\\>(\`x\`: \`string\`) => \`boolean\`
"▸ **functionReturningAFunction**(): \\<T\\>(\`x\`: \`string\`) => \`boolean\`
Comments for function
Expand All @@ -41,7 +41,7 @@ Comments for function
Return comments
▸ <\`T\`\\>(\`x\`): \`boolean\`
\\<\`T\`\\>(\`x\`): \`boolean\`
##### Type parameters
Expand Down Expand Up @@ -132,7 +132,7 @@ exports[`Signatures: should compile function with reference type' 1`] = `
| Name | Type |
| :------ | :------ |
| \`descriptor\` | \`TypedPropertyDescriptor\`<\`any\`\\> |
| \`descriptor\` | \`TypedPropertyDescriptor\`\\<\`any\`\\> |
##### Returns
Expand Down Expand Up @@ -213,7 +213,7 @@ exports[`Signatures: should compile signature with a flag' 1`] = `
`;
exports[`Signatures: should compile signature with default values' 1`] = `
"▸ **functionWithDefaults**(\`valueA?\`, \`valueB?\`, \`valueC?\`, \`valueD?\`, \`valueE?\`, \`valueF?\`): \`string\`
"▸ **functionWithDefaults**(\`valueA?\`, \`valueB?\`, \`valueC?\`, \`valueD?\`, \`valueF?\`): \`string\`
This is a function with a parameter that has a default value.
Expand All @@ -225,7 +225,6 @@ This is a function with a parameter that has a default value.
| \`valueB\` | \`number\` | \`100\` | A parameter with a default numeric value. |
| \`valueC\` | \`number\` | \`Number.NaN\` | A parameter with a default NaN value. |
| \`valueD\` | \`boolean\` | \`true\` | A parameter with a default boolean value. |
| \`valueE\` | \`boolean\` | \`null\` | A parameter with a default null value. |
| \`valueF\` | \`string\` | \`'<foo>'\` | - |
##### Returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`Types: should compile 'tuple' type' 1`] = `"[\`string\`, \`number\`]"`;
exports[`Types: should compile 'typeOperator' type ' 1`] = `"unique \`symbol\`"`;

exports[`Types: should compile 'union' of literal declarations 1`] = `
"{ \`bar\`: \`\`" "\`\` \\| \`\`"string"\`\` \\| \`\`"strong|with|pipes"\`\` \\| \`\`"type\`with\`backticks"\`\` \\| \`\`"*"\`\` }
"\\{ \`bar\`: \`\`" "\`\` \\| \`\`"string"\`\` \\| \`\`"strong|with|pipes"\`\` \\| \`\`"type\`with\`backticks"\`\` \\| \`\`"*"\`\` }
"
`;
Expand All @@ -34,14 +34,14 @@ exports[`Types: should compile conditional type ' 1`] = `"\`T\` extends \`string
exports[`Types: should compile expanded 'function' type ' 1`] = `""`;
exports[`Types: should compile expanded 'literal' type' 1`] = `"{ \`valueA?\`: \`number\` ; \`valueB?\`: \`boolean\` ; \`valueX\`: { \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => { \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` } ; \`valueY\`: () => \`string\` ; \`valueZ\`: \`string\` }"`;
exports[`Types: should compile expanded 'literal' type' 1`] = `"\\{ \`valueA?\`: \`number\` ; \`valueB?\`: \`boolean\` ; \`valueX\`: \\{ \`valueA\`: \`number\`[] ; \`valueY\`: (\`z\`: \`string\`) => \\{ \`a\`: \`string\` ; \`b\`: \`string\` } ; \`valueZ\`: \`string\` } ; \`valueY\`: () => \`string\` ; \`valueZ\`: \`string\` }"`;
exports[`Types: should compile expanded 'objectLiteralType' type' 1`] = `"{}"`;
exports[`Types: should compile intrinsic type' 1`] = `"\`string\`"`;
exports[`Types: should compile unionType with object literal type ' 1`] = `"\`string\` \\| { \`z\`: \`string\` }"`;
exports[`Types: should compile unionType with object literal type ' 1`] = `"\`string\` \\| \\{ \`z\`: \`string\` }"`;
exports[`Types: should resolve external refs with type params' 1`] = `"\`ClassWithTypeParams\`<\`HTMLElement\`, \`Error\`\\>"`;
exports[`Types: should resolve external refs with type params' 1`] = `"\`ClassWithTypeParams\`\\<\`HTMLElement\`, \`Error\`\\>"`;
exports[`Types: should resolve external refs' 1`] = `"\`HTMLElement\`"`;
Loading

0 comments on commit 04368cf

Please sign in to comment.