Commit graph

37 commits

Author SHA1 Message Date
Armano
15107ee099
refactor(v2): correct client types and type aliases (#4451) 2021-03-19 11:32:38 +01:00
Sam Zhou
5e73c72f26
chore(v2): Fix linter warnings (#4442)
* chore(v2): Fix linter warnings

223 warnings to 145 warnings

* Remove explicit type annotations

* Do not prefetch when targetLink == null
2021-03-17 17:28:42 +01:00
Alexey Pyltsyn
f8fda885fc
chore(v2): prepare v2.0.0.alpha-72 release (#4440)
* chore(v2): prepare v2.0.0.alpha-72 release

* v2.0.0-alpha.72
2021-03-16 14:30:54 +03:00
Armano
f51f21965c
refactor(v2): add ExecutionEnvironment, BrowserOnly, isInternalUrl to known type aliases (#4387) 2021-03-12 16:00:33 +01:00
Sébastien Lorber
986de6b214
chore(v2): prepare v2.0.0.alpha-71 release (#4376)
* prepare release

* v2.0.0-alpha.71
2021-03-09 18:45:05 +01:00
Sébastien Lorber
1734975f2f
feat(v2): Add Interpolate / interpolate APIs + complete theme translations (#4295)
* WIP: refactor team profile cards

* Add Interpolate / interpolate APIs

* Add interpolate snapshot test

* comments

* fix Interpolate TS types

* Interpolate should handle numbers and other JS types

* translate BlogPostItem

* interpolate translate() fn + add translations for blog post tag header

* localize the LastUpdated component

* translate DocVersionSuggestions

* fix test

* add some new translations

* Add node script to easily update the theme default translations

* fix translation extractor bug due to translate() dynamic values

* use ICU placeholder syntax

* refactor month key

* order

* team  page translation improvements

* Add interpolation doc + improve i18n doc
2021-02-26 13:19:51 +01:00
Alexey Pyltsyn
0ac34b75c5
feat(v2): add support for RTL direction (#4140)
* feat(v2): add support for RTL

* Move to i18n config

* Move direction to localeConfigs

* Create RTL styles for Docusaurus styles (via new hook)

* update infima to alpha 19

* fix minor type error

* Fix build

* Cleanup

* polish RTL support

* polish RTL support

* revert english rtl dir

* minor RTL fix

* minor doc updates

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-02-10 10:52:26 +01:00
Reece Dunham
0252d01ebb
docs(v2): Add READMEs to v2 packages (#4034)
* docs(v2): Add READMEs to v2 packages

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Update packages/docusaurus-remark-plugin-npm2yarn/package.json

* Update packages/docusaurus/README.md

* Update packages/docusaurus-plugin-sitemap/README.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-01-14 17:16:26 +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
Sébastien Lorber
aff656182c
feat(v2): Add localeDropdown navbar item type + i18n localeConfigs field (#3916)
* Add localeDropdown navbar item type

* fix type + add localeConfigs test
2020-12-14 18:28:39 +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
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
3ab7336875
fix(v2): restore prefetch functionality (#3723)
* fix(v2): attempt to restore prefetch functionality

* chore(v2): downgrade babel-plugin-dynamic-import-node to 2.3.0

* Get needed routes chunk names

* refactor prefetching logic to make it easier to understand

* array.flat() => flatten(array)

* fix flatten() typo

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-11-16 19:52:26 +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
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
Orta Therox
33ecc4bb17
chore(v2): tighten up the TypeScript onboarding (#3244)
* Tighten up the TypeScript onboarding

* Extend the API to cover everything used in the classic theme

* Wrap up internal TS support
2020-08-17 18:03:21 +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
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
15e73daae7
feat(v2): global data + useGlobalData + docs versions dropdown (#2971)
* doc components initial simplification

* doc components initial simplification

* add docContext test

* Add poc of global data system + use it in the theme

* Revert "doc components initial simplification"

This reverts commit f657b4c4

* revert useless changes

* avoid loosing context on docs switch

* fix docs tests

* fix @generated/globalData ts declaration / es import

* typo

* revert bad commit

* refactor navbar in multiple parts + add navbar item types validation + try to fix remaining merge bugs

* add missing watch mode for plugin debug

* fix docs global data integration, move related hooks to docs plugin + convert to TS

* change versions link label

* fix activeClassName react warning

* improve docs global data system + contextual navbar dropdown

* fix bug preventing the deployment

* refactor the global data system to namespace automatically by plugin name + plugin id

* proper NavbarItem comp

* fix tests

* fix snapshot

* extract theme config schema in separate file + rename navbar links to navbar items

* minor typos

* polish docs components/api

* polish useDocs api surface

* fix the docs version suggestions comp + data

* refactors + add docsClientUtils unit tests

* Add documentation

* typo

* Add check for duplicate plugin ids detection

* multi-instance: createData plugin data should be namespaced by plugin instance id

* remove attempt for multi-instance support
2020-07-21 11:16:08 +02:00
Sébastien Lorber
1272ab83fb
feat(v2): useDocusaurusContext().siteMetadata (#3058) 2020-07-16 12:46:21 +02:00
Sam Zhou
3ebe245b55
feat(v2): Collect plugin versions to allow them to be inspected in debug plugin (#3050) 2020-07-13 15:46:48 +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
slorber
16ba6e54b6 v2.0.0-alpha.58 2020-06-18 14:02:26 +02:00
Alexey Pyltsyn
d8ebe8b2e4 v2.0.0-alpha.56 2020-05-27 20:18:28 +03:00
Alexey Pyltsyn
d94a549cfb v2.0.0-alpha.55 2020-05-19 13:55:03 +03:00
Alexey Pyltsyn
753d117025 v2.0.0-alpha.54 2020-04-28 09:49:27 +03:00
Sam Zhou
94b712d4fd
fix(v2): Add all webpack module aliases to type declaration file (#2687) 2020-04-28 09:28:02 +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
Sam Zhou
61c917fd8f
refactor(v2): Expose docusaurus module type aliases to end-users (#2608) 2020-04-22 20:33:03 +08:00