Commit graph

52 commits

Author SHA1 Message Date
Sébastien Lorber
5a59378e11
chore: vendor MDX deps for Jest and the MDX 2 upgrade (#8515) 2023-01-06 12:08:15 +01: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
3666a2ede5
refactor: remove a lot of implicit anys (#7468) 2022-05-23 15:40:53 +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
6b53d4263d
misc: make copyUntypedFiles work for watch mode (#7445) 2022-05-18 19:18:32 +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
19942f990a
chore: migrate Jest and website to SWC (#6944)
* chore: migrate Jest and website to SWC

* ignore template
2022-03-19 20:56:30 +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
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
4fad1ce0cd
misc: convert all internal scripts to ESM (#6286)
* misc: convert all internal scripts to ESM

* fixes

* fix

* fixes

* fix!

* complete eslint

* more move

* fix!

* This looks better?

* Final ones
2022-01-08 12:59:28 +08:00
Armano
4578b8b4c4
fix(website): resize showcase images, tighten CI check (#6043)
* fix(website): resize images to width 640

* revert changes first...

* resize images

* final changes

* Add to CI

* refactor tests

* Fix script

* fix script

* Final fixes

* Oops

* relax

* fix

* crop

* Optimize

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-01-07 14:03:43 +08:00
Armano
85fcd9eb0f
refactor(plugin-pwa): migrate package to TS (#5941) 2021-11-16 20:38:14 +01:00
Armano
425144afc7
refactor(theme-search-algolia): migrate package to TS (#5935) 2021-11-16 20:35:09 +01:00
Joshua Chen
e0127c66be
chore(website): enable eslint in website (#5889)
* chore: enable eslint in website

* Fixes

* prettier users
2021-11-06 19:04:45 +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
28e25992ab
feat: new init template classic-typescript (#5233)
* Add typescript template

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

* Update template

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

* Complete CLI

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

* Remove d.ts file

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

* Refactor

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

* Revert lock file changes

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

* Regenerate lock

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

* Add stylelint ignore

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

* Fix tsconfig

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

* Attempt to use symlink

* More symlinks

* Link all markdown

* Link source files

* Change to relative links

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

* Fix blogs

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

* Fix link

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

* Link config

* Documentation

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

* Add option to index

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

* Add option

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

* Fix copying

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

* Provide suffix

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

* Always have colored output

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

* Remove return signature

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

* Update generate examples

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

* Update lock

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

* Fix tsconfig

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

* Use latest docusaurus

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

* Update lock

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

* Add type def

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

* init: make classic first in list + mark as recommended + minor refactors

* remove types.d.ts

* add "yarn typecheck" script

* Minor tweaks

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

* Generate example for TS

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

* Fix

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

* Add comment

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

* No emit when running tsc

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

* FIx generate examples

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

* Remove compiler options

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

* This looks better

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

* Use new tsconfig

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

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-06 19:11:36 +02:00
Joshua Chen
462b1cf2bc
style(v2): reduce number of ESLint warnings (#4993)
* Initial work

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

* More fixes

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

* Update packages/docusaurus-theme-classic/src/theme/ThemedImage/index.tsx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>

* Update packages/docusaurus-theme-bootstrap/src/theme/ThemedImage/index.tsx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>

* Fix

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

* Replace versionPathPart with function

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

* Prefer non-null assertions

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

* Substitute for-of with forEach

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

* Fill `catch` block with placeholder comment

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

* Ignore local require

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

* Revert global require change

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

* Tighten eslint disable range

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

* Make eslint ignore examples and more tolerating to templates

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

* Use reduce to handle doc items sequentially

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

* Revert "Use reduce to handle doc items sequentially"

This reverts commit c7525d463b.

* Address change requests

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

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-06-24 18:12:48 +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
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
7d0b451783
chore: add Yarn v2 cache directory to ignores (#3860) 2020-12-01 18:46:21 +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
sammychinedu2ky
bb33f54ba8
feat(v2): official CodeSandbox support (#3717)
* feat:added support for codesandbox

* added sandbox config file

* feat:added script to generate template for codesandbox

* added examples:generate script to package.json file

* added failing path to eslintignore

* added script to eslintignore

* added cleaning feature to script

* deleted sandbox script in root

* changed comment in codesandboxscript file

* update codesandboxscript.js + revert bad package.json changes

* eslint should check codesandboxscript

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-11-16 16:20:16 +01: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
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
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
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
72884a0c1a
chore(v2): fix eslint TS setup (#2949)
* update eslint parser

* fix yarn lint script

* lint-staged, lint ts files

* fix TS eslint configuration + fix some lint errors (https://github.com/facebook/docusaurus/pull/2949)

* eslint root + separate linting in 2 scripts

* test commit

* test commit

* test commit

* fix /// TS directive
2020-06-18 17:37:48 +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
Endi
8a948102c3
fix(v2): fix plugin-ideal-image breaking website (exports not defined) (#2074)
* fix(v2): fix plugin-ideal-image breaking website (exports not defined)

* nits

* add npm ignore

* lint
2019-12-01 21:59:02 +07: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
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
Zach Badgett
0813920349 refactor: refactor code tab split (#1369)
* refactor: refactor code tab split

* Add split tab unit test

* Fix code tab list bug
2019-05-01 20:57:13 -07:00
Yangshun Tay
1edbeecbe5 chore(v2): add ESLint rule to check for Facebook copyright headers in JS files (#1301) 2019-03-24 14:50:26 +07:00
Endilie Yacop Sucipto
1f91d19a8c
chore: move to monorepo (#1297)
* chore: move to monorepo

* lint all js file

* simplify circleCI

* fix failing tests

* fix tests due to folder rename

* fix test since v1 website is renamed
2019-03-23 14:21:36 +07:00
Yangshun Tay
f2927a9fc4
Move Docusaurus 1 files into directory (#966)
* Move Docusaurus 1 into v1 directory

* Update Circle CI commands for new v1 dir

* Remove OC

* Fix tests
2018-09-18 00:58:07 +08:00