Commit graph

68 commits

Author SHA1 Message Date
Sébastien Lorber
3782244ce7
feat(core): Add bundler tracing/profiling (#11006)
* Add rspack tracing/profiling

* Add CLI start PerfLogger

* cleanup BundlerCPUProfilerPlugin
2025-03-19 12:14:06 +01:00
Sébastien Lorber
776b3ee8c2
fix(core): fix i18n sites SSG memory leak - require.cache (#10599) 2024-10-22 12:40:57 +02:00
Sébastien Lorber
97bd815d9a
refactor(core): improve handling of server bundle (#10429) 2024-08-21 17:34:18 +02:00
Sébastien Lorber
7e817a42ac
chore: use Crowdin CLI --language option to filter languages to download (#8820) 2023-03-24 15:10:16 +01:00
Sébastien Lorber
79360c6ae6
docs: publish 2.0.0 release blog post + adapt website for the launch (#7863) 2022-08-01 07:51:03 +02:00
pincman
f224d3c669
docs: add pincman site to showcase (#7718)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-07-06 18:38:10 +02:00
Joshua Chen
80585e7d7e
misc: share .vscode/extensions.json (#7663) 2022-06-23 11:50:47 +08:00
Joshua Chen
b31220032b
refactor(theme-classic): migrate to tsc for build (#7447)
* refactor(theme-classic): migrate to tsc for build

* fix
2022-05-18 20:08:09 +08:00
Joshua Chen
afc72480ab
refactor(eslint-plugin): migrate to TS-ESLint infrastructure (#7276)
* refactor(eslint-plugin): migrate to TS-ESLint infrastructure

* fix lock
2022-04-30 17:57:57 +08:00
Joshua Chen
39b66d82ef
feat(core): rework swizzle CLI (#6243)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2022-02-25 14:13:15 +01:00
Joshua Chen
f6ff6474bc
feat(website): new plugin to load CHANGELOG and render as blog (#6414)
* feat(website): new plugin to load CHANGELOG and render as blog

* use CJS

* move footer links

* better design

* fixes

* correctly order posts

* add authors

* Add axios

* Update styles

* oops

* oops

* add expand button

* back to index page link

* fix styles

* add feed options

* fix

* fix

* Add fallback

* fix

* fixes
2022-01-27 23:17:31 +08:00
Joshua Chen
14bec7cf11
feat(stylelint-copyright): autofix, stricter config (#6374)
* feat(stylelint-copyright): autofix, stricter config

* revert TS

* oops
2022-01-16 11:34:10 +08:00
Joshua Chen
68c970175a
refactor: migrate lqip-loader to TS, fix typing for Webpack Loaders (#5779) 2021-10-27 16:38:11 +02:00
Sébastien Lorber
f6ec757aa0
feat: npm init docusaurus, yarn create docusaurus (#5635)
* initial create-docusaurus impl

* cleanup

* @docusaurus/init renamed to create-docusaurus

* 0.0.6

* update lockfile

* fix lint

* remove npm2yarn for "npm init" because npm2yarn doesn't convert it and yarn result fails to execute

* prettier

* add correct version

* prettier

* prettier

* prettier

* prettier

* fix annoying --config .prettierrc issue
2021-10-07 16:06:42 +02:00
Joshua Chen
493225a3c6
feat(plugin-blog): multi-authors support + authors.yml global configuration (#5396)
* Complete function

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* A lot of blank lines

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More lenient validation

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove or

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Simpler logic

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Expand docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Better docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Dogfood

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More writeup

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Polish

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Polish

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move mergeAuthorMap to authors.ts

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Unbreak relative assets

* Update docs

* Clarify in docs

* simplify feed authors

* rename authorMap -> authorsMap

* mergeAuthorsMap -> getBlogPostAuthors

* website => 5 blog posts per page

* improve authors map file

* Extract new theme authors components + display in row

* add comment for meta array syntaxes

* blog => getPathsToWatch should watch authorsMap file

* remove useless v1 blog FBID frontmatter

* keep older frontmatter syntax for now

* revert blog frontmatter

* Better console message

* better blog authors frontmatter impl

* add multi authors to beta blog post + fix some authors margins

* fix React key

* Refactor: mdx loader should support a more flexible assets system (poc, not documented yet)

* better display of blog post authors: adapt layout to authors count + add line clamp

* smaller local image

* fix blog feed tests

* fix blog frontmatter tests + improve validation schema

* add more frontmatter tests

* add tests for getAuthorsMapFilePath

* tests for validateAuthorsMapFile

* add tests for readAuthorsMapFile

* test getAuthorsMap

* exhaustive tests for getBlogPostAuthors

* fix remaining tests

* missing blog plugin author tests

* fix windows tests

* improve blog multi-author's doc

* Use new format in init template

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Improve error message

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* update feed snapshot

* blog authors: limit to 2 cols + fix margins for no authors

* minor doc improvements

* better init template blog posts, demonstrating Blog features

* replace the legacy blog author frontmatter in remaining places

* Prefer using clsx

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* cleanup getColClassName

* remove blog author name/title line-clamping

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-26 12:21:58 +02:00
Sébastien Lorber
b835aecaec
chore: removal of Docusaurus v1 code from master (it is now available on docusaurus-v1 branch) (#4902) 2021-06-10 10:54:07 +02:00
Sébastien Lorber
3422f80a9a
chore: simplify CI setup (#4447)
* improve ci

* improve ci

* use actions/setup-node@v2 everywhere

* run pwd for test

* debug gh action

* debug glob CI issue?

* Separate v1/v2 tests due to shell conflict

* cleanup

* test v1 change

* circleci fix

* fix test docusaurus v1 paths

* Refactor CI script names and use paths to filter  actions from running unnecessary

* fix lighthouse url

* v1 tests runInBand

* try to fix v1 tests race conditions

* change rootDir for v1 tests

* minor CI improvements
2021-03-18 17:40:28 +01:00
Bartosz Kaszubowski
9ad02ca466
chore(v1): add missing generated files from v1 to ignores (#3872) 2020-12-03 18:13:44 +01:00
Bartosz Kaszubowski
f37987f32f
chore(v2): fix ignore paths and Prettier commands in themes (#3865)
* chore(v2): fix Prettier ignore paths and commands in themes

* chore(ci): do not ignore v1 lib, remove old .gitignore

* chore(ci): apply tweaks also to eslint ignore
2020-12-03 11:50:03 +01:00
Bartosz Kaszubowski
3e101f86b7
chore(ci): CI scripts cleanup, add Node 14 runs, bump checkout action (#3849)
* chore(ci): CI scripts cleanup, add Node 14 and 15 runs, bump checkout action

* chore(ci): attempt to fix Yarn v2 install

* chore(ci): another attempt to fix Yarn v2 install

* use local yarn-deduplicate

* move yarn config steps earlier

* remove localhost registry config

* revert changes, temporary remove lock update from postinstall

* revert to use Yarn v2 only for website build

* revert back localhost registry

* missing flag

* is it node 15 to blame?

* not running yarn v2 on workspace so lock update can be reverted
2020-12-01 16:22:03 +01:00
Sébastien Lorber
3166fab307
feat(v2): core v2 i18n support + Docusaurus site Crowdin integration (#3325)
* docs i18n initial poc

* docs i18n initial poc

* docs i18n initial poc

* docs i18n initial poc

* crowdin-v2 attempt

* fix source

* use crowdin env variable

* try to install crowdin on netlify

* try to install crowdin on netlify

* try to use crowdin jar directly

* try to curl the crowdin jar

* add java version cmd

* try to run crowdin jar in netlify

* fix translatedDocsDirPath

* fix loadContext issue due to site baseUrl not being modified in generted config file

* real validateLocalesFile

* add locale option to deploy command

* better LocalizationFile type

* create util getPluginI18nPath

* better core localization context loading code

* More explicit VersionMetadata type for localized docs folders

* Ability to translate blog posts with Crowdin!

* blog: refactor markdown loader + report broken links + try to get linkify working better

* upgrade crowdin config to upload all docs folder files except source code related files

* try to support translated pages

* make markdown pages translation work

* add write-translations cli command template

* fix site not  reloaded with correct options

* refactor a bit the read/write of @generated/i18n.json file

* Add <Translate> + translate() API + use it on the docusaurus homepage

* watch locale translation dir

* early POC of adding babel parsing for translation extraction

* fs.stat => pathExists

* add install:fast script

* TSC: noUnusedLocals false as it's already checked  by eslint

* POC of extracting translations from source code

* minor typo

* fix extracted key to code

* initial docs extracted translations

* stable plugin translations POC

* add crowdin commands

* quickfix for i18n deployment

* POC  of themeConfig translation

* add ability to have localized site without path prefix

* sidebar typo

* refactor translation system to output multiple translation files

* translate properly  the docs plugin

* improve theme classic translation

* rework translation extractor to handle new Chrome I18n JSON format (include id/description)

* writeTranslations: allow to pass locales cli arg

* fix ThemeConfig TS issues

* fix localizePath errors

* temporary add write-translations to netlify deploy preview

* complete example of french translated folder

* update fr folder

* remove all translations from repo

* minor translation  refactors

* fix all docs-related tests

* fix blog feed tests

* fix last blog tests

* refactor i18n context a bit, extract codeTranslations in an extra generated file

* improve @generated/i18n type

* fix some i18n todos

* minor refactor

* fix logo typing issue after merge

* move i18n.json to siteConfig instead

* try to fix windows CI build

* fix config test

* attempt to fix windows non-posix path

* increase v1 minify css jest timeout due to flaky test

* proper support for localizePath on windows

* remove non-functional install:fast

* docs, fix docsDirPathLocalized

* fix Docs i18n / md linkify issues

* ensure theme-classic swizzling will use "nextjs" sources (transpiled less aggressively, to make them human readable)

* fix some snapshots

* improve themeConfig translation code

* refactor a bit getPluginI18nPath

* readTranslationFileContent => ensure files are valid, fail fast

* fix versions tests

* add extractSourceCodeAstTranslations comments/resource links

* ignore eslint: packages/docusaurus-theme-classic/lib-next/

* fix windows CI with cross-env

* crowdin ignore .DS_Store

* improve writeTranslations + add exhaustive tests for translations.ts

* remove typo

* Wire currentLocale to algolia search

* improve i18n locale error

* Add tests for translationsExtractor.ts

* better code translation extraction regarding statically evaluable code

* fix typo

* fix typo

* improve theme-classic transpilation

* refactor  +  add i18n tests

* typo

* test new utils

* add missing snapshots

* fix snapshot

* blog onBrokenMarkdownLink

* add sidebars tests

* theme-classic index should now use ES modules

* tests for theme-classic translations

* useless comment

* add more translation tests

* simplify/cleanup writeTranslations

* try to fix Netlify fr deployment

* blog: test translated md is used during feed generation

* blog: better i18n tests regarding editUrl + md translation application

* more i18n tests for docs plugin

* more i18n tests for docs plugin

* Add tests for pages i18n

* polish docusaurus build i18n logs
2020-11-26 12:16:46 +01:00
Sébastien Lorber
abcd8cefd6
feat(v2): @docusaurus/theme-common (#3775)
* create base @docusaurus/theme-common package + fix Webpack client export aliases issue shadowing other theme-common package

* Move theme-classic/src/utils code to new @docusaurus/theme-common package

* add prettierignore

* fix bad test location for getDocusaurusAliases()
2020-11-18 16:00:51 +01:00
Sébastien Lorber
e6704733e4
fix(v1): v1 deploy preview should be available (#3517)
* v1 deploy preview

* Add /v1-migrated deployment
2020-10-02 14:58:06 +02:00
Sébastien Lorber
f343450e85
feat(v2): migrate bootstrap components to ts (#3496)
* feat(v2): Migrate bootstrap theme to typescript

* chore(v2): Add eslint rule to avoid delete import of modules

* chore(v2): Add lib to gitignore

* chore(v2): Add prettier script

* chore(v2): change hooks to ts

* fix(v2): Fix Navbar and Layout problems

* fix(v2): scroll

* fix(v2): navbar metadata

* refactor(v2): improve css styles

* chore(v2): Restore debug layout

* feat(v2): Remove console.log

Co-authored-by: fanny <fanny.vieira@ccc.ufcg.edu.br>
2020-09-29 13:16:39 +02:00
Sébastien Lorber
5359d61d9e
fix(v2): allow using classic theme/preset without the docs plugin (#3382)
* deprecated nextVersionLabel option

* useActivePlugin failfast option

* remove deprecated option nextVersionLabel

* routeBasePath: '' should be forbidden

* routeBasePath: '' should be forbidden

* Docs: do not show version badge if there is only 1 version: https://github.com/facebook/docusaurus/issues/3362

* allow sidebars file to not exist: fallback to empty sidebars
https://githu.com/facebook/docusaurus/issues/3366

* Ability to use classic theme/preset while not using docs/pages without trouble.
https://github.com/facebook/docusaurus/issues/3360

* fix netlify redirects

* do not throw if useDocs do not load?

* netlify deploy typo

* try to fix useDocs

* docs(v2): update Deploy to Vercel guide (#3344)

* filter annoying useDocs conditional require warning

* netlify deploy preview homepage

* typo

* try to trigger again CLA bot

Co-authored-by: Sam Ko <sam@vercel.com>
2020-09-01 19:38:11 +02:00
Sébastien Lorber
7cceee7e38
feat(v2): markdown pages (#3158)
* markdown pages POC

* add remark admonition, mdx provider, yarn2npm...

* pluginContentPages md/mdx tests

* pluginContentPages md/mdx tests

* add relative file path test link to showcase link problem

* fix Markdown pages issues after merge

* fix broken links found in markdown pages

* fix tests

* factorize common validation in @docusaurus/utils-validation

* add some documentation

* add using plugins doc

* minor md pages fixes
2020-07-31 16:04:56 +02:00
Sébastien Lorber
a0ef8939a1
chore(v2): ability to test the migration cli easily (#3113)
* ability to test the migration cli easily

* add node scripts to help test migration cli (locally + CI)

* add test for frontmatter quotify

* more tests for shouldQuotifyFrontMatter

* typo

* updated yarn lock
2020-07-24 15:07:24 +02:00
Anshul Goyal
a78f703366
feat(v2): v1-v2 migration cli automate migration from v1 to v2 (#3015)
* add poc for migration tool

* fix version

* fix path

* fix some type error

* fix type errors

* fix commad

* delete package.lock.json

* ignore lib folder in eslint

* ignore lib in prettier

* fix missing version

* fix sidebar in next

* use primaey color

* fix navbar link

* fix footer

* sanatize front-matter for gray-matter

* add e2e test

* fixworkflow

* add unit test

* chore(v2): fix eslint error

* refactor(v2): use descriptive variable names

* refactor(v2): refactor createProjectStructure

* refactor(v2): refactor migrateDocusaurusProject

* refactor(v2): fix eslint errors

* fix(v2): fix mistake

* use path.join

* remove console.log

* try automate migrating md file to mdx

* fix types not found

* fix types

* remove unused fixture

* use package.json for version

* add support for pages

* add support

* sanitize fortmatter only in case of special character

* chore(v2): add color to dependencies

* feat(v2): initialize config with range of color and add logs

* chore(v2): add glob dependency

* fix(v2): fix color generation

* fix(v2): fix type issue

* feat(v2): add all unknown fields to customFields

* fix(v2): fix css mistake

* fix lerna

* fix(v2): fix github actions

* feat(v2): add option flag for migrating pages

* fix special character

* remove depulicate build

* fix test

* remove unwanted file

* fix frontmatter

* remove unused file

* rerun the test

* fix links

* feat(v2): filter out more fields from customFields

* feat(v2): filter out deprecated fields from customFields

* fix items

* fix types

* merge master

* revert docs

* fix doc

* fix broken link

* fix test

* test

* fix ci

* fix ci

* fix ci

* fix ci

* fix frontmatter

* log custom fields

Co-authored-by: teikjun <teikjunhci@gmail.com>
2020-07-24 12:52:16 +02:00
Sébastien Lorber
811c7ae4e9
fix(v2): fix recent baseurl issues (#3093)
* try to fix the baseUrl related issues

* fix some newly detected broken links

* fix baseurl and broken link issues

* try to configure netlify to use baseUrl deployment

* add proper netlify settings?

* add proper netlify settings?

* add proper netlify settings?

* test commit

* try to fix the redirects

* cleanup working conf

* minor redirect fix
2020-07-22 19:55:40 +02:00
Sam Zhou
5ccd24cc1f
feat(v2): Support swizzling TypeScript components (#2671)
* feat(v2): Support swizzling TypeScript components

* Add tsc --noEmit to tsc script in theme-classic

Now everything can pass the type checker! (although still a lot of any)

* Add tsconfig and types.d.ts to website

Improve developer experience.

As an example, I converted NotFound to tsx

* Apply type annotation suggestions

* Do not fallback to `getThemePath` if getTypeScriptThemePath is undefined

* Fix tsc

* Add module declaration for @theme-original/*

* Move babel cli to root package.json
2020-06-25 16:07:30 +02:00
Sébastien Lorber
9301d0c861
doc(v2): publish doc update after alpha.58 release (#2960)
* doc(v2): publish doc update after alpha.58 release

* typo

* publish doc update

* Update publish.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-06-19 12:59:08 +08:00
Sam Zhou
6e37d3fb12
feat(v2): Implement proof-of-concept Docusaurus Debug Dashboard (#2928)
* feat(v2): Implement proof-of-concept Docusaurus Debug Dashboard

* Ensure we show the exact boolean
2020-06-14 15:30:04 +08:00
Sébastien Lorber
768ed7368b
Merge branch 'master' into feature/client-side-redirects 2020-05-28 16:11:58 +02:00
Sébastien Lorber
6462e1c4da
chore: ignore /coverage folder (#2821) 2020-05-28 00:38:36 +08:00
slorber
fd47ca1925 feat(v2): docusaurus-plugin-client-redirects 2020-05-22 20:15:16 +02:00
Sébastien Lorber
79a3f35de6
chore(v2): ignore JetBrains editor .iml files (#2433) 2020-03-22 01:34:06 +08:00
Dongwoo Gim
104733914a refactor(v2): convert @docusaurus/plugin-ideal-image to TypeScript (#2011)
* refactor @docusaurus/plugin-ideal-image
refactor @docusaurus/plugin-ideal-image

* Update react-ideal-image.d.ts

* Update types.ts

* Update IdealImage.tsx

* Update package.json
2019-11-30 16:09:26 -08:00
Endi
58751b4e1a chore(v2): add lerna-changelog (#1952) 2019-11-09 00:58:56 +08:00
Pawel Kadluczka
c23f981f67 refactor(v2): Convert sitemap plugin to TypeScript (#1894)
* Convert sitemap plugin to TypeScript

Test - enabled the sitemap plugin in the v2 website and verified that
the sitemap is created after running `docusaurus build`.

* Addressing review comments
2019-10-27 14:44:53 +07:00
Yangshun Tay
54e9e025d8 misc(v2): remove legacy from docs 2019-10-10 19:45:50 -07:00
Yangshun Tay
c4cc7f881b
refactor(v2): add typing for pages plugin (#1813)
* refactor(v2): add typing for pages plugin

* misc: new lines
2019-10-07 22:35:58 -07:00
Endi
1591128cdd
refactor(v2): add typing for docs plugin (#1811)
* refactor(v2): add typing for docs plugin

* nits
2019-10-07 18:28:33 +07:00
Dongwoo Gim
78159f6dd5 refactor(v2): convert @docusaurus/plugin-content-blog to TypeScript (#1785)
* convert `@docusaurus/plugin-content-blog` to typescript

remove divided plugin
convert `@docusaurus/plugin-content-blog` to typescript
convert `@docusaurus/plugin-content-blog` to typescript
convert `@docusaurus/plugin-content-blog` to typescript
add `packages/docusaurus-plugin-content-blog/lib` to ignores
linted
refactoring type definition
fix test fails
lint

* lint
2019-09-16 23:46:57 +08:00
Endi
d61cc01217
feat(v2): @docusaurus/init package (#1655)
* feat(v2): separate v2 docusaurus/init package

* nits

* docs

* rm unwanted

* readme
2019-07-14 01:06:23 +07:00
Endi
305e698e6e refactor(v2): migrate core to Typescript ❄️🌀🐋 (#1494)
* refactor(v2): add typing for docusaurus/core

* wip: last working

* refactor(v2): add typing for @docusaurus/core

* prettier

* dont run in parallel otherwise some are uncompiled

* nits

* more typing

* more typing

* nits

* type commands

* nits
2019-05-20 09:59:04 -07:00
Endi
cbd2a589e3 refactor(v2): migrate to Typescript ❄️🌀🐋 (#1490)
* refactor(v2): migrate to typescript

* scripts nits

* fix test

* nits

* nits

* tsconfig tweak
2019-05-18 11:37:35 -07:00
Endi
56cd3a22ce
chore(v2): rm flowtype (#1444) 2019-05-09 18:32:56 +07:00
Endi
c2ebde997a
refactor(v2): add flowtype + refactor test (#1443)
* chore(v2): add flow setup

* nits

* fix

* add flow-typed

* ignore compiled library

* fix error

* fix typing

* fix module name mapper

* setup for @docusaurus/core

* dont try remove type without @flow

* fix can't find @docusaurus/utils

* fix test

* remove obscure relative paths

* more refactoring

* add typing for server/load/theme.js

* no need to ship .flow source
2019-05-08 23:03:52 +07:00
Endilie Yacop Sucipto
94a4ef55c0 feat(v2): add cache-loader by default especially on babel-loader (#1335) 2019-04-03 12:02:53 -07:00
Yangshun Tay
211e04f409 refactor(v2): shift generated files out of core into website dir 2019-02-24 15:20:58 -08:00