Skip to content

Commit

Permalink
feat: updated TypeDoc to 0.27
Browse files Browse the repository at this point in the history
The update implies that this module is now ESM only, as nweer versions of TypeDoc promote this. This
involved making changes to the plugins used by theme, the build process, and also updat some
elements to match the newer contents of the default theme. Additionally, the dependency on
gobstones-scripts have been removed, to avoid a circular dependency that complicates the deployment
process. Overall this are the changes:
* Removed the dependency on gobstones-scripts
* Updated the peer dependency of TypeDoc to 0.27.7
* Changed the build process from using tsc only to use rollup
* Updated the output module to be ESM only
* Updated the package-scripts to run on local deffinitions only
* Added the license header locally so it can be used without scripts
* Update the theme components to match the latest version of the default theme
* Updated some CSS styles so that:
    - Now inherited members are shown with an arrow
    - internal, private and protected members are shown with different colors on the listings
* Updated some JS of the theme such that:
    - Now the theme's JS runs after the default theme has completed updating the navbar
    - Fix an issue where the current page is not selected on the left sidebar on some scenarios

BREAKING CHANGE: The peer dependency has ben updated to TypeDoc 0.27.7, so you should update your
typedoc version or this version of the theme will not work.
  • Loading branch information
alanrodas committed Feb 14, 2025
1 parent 632e01b commit 2ded450
Show file tree
Hide file tree
Showing 71 changed files with 2,763 additions and 1,423 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A clear and concise description of what you expected to happen.

## Versions

- Library Version:
- Node/NPM Version (if any):
- Operating System Version:
- Browser Version:
- Library Version:
- Node/NPM Version (if any):
- Operating System Version:
- Browser Version:
16 changes: 8 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ merged into the project.

Before opening a pull request, please ensure:

