Commit graph

242 commits

Author SHA1 Message Date
Alexey Pyltsyn
2fb766ba7c
fix(v2): ignore style imports in excerpt (#3944) 2020-12-21 14:47:19 +01:00
Sébastien Lorber
3fc29f4b14
chore(v2): prepare v2.0.0.alpha-70 release (#3933)
* add alpha 70 changes

* v2.0.0-alpha.70
2020-12-17 20:08:20 +01:00
Bartosz Kaszubowski
ad31facb32
chore(v2): fix several lint warnings, add missing types, cleanup (#3844)
* fix several lint warnings, add missing types, cleanup

* fix EnumChangefreq issue

* better utilization of EnumChangefreq type

* update test snapshot
2020-11-30 16:42:58 +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
Alexey Pyltsyn
d25a54f61d
chore(v2): prepare v2.0.0.alpha-69 release (#3808)
* chore(v2): prepare v2.0.0.alpha-69 release

* v2.0.0-alpha.69
2020-11-24 13:51:15 +03:00
Bartosz Kaszubowski
d9ed20ebcf
chore: match fs-events version across the workspace (#3795) 2020-11-21 18:49:48 +03:00
Sébastien Lorber
d1e51f7e3b
chore(v2): prepare v2.0.0.alpha-68 release (#3779)
* changelog

* add alpha 68 docs

* add missing publishConfig

* update publish doc + v1 private package system

* add version files

* v2.0.0-alpha.68
2020-11-18 20:02:06 +01:00
Alexey Pyltsyn
8ef7c24583
fix(v2): use swizzled SearchPage component if any (#3721)
* fix(v2): use swizzled SearchPage component if any

* Fix dependency cycles warning
2020-11-12 17:01:46 +01:00
Alexey Pyltsyn
f2d1330207
fix(v2): ignore export declarations in excerpt (#3703) 2020-11-06 17:49:59 +01:00
iAmir
8f2d898f22
feat(v2): onBrokenMarkdownLinks config (#3658)
* refactor(v2): move `reportMessage` from `core/src/server/utils` to `utils` package

* feat(v2): handle broken markdown links by using onBrokenLinks prop from siteconfig

* feat(v2): add a new site config prop called `onBrokenMarkdownLinks`

works like onBrokenLinks, but only for markdown links

* feat(v2): add `onBrokenMarkdownLinks` to API docs

* some changes regarding test issues after adding `onBrokenMarkdownLink`

* Update website/versioned_docs/version-2.0.0-alpha.66/api/docusaurus.config.js.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-10-31 18:04:56 +01:00
Rhys Arkins
6930e91508
fix: add repository metadata to all packages (#3613)
* fix: add repository metadata to all packages

* empty commit for cla bot

* move validate-package-json.test.ts + add glob devDependency

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-10-21 15:05:01 +02:00
Sébastien Lorber
14447707c2
chore(v2): prepare v2.0.0.alpha-66 release (#3608)
* release alpha 66

* v2.0.0-alpha.66
2020-10-19 19:44:26 +02:00
Alexey Pyltsyn
f5f2064656
chore(v2): prepare v2.0.0.alpha-65 release (#3525)
* chore(v2): prepare v2.0.0.alpha-65 release

* v2.0.0-alpha.65
2020-10-02 17:09:16 +03:00
Rémi Doreau
c8d48052b5
fix(v2): normalizeUrl edge cases (#3427)
* fix(utils): cover normalizeUrl edge cases

* fix(utils): normalizeUrl new edge cases
2020-09-29 17:09:26 +02:00
Sébastien Lorber
9bf4dfb275
chore(v2): prepare v2.0.0.alpha-64 release (#3440)
* add 2.0.0 alpha 64 files

* v2.0.0-alpha.64
2020-09-11 20:35:05 +02:00
Sébastien Lorber
8af3ad4250
chore(v2): prepare v2.0.0.alpha-63 release (#3400)
* add alpha 63 + remove +3month old versions

* update publish guide

* v2.0.0-alpha.63
2020-09-03 18:52:03 +02:00
Sébastien Lorber
4f448bd54b
chore(v2): prepare v2.0.0.alpha-62 release (#3359)
* Add alpha 62

* v2.0.0-alpha.62
2020-08-28 19:17:56 +02:00
Sébastien Lorber
a4c8a7f55b
refactor(v2): docs plugin refactor (#3245)
* safe refactorings

* safe refactors

* add code to read versions more generically

* refactor docs plugin

* refactors

* stable docs refactor

* progress on refactor

* stable docs refactor

* stable docs refactor

* stable docs refactor

* attempt to fix admonition :(

* configureWebpack docs: better typing

* more refactors

* rename cli

* refactor docs metadata processing => move to pure function

* stable docs refactor

* stable docs refactor

* named exports

* basic sidebars refactor

* add getElementsAround utils

* refactor sidebar + ordering/navigation logic

* stable retrocompatible refactor

* add proper versions metadata tests

* fix docs metadata tests

* fix docs tests

* fix test due to absolute path

* fix webpack tests

* refactor linkify + add broken markdown links warning

* fix DOM warning due to forwarding legacy prop to div element

* add todo
2020-08-17 17:50:22 +02:00
Sébastien Lorber
dd3f3f1093
fix(v2): doc path special char (space or other) should lead to a valid slug (#3262)
* doc path special char (space or other) should lead to a valid slug

* doc path special char (space or other) should lead to a valid slug

* improve doc bad slug message
2020-08-11 17:20:51 +02:00
Sébastien Lorber
48b996773c
chore(v2): prepare v2.0.0.alpha-61 release (#3182)
* alpha 61 release

* doc prettier

* v2.0.0-alpha.61
2020-08-01 15:24:46 +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
1083454dbd
chore(v2): prepare v2.0.0.alpha-60 release (#3154)
* alpha 60

* v2.0.0-alpha.60

* update publish guide
2020-07-29 17:45:54 +02:00
Sébastien Lorber
0eb9c207cf
chore(v2): v2.0.0.alpha-59 release (#3114)
* alpha 59 release preparation

* v2.0.0-alpha.59
2020-07-24 16:22:51 +02:00
Sébastien Lorber
f4434b2e42
feat(v2): absolute slugs and slug resolution system (#3084)
* rework slug to allow absolute slugs and slug resolution

* add slug metadata tests

* refactor docs metadata test + fix slug bugs

* fix tests

* fix docs tests failing due to randomness + update snapshot

* add test for addLeadingSlash
2020-07-21 18:26:30 +02:00
Sébastien Lorber
9265de982b
chore(v2): refactor scripts + add theme-classic watchmode (#2998) 2020-07-01 18:30:44 +02:00
Sébastien Lorber
cf97662eef
fix(v2): refactor routes.ts + add route hash for chunkNames key (#3001)
* add simpleHash util

* refactor/split the routes generation logic + add route hash to avoid chunk conflicts

* minor fixes + fix tests

* fix comment typo
2020-06-30 11:52:39 +02:00
Teik Jun
2e055f4ae2
fix(v2): make client-redirect-plugin not baseUrl sensitive (#3010)
* feat(v2): use relative routes path in postBuild hook

* feat(v2): use relativeRoutesPath in other methods and modify tests

* fix(v2): fix D2 client redirects and tests

* feat(v2): add tests for relativeRoutesPaths

* fix(v2): fix some typos in configValidation

* fix(v2): fix an eslint warning and restart github action

* refactor(v2): create a removePrefix method

* refactor(v2): inline unnecessary method
2020-06-29 18:38:28 +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
Sam Zhou
6e43c9bd34
chore(v2): Fix more eslint errors (#2976) 2020-06-21 15:09:00 +08:00
Sam Zhou
3611c96f90
chore(v2): Fix a lot of eslint warnings (#2972) 2020-06-20 12:30:18 +08:00
slorber
16ba6e54b6 v2.0.0-alpha.58 2020-06-18 14:02:26 +02:00
Sébastien Lorber
b5d7c3a111
misc(v2): better dx: yarn clear, yarn watch, yarn serve (#2922)
* add clear + serve scripts

* add ability to launch all TS projects in --watch mode

* attempt to create a watch plugin

* use rimraf for clear script

* update watch plugin poc

* add start:v2:watch

* remove the watch plugin
2020-06-16 20:40:46 +08:00
Sébastien Lorber
68a1bb1ebf
Merge pull request #2793 from slorber/feature/client-side-redirects
feat(v2): docusaurus-plugin-client-redirects
2020-06-10 17:36:57 +02:00
slorber
6b507630e3 migrate useful helper functions to docusaurus-utils 2020-06-10 17:22:41 +02:00
Sébastien Lorber
1003a15d1f
polish(v2): improve Docusaurus 1 to 2 migration developer experience (#2884)
* improve markdown parsing errors by adding file path to error

* typo commit

* Add default nav item position to right (as v1)

* improve error when sidebar references unexisting document

* parseMarkdownFile: improve errors by providing hint about using "" to avoid parsing errors, if using special characters

* improve subcategory migration error for Unknown sidebar item type

* improve unrecognizedFields error

* typo

* fix inline snapshots

* improve the migration docs

* improve the migration docs

* improve migration doc

* Update migrating-from-v1-to-v2.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-06-06 11:16:50 +08:00
slorber
da8ccd0419 add isValidPathname 2020-06-03 15:40:10 +02:00
Alexey Pyltsyn
1b2744570b
fix(v2): strip images and footnotes for excerpt correctly (#2855) 2020-06-01 18:36:02 +08:00
Alexey Pyltsyn
d8ebe8b2e4 v2.0.0-alpha.56 2020-05-27 20:18:28 +03:00
Sam Zhou
33b60c6ba4
fix(v2): Consistently use 10.15.1 as the minimum required node version (#2819) 2020-05-27 23:18:48 +08:00
Alexey Pyltsyn
d94a549cfb v2.0.0-alpha.55 2020-05-19 13:55:03 +03:00
Alexey Pyltsyn
da0f865831
fix(v2): remove Markdown syntax from excerpt (#2701)
* fix(v2): remove Markdown syntax from excerpt

* Update snapshots

* Use Remark

* Switch to own solution
2020-05-18 19:57:03 +08:00
Alexey Pyltsyn
16dd08a690
refactor(v2): make semicolon optional in imports for excerpt (#2696) 2020-04-30 01:05:29 +08:00
Alexey Pyltsyn
753d117025 v2.0.0-alpha.54 2020-04-28 09:49:27 +03:00
Alexey Pyltsyn
d90fdb04d5 v2.0.0-alpha.53 2020-04-27 16:38:33 +03:00
Alexey Pyltsyn
7359945f52 v2.0.0-alpha.52 2020-04-27 16:30:15 +03:00
Alexey Pyltsyn
c9c5aedcb5 v2.0.0-alpha.51 2020-04-27 14:44:56 +03:00
Yangshun Tay
7d792840ba misc: prettier 2020-04-22 20:39:11 +08:00
Alexey Pyltsyn
84fa4be865
fix(v2): ignore import declarations in excerpt (#2380)
* fix(v2): ignore import declarations in excerpt

* Update index.ts

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-04-22 20:28:14 +08:00
Alexey Pyltsyn
1f00d15c74 chore(v2): fix code style (revert previous changes) 2020-04-05 17:38:12 +03:00
Alexey Pyltsyn
6965a668cd chore(v2): fix code style 2020-04-05 17:30:59 +03:00