- [ ] You have followed our [**guidelines**](https://gobstones.github.io/gobstones-guidelines/)
- [ ] Double-check your branch is based on `main` and targets `main`
- [ ] Pull request has tests (we are going for 100% coverage!)
- [ ] Code is well-commented, linted and follows project conventions
- [ ] Documentation is updated (if necessary)
- [ ] Internal code generators and templates are updated (if necessary)
- [ ] Description explains the issue/use-case resolved and auto-closes related
issues
- [ ] You have followed our [**guidelines**](https://gobstones.github.io/gobstones-guidelines/)
- [ ] Double-check your branch is based on `main` and targets `main`
- [ ] Pull request has tests (we are going for 100% coverage!)
- [ ] Code is well-commented, linted and follows project conventions
- [ ] Documentation is updated (if necessary)
- [ ] Internal code generators and templates are updated (if necessary)
- [ ] Description explains the issue/use-case resolved and auto-closes related
issues

Be kind to code reviewers, please try to keep pull requests as small and focused
as possible.
Expand Down
3 changes: 0 additions & 3 deletions .npmrc

This file was deleted.

37 changes: 34 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,43 @@
## 0.4.0 (2025-02-14)

- feat: updated TypeDoc to 0.27 ([10651b9](https://github.com/gobstones/typedoc-theme-gobstones/commit/10651b9))

### BREAKING CHANGE

- The peer dependency has ben updated to TypeDoc 0.27.7, so you should update your
typedoc version or this version of the theme will not work.

## 0.4.0 (2025-02-14)

- feat: updated TypeDoc to 0.27 ([9eaa1ce](https://github.com/gobstones/typedoc-theme-gobstones/commit/9eaa1ce))

### BREAKING CHANGE

- The peer dependency has ben updated to TypeDoc 0.27.7, so you should update your
typedoc version or this version of the theme will not work.

## 0.4.0 (2025-02-14)

- feat: updated TypeDoc to 0.27 ([e4894f2](https://github.com/gobstones/typedoc-theme-gobstones/commit/e4894f2))

### BREAKING CHANGE

- The peer dependency has ben updated to TypeDoc 0.27.7, so you should update your
typedoc version or this version of the theme will not work.

## 0.4.0 (2025-02-12)

## <small>0.4.5 (2025-02-12)</small>

## <small>0.3.1 (2024-09-05)</small>

- fix: privateRemarks should span multiple paragraphs ([032c993](https://github.com/gobstones/typedoc-theme-gobstones/commit/032c993))
- build: updated gobstones-scripts to 0.9.2 ([42a28e0](https://github.com/gobstones/typedoc-theme-gobstones/commit/42a28e0))
- fix: privateRemarks should span multiple paragraphs ([032c993](https://github.com/gobstones/typedoc-theme-gobstones/commit/032c993))
- build: updated gobstones-scripts to 0.9.2 ([42a28e0](https://github.com/gobstones/typedoc-theme-gobstones/commit/42a28e0))

## 0.3.0 (2024-09-04)

## <small>0.2.1 (2024-08-09)</small>

- feat: make theme work with default plugins and configuration ([87d03be](https://github.com/gobstones/typedoc-theme-gobstones/commit/87d03be))
- feat: make theme work with default plugins and configuration ([87d03be](https://github.com/gobstones/typedoc-theme-gobstones/commit/87d03be))

## 0.2.0 (2024-08-08)
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
This a customized theme for [TypeDoc](https://typedoc.org/) used for all the generated documentation throughout the **GobstonesWeb2** project.
It's based on the default theme used by TypeDoc, with mild improvements in readability and styling, and includes by default several plugins built-in so the user does not require to include them in their configuration. Included plugins are:

- [typedoc-plugin-mdn-links](https://github.com/Gerrit0/typedoc-plugin-mdn-links)
- [typedoc-plugin-merge-modules](https://github.com/krisztianb/typedoc-plugin-merge-modules)
- [typedoc-plugin-remove-references](https://github.com/eyworldwide/typedoc-plugin-remove-references)
- [typedoc-plugin-missing-exports](https://github.com/Gerrit0/typedoc-plugin-missing-exports) (With modifications)
- [typedoc-plugin-mdn-links](https://github.com/Gerrit0/typedoc-plugin-mdn-links)
- [typedoc-plugin-merge-modules](https://github.com/krisztianb/typedoc-plugin-merge-modules)
- [typedoc-plugin-remove-references](https://github.com/eyworldwide/typedoc-plugin-remove-references)
- [typedoc-plugin-missing-exports](https://github.com/Gerrit0/typedoc-plugin-missing-exports) (With modifications)

[![Licence](https://img.shields.io/badge/AGPL--3.0_with_additional_terms-olivegreen?style=plastic&label=License&logo=open-source-initiative&logoColor=white&color=olivegreen)](https://github.com/gobstones/typedoc-theme-gobstones/blob/main/LICENSE) [![Version](https://img.shields.io/github/package-json/v/gobstones/typedoc-theme-gobstones?style=plastic&label=Version&logo=git-lfs&logoColor=white&color=crimson)](https://www.npmjs.com/package/@gobstones/typedoc-theme-gobstones)

Expand Down
37 changes: 37 additions & 0 deletions license.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const { config } = require('@gobstones/gobstones-scripts');

config.init();
const licenseHeader = config.projectType.licenseHeader.toolingFiles.main;

module.exports = {
license: `${licenseHeader}`,
// Configuration works by exclusion, which is weird
ignore: [
// Exclude docs and tests
'docs/',
'test/',
// Exclude every file in project-types for gobstones-scripts
// Except the typescript files in their src folders.
'project-types/**/src/**/!(*.ts|*.tsx)',
// Exclude the tests in the project-types for gobstones-scripts
'project-types/**/test/**/*',
// Every file in dist is excluded except the javascript and typescript files.
'dist/**/!(*.d.ts|*.js|*.cjs|*.mjs)',
// Every file in project, except the typescript files.
'**/!(*.ts|*.tsx)'
],
defaultFormat: {
prepend: '/*',
append: '*/'
},
licenseFormats: {
'ts|tsx|js|jsx': {
prepend: '/*',
append: ' */',
eachLine: {
prepend: ' * '
}
}
},
trailingWhitespace: 'TRIM'
};
9 changes: 1 addition & 8 deletions license.config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
{
"license": "./LICENSE_HEADER",
"ignore": [
"docs/",
"test/",
"project-types/**/src/**/!(*.ts|*.tsx)",
"project-types/**/test/**/*",
"dist/**/!(*.d.ts|*.js|*.cjs|*.mjs)",
"**/!(*.ts|*.tsx)"
],
"ignore": ["docs/", "test/", "dist/**/!(*.d.ts|*.js|*.cjs|*.mjs)", "**/!(*.ts|*.tsx)"],
"defaultFormat": {
"prepend": "/*",
"append": "*/"
Expand Down
149 changes: 149 additions & 0 deletions package-scripts.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
const tasks = {
nps: (command) => {
return `nps -c ./package-scripts.cjs ${command}`;
},
serially: (...scripts) => {
return scripts.join(' && ');
},
concurrently: (scripts) => {
const keys = Object.keys(scripts);
const values = keys.map((k) => `"${scripts[k]}"`);
const defaultColors = [
'bgBlue.bold',
'bgMagenta.bold',
'bgGreen.bold',
'bgBlack.bold',
'bgCyan.bold',
'bgRed.bold',
'bgWhite.bold',
'bgYellow.bold'
];

return (
'concurrently --kill-others-on-fail ' +
`--prefix-colors ${defaultColors.slice(0, keys.length).join(',')} ` +
`--prefix "[{name}]" --names ${keys.join(',')} ` +
values.join(' ')
);
}
};

const defaultConfiguration = {
options: {
scripts: false,
logLevel: 'warn',
'help-style': 'basic'
},

scripts: {
default: {
script: tasks.nps('help'),
hiddenFromHelp: true
},

dev: {
script: tasks.serially('tsc --noEmit', 'tsx ./src/index.tsx'),
description: 'Run "index.ts" in development mode',
watch: {
script: 'tsx ./src/index.ts --watch ./src/**/*.ts',
description: 'Run "index.ts" in development mode and watch for changes'
}
},

build: {
script: tasks.serially(
tasks.nps('clean.dist'),
'rollup -c rollup.config.mjs',
'npx cpy-cli ./static ../../dist --cwd=src'
),
description: 'Build the application into "dist" folder'
},

test: {
script: tasks.serially(tasks.nps('lint'), 'echo "no tests to run"'),
description: 'Run the tests, including linting'
},

doc: {
script: tasks.serially(tasks.nps('clean.docs'), tasks.nps('build'), 'typedoc'),
description: 'Run Typedoc and generate docs',
watch: {
script: tasks.serially(tasks.nps('doc'), 'typedoc --watch'),
description: 'Run Typedoc and generate docs and watch for changes.'
},
serve: {
script: tasks.serially(tasks.nps('doc'), 'typedoc', 'serve ./docs'),
description: 'Run Typedoc and generate docs, then serve the docs as HTML',
watch: {
script: tasks.serially(
tasks.nps('doc'),
tasks.concurrently({
typedoc: 'typedoc --watch',
serve: 'serve ./docs'
})
),
description: 'Run Typedoc and generate docs and watch for changes while serving the docs as HTML'
}
}
},

clean: {
script: tasks.serially(tasks.nps('clean.dist'), tasks.nps('clean.docs')),
description: 'Remove all automatically generated files and folders',
hiddenFromHelp: true,
dist: {
script: 'rimraf ./dist',
description: 'Delete the dist folder',
hiddenFromHelp: true
},
docs: {
script: 'rimraf ./docs',
description: 'Delete the docs folder',
hiddenFromHelp: true
}
},

lint: {
script: 'eslint --format stylish --color',
description: 'Run ESLint on all the files (src and tests)',
fix: {
script: 'eslint --format stylish --color --fix',
description: 'Run ESLint on all the files (src and tests) with --fix option'
}
},

prettify: {
script: tasks.serially(
'prettier --no-error-on-unmatched-pattern --write ./.husky/*[^_]',
'prettier --no-error-on-unmatched-pattern --write ./{.github,.vscode,src,test}/{**,.}/*.{js,jsx,cjs,mjs,ts,tsx,mts,cts,yml,md,json,js}',
'prettier --no-error-on-unmatched-pattern --write {.czrc,.editorconfig,.gitignore,.npmignore,.npmrc,.prettierrc}',
'prettier --no-error-on-unmatched-pattern --write ./*.{js,jsx,cjs,mjs,ts,tsx,mts,cts,yml,md,json,js}'
),
description: 'Run Prettier on all the files, writing the results'
},

changelog: {
script: 'conventional-changelog -p angular -i CHANGELOG.md -s',
hiddenFromHelp: true,
description: 'Generate changelog based on tags',
scratch: {
script: 'conventional-changelog -p angular -i CHANGELOG.md -s -r 0',
description: 'Generate changelog based on tags, starting from scratch',
hiddenFromHelp: true
}
},

license: {
script: tasks.serially(tasks.nps('build'), 'license-check-and-add add -f ./license.config.json '),
hiddenFromHelp: true,
description: 'Add license information to all code files in the project',
remove: {
script: tasks.serially(tasks.nps('build'), 'license-check-and-add remove -f ./license.config.json'),
hiddenFromHelp: true,
description: 'Remove license information to all code files in the project'
}
}
}
};

module.exports = defaultConfiguration;
Loading

0 comments on commit 2ded450

Please sign in to comment.